Commit 304c969f authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'qa/updates-on-epics-management-e2e-tests' into 'master'

Improve tests' speed and de-quarantine tests

See merge request gitlab-org/gitlab-ee!14320
parents eeab52de 7d61ce0f
...@@ -242,7 +242,7 @@ module QA ...@@ -242,7 +242,7 @@ module QA
issue = Resource::Issue.fabricate_via_api! do |issue| issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'Issue to test the scoped labels' issue.title = 'Issue to test the scoped labels'
issue.labels = @initial_label issue.labels = [@initial_label]
end end
[@new_label_same_scope, @new_label_different_scope].each do |label| [@new_label_same_scope, @new_label_different_scope].each do |label|
...@@ -365,6 +365,14 @@ Add the following `attribute :id` and `attribute :labels` right above the [`attr ...@@ -365,6 +365,14 @@ Add the following `attribute :id` and `attribute :labels` right above the [`attr
> We add the attributes above the existing attribute to keep them alphabetically organized. > We add the attributes above the existing attribute to keep them alphabetically organized.
Then, let's initialize an instance variable for labels to allow an empty array as default value when such information is not passed during the resource fabricatioin, since this optional. [Between the attributes and the `fabricate!` method](https://gitlab.com/gitlab-org/gitlab-ee/blob/1a1f1408728f19b2aa15887cd20bddab7e70c8bd/qa/qa/resource/issue.rb#L18), add the following:
```ruby
def initialize
@labels = []
end
```
Next, add the following code right below the [`fabricate!`](https://gitlab.com/gitlab-org/gitlab-ee/blob/d3584e80b4236acdf393d815d604801573af72cc/qa/qa/resource/issue.rb#L27) method. Next, add the following code right below the [`fabricate!`](https://gitlab.com/gitlab-org/gitlab-ee/blob/d3584e80b4236acdf393d815d604801573af72cc/qa/qa/resource/issue.rb#L27) method.
```ruby ```ruby
...@@ -378,7 +386,7 @@ end ...@@ -378,7 +386,7 @@ end
def api_post_body def api_post_body
{ {
labels: [labels], labels: labels,
title: title title: title
} }
end end
......
...@@ -258,6 +258,7 @@ export default { ...@@ -258,6 +258,7 @@ export default {
:can-reorder="canReorder" :can-reorder="canReorder"
:path-id-separator="pathIdSeparator" :path-id-separator="pathIdSeparator"
event-namespace="relatedIssue" event-namespace="relatedIssue"
class="qa-related-issuable-item"
@relatedIssueRemoveRequest="$emit('relatedIssueRemoveRequest', $event)" @relatedIssueRemoveRequest="$emit('relatedIssueRemoveRequest', $event)"
> >
<span v-if="issue.weight" slot="weight" class="order-md-1"> <span v-if="issue.weight" slot="weight" class="order-md-1">
......
...@@ -25,6 +25,10 @@ module QA ...@@ -25,6 +25,10 @@ module QA
element :add_issue_input element :add_issue_input
end end
view 'ee/app/assets/javascripts/related_issues/components/related_issues_block.vue' do
element :related_issuable_item
end
view 'ee/app/assets/javascripts/related_issues/constants.js' do view 'ee/app/assets/javascripts/related_issues/constants.js' do
element :add_issues_button element :add_issues_button
end end
...@@ -58,6 +62,14 @@ module QA ...@@ -58,6 +62,14 @@ module QA
def close_reopen_epic def close_reopen_epic
click_element :close_reopen_epic_button click_element :close_reopen_epic_button
end end
def has_related_issuable_item?
has_element?(:related_issuable_item)
end
def has_no_related_issuable_item?
has_no_element?(:related_issuable_item)
end
end end
end end
end end
......
...@@ -16,6 +16,10 @@ module QA ...@@ -16,6 +16,10 @@ module QA
attribute :labels attribute :labels
attribute :title attribute :title
def initialize
@labels = []
end
def fabricate! def fabricate!
project.visit! project.visit!
...@@ -38,7 +42,7 @@ module QA ...@@ -38,7 +42,7 @@ module QA
def api_post_body def api_post_body
{ {
labels: [labels], labels: labels,
title: title title: title
} }
end end
......
...@@ -44,15 +44,15 @@ module QA ...@@ -44,15 +44,15 @@ module QA
EE::Page::Group::Epic::Show.perform do |show_page| EE::Page::Group::Epic::Show.perform do |show_page|
show_page.add_issue_to_epic(issue.web_url) show_page.add_issue_to_epic(issue.web_url)
expect(show_page).to have_content('added issue') expect(show_page).to have_related_issuable_item
show_page.remove_issue_from_epic show_page.remove_issue_from_epic
expect(show_page).to have_content('removed issue') expect(show_page).to have_no_related_issuable_item
end end
end end
it 'comments on epic', :quarantine do it 'comments on epic' do
epic.visit! epic.visit!
comment = 'My Epic Comment' comment = 'My Epic Comment'
...@@ -75,7 +75,7 @@ module QA ...@@ -75,7 +75,7 @@ module QA
expect(page).to have_content('Open') expect(page).to have_content('Open')
end end
it 'adds/removes issue to/from epic using quick actions', :quarantine do it 'adds/removes issue to/from epic using quick actions' do
issue.visit! issue.visit!
Page::Project::Issue::Show.perform do |show_page| Page::Project::Issue::Show.perform do |show_page|
...@@ -97,7 +97,6 @@ module QA ...@@ -97,7 +97,6 @@ module QA
def create_issue_resource def create_issue_resource
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api! do |issue|
issue.labels = ''
issue.title = 'Issue created via API' issue.title = 'Issue created via API'
end end
end end
......
...@@ -17,11 +17,13 @@ module QA ...@@ -17,11 +17,13 @@ module QA
project.group = group project.group = group
end end
Resource::Issue.fabricate_via_browser_ui! do |issue| issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = issue_title issue.title = issue_title
issue.project = project issue.project = project
end end
issue.visit!
Page::Project::Issue::Show.perform do |show| Page::Project::Issue::Show.perform do |show|
# Due to the randomness of tests execution, sometimes a previous test # Due to the randomness of tests execution, sometimes a previous test
# may have changed the filter, which makes the below action needed. # may have changed the filter, which makes the below action needed.
......
...@@ -11,7 +11,7 @@ module QA ...@@ -11,7 +11,7 @@ module QA
issue = Resource::Issue.fabricate_via_api! do |issue| issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'Issue to test the scoped labels' issue.title = 'Issue to test the scoped labels'
issue.labels = @initial_label issue.labels = [@initial_label]
end end
[@new_label_same_scope, @new_label_different_scope].each do |label| [@new_label_same_scope, @new_label_different_scope].each do |label|
......
...@@ -26,7 +26,6 @@ module QA ...@@ -26,7 +26,6 @@ module QA
@issue = Resource::Issue.fabricate! do |issue| @issue = Resource::Issue.fabricate! do |issue|
issue.title = 'My geo issue' issue.title = 'My geo issue'
issue.project = @project issue.project = @project
issue.labels = ''
end end
@issue.visit! @issue.visit!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment