Standardize Page Objects use on CE Plan Tests

This is a first iteration to address the following issue:
gitlab-org/quality/team-tasks#168

Note: depends on
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/30945
parent 66394bd1
Pipeline #72036413 passed with stages
in 139 minutes and 40 seconds
......@@ -30,12 +30,12 @@ module QA
end
it 'user mentions a user in comment' do
Page::Project::Issue::Show.perform do |show_page|
show_page.select_all_activities_filter
show_page.comment('cc-ing you here @eve')
Page::Project::Issue::Show.perform do |show|
show.select_all_activities_filter
show.comment('cc-ing you here @eve')
expect do
expect(show_page).to have_content("cc-ing you here")
expect(show).to have_content("cc-ing you here")
end.not_to raise_error # Selenium::WebDriver::Error::UnhandledAlertError
end
end
......
......@@ -15,28 +15,28 @@ module QA
issue.visit!
Page::Project::Issue::Show.perform do |show_page|
Page::Project::Issue::Show.perform do |show|
my_first_discussion = 'My first discussion'
show_page.select_all_activities_filter
show_page.start_discussion(my_first_discussion)
show.select_all_activities_filter
show.start_discussion(my_first_discussion)
page.assert_text(my_first_discussion)
show_page.reply_to_discussion(my_first_reply)
show.reply_to_discussion(my_first_reply)
page.assert_text(my_first_reply)
end
end
it 'user collapses and expands reply for comments in an issue' do
Page::Project::Issue::Show.perform do |show_page|
Page::Project::Issue::Show.perform do |show|
one_reply = "1 reply"
show_page.collapse_replies
expect(show_page).to have_content(one_reply)
expect(show_page).not_to have_content(my_first_reply)
show.collapse_replies
expect(show).to have_content(one_reply)
expect(show).not_to have_content(my_first_reply)
show_page.expand_replies
expect(show_page).to have_content(my_first_reply)
expect(show_page).not_to have_content(one_reply)
show.expand_replies
expect(show).to have_content(my_first_reply)
expect(show).not_to have_content(one_reply)
end
end
end
......
......@@ -14,18 +14,18 @@ module QA
end
it 'user comments on an issue and edits the comment' do
Page::Project::Issue::Show.perform do |issue_show_page|
Page::Project::Issue::Show.perform do |show|
first_version_of_comment = 'First version of the comment'
second_version_of_comment = 'Second version of the comment'
issue_show_page.comment(first_version_of_comment)
show.comment(first_version_of_comment)
expect(issue_show_page).to have_content(first_version_of_comment)
expect(show).to have_content(first_version_of_comment)
issue_show_page.edit_comment(second_version_of_comment)
show.edit_comment(second_version_of_comment)
expect(issue_show_page).to have_content(second_version_of_comment)
expect(issue_show_page).not_to have_content(first_version_of_comment)
expect(show).to have_content(second_version_of_comment)
expect(show).not_to have_content(first_version_of_comment)
end
end
end
......
......@@ -17,25 +17,25 @@ module QA
end
it 'user filters comments and activities in an issue' do
Page::Project::Issue::Show.perform do |show_page|
Page::Project::Issue::Show.perform do |show|
my_own_comment = "My own comment"
made_the_issue_confidential = "made the issue confidential"
show_page.comment('/confidential', filter: :comments_only)
show_page.comment(my_own_comment, filter: :comments_only)
show.comment('/confidential', filter: :comments_only)
show.comment(my_own_comment, filter: :comments_only)
expect(show_page).not_to have_content(made_the_issue_confidential)
expect(show_page).to have_content(my_own_comment)
expect(show).not_to have_content(made_the_issue_confidential)
expect(show).to have_content(my_own_comment)
show_page.select_all_activities_filter
show.select_all_activities_filter
expect(show_page).to have_content(made_the_issue_confidential)
expect(show_page).to have_content(my_own_comment)
expect(show).to have_content(made_the_issue_confidential)
expect(show).to have_content(my_own_comment)
show_page.select_history_only_filter
show.select_history_only_filter
expect(show_page).to have_content(made_the_issue_confidential)
expect(show_page).not_to have_content(my_own_comment)
expect(show).to have_content(made_the_issue_confidential)
expect(show).not_to have_content(my_own_comment)
end
end
end
......
......@@ -24,12 +24,12 @@ module QA
it 'user sees issue suggestions when creating a new issue' do
Page::Project::Show.perform(&:go_to_new_issue)
Page::Project::Issue::New.perform do |new_issue_page|
new_issue_page.add_title("issue")
expect(new_issue_page).to have_content(issue_title)
Page::Project::Issue::New.perform do |new|
new.add_title("issue")
expect(new).to have_content(issue_title)
new_issue_page.add_title("Issue Board")
expect(new_issue_page).not_to have_content(issue_title)
new.add_title("Issue Board")
expect(new).not_to have_content(issue_title)
end
end
end
......
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