Commit 0e37f5ef authored by Walmyr Lima's avatar Walmyr Lima

Refactor plan qa tests to use login flow

And by doing so reduces the code base in 31 lines.
parent caab23bc
......@@ -7,8 +7,7 @@ module QA
QA::Runtime::Env.personal_access_token = QA::Runtime::Env.admin_personal_access_token
unless QA::Runtime::Env.personal_access_token
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
Flow::Login.sign_in_as_admin
end
user = Resource::User.fabricate_via_api! do |user|
......@@ -20,9 +19,7 @@ module QA
Page::Main::Menu.perform(&:sign_out) if Page::Main::Menu.perform { |p| p.has_personal_area?(wait: 0) }
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
project = Resource::Project.fabricate_via_api! do |resource|
resource.name = 'xss-test-for-mentions-project'
......
......@@ -7,8 +7,7 @@ module QA
let(:commit_message) { 'Closes' }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = issue_title
......
......@@ -6,8 +6,7 @@ module QA
let(:my_first_reply) { 'My first reply' }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'issue title'
......
......@@ -4,8 +4,7 @@ module QA
context 'Plan' do
describe 'Issue comments' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'issue title'
......
......@@ -6,8 +6,7 @@ module QA
let(:issue_title) { 'issue title' }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
end
it 'user creates an issue' do
......
......@@ -6,8 +6,7 @@ module QA
let(:issue_title) { 'issue title' }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = issue_title
......
......@@ -6,8 +6,7 @@ module QA
let(:issue_title) { 'Issue Lists are awesome' }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
project = Resource::Project.fabricate_via_api! do |resource|
resource.name = 'project-for-issue-suggestions'
......
......@@ -4,8 +4,7 @@ module QA
context 'Plan', :smoke do
describe 'mention' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
@user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
......
......@@ -21,8 +21,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
weight_of_two = 2
......
......@@ -6,8 +6,7 @@ module QA
context 'Plan' do
describe 'Custom email', :requires_admin do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
Flow::Login.sign_in_as_admin
Page::Main::Menu.perform(&:click_admin_area)
Page::Admin::Menu.perform(&:go_to_preferences_settings)
end
......
......@@ -4,8 +4,7 @@ module QA
context 'Plan' do
describe 'Epics Management' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
end
it 'creates, edits, and deletes an epic' do
......
......@@ -6,8 +6,7 @@ module QA
let(:issue_title) { "My Awesome Issue #{SecureRandom.hex(8)}" }
it 'user promotes issue to an epic' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
group = Resource::Group.fabricate_via_api!
......
......@@ -16,8 +16,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
end
it 'presents epic on roadmap' do
......
......@@ -8,8 +8,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
label_board_list.project.visit!
Page::Project::Menu.perform(&:go_to_boards)
......
......@@ -14,8 +14,7 @@ module QA
let(:issue_2) { 'Issue 2' }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
fabricate_issue_with_label(label_board_list.project, issue_1, doing)
fabricate_issue_with_label(label_board_list.project, issue_2, ready_for_dev)
......
......@@ -6,8 +6,7 @@ module QA
context 'Plan' do
describe 'Group issue boards' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
group = QA::Resource::Group.fabricate_via_api!
......
......@@ -14,8 +14,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
create_group_board(board_1)
create_group_board(board_2)
......
......@@ -10,8 +10,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
end
it 'focuses on issue board' do
......
......@@ -14,8 +14,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
create_group_board(board_1)
create_group_board(board_2)
......
......@@ -4,8 +4,7 @@ module QA
context 'Plan' do
describe 'Project issue boards' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
end
let(:issue_title) { 'Issue to test board list' }
......
......@@ -12,8 +12,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
label_board_list.project.add_member(qa_user, Resource::Members::AccessLevel::GUEST)
......
......@@ -12,8 +12,7 @@ module QA
let(:weight_for_issue_2) { 3 }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
Resource::Issue.fabricate_via_api! do |issue|
issue.project = label_board_list.project
......
......@@ -10,8 +10,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
end
it 'displays a graph' do
......
......@@ -4,8 +4,7 @@ module QA
context 'Plan' do
describe 'Issues weight visualization' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
end
let(:project) do
......
......@@ -4,8 +4,7 @@ module QA
context 'Plan' do
describe 'Multiple assignees per issue' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
user_1 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
user_2 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2)
......
......@@ -4,8 +4,7 @@ module QA
context 'Plan' do
describe 'Multiple assignees per issue' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
user_1 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
user_2 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2)
......
......@@ -4,8 +4,7 @@ module QA
context 'Plan' do
describe 'Multiple assignees per issue' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
user_1 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
@user_2 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2)
......
......@@ -24,8 +24,7 @@ module QA
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
end
it 'relates and unrelates one issue to/from another' do
......
......@@ -12,8 +12,7 @@ module QA
let(:new_label_different_scope_multi_colon) { 'group::truck::mercedes-bens' }
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'Issue to test scoped labels'
......
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