summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/show.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/project/show.rb')
-rw-r--r--qa/qa/page/project/show.rb77
1 files changed, 44 insertions, 33 deletions
diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb
index d6dddf03ffb..99d849db439 100644
--- a/qa/qa/page/project/show.rb
+++ b/qa/qa/page/project/show.rb
@@ -6,6 +6,11 @@ module QA
class Show < Page::Base
include Page::Component::ClonePanel
+ view 'app/views/layouts/header/_new_dropdown.haml' do
+ element :new_menu_toggle
+ element :new_issue_link, "link_to _('New issue'), new_project_issue_path(@project)" # rubocop:disable QA/ElementWithPattern
+ end
+
view 'app/views/projects/_last_push.html.haml' do
element :create_merge_request
end
@@ -14,14 +19,12 @@ module QA
element :project_name
end
- view 'app/views/layouts/header/_new_dropdown.haml' do
- element :new_menu_toggle
- element :new_issue_link, "link_to _('New issue'), new_project_issue_path(@project)" # rubocop:disable QA/ElementWithPattern
+ view 'app/views/projects/_files.html.haml' do
+ element :tree_holder, '.tree-holder' # rubocop:disable QA/ElementWithPattern
end
- view 'app/views/shared/_ref_switcher.html.haml' do
- element :branches_select
- element :branches_dropdown
+ view 'app/views/projects/buttons/_dropdown.html.haml' do
+ element :create_new_dropdown
end
view 'app/views/projects/buttons/_fork.html.haml' do
@@ -29,44 +32,50 @@ module QA
element :fork_link, "link_to new_project_fork_path(@project)" # rubocop:disable QA/ElementWithPattern
end
- view 'app/views/projects/_files.html.haml' do
- element :tree_holder, '.tree-holder' # rubocop:disable QA/ElementWithPattern
+ view 'app/views/projects/empty.html.haml' do
+ element :quick_actions
end
- view 'app/views/projects/buttons/_dropdown.html.haml' do
- element :create_new_dropdown
- element :new_file_option
+ view 'app/views/projects/tree/_tree_content.html.haml' do
+ element :file_tree
end
view 'app/views/projects/tree/_tree_header.html.haml' do
+ element :add_to_tree
+ element :new_file_option
element :web_ide_button
end
- view 'app/views/projects/tree/_tree_content.html.haml' do
- element :file_tree
+ view 'app/views/shared/_ref_switcher.html.haml' do
+ element :branches_select
+ element :branches_dropdown
end
- def project_name
- find('.qa-project-name').text
+ def create_first_new_file!
+ within_element(:quick_actions) do
+ click_link_with_text 'New file'
+ end
end
def create_new_file!
- click_element :create_new_dropdown
+ click_element :add_to_tree
click_element :new_file_option
end
+ def fork_project
+ click_on 'Fork'
+ end
+
def go_to_file(filename)
within_element(:file_tree) do
click_on filename
end
end
- def switch_to_branch(branch_name)
- find_element(:branches_select).click
+ def go_to_new_issue
+ click_element :new_menu_toggle
- within_element(:branches_dropdown) do
- click_on branch_name
- end
+ click_link 'New issue'
end
def last_commit_content
@@ -81,24 +90,26 @@ module QA
click_element :create_merge_request
end
- def wait_for_import
- wait(reload: true) do
- has_css?('.tree-holder')
- end
+ def open_web_ide!
+ click_element :web_ide_button
end
- def go_to_new_issue
- click_element :new_menu_toggle
-
- click_link 'New issue'
+ def project_name
+ find('.qa-project-name').text
end
- def fork_project
- click_on 'Fork'
+ def switch_to_branch(branch_name)
+ find_element(:branches_select).click
+
+ within_element(:branches_dropdown) do
+ click_on branch_name
+ end
end
- def open_web_ide!
- click_element :web_ide_button
+ def wait_for_import
+ wait(reload: true) do
+ has_css?('.tree-holder')
+ end
end
end
end