Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6a6c0f3d
Commit
6a6c0f3d
authored
Jul 06, 2020
by
ddavison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update QA E2E documentation
Update QA docs to reflect changes from RSpec 4.0 monkey patching
parent
3383208e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
doc/development/testing_guide/end_to_end/beginners_guide.md
doc/development/testing_guide/end_to_end/beginners_guide.md
+17
-9
doc/development/testing_guide/end_to_end/feature_flags.md
doc/development/testing_guide/end_to_end/feature_flags.md
+1
-1
No files found.
doc/development/testing_guide/end_to_end/beginners_guide.md
View file @
6a6c0f3d
...
...
@@ -80,13 +80,21 @@ file `basic_login_spec.rb`.
### 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
# frozen_string_literal: true
module
QA
context
'Manage'
do
RSpec
.
describe
'Manage'
do
end
end
...
...
@@ -94,13 +102,13 @@ end
### 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
# frozen_string_literal: true
module
QA
context
'Manage'
do
RSpec
.
describe
'Manage'
do
describe
'Login'
do
end
...
...
@@ -115,7 +123,7 @@ writing end-to-end tests is to write test case descriptions as `it` blocks:
```
ruby
module
QA
context
'Manage'
do
RSpec
.
describe
'Manage'
do
describe
'Login'
do
it
'can login'
do
...
...
@@ -139,7 +147,7 @@ Begin by logging in.
# frozen_string_literal: true
module
QA
context
'Manage'
do
RSpec
.
describe
'Manage'
do
describe
'Login'
do
it
'can login'
do
Flow
::
Login
.
sign_in
...
...
@@ -162,7 +170,7 @@ should answer the question "What do we test?"
# frozen_string_literal: true
module
QA
context
'Manage'
do
RSpec
.
describe
'Manage'
do
describe
'Login'
do
it
'can login'
do
Flow
::
Login
.
sign_in
...
...
@@ -210,7 +218,7 @@ a call to `sign_in`.
# frozen_string_literal: true
module
QA
context
'Manage'
do
RSpec
.
describe
'Manage'
do
describe
'Login'
do
before
do
Flow
::
Login
.
sign_in
...
...
@@ -247,7 +255,7 @@ stage, so [create a file](#identify-the-devops-stage) in
# frozen_string_literal: true
module
QA
context
'Plan'
do
RSpec
.
describe
'Plan'
do
describe
'Issues'
do
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
...
...
doc/development/testing_guide/end_to_end/feature_flags.md
View file @
6a6c0f3d
...
...
@@ -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.
```
ruby
context
"with feature flag enabled"
,
:requires_admin
do
RSpec
.
describe
"with feature flag enabled"
,
:requires_admin
do
before
do
Runtime
::
Feature
.
enable
(
'feature_flag_name'
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment