Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 7 additions & 0 deletions system-tests/lib/system-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export type ItOptions = ExecOptions & {
* Same as using `systemTests.it.skip`.
*/
skip?: boolean
/**
* If set, the system test will be retried up to the given number of times.
*/
retries?: number
}

type ExecOptions = {
Expand Down Expand Up @@ -501,6 +505,7 @@ const localItFn = function (title: string, opts: ItOptions) {
const DEFAULT_OPTIONS = {
only: false,
skip: false,
retries: 0,
browser: [],
snapshot: false,
onStdout: _.noop,
Expand Down Expand Up @@ -532,6 +537,8 @@ const localItFn = function (title: string, opts: ItOptions) {
const testTitle = `${title} [${browser}]`

return mochaItFn(testTitle, function () {
this.retries(options.retries)

if (options.useSeparateBrowserSnapshots) {
title = testTitle
}
Expand Down
2 changes: 2 additions & 0 deletions system-tests/test/downloads_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ describe('e2e downloads', () => {
})

it('does not trash downloads between runs if trashAssetsBeforeRuns: false', async function () {
this.retries(5)

await systemTests.exec(this, {
project: 'downloads',
spec: 'download_csv.cy.ts',
Expand Down
2 changes: 2 additions & 0 deletions system-tests/test/service_worker_protocol_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ describe('capture-protocol', () => {
describe('service worker', () => {
BROWSERS.forEach((browser) => {
it(`verifies the types of requests match - ${browser}`, function () {
this.retries(10)

return systemTests.exec(this, {
key: 'f858a2bc-b469-4e48-be67-0876339ee7e1',
project: 'protocol',
Expand Down
2 changes: 2 additions & 0 deletions system-tests/test/service_worker_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ describe('e2e service worker', () => {
systemTests.it('executes one spec with a cached call', {
project: 'e2e',
spec: 'service_worker.cy.js',
retries: 10,
onRun: async (exec, browser) => {
requestsForServiceWorkerCache = 0
await exec()
// Ensure that we only called this once even though we loaded the
// service worker twice
Expand Down
2 changes: 2 additions & 0 deletions system-tests/test/vite_dev_server_fresh_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ describe('@cypress/vite-dev-server', function () {
describe('react', () => {
for (const project of VITE_REACT) {
it(`executes all of the specs for ${project}`, function () {
this.retries(10)

return systemTests.exec(this, {
project,
configFile: 'cypress-vite.config.ts',
Expand Down
Loading