Commit 8b8c5984 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'ml-qa-document-per-test-feature-flag' into 'master'

Document that individual tests can be run with a feature flag toggled

See merge request gitlab-org/gitlab!19201
parents aaaf6451 f61a3758
# Testing with feature flags
To run a specific test with a feature flag enabled you can use the `QA::Runtime::Feature` class to enabled and disable feature flags ([via the API](../../../api/features.md)).
```ruby
context "with feature flag enabled" do
before do
Runtime::Feature.enable('feature_flag_name')
end
it "feature flag test" do
# Execute a test with a feature flag enabled
end
after do
Runtime::Feature.disable('feature_flag_name')
end
end
```
## Running a scenario with a feature flag enabled
It's also possible to run an entire scenario with a feature flag enabled, without having to edit existing tests or write new ones.
Please see the [QA readme](https://gitlab.com/gitlab-org/gitlab/tree/master/qa#running-tests-with-a-feature-flag-enabled) for details.
......@@ -130,6 +130,7 @@ Continued reading:
- [Quick Start Guide](quick_start_guide.md)
- [Style Guide](style_guide.md)
- [Best Practices](best_practices.md)
- [Testing with feature flags](feature_flags.md)
## Where can I ask for help?
......
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