Skip to content

Commit

Permalink
Merge pull request #5 from javierbrea/release
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
javierbrea committed Nov 28, 2020
2 parents 5c15f40 + fbcf6c7 commit 1b7b7f0
Show file tree
Hide file tree
Showing 23 changed files with 7,258 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Removed
### BREAKING CHANGES

## [1.1.0] - 2019-11-28
### Added
- test(deps): Add support for Cypress v6.x

### Fixed
- docs(readme): Fix installation instructions

## [1.0.0] - 2019-11-28
### Added
- First release
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Cypress Fail Fast

Enables fail fast on Cypress, skipping the rest of tests on first failure.
Enables fail fast in Cypress, skipping the rest of tests on first failure.

## Installation

Expand All @@ -20,15 +20,15 @@ Inside `cypress/plugins/index.js`:

```javascript
module.exports = (on, config) => {
require("cypress-fail-fast")(on, config);
require("cypress-fail-fast/plugin")(on, config);
return config;
};
```

At the top of `cypress/support/index.js`:

```javascript
require "cypress-fail-fast";
import "cypress-fail-fast";
```

## Usage
Expand All @@ -54,9 +54,7 @@ or Set the "env" key in your cypress.json configuration file:

The plugin uses tests' internal properties such as the `state`, `currentRetrys`, etc, so it may stop working on each new Cypress release. To avoid this it has been tested with Cypress versions from 5.0.0, and new releases will be published for each new Cypress minor or major releases, updating the Cypress version used in the package E2E tests.

If you find some issue please check the latest tested version in the `package.json` file of the E2E tests at https://github.com/javierbrea/cypress-fail-fast/blob/main/test-e2e/cypress-5/package.json

Tests for checking that the solution also works on Cypress 6 will be added soon, as well as the correspondent E2E tests.
If you find some issue please check the latest tested version in the `devDependencies` of the `package.json` files of the E2E tests at https://github.com/javierbrea/cypress-fail-fast/blob/main/test-e2e/cypress-5/package.json and https://github.com/javierbrea/cypress-fail-fast/blob/main/test-e2e/cypress-6/package.json.

