Skip to content

Commit

Permalink
fix > chars (#5972)
Browse files Browse the repository at this point in the history
* fix > chars

* lint

* Update docs/accessibility/results-api.mdx

Co-authored-by: Peter Stakoun <[email protected]>

* Update docs/ui-coverage/results-api.mdx

Co-authored-by: Peter Stakoun <[email protected]>

---------

Co-authored-by: Peter Stakoun <[email protected]>
  • Loading branch information
jennifer-shehane and pstakoun authored Oct 28, 2024
1 parent 0c03b08 commit 84e88aa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 deletions.
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.&#x20;
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 &#x3C; 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

0 comments on commit 84e88aa

Please sign in to comment.