Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorImre Farkas <ifarkas@gitlab.com>2018-11-13 00:40:42 +0300
committerImre Farkas <ifarkas@gitlab.com>2018-11-18 23:00:28 +0300
commit02326fa4b128c6272cc5c802cf5145f0fa6f6cc2 (patch)
treea17739647988e8f2c3e414cb9c91d76c09496f6a /spec/support/helpers
parent29d8179ba07be3ed111f939285eb4064d84cb7df (diff)
Backport of ee/8120: Smartcard authentication
Diffstat (limited to 'spec/support/helpers')
-rw-r--r--spec/support/helpers/user_login_helper.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/support/helpers/user_login_helper.rb b/spec/support/helpers/user_login_helper.rb
new file mode 100644
index 00000000000..36c002f53af
--- /dev/null
+++ b/spec/support/helpers/user_login_helper.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module UserLoginHelper
+ def ensure_tab_pane_correctness(visit_path = true)
+ if visit_path
+ visit new_user_session_path
+ end
+
+ ensure_tab_pane_counts
+ ensure_one_active_tab
+ ensure_one_active_pane
+ end
+
+ def ensure_tab_pane_counts
+ tabs_count = page.all('[role="tab"]').size
+ expect(page).to have_selector('[role="tabpanel"]', count: tabs_count)
+ end
+
+ def ensure_one_active_tab
+ expect(page).to have_selector('ul.new-session-tabs > li > a.active', count: 1)
+ end
+
+ def ensure_one_active_pane
+ expect(page).to have_selector('.tab-pane.active', count: 1)
+ end
+end