From b8e17fa321b4208af4213aaa0aece3abe9498cbf Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Sat, 27 Apr 2019 13:45:37 -0300 Subject: [PATCH 1/4] Rerun moderation/report tests on failure - intermittent failing test --- cypress/integration/common/report.js | 2 ++ package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index 78abf5378..fb4eb4794 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -1,4 +1,6 @@ import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps' +// intermittent failing tests +Cypress.env('RETRIES', 2) /* global cy */ diff --git a/package.json b/package.json index 703997ee1..56bed0c01 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "cross-env": "^5.2.0", "cypress": "^3.2.0", "cypress-cucumber-preprocessor": "^1.11.0", + "cypress-plugin-retries": "^1.2.0", "dotenv": "^7.0.0", "faker": "^4.1.0", "graphql-request": "^1.8.2", diff --git a/yarn.lock b/yarn.lock index 1d7745f03..ba9e54364 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1787,6 +1787,11 @@ cypress-cucumber-preprocessor@^1.11.0: glob "^7.1.2" through "^2.3.8" +cypress-plugin-retries@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/cypress-plugin-retries/-/cypress-plugin-retries-1.2.0.tgz#a4e120c1bc417d1be525632e7d38e52a87bc0578" + integrity sha512-seQFI/0j5WCqX7IVN2k0tbd3FLdhbPuSCWdDtdzDmU9oJfUkRUlluV47TYD+qQ/l+fJYkQkpw8csLg8/LohfRg== + cypress@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.2.0.tgz#c2d5befd5077dab6fb52ad70721e0868ac057001" From b7b9f8c46459c59fc1f432104db26247bd0dfa6d Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Sat, 27 Apr 2019 15:24:39 -0300 Subject: [PATCH 2/4] Require cypress plugin retries --- cypress/cypress/support/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/cypress/support/index.js b/cypress/cypress/support/index.js index d68db96df..a24e4442d 100644 --- a/cypress/cypress/support/index.js +++ b/cypress/cypress/support/index.js @@ -15,6 +15,6 @@ // Import commands.js using ES2015 syntax: import './commands' - +require('cypress-plugin-retries') // Alternatively you can use CommonJS syntax: // require('./commands') From d255a165b4a38e821cc8ab4c4396624b291bf086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Tue, 7 May 2019 00:49:48 +0200 Subject: [PATCH 3/4] Delete unused folder cypres/cypress/ Where did that come from? @mattwr18 --- cypress/cypress/plugins/index.js | 17 ----------------- cypress/cypress/support/commands.js | 25 ------------------------- cypress/cypress/support/index.js | 20 -------------------- 3 files changed, 62 deletions(-) delete mode 100644 cypress/cypress/plugins/index.js delete mode 100644 cypress/cypress/support/commands.js delete mode 100644 cypress/cypress/support/index.js diff --git a/cypress/cypress/plugins/index.js b/cypress/cypress/plugins/index.js deleted file mode 100644 index fd170fba6..000000000 --- a/cypress/cypress/plugins/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -} diff --git a/cypress/cypress/support/commands.js b/cypress/cypress/support/commands.js deleted file mode 100644 index c1f5a772e..000000000 --- a/cypress/cypress/support/commands.js +++ /dev/null @@ -1,25 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add("login", (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This is will overwrite an existing command -- -// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/cypress/cypress/support/index.js b/cypress/cypress/support/index.js deleted file mode 100644 index a24e4442d..000000000 --- a/cypress/cypress/support/index.js +++ /dev/null @@ -1,20 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands' -require('cypress-plugin-retries') -// Alternatively you can use CommonJS syntax: -// require('./commands') From a1b74bef001ca24de30fa7e4596dbeb2c90ea567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Tue, 7 May 2019 00:51:18 +0200 Subject: [PATCH 4/4] Configure 1 retry on Travis --- .travis.yml | 2 +- cypress/integration/common/report.js | 2 -- cypress/support/index.js | 5 +++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd43b771f..632786285 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ script: - docker-compose exec webapp yarn run lint - docker-compose exec webapp yarn run test --ci --verbose=false - docker-compose exec -d backend yarn run test:before:seeder - - yarn run cypress:run + - CYPRESS_RETRIES=1 yarn run cypress:run after_success: - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index 519c8514b..2c8b848b4 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -1,6 +1,4 @@ import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps' -// intermittent failing tests -Cypress.env('RETRIES', 2) /* global cy */ diff --git a/cypress/support/index.js b/cypress/support/index.js index 3519487bf..195b0de7d 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -14,8 +14,13 @@ // *********************************************************** // Import commands.js using ES2015 syntax: + import './commands' import './factories' +// intermittent failing tests +import 'cypress-plugin-retries' + // Alternatively you can use CommonJS syntax: // require('./commands') +