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/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 d68db96df..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' - -// Alternatively you can use CommonJS syntax: -// require('./commands') 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') + diff --git a/package.json b/package.json index 3d866c203..7689e26ac 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "cross-env": "^5.2.0", "cypress": "^3.2.0", "cypress-cucumber-preprocessor": "^1.11.0", + "cypress-plugin-retries": "^1.2.0", "dotenv": "^8.0.0", "faker": "^4.1.0", "graphql-request": "^1.8.2", diff --git a/yarn.lock b/yarn.lock index 31416a522..c56771aac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1810,6 +1810,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"