summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-09-07 06:39:01 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-09-07 06:39:01 +0000
commitc380d3acebd181f13629a25d2e2acca46ffe1e00 (patch)
treebbac4171cd348306ede3c39951e5aea1c5014d76 /qa
parentd5cc0c8d9eaef90fb8a76093536dd1ea07cee196 (diff)
parentcbae3e974d2c2a0feb573c1730108aae7bbf435a (diff)
downloadgitlab-ce-c380d3acebd181f13629a25d2e2acca46ffe1e00.tar.gz
Merge branch 'qa-change-sanity-failing-to-sanity-framework' into 'master'
[QA] Change Test::Sanity::Failing to Test::Sanity::Framework See merge request gitlab-org/gitlab-ce!21568
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb2
-rw-r--r--qa/qa/page/main/login.rb12
-rw-r--r--qa/qa/scenario/test/sanity/framework.rb (renamed from qa/qa/scenario/test/sanity/failing.rb)7
-rw-r--r--qa/qa/specs/features/sanity/failing_spec.rb13
-rw-r--r--qa/qa/specs/features/sanity/framework_spec.rb23
-rw-r--r--qa/spec/scenario/test/sanity/framework_spec.rb5
6 files changed, 43 insertions, 19 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index c21cb3c1929..cb3202c8e1c 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -100,7 +100,7 @@ module QA
end
module Sanity
- autoload :Failing, 'qa/scenario/test/sanity/failing'
+ autoload :Framework, 'qa/scenario/test/sanity/framework'
autoload :Selectors, 'qa/scenario/test/sanity/selectors'
end
end
diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb
index afc8b66d878..1ea98b94aeb 100644
--- a/qa/qa/page/main/login.rb
+++ b/qa/qa/page/main/login.rb
@@ -63,6 +63,14 @@ module QA
'/users/sign_in'
end
+ def sign_in_tab?
+ page.has_button?('Sign in')
+ end
+
+ def ldap_tab?
+ page.has_button?('LDAP')
+ end
+
def switch_to_sign_in_tab
click_on 'Sign in'
end
@@ -90,8 +98,8 @@ module QA
end
def sign_in_using_gitlab_credentials(user)
- switch_to_sign_in_tab unless page.has_button?('Sign in')
- switch_to_standard_tab if page.has_content?('LDAP')
+ switch_to_sign_in_tab unless sign_in_tab?
+ switch_to_standard_tab if ldap_tab?
fill_in :user_login, with: user.username
fill_in :user_password, with: user.password
diff --git a/qa/qa/scenario/test/sanity/failing.rb b/qa/qa/scenario/test/sanity/framework.rb
index 03452f6693d..7835d2564f0 100644
--- a/qa/qa/scenario/test/sanity/failing.rb
+++ b/qa/qa/scenario/test/sanity/framework.rb
@@ -5,12 +5,13 @@ module QA
module Test
module Sanity
##
- # This scenario exits with a 1 exit code.
+ # This scenario runs 1 passing example, and 1 failing example, and exits
+ # with a 1 exit code.
#
- class Failing < Template
+ class Framework < Template
include Bootable
- tags :failing
+ tags :framework
end
end
end
diff --git a/qa/qa/specs/features/sanity/failing_spec.rb b/qa/qa/specs/features/sanity/failing_spec.rb
deleted file mode 100644
index 7e0480e9067..00000000000
--- a/qa/qa/specs/features/sanity/failing_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context 'Sanity checks', :orchestrated, :failing do
- describe 'Failing orchestrated example' do
- it 'always fails' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
-
- expect(page).to have_text("These Aren't the Texts You're Looking For", wait: 1)
- end
- end
- end
-end
diff --git a/qa/qa/specs/features/sanity/framework_spec.rb b/qa/qa/specs/features/sanity/framework_spec.rb
new file mode 100644
index 00000000000..ee9d068eb3a
--- /dev/null
+++ b/qa/qa/specs/features/sanity/framework_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module QA
+ context 'Framework sanity checks', :orchestrated, :framework do
+ describe 'Passing orchestrated example' do
+ it 'succeeds' do
+ Runtime::Browser.visit(:gitlab, Page::Main::Login)
+
+ Page::Main::Login.perform do |main_login|
+ expect(main_login.sign_in_tab?).to be(true)
+ end
+ end
+ end
+
+ describe 'Failing orchestrated example' do
+ it 'fails' do
+ Runtime::Browser.visit(:gitlab, Page::Main::Login)
+
+ expect(page).to have_text("These Aren't the Texts You're Looking For", wait: 1)
+ end
+ end
+ end
+end
diff --git a/qa/spec/scenario/test/sanity/framework_spec.rb b/qa/spec/scenario/test/sanity/framework_spec.rb
new file mode 100644
index 00000000000..44ac780556e
--- /dev/null
+++ b/qa/spec/scenario/test/sanity/framework_spec.rb
@@ -0,0 +1,5 @@
+describe QA::Scenario::Test::Sanity::Framework do
+ it_behaves_like 'a QA scenario class' do
+ let(:tags) { [:framework] }
+ end
+end