Commit 9599936c authored by Dan Davison's avatar Dan Davison Committed by Mark Lapierre

Refactor all existing usages of .act

Replace any occurance of .act with the
preferred method .perform
parent 037096ef
...@@ -44,7 +44,7 @@ module QA ...@@ -44,7 +44,7 @@ module QA
def sign_in_using_credentials(user = nil) def sign_in_using_credentials(user = nil)
# Don't try to log-in if we're already logged-in # Don't try to log-in if we're already logged-in
return if Page::Main::Menu.act { has_personal_area?(wait: 0) } return if Page::Main::Menu.perform { |menu| menu.has_personal_area?(wait: 0) }
using_wait_time 0 do using_wait_time 0 do
set_initial_password_if_present set_initial_password_if_present
...@@ -58,7 +58,7 @@ module QA ...@@ -58,7 +58,7 @@ module QA
end end
end end
Page::Main::Menu.act { has_personal_area? } Page::Main::Menu.perform(&:has_personal_area?)
end end
def sign_in_using_admin_credentials def sign_in_using_admin_credentials
...@@ -73,7 +73,7 @@ module QA ...@@ -73,7 +73,7 @@ module QA
sign_in_using_gitlab_credentials(admin) sign_in_using_gitlab_credentials(admin)
end end
Page::Main::Menu.act { has_personal_area? } Page::Main::Menu.perform(&:has_personal_area?)
end end
def self.path def self.path
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
describe 'Project transfer between groups' do describe 'Project transfer between groups' do
it 'user transfers a project between groups' do it 'user transfers a project between groups' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
source_group = Resource::Group.fabricate_via_api! do |group| source_group = Resource::Group.fabricate_via_api! do |group|
group.path = 'source-group' group.path = 'source-group'
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
describe 'basic user login' do describe 'basic user login' do
it 'user logs in using basic credentials and logs out' do it 'user logs in using basic credentials and logs out' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
expect(menu).to have_personal_area expect(menu).to have_personal_area
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
describe 'LDAP login' do describe 'LDAP login' do
it 'user logs into GitLab using LDAP credentials' do it 'user logs into GitLab using LDAP credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
expect(menu).to have_personal_area expect(menu).to have_personal_area
......
...@@ -6,9 +6,9 @@ module QA ...@@ -6,9 +6,9 @@ module QA
it 'User logs in to gitlab with SAML SSO' do it 'User logs in to gitlab with SAML SSO' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_with_saml } Page::Main::Login.perform(&:sign_in_with_saml)
Vendor::SAMLIdp::Page::Login.act { login } Vendor::SAMLIdp::Page::Login.perform(&:login)
expect(page).to have_content('Welcome to GitLab') expect(page).to have_content('Welcome to GitLab')
end end
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
describe 'Project creation' do describe 'Project creation' do
it 'user creates a new project' do it 'user creates a new project' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
created_project = Resource::Project.fabricate_via_browser_ui! do |project| created_project = Resource::Project.fabricate_via_browser_ui! do |project|
project.name = 'awesome-project' project.name = 'awesome-project'
......
...@@ -24,16 +24,16 @@ module QA ...@@ -24,16 +24,16 @@ module QA
it 'user imports a GitHub repo' do it 'user imports a GitHub repo' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
imported_project # import the project imported_project # import the project
Page::Main::Menu.act { go_to_projects } Page::Main::Menu.perform(&:go_to_projects)
Page::Dashboard::Projects.perform do |dashboard| Page::Dashboard::Projects.perform do |dashboard|
dashboard.go_to_project(imported_project.name) dashboard.go_to_project(imported_project.name)
end end
Page::Project::Show.act { wait_for_import } Page::Project::Show.perform(&:wait_for_import)
verify_repository_import verify_repository_import
verify_issues_import verify_issues_import
...@@ -50,7 +50,7 @@ module QA ...@@ -50,7 +50,7 @@ module QA
def verify_issues_import def verify_issues_import
QA::Support::Retrier.retry_on_exception do QA::Support::Retrier.retry_on_exception do
Page::Project::Menu.act { click_issues } Page::Project::Menu.perform(&:click_issues)
expect(page).to have_content('This is a sample issue') expect(page).to have_content('This is a sample issue')
click_link 'This is a sample issue' click_link 'This is a sample issue'
...@@ -73,7 +73,7 @@ module QA ...@@ -73,7 +73,7 @@ module QA
end end
def verify_merge_requests_import def verify_merge_requests_import
Page::Project::Menu.act { click_merge_requests } Page::Project::Menu.perform(&:click_merge_requests)
expect(page).to have_content('Improve README.md') expect(page).to have_content('Improve README.md')
click_link 'Improve README.md' click_link 'Improve README.md'
...@@ -108,7 +108,7 @@ module QA ...@@ -108,7 +108,7 @@ module QA
end end
def verify_wiki_import def verify_wiki_import
Page::Project::Menu.act { click_wiki } Page::Project::Menu.perform(&:click_wiki)
expect(page).to have_content('Welcome to the test-project wiki!') expect(page).to have_content('Welcome to the test-project wiki!')
end end
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
describe 'Issue comments' do describe 'Issue comments' do
it 'user comments on an issue and edits the comment' do it 'user comments on an issue and edits the comment' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
issue = Resource::Issue.fabricate_via_api! do |issue| issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'issue title' issue.title = 'issue title'
......
...@@ -8,7 +8,7 @@ module QA ...@@ -8,7 +8,7 @@ module QA
it 'user creates an issue' do it 'user creates an issue' do
create_issue create_issue
Page::Project::Menu.act { click_issues } Page::Project::Menu.perform(&:click_issues)
expect(page).to have_content(issue_title) expect(page).to have_content(issue_title)
end end
...@@ -39,7 +39,7 @@ module QA ...@@ -39,7 +39,7 @@ module QA
def create_issue def create_issue
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
Resource::Issue.fabricate_via_browser_ui! do |issue| Resource::Issue.fabricate_via_browser_ui! do |issue|
issue.title = issue_title issue.title = issue_title
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
it 'user filters comments and activities in an issue' do it 'user filters comments and activities in an issue' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
issue = Resource::Issue.fabricate_via_api! do |issue| issue = Resource::Issue.fabricate_via_api! do |issue|
issue.title = issue_title issue.title = issue_title
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
it 'user adds and then removes an SSH key', :smoke do it 'user adds and then removes an SSH key', :smoke do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
key = Resource::SSHKey.fabricate! do |resource| key = Resource::SSHKey.fabricate! do |resource|
resource.title = key_title resource.title = key_title
...@@ -16,8 +16,8 @@ module QA ...@@ -16,8 +16,8 @@ module QA
expect(page).to have_content("Title: #{key_title}") expect(page).to have_content("Title: #{key_title}")
expect(page).to have_content(key.fingerprint) expect(page).to have_content(key.fingerprint)
Page::Main::Menu.act { click_settings_link } Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.act { click_ssh_keys } Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |ssh_keys| Page::Profile::SSHKeys.perform do |ssh_keys|
ssh_keys.remove_key(key_title) ssh_keys.remove_key(key_title)
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
describe 'Files management' do describe 'Files management' do
it 'user creates, edits and deletes a file via the Web' do it 'user creates, edits and deletes a file via the Web' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
# Create # Create
file_name = 'QA Test - File name' file_name = 'QA Test - File name'
...@@ -27,7 +27,7 @@ module QA ...@@ -27,7 +27,7 @@ module QA
updated_file_content = 'QA Test - Updated file content' updated_file_content = 'QA Test - Updated file content'
commit_message_for_update = 'QA Test - Update file' commit_message_for_update = 'QA Test - Update file'
Page::File::Show.act { click_edit } Page::File::Show.perform(&:click_edit)
Page::File::Form.act do Page::File::Form.act do
remove_content remove_content
......
...@@ -13,7 +13,7 @@ module QA ...@@ -13,7 +13,7 @@ module QA
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
end end
after do after do
......
...@@ -11,7 +11,7 @@ module QA ...@@ -11,7 +11,7 @@ module QA
it 'user registers a new specific runner' do it 'user registers a new specific runner' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
Resource::Runner.fabricate! do |runner| Resource::Runner.fabricate! do |runner|
runner.name = executor runner.name = executor
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
describe 'Deploy token creation' do describe 'Deploy token creation' do
it 'user adds a deploy token' do it 'user adds a deploy token' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
deploy_token_name = 'deploy token name' deploy_token_name = 'deploy token name'
one_week_from_now = Date.today + 7 one_week_from_now = Date.today + 7
......
...@@ -5,8 +5,8 @@ module QA ...@@ -5,8 +5,8 @@ module QA
describe 'Mattermost support' do describe 'Mattermost support' do
it 'user creates a group with a mattermost team' do it 'user creates a group with a mattermost team' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.act { go_to_groups } Page::Main::Menu.perform(&:go_to_groups)
Page::Dashboard::Groups.perform do |page| Page::Dashboard::Groups.perform do |page|
page.click_new_group page.click_new_group
......
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