Skip to content
代码片段 群组 项目
提交 3f69bd51 编辑于 作者: Rémy Coutable's avatar Rémy Coutable
浏览文件

Merge branch 'standardize-click-and-go-to' into 'master'

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

See merge request gitlab-org/gitlab-ce!26328
No related branches found
No related tags found
无相关合并请求
显示
38 个添加44 个删除
......@@ -19,11 +19,13 @@ def has_group?(name)
has_filtered_group?(name)
end
def go_to_group(name)
def click_group(name)
raise "Group with name #{name} not found!" unless has_group?(name)
click_link name
end
def go_to_new_group
def click_new_group
click_on 'New group'
end
end
......
......@@ -37,7 +37,7 @@ def fill_file_content(content)
text_area.set content
end
def create_snippet
def click_create_snippet_button
click_element :create_snippet_button
end
......
......@@ -18,7 +18,7 @@ class Show < Page::Base
element :no_result_text, 'No groups or projects matched your search' # rubocop:disable QA/ElementWithPattern
end
def go_to_subgroup(name)
def click_subgroup(name)
click_link name
end
......
......@@ -18,7 +18,7 @@ class Index < Page::Base
element :label_svg
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
# This can cause webdriver to miss the hit so we wait for the svg to load (implicitly with has_element?)
# before clicking the button.
......
......@@ -9,7 +9,7 @@ class New < Page::Base
element :label_create_button
end
def create_label
def click_label_create_button
click_element :label_create_button
end
......
......@@ -47,7 +47,7 @@ def go_to_projects
end
end
def go_to_admin_area
def click_admin_area
within_top_menu { click_element :admin_area_link }
end
......@@ -57,7 +57,7 @@ def sign_out
end
end
def go_to_profile_settings
def click_settings_link
retry_until(reload: false) do
within_user_menu do
click_link 'Settings'
......@@ -67,7 +67,7 @@ def go_to_profile_settings
end
end
def go_to_snippets
def click_snippets_link
click_element :snippets_link
end
......
......@@ -145,11 +145,11 @@ def mark_to_squash
click_element :squash_checkbox
end
def go_to_discussions_tab
def click_discussions_tab
click_element :notes_tab
end
def go_to_diffs_tab
def click_diffs_tab
click_element :diffs_tab
end
......
......@@ -26,7 +26,7 @@ def check_api
check_element(:api_radio)
end
def create_token
def click_create_token_button
click_element(:create_token_button)
end
......
......@@ -7,7 +7,7 @@ class Index < Page::Base
element :issue_link, 'link_to issue.title' # rubocop:disable QA/ElementWithPattern
end
def go_to_issue(title)
def click_issue_link(title)
click_link(title)
end
end
......
......@@ -17,7 +17,7 @@ def set_description(description)
fill_element :milestone_description, description
end
def create_new_milestone
def click_milestone_create_button
click_element :milestone_create_button
end
end
......
......@@ -35,7 +35,7 @@ def choose_namespace(namespace)
end
end
def go_to_import_project
def click_import_project
click_on 'Import project'
end
......@@ -51,7 +51,7 @@ def create_new_project
click_on 'Create project'
end
def go_to_create_from_template
def click_create_from_template_tab
click_element(:project_create_from_template_tab)
end
......@@ -59,7 +59,7 @@ def set_visibility(visibility)
choose visibility
end
def go_to_github_import
def click_github_link
click_link 'GitHub'
end
end
......
......@@ -10,7 +10,7 @@ class Index < Page::Base
element :environment_link
end
def go_to_environment(environment_name)
def click_environment_link(environment_name)
wait(reload: false) do
find(element_selector_css(:environment_link), text: environment_name).click
end
......
......@@ -5,7 +5,7 @@ class Index < QA::Page::Base
element :pipeline_link, 'class="js-pipeline-url-link"' # rubocop:disable QA/ElementWithPattern
end
def go_to_latest_pipeline
def click_on_latest_pipeline
css = '.js-pipeline-url-link'
link = wait(reload: false) do
......
......@@ -42,11 +42,11 @@ def has_tag?(tag_name)
end
end
def go_to_job(job_name)
def click_job(job_name)
find_element(:job_link, text: job_name).click
end
def go_to_first_job
def click_on_first_job
css = '.js-pipeline-graph-job-link'
wait(reload: false) do
......
......@@ -32,22 +32,22 @@ def select_branch(branch_name)
end
def allow_no_one_to_push
click_allow(:push, 'No one')
go_to_allow(:push, 'No one')
end
def allow_devs_and_maintainers_to_push
click_allow(:push, 'Developers + Maintainers')
go_to_allow(:push, 'Developers + Maintainers')
end
# @deprecated
alias_method :allow_devs_and_masters_to_push, :allow_devs_and_maintainers_to_push
def allow_no_one_to_merge
click_allow(:merge, 'No one')
go_to_allow(:merge, 'No one')
end
def allow_devs_and_maintainers_to_merge
click_allow(:merge, 'Developers + Maintainers')
go_to_allow(:merge, 'Developers + Maintainers')
end
# @deprecated
......@@ -59,7 +59,7 @@ def protect_branch
private
def click_allow(action, text)
def go_to_allow(action, text)
click_element :"allowed_to_#{action}_select"
within_element(:"allowed_to_#{action}_dropdown") do
......
......@@ -76,13 +76,13 @@ def fork_project
click_on 'Fork'
end
def go_to_file(filename)
def click_file(filename)
within_element(:file_tree) do
click_on filename
end
end
def go_to_commit(commit_msg)
def click_commit(commit_msg)
within_element(:file_tree) do
click_on commit_msg
end
......
......@@ -14,7 +14,7 @@ def self.included(base)
end
end
def click_operations_environments
def go_to_operations_environments
hover_operations do
within_submenu do
click_element(:operations_environments_link)
......@@ -22,7 +22,7 @@ def click_operations_environments
end
end
def click_operations_kubernetes
def go_to_operations_kubernetes
hover_operations do
within_submenu do
click_link('Kubernetes')
......
......@@ -20,7 +20,7 @@ def click_repository
end
end
def click_repository_branches
def go_to_repository_branches
hover_repository do
within_submenu do
click_element(:branches_link)
......
......@@ -14,7 +14,7 @@ def self.included(base)
end
end
def click_ci_cd_settings
def go_to_ci_cd_settings
hover_settings do
within_submenu do
click_link('CI / CD')
......@@ -22,7 +22,7 @@ def click_ci_cd_settings
end
end
def click_members_settings
def go_to_members_settings
hover_settings do
within_submenu do
click_element :link_members_settings
......@@ -30,7 +30,7 @@ def click_members_settings
end
end
def click_repository_settings
def go_to_repository_settings
hover_settings do
within_submenu do
click_link('Repository')
......@@ -38,7 +38,7 @@ def click_repository_settings
end
end
def go_to_settings
def click_settings
within_sidebar do
click_on 'Settings'
end
......
......@@ -9,15 +9,7 @@ class Edit < Page::Base
element :edit_page_link, 'Edit' # rubocop:disable QA/ElementWithPattern
end
def go_to_new_page
click_on 'New page'
end
def got_to_view_history_page
click_on 'Page history'
end
def go_to_edit_page
def click_edit
click_on 'Edit'
end
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册