summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/show.rb
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2018-09-26 15:15:35 -0400
committerMark Lapierre <mlapierre@gitlab.com>2018-10-09 11:17:02 -0400
commitd36055cbef1e5f2e9ffe1b0b9c1ad32e85bb5248 (patch)
tree98762181835df5d65c26a17af846593c1e6712e4 /qa/qa/page/project/show.rb
parenteeb0baff480a5b4275fb152920e5b81b1a2cda3c (diff)
downloadgitlab-ce-d36055cbef1e5f2e9ffe1b0b9c1ad32e85bb5248.tar.gz
Add tests of adding file templates
Adds tests that adds new files via file templates via the Files view and the Web IDE. Includes changes to page objects and associated code Fetches template content from the API rather than hardcoding strings that will need to be updated if the templates change. Some of the content is stored as flat files but we can't use them because they're not included in the docker images gitlab-qa uses.
Diffstat (limited to 'qa/qa/page/project/show.rb')
-rw-r--r--qa/qa/page/project/show.rb20
1 files changed, 16 insertions, 4 deletions
diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb
index 267e7bbc249..2e7be1deb27 100644
--- a/qa/qa/page/project/show.rb
+++ b/qa/qa/page/project/show.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module QA
module Page
module Project
@@ -31,16 +33,22 @@ module QA
element :tree_holder, '.tree-holder'
end
- view 'app/presenters/project_presenter.rb' do
- element :new_file_button, "_('New file'),"
+ view 'app/views/projects/buttons/_dropdown.html.haml' do
+ element :create_new_dropdown
+ element :new_file_option
+ end
+
+ view 'app/views/projects/tree/_tree_header.html.haml' do
+ element :web_ide_button
end
def project_name
find('.qa-project-name').text
end
- def go_to_new_file!
- click_on 'New file'
+ def create_new_file!
+ click_element :create_new_dropdown
+ click_element :new_file_option
end
def switch_to_branch(branch_name)
@@ -78,6 +86,10 @@ module QA
def fork_project
click_on 'Fork'
end
+
+ def open_web_ide!
+ click_element :web_ide_button
+ end
end
end
end