-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Docs for app quality config profiles and comment field #6333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
marktnoonan
wants to merge
4
commits into
main
Choose a base branch
from
aq-mutli-config-and-comment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| sidebar_label: profiles | ||
| title: 'Profiles | Cypress Accessibility' | ||
| description: 'The `profiles` configuration property allows you to create configuration overrides that are applied based on run tags.' | ||
| sidebar_position: 100 | ||
| --- | ||
|
|
||
| <ProductHeading product="accessibility" /> | ||
|
|
||
| # profiles | ||
|
|
||
| <Profiles /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,249 @@ | ||
| The `profiles` property allows you to create configuration overrides that are applied based on run tags. This enables you to use different configuration settings for different types of runs, such as regression tests compared to smoke tests environments, or providing scoped results relevant to specific teams. | ||
|
|
||
| ## Why use profiles? | ||
|
|
||
| - **Team specific reporting**: If multiple teams use the same Cypress Cloud project, they may have completely different areas of concern for which pages or DOM elements are included in reports about accessibility or UI Coverage. Profiles allow each team to see and track against only the results that matter to them, and remove all other findings. | ||
| - **Run-type customization**: Use different filters or settings for regression runs versus pull requests. It can be useful to have a narrow config for blocking a merge, optimized for the most critical areas of your app -- while still running a wide config on a full regression suite to manage on a difference cadence. | ||
| - **Skip runs when needed**: If you know that certain kinds of runs are not going to be valuable for App Quality reporting, you can ignore all view on these runs so that no report is created. In some situations this can improve clarity about when to look at a report and which reports are considered significant. | ||
|
|
||
| ## How profiles work | ||
|
|
||
| Profiles are selected by matching run tags to profile names. When you run Cypress with the [`--tag`](/app/references/command-line#cypress-run-tag-lt-tag-gt) flag, Cypress Cloud looks for a profile whose `name` matches one of the tags. If a match is found, properties defined in profile's `config` properties override the root configuration. Properties defined in the root that are not referenced in the profile will be inherited, meaning you do not need to repeat config values that you want to keep the same. | ||
|
|
||
| If more than one tag provided to a run matches a profile in your App Quality profiles array, the first matching profile in the array will be used. The order in which the tags are passed to the run doesn't matter. | ||
|
|
||
| ## Best practices | ||
|
|
||
| Use a naming convention like `aq-config-x` (e.g., `aq-config-regression`, `aq-config-staging`) to make it clear that a tag is used for configuration lookup purposes. | ||
|
|
||
| While relying on existing tags works just fine, but being explicit will help avoid accidental removal or changes of important tags. | ||
|
|
||
| ## Syntax | ||
|
|
||
| ```json | ||
| { | ||
| "profiles": [ | ||
| { | ||
| "name": string, | ||
| "config": { | ||
| // Any App Quality configuration options | ||
| }, | ||
| "comment": string | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ### Options | ||
|
|
||
| | Option | Required | Description | | ||
| | --------- | -------- | --------------------------------------------------------------------------------------------------------- | | ||
| | `name` | Required | The profile name that must match a run tag to activate this profile. | | ||
| | `config` | Required | An object containing any App Quality configuration options. These values override the root configuration. | | ||
| | `comment` | Optional | A comment describing the purpose of this profile. | | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Basic profile structure | ||
|
|
||
| #### Config | ||
|
|
||
| ```json | ||
| { | ||
| "elementFilters": [ | ||
| { | ||
| "selector": "[data-testid*='temp']", | ||
| "include": false, | ||
| "comment": "Exclude temporary test elements" | ||
| } | ||
| ], | ||
| "profiles": [ | ||
| { | ||
| "name": "aq-config-regression", | ||
| "config": { | ||
| "elementFilters": [ | ||
| { | ||
| "selector": "[data-testid*='temp']", | ||
| "include": false, | ||
| "comment": "Exclude temporary test elements in regression runs" | ||
| }, | ||
| { | ||
| "selector": "[data-role='debug']", | ||
| "include": false, | ||
| "comment": "Exclude debug elements in regression runs" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| #### Usage | ||
|
|
||
| To use this profile, run Cypress with a matching tag: | ||
|
|
||
| ```shell | ||
| cypress run --record --tag "aq-config-regression" | ||
| ``` | ||
|
|
||
| When this tag is used, the profile's `elementFilters` configuration will override the base `elementFilters`, excluding both temporary test elements and debug elements. | ||
|
|
||
| --- | ||
|
|
||
| ### Multiple profiles | ||
|
|
||
| You can define multiple profiles for different scenarios: | ||
|
|
||
| #### Config | ||
|
|
||
| ```json | ||
| { | ||
| "elementFilters": [ | ||
| { | ||
| "selector": "[data-testid*='temp']", | ||
| "include": false | ||
| } | ||
| ], | ||
| "profiles": [ | ||
| { | ||
| "name": "aq-config-regression", | ||
| "config": { | ||
| "elementFilters": [ | ||
| { | ||
| "selector": "[data-testid*='temp']", | ||
| "include": false | ||
| }, | ||
| { | ||
| "selector": "[data-role='debug']", | ||
| "include": false, | ||
| "comment": "Exclude debug elements in regression runs" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "name": "aq-config-staging", | ||
| "config": { | ||
| "viewFilters": [ | ||
| { | ||
| "pattern": "https://staging.example.com/admin/*", | ||
| "include": false, | ||
| "comment": "Exclude admin pages in staging runs" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| #### Usage | ||
|
|
||
| Use different tags to activate different profiles: | ||
|
|
||
| ```shell | ||
| # For regression runs | ||
| cypress run --record --tag "aq-config-regression" | ||
|
|
||
| # For staging runs | ||
| cypress run --record --tag "aq-config-staging" | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### Profile with nested configuration | ||
|
|
||
| Profiles can override configuration at any level, including nested configuration specific to Cypress Accessibility or UI Coverage, if your project has both projects enabled. For example: | ||
|
|
||
| #### Config | ||
|
|
||
| ```json | ||
| { | ||
| "elementFilters": [ | ||
| { | ||
| "selector": "[data-testid*='temp']", | ||
| "include": false | ||
| } | ||
| ], | ||
| "uiCoverage": { | ||
| "attributeFilters": [ | ||
| { | ||
| "attribute": "id", | ||
| "value": ":r.*:", | ||
| "include": false, | ||
| "comment": "Filter out React auto-generated IDs" | ||
| } | ||
| ] | ||
| }, | ||
| "profiles": [ | ||
| { | ||
| "name": "aq-config-feature-branch", | ||
| "config": { | ||
| "uiCoverage": { | ||
| "elementGroups": [ | ||
| { | ||
| "selector": "[data-feature='new-checkout']", | ||
| "name": "New Checkout Flow", | ||
| "comment": "Group new checkout elements for feature branch testing" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| #### Usage | ||
|
|
||
| ```shell | ||
| cypress run --record --tag "aq-config-feature-branch" | ||
| ``` | ||
|
|
||
| This profile adds element grouping for the new checkout flow while keeping the base configuration for element filters and attribute filters. | ||
|
|
||
| --- | ||
|
|
||
| ### Profile selection with multiple matching tags | ||
|
|
||
| If you pass multiple tags and more than one matches a profile name, the first matching profile in the `profiles` array is used: | ||
|
|
||
| #### Config | ||
|
|
||
| ```json | ||
| { | ||
| "profiles": [ | ||
| { | ||
| "name": "aq-config-regression", | ||
| "config": { | ||
| "elementFilters": [ | ||
| { | ||
| "selector": "[data-role='debug']", | ||
| "include": false | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "name": "aq-config-staging", | ||
| "config": { | ||
| "viewFilters": [ | ||
| { | ||
| "pattern": "https://staging.example.com/admin/*", | ||
| "include": false | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| #### Usage | ||
|
|
||
| ```shell | ||
| cypress run --record --tag "aq-config-regression,aq-config-staging" | ||
| ``` | ||
|
|
||
| In this case, the `aq-config-regression` profile will be used because it appears first in the `profiles` array, even though both tags match profile names. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.