Commit 654c89e7 authored by Dan Davison's avatar Dan Davison

Merge branch 'qa-no-monkey-patching-docs' into 'master'

Update QA E2E documentation

See merge request gitlab-org/gitlab!36134
parents 3ac5fd95 6a6c0f3d
...@@ -80,13 +80,21 @@ file `basic_login_spec.rb`. ...@@ -80,13 +80,21 @@ file `basic_login_spec.rb`.
### The outer `context` block ### The outer `context` block
Specs have an outer `context` indicating the DevOps stage. See the [`RSpec.describe` outer block](#the-outer-rspecdescribe-block)
CAUTION: **Deprecation notice:**
The outer `context` [was deprecated](https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/550) in `13.2`
in adherance to RSpec 4.0 specifications. Use `RSpec.describe` instead.
### The outer `RSpec.describe` block
Specs have an outer `RSpec.describe` indicating the DevOps stage.
```ruby ```ruby
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
context 'Manage' do RSpec.describe 'Manage' do
end end
end end
...@@ -94,13 +102,13 @@ end ...@@ -94,13 +102,13 @@ end
### The `describe` block ### The `describe` block
Inside of our outer `context`, describe the feature to test. In this case, `Login`. Inside of our outer `RSpec.describe`, describe the feature to test. In this case, `Login`.
```ruby ```ruby
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
context 'Manage' do RSpec.describe 'Manage' do
describe 'Login' do describe 'Login' do
end end
...@@ -115,7 +123,7 @@ writing end-to-end tests is to write test case descriptions as `it` blocks: ...@@ -115,7 +123,7 @@ writing end-to-end tests is to write test case descriptions as `it` blocks:
```ruby ```ruby
module QA module QA
context 'Manage' do RSpec.describe 'Manage' do
describe 'Login' do describe 'Login' do
it 'can login' do it 'can login' do
...@@ -139,7 +147,7 @@ Begin by logging in. ...@@ -139,7 +147,7 @@ Begin by logging in.
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
context 'Manage' do RSpec.describe 'Manage' do
describe 'Login' do describe 'Login' do
it 'can login' do it 'can login' do
Flow::Login.sign_in Flow::Login.sign_in
...@@ -162,7 +170,7 @@ should answer the question "What do we test?" ...@@ -162,7 +170,7 @@ should answer the question "What do we test?"
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
context 'Manage' do RSpec.describe 'Manage' do
describe 'Login' do describe 'Login' do
it 'can login' do it 'can login' do
Flow::Login.sign_in Flow::Login.sign_in
...@@ -210,7 +218,7 @@ a call to `sign_in`. ...@@ -210,7 +218,7 @@ a call to `sign_in`.
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
context 'Manage' do RSpec.describe 'Manage' do
describe 'Login' do describe 'Login' do
before do before do
Flow::Login.sign_in Flow::Login.sign_in
...@@ -247,7 +255,7 @@ stage, so [create a file](#identify-the-devops-stage) in ...@@ -247,7 +255,7 @@ stage, so [create a file](#identify-the-devops-stage) in
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
context 'Plan' do RSpec.describe 'Plan' do
describe 'Issues' do describe 'Issues' do
let(:issue) do let(:issue) do
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api! do |issue|
......
...@@ -7,7 +7,7 @@ Note that administrator authorization is required to change feature flags. `QA:: ...@@ -7,7 +7,7 @@ Note that administrator authorization is required to change feature flags. `QA::
Please be sure to include the tag `:requires_admin` so that the test can be skipped in environments where admin access is not available. Please be sure to include the tag `:requires_admin` so that the test can be skipped in environments where admin access is not available.
```ruby ```ruby
context "with feature flag enabled", :requires_admin do RSpec.describe "with feature flag enabled", :requires_admin do
before do before do
Runtime::Feature.enable('feature_flag_name') Runtime::Feature.enable('feature_flag_name')
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment