Skip to content

Commit

Permalink
test: automatically retry cypress tests (#3rmp6q)
Browse files Browse the repository at this point in the history
  • Loading branch information
matzeeable committed Apr 27, 2020
1 parent 1e0af37 commit a439cd3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/wp-reactjs-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
"css-loader": "^3.4.2",
"cypress": "~4.4.0",
"cypress-cucumber-preprocessor": "^2.0.1",
"cypress-plugin-retries": "^1.5.2",
"fork-ts-checker-webpack-plugin": "^4.1.1",
"grunt": "^1.1.0",
"grunt-cachebuster": "^0.1.7",
Expand Down
3 changes: 3 additions & 0 deletions plugins/wp-reactjs-starter/test/cypress/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import { execSync } from "child_process";
import cypressWebpackPreprocessor from "@cypress/webpack-preprocessor";
import { resolve } from "path";
import retryPlugin from "cypress-plugin-retries/lib/plugin";

// eslint-disable-next-line import/no-extraneous-dependencies
require("dotenv").config({
Expand All @@ -34,6 +35,7 @@ function applyConfig(config) {
config.supportFile = "test/cypress/support/index.ts";
config.fixturesFolder = "test/cypress/fixtures";
config.ignoreTestFiles = "*.ts";
config.env.RETRIES = 3;
// config.testFiles = "test/cypress/integration/**/*.{feature,features}";

// The both configs can not be altered through this plugin because they are needed at CLI startup
Expand Down Expand Up @@ -62,6 +64,7 @@ function applyConfig(config) {

module.exports = (on, config) => {
applyConfig(config);
retryPlugin(on);

// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
Expand Down
1 change: 1 addition & 0 deletions plugins/wp-reactjs-starter/test/cypress/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

// Import commands.js using ES2015 syntax:
import "./commands";
import "cypress-plugin-retries";

// Alternatively you can use CommonJS syntax:
// require('./commands')
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5608,6 +5608,13 @@ cypress-cucumber-preprocessor@^2.0.1:
minimist "^1.2.0"
through "^2.3.8"

cypress-plugin-retries@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/cypress-plugin-retries/-/cypress-plugin-retries-1.5.2.tgz#21d5247cd77013b95bbfdd914f2de66f91f76a2e"
integrity sha512-o1xVIGtv4WvNVxoVJ2X08eAuvditPHrePRzHqhwwHbMKu3C2rtxCdanRCZdO5fjh8ww+q4v4V0e9GmysbOvu3A==
dependencies:
chalk "^3.0.0"

cypress@~4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-4.4.0.tgz#566ac224e11601634c31e5648e5c15199dde7954"
Expand Down

0 comments on commit a439cd3

Please sign in to comment.