diff --git a/scripts/checkLinks.ts b/scripts/checkLinks.ts index bc5e798c..b49fbd62 100644 --- a/scripts/checkLinks.ts +++ b/scripts/checkLinks.ts @@ -118,23 +118,27 @@ async function main(): Promise { for (const [index, file] of files.entries()) { const { file: filePath, links } = file process.stdout.write(`${index + 1} ${filePath} `) - failedLinks.push(...(await checkLinksInFile(filePath, links))) + failedLinks.push( + ...(await checkLinksInFile(filePath, links)).map( + (l) => `${filePath}: ${l}`, + ), + ) process.stdout.write('\n') } console.log('Checking links in Vercel.json') failedLinks.push( - ...(await checkLinksInFile( - 'vercel.json', - vercelConfig.redirects.map((l) => l.destination), - )), + ...( + await checkLinksInFile( + 'vercel.json', + vercelConfig.redirects.map((l) => l.destination), + ) + ).map((l) => `vercel.json: ${l}`), ) - const dedupedFailedLinks = [...new Set(failedLinks)] - if (failedLinks.length > 0) { console.error('\nThe following links are broken:') - for (const link of dedupedFailedLinks) { + for (const link of failedLinks) { console.error(link) } process.exit(1) diff --git a/src/app/basics/test-suites/overview/page.md b/src/app/basics/test-suites/overview/page.md index 43f63e84..1c2379cd 100644 --- a/src/app/basics/test-suites/overview/page.md +++ b/src/app/basics/test-suites/overview/page.md @@ -149,7 +149,7 @@ At the first glance, that recording may look like a series of snapshots of your {% accordion-item title="When do I use Replay with my tests?" %} -There are a [couple of strategies](/reference/ci-workflows/recording-strategies) you can adopt, but generally you can use Replay Browser with every test run on your CI, as there is both short-term and long-term value. +There are a couple of strategies you can adopt, but generally you can use Replay Browser with every test run on your CI, as there is both short-term and long-term value. When a test fails on CI, you don’t need to replicate it locally anymore. A replay captures your test run **exactly** as it happened and will provide you better insight than if you tried to locally reproduce an issue from CI. diff --git a/src/app/reference/ci-workflows/recording-strategies/page.md b/src/app/reference/ci-workflows/recording-strategies/page.md deleted file mode 100644 index 3b82be36..00000000 --- a/src/app/reference/ci-workflows/recording-strategies/page.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Recording strategies -description: Depending on what problem you’re trying to solve, there are two primary ways of using Replay. ---- - -## Record failures on PRs - -This is useful for debugging failing tests in pull requests. It only records failing tests so there’s minimal overhead, and those replays will be available for debugging immediately after tests finish. - -Run your tests and pass the mode `record-on-retry` . - -{% tabs labels=["npm", "yarn", "pnpm"] %} -{% tab %} - -```sh -npx @replayio/cypress run --mode record-on-retry -``` - -{% /tab %} -{% tab %} - -```sh -yarn @replayio/cypress run --mode record-on-retry -``` - -{% /tab %} -{% tab %} - -```sh -pnpx @replayio/cypress run --mode record-on-retry -``` - -{% /tab %} -{% /tabs %} - -## Record all on merge to master - -This is useful for busting flakes. It only records failing tests so there’s minimal overhead, and those replays will be available for debugging immediately after tests finish. - -Run your tests as usual, but set the trigger to only run on merge to master. - -{% callout type="link" title="Upload strategies" href="/reference/ci-workflows/upload-strategies" %} -You have the flexibility to choose not only when to record but also when to upload your recordings. For details on various uploading strategies, [see the documentation](/reference/ci-workflows/upload-strategies). -{% /callout %} diff --git a/src/app/reference/test-runners/cypress-io/github-actions/page.md b/src/app/reference/test-runners/cypress-io/github-actions/page.md index 887d712a..cc0cae81 100644 --- a/src/app/reference/test-runners/cypress-io/github-actions/page.md +++ b/src/app/reference/test-runners/cypress-io/github-actions/page.md @@ -75,6 +75,6 @@ Add a new step to run after your Cypress tests for uploading the replays: api-key: ${{ secrets.REPLAY_API_KEY }} ``` -{% callout title="Recording strategies" %} -There are different strategies for creating your replays. For example you can use Replay only when retrying a failed test, or choose to upload recordings from failed tests only. See [docs on recording strategies](/reference/ci-workflows/recording-strategies) to learn more. +{% callout title="Upload strategies" %} +There are different strategies for uploading your replays. For example you can use Replay only when retrying a failed test, or choose to upload recordings from failed tests only. See [docs on upload strategies](/reference/ci-workflows/upload-strategies) to learn more. {% /callout %} diff --git a/src/app/reference/test-runners/cypress-io/overview/page.md b/src/app/reference/test-runners/cypress-io/overview/page.md index 05cea6b3..5e521809 100644 --- a/src/app/reference/test-runners/cypress-io/overview/page.md +++ b/src/app/reference/test-runners/cypress-io/overview/page.md @@ -19,13 +19,6 @@ npx cypress run --browser replay-chromium description="Learn how to get started with Cypress and Replay" /%} -{% quick-link - title="Recording options" - icon="record" - href="/reference/test-runners/cypress-io/recording-options" - description="See what recording options are available for Cypress.io and Replay" -/%} - {% quick-link title="GitHub Actions" icon="github" diff --git a/src/app/reference/test-runners/cypress-io/recording-options/page.md b/src/app/reference/test-runners/cypress-io/recording-options/page.md deleted file mode 100644 index b66ca1cc..00000000 --- a/src/app/reference/test-runners/cypress-io/recording-options/page.md +++ /dev/null @@ -1,154 +0,0 @@ ---- -title: Configuration -description: There are different modes and strategies that help you create your replays more effectively. By default, every test is recorded, but you can choose to create your replays only when problems appear, saving costs and time. ---- - -## Diagnostic Modes - -The `@replayio/cypress` plugin includes a Cypress runner that includes diagnostic modes to help identify issues with the Replay browsers. Internally, the plugin uses [Cypress’s module API](https://docs.cypress.io/guides/guides/module-api) to invoke Cypress multiple times with different environment variables to adjust the behavior of the Replay browser. - -{% tabs labels=["npm", "yarn", "pnpm"] %} -{% tab %} - -```sh -npx @replayio/cypress run --mode [mode] [...other cypress parameters] -``` - -{% /tab %} -{% tab %} - -```sh -yarn @replayio/cypress run --mode [mode] [...other cypress parameters] -``` - -{% /tab %} -{% tab %} - -```sh -pnpx @replayio/cypress run --mode [mode] [...other cypress parameters] -``` - -{% /tab %} -{% /tabs %} - -## Record on Retry - -Runs the test suite once with recording disabled and if any specs fail, those are re-ran with recording enabled. - -{% tabs labels=["npm", "yarn", "pnpm"] %} -{% tab %} - -```sh -npx @replayio/cypress run --mode record-on-retry -``` - -{% /tab %} -{% tab %} - -```sh -yarn @replayio/cypress run --mode record-on-retry -``` - -{% /tab %} -{% tab %} - -```sh -pnpx @replayio/cypress run --mode record-on-retry -``` - -{% /tab %} -{% /tabs %} - -## Stress - -Runs the test suite 10 times regardless of test result. This mode is useful for diagnosing tests that have a low flakiness rate and are hard to reproduce locally. - -{% tabs labels=["npm", "yarn", "pnpm"] %} -{% tab %} - -```sh -npx @replayio/cypress run --mode stress -``` - -{% /tab %} -{% tab %} - -```sh -yarn @replayio/cypress run --mode stress -``` - -{% /tab %} -{% tab %} - -```sh -pnpx @replayio/cypress run --mode stress -``` - -{% /tab %} -{% /tabs %} - -## Diagnostics - -{% tabs labels=["npm", "yarn", "pnpm"] %} -{% tab %} - -```sh -npx @replayio/cypress run --mode diagnostics --level basic -``` - -{% /tab %} -{% tab %} - -```sh -yarn @replayio/cypress run --mode diagnostics --level basic -``` - -{% /tab %} -{% tab %} - -```sh -pnpx @replayio/cypress run --mode diagnostics --level basic -``` - -{% /tab %} -{% /tabs %} - -`--level basic` - -When level is set to `basic`, the test suite is ran 3 times: - -1. Recording disabled -2. Recording enabled -3. Recording enabled with debug assertions disabled - -`--level full` - -When level is set to `full`, the test suite is run _many_ times with each run disabling a different browser feature. - -{% tabs labels=["npm", "yarn", "pnpm"] %} -{% tab %} - -```sh -npx @replayio/cypress run --mode diagnostics --level full --spec cypress/e2e/failing-spec.ts -``` - -{% /tab %} -{% tab %} - -```sh -yarn @replayio/cypress run --mode diagnostics --level full --spec cypress/e2e/failing-spec.ts -``` - -{% /tab %} -{% tab %} - -```sh -pnpx @replayio/cypress run --mode diagnostics --level full --spec cypress/e2e/failing-spec.ts -``` - -{% /tab %} -{% /tabs %} - -{% callout type="warning" %} -This mode is mostly used for diagnosing problems with integration of Replay into your test run. Due to the number of runs (currently 38), we don’t recommend using the `--level full` flag for standard test runs. Be sure to limit using this mode to a specific spec file that is failing by using `--spec [path to spec]`. -{% /callout %} diff --git a/src/lib/navigation.ts b/src/lib/navigation.ts index 4682f71b..9a33c291 100644 --- a/src/lib/navigation.ts +++ b/src/lib/navigation.ts @@ -229,10 +229,6 @@ export const navigation: Record = { title: 'Debugging tests', href: '/reference/test-runners/cypress-io/debugging-tests', }, - { - title: 'Recording options', - href: '/reference/test-runners/cypress-io/recording-options', - }, { title: 'GitHub actions', href: '/reference/test-runners/cypress-io/github-actions', @@ -309,10 +305,6 @@ export const navigation: Record = { title: 'Generate API key', href: '/reference/ci-workflows/generate-api-key', }, - { - title: 'Recording strategies', - href: '/reference/ci-workflows/recording-strategies', - }, { title: 'Upload strategies', href: '/reference/ci-workflows/upload-strategies', diff --git a/vercel.json b/vercel.json index 98b0704a..a91a3358 100644 --- a/vercel.json +++ b/vercel.json @@ -570,7 +570,7 @@ }, { "source": "/test-suites/_archive/ci-integration/circle-ci", - "destination": "/reference/ci-workflows/recording-strategies" + "destination": "/reference/ci-workflows/upload-strategies" }, { "source": "/test-suites/_archive/ci-integration/github-actions", @@ -895,7 +895,11 @@ }, { "source": "/ci-workflows/recording-strategies", - "destination": "/reference/ci-workflows/recording-strategies" + "destination": "/reference/ci-workflows/upload-strategies" + }, + { + "source": "/reference/ci-workflows/recording-strategies", + "destination": "/reference/ci-workflows/upload-strategies" }, { "source": "/ci-workflows/upload-strategies", @@ -991,7 +995,11 @@ }, { "source": "/test-runners/cypress-io/recording-options", - "destination": "/reference/test-runners/cypress-io/recording-options" + "destination": "/reference/test-runners/cypress-io/overview" + }, + { + "source": "/reference/test-runners/cypress-io/recording-options", + "destination": "/reference/test-runners/cypress-io/overview" }, { "source": "/test-runners/cypress-io/troubleshooting-guide",