Skip to content

Commit b40f7dd

Browse files
committed
move test retries to cypress.json in blog iframe recipe
1 parent 41608fb commit b40f7dd

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

examples/blogs__iframes/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ Spec | Description
1717
[spy-on-fetch-spec.js](cypress/integration/spy-on-fetch-spec.js) | Accesses `window` inside the iframe and spies on `fetch` calls
1818
[xhr-spec.js](cypress/integration/xhr-spec.js) | Shows how to spy and stub network calls the iframe is making
1919
[plugin-spec.js](cypress/integration/plugin-spec.js) | Uses [cypress-iframe](https://gitlab.com/kgroat/cypress-iframe) plugin to work elements inside an iframe
20+
21+
## Notes
22+
23+
In [cypress.json](cypress.json) we are using [test retries](https://on.cypress.io/test-retries) to get through an occasional (rare) flake, see issue [#558](https://github.com/cypress-io/cypress-example-recipes/issues/558)

examples/blogs__iframes/cypress.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
"chromeWebSecurity": false,
33
"viewportHeight": 1000,
44
"fixturesFolder": false,
5-
"pluginsFile": false
5+
"pluginsFile": false,
6+
"retries": {
7+
"runMode": 2,
8+
"openMode": 0
9+
}
610
}

examples/blogs__iframes/cypress/integration/custom-command-spec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { skipOn } from '@cypress/skip-test'
33

44
describe('Recipe: blogs__iframes', () => {
55
skipOn('firefox', () => {
6-
// using test retries to get occasional (rare) flake
7-
// https://github.com/cypress-io/cypress-example-recipes/issues/558
8-
it('gets the post using custom command', { retries: { runMode: 2 } }, () => {
6+
it('gets the post using custom command', () => {
97
cy.visit('index.html')
108
cy.getIframeBody()
119
.find('#run-button').should('have.text', 'Try it').click()

examples/blogs__iframes/cypress/integration/plugin-spec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { skipOn } from '@cypress/skip-test'
55

66
describe('Recipe: blogs__iframes', () => {
77
skipOn('firefox', () => {
8-
// using test retries to get occasional (rare) flake
9-
// https://github.com/cypress-io/cypress-example-recipes/issues/558
10-
it('fetches post using iframes plugin', { retries: { runMode: 2 } }, () => {
8+
it('fetches post using iframes plugin', () => {
119
cy.visit('index.html')
1210
cy.frameLoaded('[data-cy="the-frame"]')
1311
// after the frame has loaded, we can use "cy.iframe()"

examples/blogs__iframes/cypress/integration/single-its-spec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const getIframeBody = () => {
1515

1616
describe('Recipe: blogs__iframes', () => {
1717
skipOn('firefox', () => {
18-
// using test retries to get occasional (rare) flake
19-
// https://github.com/cypress-io/cypress-example-recipes/issues/558
20-
it('gets the post using single its', { retries: { runMode: 2 } }, () => {
18+
it('gets the post using single its', () => {
2119
cy.visit('index.html')
2220
getIframeBody().find('#run-button').should('have.text', 'Try it').click()
2321
getIframeBody().find('#result').should('include.text', '"delectus aut autem"')

examples/blogs__iframes/cypress/integration/spy-on-fetch-spec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ const getIframeWindow = () => {
99

1010
describe('Recipe: blogs__iframes', () => {
1111
skipOn('firefox', () => {
12-
// using test retries to get occasional (rare) flake
13-
// https://github.com/cypress-io/cypress-example-recipes/issues/558
14-
it('spies on window.fetch method call', { retries: { runMode: 2 } }, () => {
12+
it('spies on window.fetch method call', () => {
1513
cy.visit('index.html')
1614

1715
getIframeWindow().then((win) => {

0 commit comments

Comments
 (0)