summaryrefslogtreecommitdiff
path: root/qa/qa/page/component
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2018-11-26 10:59:52 -0500
committerMark Lapierre <mlapierre@gitlab.com>2018-12-10 13:07:38 -0500
commitc61c5cf2d973f9a9add71dbe876df42caa8e4bfe (patch)
tree35cbaaa60c4e6c0081a82a1fce0ec134fafa1634 /qa/qa/page/component
parent3f2418b2c3af4c2952b1e535d72c7358aeb135af (diff)
downloadgitlab-ce-c61c5cf2d973f9a9add71dbe876df42caa8e4bfe.tar.gz
Update E2E tests for Project overview UI changes
Includes updates to how clone URLs are accessed.
Diffstat (limited to 'qa/qa/page/component')
-rw-r--r--qa/qa/page/component/clone_panel.rb31
-rw-r--r--qa/qa/page/component/legacy_clone_panel.rb52
2 files changed, 63 insertions, 20 deletions
diff --git a/qa/qa/page/component/clone_panel.rb b/qa/qa/page/component/clone_panel.rb
index 94e761b0e0c..d37b63c716a 100644
--- a/qa/qa/page/component/clone_panel.rb
+++ b/qa/qa/page/component/clone_panel.rb
@@ -5,26 +5,20 @@ module QA
module Component
module ClonePanel
def self.included(base)
- base.view 'app/views/shared/_clone_panel.html.haml' do
+ base.view 'app/views/projects/buttons/_clone.html.haml' do
element :clone_dropdown
- element :clone_options_dropdown, '.clone-options-dropdown' # rubocop:disable QA/ElementWithPattern
- element :project_repository_location, 'text_field_tag :project_clone' # rubocop:disable QA/ElementWithPattern
+ element :clone_options
+ element :ssh_clone_url
+ element :http_clone_url
end
end
- def choose_repository_clone_http
- choose_repository_clone('HTTP', 'http')
+ def repository_clone_http_location
+ repository_clone_location(:http_clone_url)
end
- def choose_repository_clone_ssh
- # It's not always beginning with ssh:// so detecting with @
- # would be more reliable because ssh would always contain it.
- # We can't use .git because HTTP also contain that part.
- choose_repository_clone('SSH', '@')
- end
-
- def repository_location
- Git::Location.new(find('#project_clone').value)
+ def repository_clone_ssh_location
+ repository_clone_location(:ssh_clone_url)
end
def wait_for_push
@@ -34,16 +28,13 @@ module QA
private
- def choose_repository_clone(kind, detect_text)
+ def repository_clone_location(kind)
wait(reload: false) do
click_element :clone_dropdown
- page.within('.clone-options-dropdown') do
- click_link(kind)
+ within_element :clone_options do
+ Git::Location.new(find_element(kind).value)
end
-
- # Ensure git clone textbox was updated
- repository_location.git_uri.include?(detect_text)
end
end
end
diff --git a/qa/qa/page/component/legacy_clone_panel.rb b/qa/qa/page/component/legacy_clone_panel.rb
new file mode 100644
index 00000000000..99132190f3f
--- /dev/null
+++ b/qa/qa/page/component/legacy_clone_panel.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Component
+ module LegacyClonePanel
+ def self.included(base)
+ base.view 'app/views/shared/_clone_panel.html.haml' do
+ element :clone_dropdown
+ element :clone_options_dropdown, '.clone-options-dropdown' # rubocop:disable QA/ElementWithPattern
+ element :project_repository_location, 'text_field_tag :project_clone' # rubocop:disable QA/ElementWithPattern
+ end
+ end
+
+ def choose_repository_clone_http
+ choose_repository_clone('HTTP', 'http')
+ end
+
+ def choose_repository_clone_ssh
+ # It's not always beginning with ssh:// so detecting with @
+ # would be more reliable because ssh would always contain it.
+ # We can't use .git because HTTP also contain that part.
+ choose_repository_clone('SSH', '@')
+ end
+
+ def repository_location
+ Git::Location.new(find('#project_clone').value)
+ end
+
+ def wait_for_push
+ sleep 5
+ refresh
+ end
+
+ private
+
+ def choose_repository_clone(kind, detect_text)
+ wait(reload: false) do
+ click_element :clone_dropdown
+
+ page.within('.clone-options-dropdown') do
+ click_link(kind)
+ end
+
+ # Ensure git clone textbox was updated
+ repository_location.git_uri.include?(detect_text)
+ end
+ end
+ end
+ end
+ end
+end