summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/snippet/new.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/project/snippet/new.rb')
-rw-r--r--qa/qa/page/project/snippet/new.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/qa/qa/page/project/snippet/new.rb b/qa/qa/page/project/snippet/new.rb
new file mode 100644
index 00000000000..1463dfc2c7f
--- /dev/null
+++ b/qa/qa/page/project/snippet/new.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Snippet
+ class New < Page::Dashboard::Snippet::New
+ include Component::LazyLoader
+ view 'app/views/shared/empty_states/_snippets.html.haml' do
+ element :create_first_snippet_link
+ element :svg_content
+ end
+
+ def click_create_first_snippet
+ finished_loading?
+ # The svg takes a fraction of a second to load after which the
+ # "New snippet" button shifts up a bit. This can cause
+ # webdriver to miss the hit so we wait for the svg to load before
+ # clicking the button.
+ within_element(:svg_content) do
+ has_element?(:js_lazy_loaded)
+ end
+ click_element(:create_first_snippet_link)
+ end
+ end
+ end
+ end
+ end
+end