Skip to content
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

fix > chars #5972

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/accessibility/results-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ In your CI workflow that runs your Cypress tests,

:::info

If you record multiple runs in a single CI build, you must record these runs using the `--tag` parameter and then call `getAccessibilityResults`with the `runTags` argument for each run. 
If you record multiple runs in a single CI build, you must record these runs using the `--tag` parameter and then call `getAccessibilityResults` with the `runTags` argument for each run.

This is necessary to identify each unique run and return a corresponding set of results. The tags are how each run is uniquely identified.

Expand Down
42 changes: 18 additions & 24 deletions docs/ui-coverage/results-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,41 +52,35 @@ getUICoverageResults({
projectId: '...', // optional if set from env
recordKey: '...', // optional if set from env
runTags: [process.env.RUN_TAGS], // required if recording multiple runs
})
.then((results) => {
const {
runNumber,
uiCoverageReportUrl,
summary,
views
} = results
}).then((results) => {
const { runNumber, uiCoverageReportUrl, summary, views } = results

console.log(`Received ${summary.isPartialReport ? 'partial' : ''} results for run #${runNumber}.`).
console.log(`See full report at ${uiCoverageReportUrl}.`)
console
.log(
`Received ${summary.isPartialReport ? 'partial' : ''} results for run #${runNumber}.`
)
.console.log(`See full report at ${uiCoverageReportUrl}.`)

// verify project coverage
if (summary.coverage < 80) {
throw new Error(`Project coverage is ${summary.coverage}, which does not meet the minimum coverage of 80%.`)
if (summary.coverage < 80) {
throw new Error(
`Project coverage is ${summary.coverage}, which does not meet the minimum coverage of 80%.`
)
}

const criticalViews = [
/login/,
/checkout/
]
const criticalViews = [/login/, /checkout/]

// verify critical view coverage
const criticalViewResults = views.forEach((view) => {
const {
displayName,
coverage,
uiCoverageReportUrl
} = view
const { displayName, coverage, uiCoverageReportUrl } = view

const isCriticalView = criticalViews.some((rx) => rx.test(displayName))
if (!isCriticalView) return

if (coverage &#x3C; 95) {
throw new Error(`The critical view ${displayName} has the coverage of ${coverage}, which does not meet the critical view coverage of 95%. See report at ${uiCoverageReportUrl}.`)
if (coverage < 95) {
throw new Error(
`The critical view ${displayName} has the coverage of ${coverage}, which does not meet the critical view coverage of 95%. See report at ${uiCoverageReportUrl}.`
)
}
})

Expand Down Expand Up @@ -185,7 +179,7 @@ In your CI workflow that runs your Cypress tests,

:::info

If you record multiple runs in a single CI build, you must record these runs using the `--tag` parameter and then call `getUICoverageResults`with the `runTags` argument for each run.&#x20;
If you record multiple runs in a single CI build, you must record these runs using the `--tag` parameter and then call `getUICoverageResults` with the `runTags` argument for each run.

This is necessary to identify each unique run and return a corresponding set of results. The tags are how each run is uniquely identified.

Expand Down