summaryrefslogtreecommitdiff
path: root/qa/qa/page/component
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/component')
-rw-r--r--qa/qa/page/component/issue_board/show.rb2
-rw-r--r--qa/qa/page/component/snippet.rb11
-rw-r--r--qa/qa/page/component/web_ide/web_terminal_panel.rb63
3 files changed, 75 insertions, 1 deletions
diff --git a/qa/qa/page/component/issue_board/show.rb b/qa/qa/page/component/issue_board/show.rb
index 1c1f7ab17f3..4b842412c0f 100644
--- a/qa/qa/page/component/issue_board/show.rb
+++ b/qa/qa/page/component/issue_board/show.rb
@@ -48,7 +48,7 @@ module QA
# with the attribute `data-qa-selector` since such element is not unique when the
# `is-focused` class is not set, and it was not possible to find a better solution.
def focused_board
- find('.issue-boards-content.js-focus-mode-board.is-focused')
+ find('.js-focus-mode-board.is-focused')
end
def boards_dropdown
diff --git a/qa/qa/page/component/snippet.rb b/qa/qa/page/component/snippet.rb
index 73f41e0aa51..ad264bd6d56 100644
--- a/qa/qa/page/component/snippet.rb
+++ b/qa/qa/page/component/snippet.rb
@@ -79,6 +79,11 @@ module QA
element :default_actions_container
element :copy_contents_button
end
+
+ base.view 'app/views/layouts/nav/_breadcrumbs.html.haml' do
+ element :breadcrumb_links_content
+ element :breadcrumb_sub_title_content
+ end
end
def has_snippet_title?(snippet_title)
@@ -249,6 +254,12 @@ module QA
raise ElementNotFound, "Comment did not appear as expected"
end
end
+
+ def snippet_id
+ within_element(:breadcrumb_links_content) do
+ find_element(:breadcrumb_sub_title_content).text.delete_prefix('$')
+ end
+ end
end
end
end
diff --git a/qa/qa/page/component/web_ide/web_terminal_panel.rb b/qa/qa/page/component/web_ide/web_terminal_panel.rb
new file mode 100644
index 00000000000..80f83bcff7c
--- /dev/null
+++ b/qa/qa/page/component/web_ide/web_terminal_panel.rb
@@ -0,0 +1,63 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Component
+ module WebIDE
+ module WebTerminalPanel
+ extend QA::Page::PageConcern
+
+ def self.prepended(base)
+ super
+
+ base.class_eval do
+ view 'app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue' do
+ element :ide_right_sidebar, %q(:data-qa-selector="`ide_${side}_sidebar`") # rubocop:disable QA/ElementWithPattern
+ end
+
+ view 'app/assets/javascripts/ide/components/ide_sidebar_nav.vue' do
+ element :terminal_tab_button, %q(:data-qa-selector="`${tab.title.toLowerCase()}_tab_button`") # rubocop:disable QA/ElementWithPattern
+ end
+
+ view 'app/assets/javascripts/ide/components/terminal/empty_state.vue' do
+ element :start_web_terminal_button
+ end
+
+ view 'app/assets/javascripts/ide/components/terminal/terminal.vue' do
+ element :loading_container
+ element :terminal_screen
+ end
+ end
+ end
+
+ def has_finished_loading?
+ has_no_element?(:loading_container, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME)
+ end
+
+ def has_terminal_screen?
+ wait_until(reload: false) do
+ within_element :terminal_screen do
+ # The DOM initially just includes the :terminal_screen element
+ # and then the xterm package dynamically loads when the user
+ # clicks the Start Web Terminal button. If it loads succesfully
+ # an element with the class `xterm` is added to the DOM.
+ # The xterm is a third-party library, so we can't add a selector
+ find(".xterm")
+ end
+ end
+ end
+
+ def start_web_terminal
+ within_element :ide_right_sidebar do
+ click_element :terminal_tab_button
+ end
+
+ click_element :start_web_terminal_button
+
+ has_element? :loading_container, text: "Starting"
+ end
+ end
+ end
+ end
+ end
+end