Commit ccf22c31 authored by Walmyr's avatar Walmyr Committed by Rémy Coutable

Standardize usage of `click_` and `go_to` on GUI tests

This MR addresses the following issue:
https://gitlab.com/gitlab-org/gitlab-ce/issues/57043
Based on the following comment:
https://gitlab.com/gitlab-org/gitlab-ce/issues/57043#note_136663994
parent 59d447e9
...@@ -15,11 +15,11 @@ module QA ...@@ -15,11 +15,11 @@ module QA
end end
end end
def go_to_geo_nodes def click_geo_menu_link
click_element :link_geo_menu click_element :link_geo_menu
end end
def go_to_license def click_license_menu_link
click_element :link_license_menu click_element :link_license_menu
end end
......
...@@ -41,7 +41,7 @@ module QA ...@@ -41,7 +41,7 @@ module QA
click_element :remove_issue_button click_element :remove_issue_button
end end
def go_to_edit_page def click_edit_button
click_element :edit_button click_element :edit_button
end end
......
...@@ -37,13 +37,13 @@ module QA ...@@ -37,13 +37,13 @@ module QA
end end
end end
def go_to_members def click_group_members_item
within_sidebar do within_sidebar do
click_element(:group_members_item) click_element(:group_members_item)
end end
end end
def go_to_group_epics def click_group_epics_link
within_sidebar do within_sidebar do
click_element(:group_epics_link) click_element(:group_epics_link)
end end
......
...@@ -20,7 +20,7 @@ module QA ...@@ -20,7 +20,7 @@ module QA
page.has_content?(issue.title) page.has_content?(issue.title)
end end
go_to_issue(issue.title) click_issue_link(issue.title)
end end
def filter_by_title(title) def filter_by_title(title)
......
...@@ -27,12 +27,12 @@ module QA ...@@ -27,12 +27,12 @@ module QA
end end
def go_to_create_from_template_group_tab def go_to_create_from_template_group_tab
go_to_create_from_template click_create_from_template_tab
click_element(:group_templates_tab) click_element(:group_templates_tab)
end end
def go_to_create_from_template_instance_tab def go_to_create_from_template_instance_tab
go_to_create_from_template click_create_from_template_tab
click_element(:instance_templates_tab) click_element(:instance_templates_tab)
end end
......
...@@ -13,7 +13,7 @@ module QA ...@@ -13,7 +13,7 @@ module QA
def fabricate! def fabricate!
group.visit! group.visit!
QA::EE::Page::Group::Menu.perform(&:go_to_group_epics) QA::EE::Page::Group::Menu.perform(&:click_group_epics_link)
QA::EE::Page::Group::Epic::Index.perform do |page| QA::EE::Page::Group::Epic::Index.perform do |page|
page.click_new_epic page.click_new_epic
......
...@@ -9,8 +9,8 @@ module QA ...@@ -9,8 +9,8 @@ module QA
def fabricate! def fabricate!
QA::Page::Main::Login.perform(&:sign_in_using_credentials) QA::Page::Main::Login.perform(&:sign_in_using_credentials)
QA::Page::Main::Menu.perform(&:go_to_admin_area) QA::Page::Main::Menu.perform(&:click_admin_area)
QA::Page::Admin::Menu.perform(&:go_to_geo_nodes) QA::Page::Admin::Menu.perform(&:click_geo_menu_link)
EE::Page::Admin::Geo::Nodes::Show.perform(&:new_node!) EE::Page::Admin::Geo::Nodes::Show.perform(&:new_node!)
EE::Page::Admin::Geo::Nodes::New.perform do |page| EE::Page::Admin::Geo::Nodes::New.perform do |page|
......
...@@ -6,8 +6,8 @@ module QA ...@@ -6,8 +6,8 @@ module QA
class License < QA::Resource::Base class License < QA::Resource::Base
def fabricate!(license) def fabricate!(license)
QA::Page::Main::Login.perform(&:sign_in_using_admin_credentials) QA::Page::Main::Login.perform(&:sign_in_using_admin_credentials)
QA::Page::Main::Menu.perform(&:go_to_admin_area) QA::Page::Main::Menu.perform(&:click_admin_area)
QA::Page::Admin::Menu.perform(&:go_to_license) QA::Page::Admin::Menu.perform(&:click_license_menu_link)
EE::Page::Admin::License.perform do |page| EE::Page::Admin::License.perform do |page|
page.add_new_license(license) unless page.license? page.add_new_license(license) unless page.license?
......
...@@ -19,13 +19,13 @@ module QA ...@@ -19,13 +19,13 @@ module QA
has_filtered_group?(name) has_filtered_group?(name)
end end
def go_to_group(name) def click_group(name)
raise "Group with name #{name} not found!" unless has_group?(name) raise "Group with name #{name} not found!" unless has_group?(name)
click_link name click_link name
end end
def go_to_new_group def click_new_group
click_on 'New group' click_on 'New group'
end end
end end
......
...@@ -37,7 +37,7 @@ module QA ...@@ -37,7 +37,7 @@ module QA
text_area.set content text_area.set content
end end
def create_snippet def click_create_snippet_button
click_element :create_snippet_button click_element :create_snippet_button
end end
......
...@@ -18,7 +18,7 @@ module QA ...@@ -18,7 +18,7 @@ module QA
element :no_result_text, 'No groups or projects matched your search' # rubocop:disable QA/ElementWithPattern element :no_result_text, 'No groups or projects matched your search' # rubocop:disable QA/ElementWithPattern
end end
def go_to_subgroup(name) def click_subgroup(name)
click_link name click_link name
end end
......
...@@ -18,7 +18,7 @@ module QA ...@@ -18,7 +18,7 @@ module QA
element :label_svg element :label_svg
end end
def go_to_new_label def click_new_label_button
# The 'labels.svg' takes a fraction of a second to load after which the "New label" button shifts up a bit # The 'labels.svg' takes a fraction of a second to load after which the "New label" button shifts up a bit
# This can cause webdriver to miss the hit so we wait for the svg to load (implicitly with has_element?) # This can cause webdriver to miss the hit so we wait for the svg to load (implicitly with has_element?)
# before clicking the button. # before clicking the button.
......
...@@ -9,7 +9,7 @@ module QA ...@@ -9,7 +9,7 @@ module QA
element :label_create_button element :label_create_button
end end
def create_label def click_label_create_button
click_element :label_create_button click_element :label_create_button
end end
......
...@@ -47,7 +47,7 @@ module QA ...@@ -47,7 +47,7 @@ module QA
end end
end end
def go_to_admin_area def click_admin_area
within_top_menu { click_element :admin_area_link } within_top_menu { click_element :admin_area_link }
end end
...@@ -57,7 +57,7 @@ module QA ...@@ -57,7 +57,7 @@ module QA
end end
end end
def go_to_profile_settings def click_settings_link
retry_until(reload: false) do retry_until(reload: false) do
within_user_menu do within_user_menu do
click_link 'Settings' click_link 'Settings'
...@@ -67,7 +67,7 @@ module QA ...@@ -67,7 +67,7 @@ module QA
end end
end end
def go_to_snippets def click_snippets_link
click_element :snippets_link click_element :snippets_link
end end
......
...@@ -146,11 +146,11 @@ module QA ...@@ -146,11 +146,11 @@ module QA
click_element :squash_checkbox click_element :squash_checkbox
end end
def go_to_discussions_tab def click_discussions_tab
click_element :notes_tab click_element :notes_tab
end end
def go_to_diffs_tab def click_diffs_tab
click_element :diffs_tab click_element :diffs_tab
end end
......
...@@ -26,7 +26,7 @@ module QA ...@@ -26,7 +26,7 @@ module QA
check_element(:api_radio) check_element(:api_radio)
end end
def create_token def click_create_token_button
click_element(:create_token_button) click_element(:create_token_button)
end end
......
...@@ -9,7 +9,7 @@ module QA ...@@ -9,7 +9,7 @@ module QA
element :issue_link, 'link_to issue.title' # rubocop:disable QA/ElementWithPattern element :issue_link, 'link_to issue.title' # rubocop:disable QA/ElementWithPattern
end end
def go_to_issue(title) def click_issue_link(title)
click_link(title) click_link(title)
end end
end end
......
...@@ -17,7 +17,7 @@ module QA ...@@ -17,7 +17,7 @@ module QA
fill_element :milestone_description, description fill_element :milestone_description, description
end end
def create_new_milestone def click_milestone_create_button
click_element :milestone_create_button click_element :milestone_create_button
end end
end end
......
...@@ -36,7 +36,7 @@ module QA ...@@ -36,7 +36,7 @@ module QA
end end
end end
def go_to_import_project def click_import_project
click_on 'Import project' click_on 'Import project'
end end
...@@ -52,7 +52,7 @@ module QA ...@@ -52,7 +52,7 @@ module QA
click_on 'Create project' click_on 'Create project'
end end
def go_to_create_from_template def click_create_from_template_tab
click_element(:project_create_from_template_tab) click_element(:project_create_from_template_tab)
end end
...@@ -60,7 +60,7 @@ module QA ...@@ -60,7 +60,7 @@ module QA
choose visibility choose visibility
end end
def go_to_github_import def click_github_link
click_link 'GitHub' click_link 'GitHub'
end end
end end
......
...@@ -10,7 +10,7 @@ module QA ...@@ -10,7 +10,7 @@ module QA
element :environment_link element :environment_link
end end
def go_to_environment(environment_name) def click_environment_link(environment_name)
wait(reload: false) do wait(reload: false) do
find(element_selector_css(:environment_link), text: environment_name).click find(element_selector_css(:environment_link), text: environment_name).click
end end
......
...@@ -5,7 +5,7 @@ module QA::Page ...@@ -5,7 +5,7 @@ module QA::Page
element :pipeline_link, 'class="js-pipeline-url-link"' # rubocop:disable QA/ElementWithPattern element :pipeline_link, 'class="js-pipeline-url-link"' # rubocop:disable QA/ElementWithPattern
end end
def go_to_latest_pipeline def click_on_latest_pipeline
css = '.js-pipeline-url-link' css = '.js-pipeline-url-link'
link = wait(reload: false) do link = wait(reload: false) do
......
...@@ -42,11 +42,11 @@ module QA::Page ...@@ -42,11 +42,11 @@ module QA::Page
end end
end end
def go_to_job(job_name) def click_job(job_name)
find_element(:job_link, text: job_name).click find_element(:job_link, text: job_name).click
end end
def go_to_first_job def click_on_first_job
css = '.js-pipeline-graph-job-link' css = '.js-pipeline-graph-job-link'
wait(reload: false) do wait(reload: false) do
......
...@@ -34,22 +34,22 @@ module QA ...@@ -34,22 +34,22 @@ module QA
end end
def allow_no_one_to_push def allow_no_one_to_push
click_allow(:push, 'No one') go_to_allow(:push, 'No one')
end end
def allow_devs_and_maintainers_to_push def allow_devs_and_maintainers_to_push
click_allow(:push, 'Developers + Maintainers') go_to_allow(:push, 'Developers + Maintainers')
end end
# @deprecated # @deprecated
alias_method :allow_devs_and_masters_to_push, :allow_devs_and_maintainers_to_push alias_method :allow_devs_and_masters_to_push, :allow_devs_and_maintainers_to_push
def allow_no_one_to_merge def allow_no_one_to_merge
click_allow(:merge, 'No one') go_to_allow(:merge, 'No one')
end end
def allow_devs_and_maintainers_to_merge def allow_devs_and_maintainers_to_merge
click_allow(:merge, 'Developers + Maintainers') go_to_allow(:merge, 'Developers + Maintainers')
end end
# @deprecated # @deprecated
...@@ -61,7 +61,7 @@ module QA ...@@ -61,7 +61,7 @@ module QA
private private
def click_allow(action, text) def go_to_allow(action, text)
click_element :"allowed_to_#{action}_select" click_element :"allowed_to_#{action}_select"
within_element(:"allowed_to_#{action}_dropdown") do within_element(:"allowed_to_#{action}_dropdown") do
......
...@@ -78,13 +78,13 @@ module QA ...@@ -78,13 +78,13 @@ module QA
click_on 'Fork' click_on 'Fork'
end end
def go_to_file(filename) def click_file(filename)
within_element(:file_tree) do within_element(:file_tree) do
click_on filename click_on filename
end end
end end
def go_to_commit(commit_msg) def click_commit(commit_msg)
within_element(:file_tree) do within_element(:file_tree) do
click_on commit_msg click_on commit_msg
end end
......
...@@ -14,7 +14,7 @@ module QA ...@@ -14,7 +14,7 @@ module QA
end end
end end
def click_operations_environments def go_to_operations_environments
hover_operations do hover_operations do
within_submenu do within_submenu do
click_element(:operations_environments_link) click_element(:operations_environments_link)
...@@ -22,7 +22,7 @@ module QA ...@@ -22,7 +22,7 @@ module QA
end end
end end
def click_operations_kubernetes def go_to_operations_kubernetes
hover_operations do hover_operations do
within_submenu do within_submenu do
click_link('Kubernetes') click_link('Kubernetes')
......
...@@ -20,7 +20,7 @@ module QA ...@@ -20,7 +20,7 @@ module QA
end end
end end
def click_repository_branches def go_to_repository_branches
hover_repository do hover_repository do
within_submenu do within_submenu do
click_element(:branches_link) click_element(:branches_link)
......
...@@ -14,7 +14,7 @@ module QA ...@@ -14,7 +14,7 @@ module QA
end end
end end
def click_ci_cd_settings def go_to_ci_cd_settings
hover_settings do hover_settings do
within_submenu do within_submenu do
click_link('CI / CD') click_link('CI / CD')
...@@ -22,7 +22,7 @@ module QA ...@@ -22,7 +22,7 @@ module QA
end end
end end
def click_members_settings def go_to_members_settings
hover_settings do hover_settings do
within_submenu do within_submenu do
click_element :link_members_settings click_element :link_members_settings
...@@ -30,7 +30,7 @@ module QA ...@@ -30,7 +30,7 @@ module QA
end end
end end
def click_repository_settings def go_to_repository_settings
hover_settings do hover_settings do
within_submenu do within_submenu do
click_link('Repository') click_link('Repository')
...@@ -38,7 +38,7 @@ module QA ...@@ -38,7 +38,7 @@ module QA
end end
end end
def go_to_settings def click_settings
within_sidebar do within_sidebar do
click_on 'Settings' click_on 'Settings'
end end
......
...@@ -9,15 +9,7 @@ module QA ...@@ -9,15 +9,7 @@ module QA
element :edit_page_link, 'Edit' # rubocop:disable QA/ElementWithPattern element :edit_page_link, 'Edit' # rubocop:disable QA/ElementWithPattern
end end
def go_to_new_page def click_edit
click_on 'New page'
end
def got_to_view_history_page
click_on 'Page history'
end
def go_to_edit_page
click_on 'Edit' click_on 'Edit'
end end
end end
......
...@@ -23,7 +23,7 @@ module QA ...@@ -23,7 +23,7 @@ module QA
element :svg_content element :svg_content
end end
def go_to_create_first_page def click_create_your_first_page_button
# The svg takes a fraction of a second to load after which the # The svg takes a fraction of a second to load after which the
# "Create your first page" button shifts up a bit. This can cause # "Create your first page" button shifts up a bit. This can cause
# webdriver to miss the hit so we wait for the svg to load before # webdriver to miss the hit so we wait for the svg to load before
......
...@@ -11,7 +11,7 @@ module QA ...@@ -11,7 +11,7 @@ module QA
element :clone_repository_link, 'Clone repository' # rubocop:disable QA/ElementWithPattern element :clone_repository_link, 'Clone repository' # rubocop:disable QA/ElementWithPattern
end end
def go_to_clone_repository def click_clone_repository
click_on 'Clone repository' click_on 'Clone repository'
end end
end end
......
...@@ -46,7 +46,7 @@ module QA ...@@ -46,7 +46,7 @@ module QA
# to `allow_to_push` variable. # to `allow_to_push` variable.
return branch unless @protected return branch unless @protected
Page::Project::Menu.perform(&:click_repository_settings) Page::Project::Menu.perform(&:go_to_repository_settings)
Page::Project::Settings::Repository.perform do |setting| Page::Project::Settings::Repository.perform do |setting|
setting.expand_protected_branches do |page| setting.expand_protected_branches do |page|
......
...@@ -15,7 +15,7 @@ module QA ...@@ -15,7 +15,7 @@ module QA
def fabricate! def fabricate!
project.visit! project.visit!
Page::Project::Menu.perform(&:click_ci_cd_settings) Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform do |setting| Page::Project::Settings::CICD.perform do |setting|
setting.expand_ci_variables do |page| setting.expand_ci_variables do |page|
......
...@@ -23,7 +23,7 @@ module QA ...@@ -23,7 +23,7 @@ module QA
def fabricate! def fabricate!
project.visit! project.visit!
Page::Project::Menu.perform(&:click_repository_settings) Page::Project::Menu.perform(&:go_to_repository_settings)
Page::Project::Settings::Repository.perform do |setting| Page::Project::Settings::Repository.perform do |setting|
setting.expand_deploy_keys do |page| setting.expand_deploy_keys do |page|
......
...@@ -32,7 +32,7 @@ module QA ...@@ -32,7 +32,7 @@ module QA
project.visit! project.visit!
Page::Project::Menu.act do Page::Project::Menu.act do
click_repository_settings go_to_repository_settings
end end
Page::Project::Settings::Repository.perform do |setting| Page::Project::Settings::Repository.perform do |setting|
......
...@@ -21,7 +21,7 @@ module QA ...@@ -21,7 +21,7 @@ module QA
Page::Group::Show.perform do |group_show| Page::Group::Show.perform do |group_show|
if group_show.has_subgroup?(path) if group_show.has_subgroup?(path)
group_show.go_to_subgroup(path) group_show.click_subgroup(path)
else else
group_show.go_to_new_subgroup group_show.go_to_new_subgroup
......
...@@ -16,7 +16,7 @@ module QA ...@@ -16,7 +16,7 @@ module QA
@project.visit! @project.visit!
Page::Project::Menu.perform( Page::Project::Menu.perform(
&:click_operations_kubernetes) &:go_to_operations_kubernetes)
Page::Project::Operations::Kubernetes::Index.perform( Page::Project::Operations::Kubernetes::Index.perform(
&:add_kubernetes_cluster) &:add_kubernetes_cluster)
......
...@@ -25,13 +25,13 @@ module QA ...@@ -25,13 +25,13 @@ module QA
project.visit! project.visit!
Page::Project::Menu.perform(&:go_to_labels) Page::Project::Menu.perform(&:go_to_labels)
Page::Label::Index.perform(&:go_to_new_label) Page::Label::Index.perform(&:click_new_label_button)
Page::Label::New.perform do |page| Page::Label::New.perform do |page|
page.fill_title(@title) page.fill_title(@title)
page.fill_description(@description) page.fill_description(@description)
page.fill_color(@color) page.fill_color(@color)
page.create_label page.click_label_create_button
end end
end end
end end
......
...@@ -13,13 +13,13 @@ module QA ...@@ -13,13 +13,13 @@ module QA
end end
def fabricate! def fabricate!
Page::Main::Menu.perform(&:go_to_profile_settings) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_access_tokens) Page::Profile::Menu.perform(&:click_access_tokens)
Page::Profile::PersonalAccessTokens.perform do |page| Page::Profile::PersonalAccessTokens.perform do |page|
page.fill_token_name(name || 'api-test-token') page.fill_token_name(name || 'api-test-token')
page.check_api page.check_api
page.create_token page.click_create_token_button
end end
end end
end end
......
...@@ -18,11 +18,11 @@ module QA ...@@ -18,11 +18,11 @@ module QA
Page::Group::Show.perform(&:go_to_new_project) Page::Group::Show.perform(&:go_to_new_project)
Page::Project::New.perform do |page| Page::Project::New.perform do |page|
page.go_to_import_project page.click_import_project
end end
Page::Project::New.perform do |page| Page::Project::New.perform do |page|
page.go_to_github_import page.click_github_link
end end
Page::Project::Import::Github.perform do |page| Page::Project::Import::Github.perform do |page|
......
...@@ -28,7 +28,7 @@ module QA ...@@ -28,7 +28,7 @@ module QA
Page::Project::Milestone::New.perform do |milestone_new| Page::Project::Milestone::New.perform do |milestone_new|
milestone_new.set_title(@title) milestone_new.set_title(@title)
milestone_new.set_description(@description) milestone_new.set_description(@description)
milestone_new.create_new_milestone milestone_new.click_milestone_create_button
end end
end end
end end
......
...@@ -24,7 +24,7 @@ module QA ...@@ -24,7 +24,7 @@ module QA
@repository_http_uri ||= begin @repository_http_uri ||= begin
wiki.visit! wiki.visit!
Page::Project::Wiki::Show.act do Page::Project::Wiki::Show.act do
go_to_clone_repository click_clone_repository
choose_repository_clone_http choose_repository_clone_http
repository_location.uri repository_location.uri
end end
......
...@@ -29,7 +29,7 @@ module QA ...@@ -29,7 +29,7 @@ module QA
def fabricate! def fabricate!
project.visit! project.visit!
Page::Project::Menu.perform(&:click_ci_cd_settings) Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Service::Runner.new(name).tap do |runner| Service::Runner.new(name).tap do |runner|
Page::Project::Settings::CICD.perform do |settings| Page::Project::Settings::CICD.perform do |settings|
......
...@@ -20,9 +20,9 @@ module QA ...@@ -20,9 +20,9 @@ module QA
Page::Dashboard::Groups.perform do |page| Page::Dashboard::Groups.perform do |page|
if page.has_group?(path) if page.has_group?(path)
page.go_to_group(path) page.click_group(path)
else else
page.go_to_new_group page.click_new_group
Page::Group::New.perform do |group| Page::Group::New.perform do |group|
group.set_path(path) group.set_path(path)
......
...@@ -8,7 +8,7 @@ module QA ...@@ -8,7 +8,7 @@ module QA
raise ArgumentError unless traits.include?(:enabled) raise ArgumentError unless traits.include?(:enabled)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_admin_area) Page::Main::Menu.perform(&:click_admin_area)
Page::Admin::Menu.perform(&:go_to_repository_settings) Page::Admin::Menu.perform(&:go_to_repository_settings)
Page::Admin::Settings::Repository.perform do |setting| Page::Admin::Settings::Repository.perform do |setting|
......
...@@ -22,7 +22,7 @@ module QA ...@@ -22,7 +22,7 @@ module QA
page.set_visibility(@visibility) page.set_visibility(@visibility)
page.fill_file_name(@file_name) page.fill_file_name(@file_name)
page.fill_file_content(@file_content) page.fill_file_content(@file_content)
page.create_snippet page.click_create_snippet_button
end end
end end
end end
......
...@@ -14,7 +14,7 @@ module QA ...@@ -14,7 +14,7 @@ module QA
end end
def fabricate! def fabricate!
Page::Main::Menu.perform(&:go_to_profile_settings) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys) Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |page| Page::Profile::SSHKeys.perform do |page|
......
...@@ -18,7 +18,7 @@ module QA ...@@ -18,7 +18,7 @@ module QA
Page::Project::Menu.perform { |menu_side| menu_side.click_wiki } Page::Project::Menu.perform { |menu_side| menu_side.click_wiki }
Page::Project::Wiki::New.perform do |wiki_new| Page::Project::Wiki::New.perform do |wiki_new|
wiki_new.go_to_create_first_page wiki_new.click_create_your_first_page_button
wiki_new.set_title(@title) wiki_new.set_title(@title)
wiki_new.set_content(@content) wiki_new.set_content(@content)
wiki_new.set_message(@message) wiki_new.set_message(@message)
......
...@@ -68,7 +68,7 @@ module QA ...@@ -68,7 +68,7 @@ module QA
page.click_add_sync_button page.click_add_sync_button
end end
EE::Page::Group::Menu.perform(&:go_to_members) EE::Page::Group::Menu.perform(&:click_group_members_item)
end end
it 'has LDAP users synced' do it 'has LDAP users synced' do
...@@ -117,7 +117,7 @@ module QA ...@@ -117,7 +117,7 @@ module QA
page.click_add_sync_button page.click_add_sync_button
end end
EE::Page::Group::Menu.perform(&:go_to_members) EE::Page::Group::Menu.perform(&:click_group_members_item)
end end
it 'has LDAP users synced' do it 'has LDAP users synced' do
......
...@@ -14,7 +14,7 @@ module QA ...@@ -14,7 +14,7 @@ module QA
end end
project.visit! project.visit!
Page::Project::Menu.perform(&:click_members_settings) Page::Project::Menu.perform(&:go_to_members_settings)
Page::Project::Settings::Members.perform do |page| Page::Project::Settings::Members.perform do |page|
page.add_member(user.username) page.add_member(user.username)
end end
......
...@@ -43,7 +43,7 @@ module QA ...@@ -43,7 +43,7 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_admin_area) Page::Main::Menu.perform(&:click_admin_area)
Page::Admin::Menu.perform(&:go_to_template_settings) Page::Admin::Menu.perform(&:go_to_template_settings)
EE::Page::Admin::Settings::Templates.perform do |page| EE::Page::Admin::Settings::Templates.perform do |page|
...@@ -81,8 +81,8 @@ module QA ...@@ -81,8 +81,8 @@ module QA
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_groups) Page::Main::Menu.perform(&:go_to_groups)
Page::Dashboard::Groups.perform { |page| page.go_to_group(Runtime::Namespace.sandbox_name) } Page::Dashboard::Groups.perform { |page| page.click_group(Runtime::Namespace.sandbox_name) }
Page::Project::Menu.perform(&:go_to_settings) Page::Project::Menu.perform(&:click_settings)
EE::Page::Group::Settings::General.perform do |settings| EE::Page::Group::Settings::General.perform do |settings|
settings.choose_custom_project_template("#{@template_container_group_name}") settings.choose_custom_project_template("#{@template_container_group_name}")
......
...@@ -22,7 +22,7 @@ module QA ...@@ -22,7 +22,7 @@ module QA
expect(page).to have_content('My First Epic') expect(page).to have_content('My First Epic')
# Edit Epics # Edit Epics
EE::Page::Group::Epic::Show.act { go_to_edit_page } EE::Page::Group::Epic::Show.act { click_edit_button }
EE::Page::Group::Epic::Edit.perform do |edit_page| EE::Page::Group::Epic::Edit.perform do |edit_page|
edit_page.set_description('My Edited Epic Description') edit_page.set_description('My Edited Epic Description')
...@@ -73,7 +73,7 @@ module QA ...@@ -73,7 +73,7 @@ module QA
expect(page).to have_content('Open') expect(page).to have_content('Open')
# Delete Epics # Delete Epics
EE::Page::Group::Epic::Show.act { go_to_edit_page } EE::Page::Group::Epic::Show.act { click_edit_button }
EE::Page::Group::Epic::Edit.perform do |edit_page| EE::Page::Group::Epic::Edit.perform do |edit_page|
edit_page.delete_epic edit_page.delete_epic
......
...@@ -31,7 +31,7 @@ module QA ...@@ -31,7 +31,7 @@ module QA
end end
group.visit! group.visit!
QA::EE::Page::Group::Menu.perform(&:go_to_group_epics) QA::EE::Page::Group::Menu.perform(&:click_group_epics_link)
QA::EE::Page::Group::Epic::Index.perform(&:click_first_epic) QA::EE::Page::Group::Epic::Index.perform(&:click_first_epic)
expect(page).to have_content(issue_title) expect(page).to have_content(issue_title)
......
...@@ -18,7 +18,7 @@ module QA ...@@ -18,7 +18,7 @@ module QA
end end
Page::MergeRequest::Show.perform do |show_page| Page::MergeRequest::Show.perform do |show_page|
show_page.go_to_discussions_tab show_page.click_discussions_tab
show_page.start_discussion("I'm starting a new discussion") show_page.start_discussion("I'm starting a new discussion")
expect(show_page).to have_content("I'm starting a new discussion") expect(show_page).to have_content("I'm starting a new discussion")
...@@ -34,7 +34,7 @@ module QA ...@@ -34,7 +34,7 @@ module QA
expect(show_page).to have_content("Could you also check that?") expect(show_page).to have_content("Could you also check that?")
expect(show_page).to have_content("Finish review 1") expect(show_page).to have_content("Finish review 1")
show_page.go_to_diffs_tab show_page.click_diffs_tab
show_page.add_comment_to_diff("Can you check this line of code?") show_page.add_comment_to_diff("Can you check this line of code?")
show_page.comment_now show_page.comment_now
...@@ -56,7 +56,7 @@ module QA ...@@ -56,7 +56,7 @@ module QA
end end
Page::MergeRequest::Show.perform do |show_page| Page::MergeRequest::Show.perform do |show_page|
show_page.go_to_discussions_tab show_page.click_discussions_tab
show_page.type_reply_to_discussion("Planning to discard this comment") show_page.type_reply_to_discussion("Planning to discard this comment")
show_page.start_review show_page.start_review
......
...@@ -12,7 +12,7 @@ module QA ...@@ -12,7 +12,7 @@ module QA
end end
project.visit! project.visit!
Page::Project::Menu.perform(&:go_to_settings) Page::Project::Menu.perform(&:click_settings)
Page::Project::Settings::MergeRequest.perform(&:enable_ff_only) Page::Project::Settings::MergeRequest.perform(&:enable_ff_only)
merge_request = Resource::MergeRequest.fabricate! do |merge_request| merge_request = Resource::MergeRequest.fabricate! do |merge_request|
......
...@@ -57,7 +57,7 @@ module QA ...@@ -57,7 +57,7 @@ module QA
end end
it 'branches are correctly listed after CRUD operations' do it 'branches are correctly listed after CRUD operations' do
Page::Project::Menu.perform(&:click_repository_branches) Page::Project::Menu.perform(&:go_to_repository_branches)
expect(page).to have_content(master_branch) expect(page).to have_content(master_branch)
expect(page).to have_content(second_branch) expect(page).to have_content(second_branch)
......
...@@ -16,7 +16,7 @@ module QA ...@@ -16,7 +16,7 @@ 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 { go_to_profile_settings } Page::Main::Menu.act { click_settings_link }
Page::Profile::Menu.act { click_ssh_keys } Page::Profile::Menu.act { click_ssh_keys }
Page::Profile::SSHKeys.perform do |ssh_keys| Page::Profile::SSHKeys.perform do |ssh_keys|
......
...@@ -19,7 +19,7 @@ module QA ...@@ -19,7 +19,7 @@ module QA
end end
project.visit! project.visit!
Page::Project::Menu.perform(&:click_members_settings) Page::Project::Menu.perform(&:go_to_members_settings)
Page::Project::Settings::Members.perform do |members_page| Page::Project::Settings::Members.perform do |members_page|
members_page.add_member(approver.username) members_page.add_member(approver.username)
members_page.add_member(non_approver.username) members_page.add_member(non_approver.username)
......
...@@ -29,7 +29,7 @@ module QA ...@@ -29,7 +29,7 @@ module QA
end end
@project.visit! @project.visit!
Page::Project::Menu.perform(&:click_members_settings) Page::Project::Menu.perform(&:go_to_members_settings)
Page::Project::Settings::Members.perform do |members_page| Page::Project::Settings::Members.perform do |members_page|
members_page.add_member(@user.username) members_page.add_member(@user.username)
members_page.add_member(@user2.username) members_page.add_member(@user2.username)
...@@ -57,7 +57,7 @@ module QA ...@@ -57,7 +57,7 @@ module QA
# Check the files and code owners # Check the files and code owners
Page::Project::Show.perform do |project_page| Page::Project::Show.perform do |project_page|
project_page.go_to_file 'file.txt' project_page.click_file 'file.txt'
end end
expect(page).to have_content(@user.name) expect(page).to have_content(@user.name)
...@@ -65,7 +65,7 @@ module QA ...@@ -65,7 +65,7 @@ module QA
@project.visit! @project.visit!
Page::Project::Show.perform do |project_page| Page::Project::Show.perform do |project_page|
project_page.go_to_file 'README.md' project_page.click_file 'README.md'
end end
expect(page).to have_content(@user2.name) expect(page).to have_content(@user2.name)
......
...@@ -31,7 +31,7 @@ module QA ...@@ -31,7 +31,7 @@ module QA
# Remove the SSH key # Remove the SSH key
login login
Page::Main::Menu.perform(&:go_to_profile_settings) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&: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)
......
...@@ -21,7 +21,7 @@ module QA ...@@ -21,7 +21,7 @@ module QA
end end
source_project_push.project.visit! source_project_push.project.visit!
Page::Project::Menu.perform(&:click_repository_settings) Page::Project::Menu.perform(&:go_to_repository_settings)
Page::Project::Settings::Repository.perform do |settings| Page::Project::Settings::Repository.perform do |settings|
settings.expand_mirroring_repositories do |mirror_settings| settings.expand_mirroring_repositories do |mirror_settings|
# Configure the source project to push to the target project # Configure the source project to push to the target project
......
...@@ -45,7 +45,7 @@ module QA ...@@ -45,7 +45,7 @@ module QA
end end
def set_file_size_limit(limit) def set_file_size_limit(limit)
Page::Main::Menu.perform(&:go_to_admin_area) Page::Main::Menu.perform(&:click_admin_area)
Page::Admin::Menu.perform(&:go_to_general_settings) Page::Admin::Menu.perform(&:go_to_general_settings)
Page::Admin::Settings::General.perform do |setting| Page::Admin::Settings::General.perform do |setting|
......
...@@ -28,7 +28,7 @@ module QA ...@@ -28,7 +28,7 @@ module QA
expect(page).to have_content('README.md') expect(page).to have_content('README.md')
expect(page).to have_content('Test Use SSH Key') expect(page).to have_content('Test Use SSH Key')
Page::Main::Menu.perform(&:go_to_profile_settings) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys) Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |ssh_keys| Page::Profile::SSHKeys.perform do |ssh_keys|
......
...@@ -33,7 +33,7 @@ module QA ...@@ -33,7 +33,7 @@ module QA
def view_commit def view_commit
@project.visit! @project.visit!
Page::Project::Show.perform do |page| Page::Project::Show.perform do |page|
page.go_to_commit(@commit_message) page.click_commit(@commit_message)
end end
end end
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_snippets) Page::Main::Menu.perform(&:click_snippets_link)
Resource::Snippet.fabricate_via_browser_ui! do |snippet| Resource::Snippet.fabricate_via_browser_ui! do |snippet|
snippet.title = 'Snippet title' snippet.title = 'Snippet title'
......
...@@ -20,7 +20,7 @@ module QA ...@@ -20,7 +20,7 @@ module QA
validate_content('My First Wiki Content') validate_content('My First Wiki Content')
Page::Project::Wiki::Edit.perform(&:go_to_edit_page) Page::Project::Wiki::Edit.perform(&:click_edit)
Page::Project::Wiki::New.perform do |page| Page::Project::Wiki::New.perform do |page|
page.set_content("My Second Wiki Content") page.set_content("My Second Wiki Content")
page.save_changes page.save_changes
......
...@@ -70,7 +70,7 @@ module QA ...@@ -70,7 +70,7 @@ module QA
puts 'Waiting for the runner to process the pipeline' puts 'Waiting for the runner to process the pipeline'
sleep 15 # Runner should process all jobs within 15 seconds. sleep 15 # Runner should process all jobs within 15 seconds.
Page::Project::Pipeline::Index.perform(&:go_to_latest_pipeline) Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
Page::Project::Pipeline::Show.perform do |pipeline| Page::Project::Pipeline::Show.perform do |pipeline|
expect(pipeline).to be_running expect(pipeline).to be_running
......
...@@ -91,8 +91,8 @@ module QA ...@@ -91,8 +91,8 @@ module QA
sha1sum = Digest::SHA1.hexdigest(gitlab_ci) sha1sum = Digest::SHA1.hexdigest(gitlab_ci)
Page::Project::Menu.perform(&:click_ci_cd_pipelines) Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:go_to_latest_pipeline) Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
Page::Project::Pipeline::Show.perform(&:go_to_first_job) Page::Project::Pipeline::Show.perform(&:click_on_first_job)
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_successful expect(job).to be_successful
......
...@@ -63,10 +63,10 @@ module QA ...@@ -63,10 +63,10 @@ module QA
end end
Page::Project::Menu.perform(&:click_ci_cd_pipelines) Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:go_to_latest_pipeline) Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
Page::Project::Pipeline::Show.perform do |pipeline| Page::Project::Pipeline::Show.perform do |pipeline|
pipeline.go_to_job('build') pipeline.click_job('build')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_successful(timeout: 600) expect(job).to be_successful(timeout: 600)
...@@ -75,7 +75,7 @@ module QA ...@@ -75,7 +75,7 @@ module QA
end end
Page::Project::Pipeline::Show.perform do |pipeline| Page::Project::Pipeline::Show.perform do |pipeline|
pipeline.go_to_job('test') pipeline.click_job('test')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_successful(timeout: 600) expect(job).to be_successful(timeout: 600)
...@@ -84,7 +84,7 @@ module QA ...@@ -84,7 +84,7 @@ module QA
end end
Page::Project::Pipeline::Show.perform do |pipeline| Page::Project::Pipeline::Show.perform do |pipeline|
pipeline.go_to_job('production') pipeline.click_job('production')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_successful(timeout: 1200) expect(job).to be_successful(timeout: 1200)
...@@ -92,9 +92,9 @@ module QA ...@@ -92,9 +92,9 @@ module QA
job.click_element(:pipeline_path) job.click_element(:pipeline_path)
end end
Page::Project::Menu.perform(&:click_operations_environments) Page::Project::Menu.perform(&:go_to_operations_environments)
Page::Project::Operations::Environments::Index.perform do |index| Page::Project::Operations::Environments::Index.perform do |index|
index.go_to_environment('production') index.click_environment_link('production')
end end
Page::Project::Operations::Environments::Show.perform do |show| Page::Project::Operations::Environments::Show.perform do |show|
show.view_deployment do show.view_deployment do
...@@ -125,7 +125,7 @@ module QA ...@@ -125,7 +125,7 @@ module QA
end end
Page::Project::Menu.perform(&:click_ci_cd_pipelines) Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:go_to_latest_pipeline) Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
Page::Project::Pipeline::Show.perform do |pipeline| Page::Project::Pipeline::Show.perform do |pipeline|
expect(pipeline).to have_tag('Auto DevOps') expect(pipeline).to have_tag('Auto DevOps')
......
...@@ -9,7 +9,7 @@ module QA ...@@ -9,7 +9,7 @@ module QA
Page::Main::Menu.act { go_to_groups } Page::Main::Menu.act { go_to_groups }
Page::Dashboard::Groups.perform do |page| Page::Dashboard::Groups.perform do |page|
page.go_to_new_group page.click_new_group
expect(page).to have_content( expect(page).to have_content(
/Create a Mattermost team for this group/ /Create a Mattermost team for this group/
......
...@@ -30,7 +30,7 @@ module QA ...@@ -30,7 +30,7 @@ module QA
dashboard.go_to_project(geo_project_name) dashboard.go_to_project(geo_project_name)
end end
Page::Project::Menu.act { go_to_settings } Page::Project::Menu.act { click_settings }
geo_project_renamed = "geo-after-rename-#{SecureRandom.hex(8)}" geo_project_renamed = "geo-after-rename-#{SecureRandom.hex(8)}"
Page::Project::Settings::Main.perform do |settings| Page::Project::Settings::Main.perform do |settings|
......
...@@ -51,7 +51,7 @@ module QA ...@@ -51,7 +51,7 @@ module QA
end end
# Ensure the SSH key has replicated # Ensure the SSH key has replicated
Page::Main::Menu.act { go_to_profile_settings } Page::Main::Menu.act { click_settings_link }
Page::Profile::Menu.act { click_ssh_keys } Page::Profile::Menu.act { click_ssh_keys }
expect(page).to have_content(key_title) expect(page).to have_content(key_title)
...@@ -125,7 +125,7 @@ module QA ...@@ -125,7 +125,7 @@ module QA
end end
# Ensure the SSH key has replicated # Ensure the SSH key has replicated
Page::Main::Menu.act { go_to_profile_settings } Page::Main::Menu.act { click_settings_link }
Page::Profile::Menu.act { click_ssh_keys } Page::Profile::Menu.act { click_ssh_keys }
expect(page).to have_content(key_title) expect(page).to have_content(key_title)
......
...@@ -49,7 +49,7 @@ module QA ...@@ -49,7 +49,7 @@ module QA
end end
# Ensure the SSH key has replicated # Ensure the SSH key has replicated
Page::Main::Menu.perform(&:go_to_profile_settings) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform do |menu| Page::Profile::Menu.perform do |menu|
menu.click_ssh_keys menu.click_ssh_keys
menu.wait_for_key_to_replicate(key_title) menu.wait_for_key_to_replicate(key_title)
...@@ -141,7 +141,7 @@ module QA ...@@ -141,7 +141,7 @@ module QA
end end
# Ensure the SSH key has replicated # Ensure the SSH key has replicated
Page::Main::Menu.perform(&:go_to_profile_settings) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform do |menu| Page::Profile::Menu.perform do |menu|
menu.click_ssh_keys menu.click_ssh_keys
menu.wait_for_key_to_replicate(key_title) menu.wait_for_key_to_replicate(key_title)
......
...@@ -27,7 +27,7 @@ module QA ...@@ -27,7 +27,7 @@ module QA
Runtime::Browser.visit(ENV['GITLAB_ADDRESS'], Page::Main::Login) Runtime::Browser.visit(ENV['GITLAB_ADDRESS'], Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_profile_settings) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_access_tokens) Page::Profile::Menu.perform(&:click_access_tokens)
token_name = 'api-test-token' token_name = 'api-test-token'
......
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