## Acknowledgements

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-fail-fast",
"version": "1.0.0",
"version": "1.1.0",
"description": "Skip the rest of Cypress tests on first failure",
"keywords": [
"cypress",
Expand All @@ -22,17 +22,18 @@
"main": "index.js",
"scripts": {
"coveralls": "cat ./coverage/lcov.info | coveralls",
"lint": "eslint src test *.js test-e2e/cypress-5/*.js test-e2e/cypress-5/cypress/**/*.js",
"lint": "eslint src test *.js test-e2e/cypress-5/*.js test-e2e/cypress-5/cypress/**/*.js test-e2e/cypress-6/*.js test-e2e/cypress-6/cypress/**/*.js",
"lint:local": "npm run lint:all",
"lint-staged": "lint-staged",
"test": "jest",
"test:e2e:ci": "cd test-e2e/cypress-5 && npm i && npm run test:ci",
"test:e2e:v5:ci": "cd test-e2e/cypress-5 && npm i && npm run test:ci",
"test:e2e:v6:ci": "cd test-e2e/cypress-6 && npm i && npm run test:ci",
"test:coverage": "npm run test",
"test:ci": "npm run test && npm run test:mutation && npm run test:e2e:ci",
"test:ci": "npm run test && npm run test:mutation && npm run test:e2e:v5:ci && npm run test:e2e:v6:ci",
"test:mutation": "stryker run"
},
"peerDependencies": {
"cypress": "5.x"
"cypress": "5.x || 6.x"
},
"devDependencies": {
"@stryker-mutator/core": "4.0.0",
Expand All @@ -54,7 +55,9 @@
"src/**/*.js": "eslint",
"test/**/*.js": "eslint",
"test-e2e/cypress-5/*.js": "eslint",
"test-e2e/cypress-5/cypress/**/*.js": "eslint"
"test-e2e/cypress-5/cypress/**/*.js": "eslint",
"test-e2e/cypress-6/*.js": "eslint",
"test-e2e/cypress-6/cypress/**/*.js": "eslint"
},
"husky": {
"hooks": {
Expand Down
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
sonar.organization=javierbrea
sonar.projectKey=cypress-fail-fast
sonar.projectVersion=1.0.0
sonar.projectVersion=1.1.0

sonar.javascript.file.suffixes=.js
sonar.sourceEncoding=UTF-8
sonar.exclusions=node_modules/**,test-e2e/cypress-5/node_modules/**
sonar.exclusions=node_modules/**,test-e2e/cypress-5/node_modules/**,test-e2e/cypress-6/node_modules/**
sonar.coverage.exclusions=test/**/*,index.js,plugin.js,stryker.conf.js,jest.config.js,test-e2e/**/*
sonar.cpd.exclusions=test/**/*,test-e2e/**/*
sonar.javascript.lcov.reportPaths=coverage/lcov.info
Expand Down
2 changes: 1 addition & 1 deletion test-e2e/cypress-5/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-e2e/cypress-5/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cypress-fast-fail-e2e-tests",
"name": "cypress-fast-fail-v5-e2e-tests",
"version": "1.0.0",
"private": true,
"scripts": {
Expand Down
29 changes: 29 additions & 0 deletions test-e2e/cypress-6/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

#environment variables
#.env

# dependencies
/node_modules

#build
/build

# tests
/cypress/screenshots
/cypress/fixtures

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# ides
.idea
.vs
13 changes: 13 additions & 0 deletions test-e2e/cypress-6/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
plugins: [
[
"module-resolver",
{
root: ["."],
alias: {
"cypress-fail-fast": `../../`,
},
},
],
],
};
7 changes: 7 additions & 0 deletions test-e2e/cypress-6/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"baseUrl": "http://localhost:3000",
"video": false,
"env": {
"FAIL_FAST": true
}
}
19 changes: 19 additions & 0 deletions test-e2e/cypress-6/cypress/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"sourceType": "module"
},
"globals": {
"cy": true,
"afterEach": true,
"after": true,
"before": true,
"beforeEach": true,
"describe": true,
"expect": true,
"it": true
}
}
21 changes: 21 additions & 0 deletions test-e2e/cypress-6/cypress/integration/a-file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
describe("List items", () => {
before(() => {
cy.visit("/");
});

it("should display title", () => {
cy.get("h1").should("have.text", "Items list");
});

it("should display first item", () => {
cy.get("ul li:eq(0)").should("have.text", "Wrong text");
});

it("should display second item", () => {
cy.get("ul li:eq(1)").should("have.text", "Second item");
});

it("should display third item", () => {
cy.get("ul li:eq(2)").should("have.text", "Third item");
});
});
21 changes: 21 additions & 0 deletions test-e2e/cypress-6/cypress/integration/b-file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
describe("List items", () => {
before(() => {
cy.visit("/");
});

it("should display title", () => {
cy.get("h1").should("have.text", "Items list");
});

it("should display first item", () => {
cy.get("ul li:eq(0)").should("have.text", "First item");
});

it("should display second item", () => {
cy.get("ul li:eq(1)").should("have.text", "Second item");
});

it("should display third item", () => {
cy.get("ul li:eq(2)").should("have.text", "Third item");
});
});
4 changes: 4 additions & 0 deletions test-e2e/cypress-6/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = (on, config) => {
require("../../../../plugin")(on, config);
return config;
};
1 change: 1 addition & 0 deletions test-e2e/cypress-6/cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "cypress-fail-fast";
16 changes: 16 additions & 0 deletions test-e2e/cypress-6/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html

module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,

// Indicates whether the coverage information should be collected while executing the test
collectCoverage: false,

// The test environment that will be used for testing
testEnvironment: "node",

// The glob patterns Jest uses to detect test files
testMatch: ["**/test/**/*.spec.js"],
};

0 comments on commit 1b7b7f0

Please sign in to comment.