From c9f6afae28bd8d34ec1c231df673028f500d087c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 12 Jun 2024 16:13:48 +0200 Subject: [PATCH 1/4] Remove mentions of `npx @replayio/cypress run` --- src/app/basics/test-suites/overview/page.md | 2 +- .../ci-workflows/recording-strategies/page.md | 34 +--- .../cypress-io/github-actions/page.md | 4 +- .../test-runners/cypress-io/overview/page.md | 7 - .../cypress-io/recording-options/page.md | 154 ------------------ src/lib/navigation.ts | 8 - vercel.json | 14 +- 7 files changed, 17 insertions(+), 206 deletions(-) delete mode 100644 src/app/reference/test-runners/cypress-io/recording-options/page.md 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 index 3b82be36..ae13424c 100644 --- a/src/app/reference/ci-workflows/recording-strategies/page.md +++ b/src/app/reference/ci-workflows/recording-strategies/page.md @@ -3,42 +3,14 @@ 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 +## Record 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 %} +This is useful for debugging failing tests in pull requests. It records tests and those replays will be available for debugging immediately after tests finish. ## 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). +You have the flexibility to choose 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..114178e9 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" + }, + { + "source": "/reference/test-runners/cypress-io/recording-options", + "destination": "/reference/test-runners/cypress-io" }, { "source": "/test-runners/cypress-io/troubleshooting-guide", From fe112521e8d9f4d6bff96e9d1e8d932619cff301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 12 Jun 2024 17:31:46 +0200 Subject: [PATCH 2/4] remove recording strategies --- .../ci-workflows/recording-strategies/page.md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 src/app/reference/ci-workflows/recording-strategies/page.md 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 ae13424c..00000000 --- a/src/app/reference/ci-workflows/recording-strategies/page.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Recording strategies -description: Depending on what problem you’re trying to solve, there are two primary ways of using Replay. ---- - -## Record on PRs - -This is useful for debugging failing tests in pull requests. It records tests and those replays will be available for debugging immediately after tests finish. - -## Record all on merge to master - -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 when to upload your recordings. For details on various uploading strategies, [see the documentation](/reference/ci-workflows/upload-strategies). -{% /callout %} From 47fd23291e8f5ff7de9990c151d55ce3a99a82a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 13 Jun 2024 17:34:53 +0200 Subject: [PATCH 3/4] extend failed links summary with source --- scripts/checkLinks.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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) From d4df8b533ce549f16bf0522ba7f8f3d5a46857bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 13 Jun 2024 17:41:44 +0200 Subject: [PATCH 4/4] update `vercel.json` --- vercel.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vercel.json b/vercel.json index 114178e9..a91a3358 100644 --- a/vercel.json +++ b/vercel.json @@ -995,11 +995,11 @@ }, { "source": "/test-runners/cypress-io/recording-options", - "destination": "/reference/test-runners/cypress-io" + "destination": "/reference/test-runners/cypress-io/overview" }, { "source": "/reference/test-runners/cypress-io/recording-options", - "destination": "/reference/test-runners/cypress-io" + "destination": "/reference/test-runners/cypress-io/overview" }, { "source": "/test-runners/cypress-io/troubleshooting-guide",