Skip to content

Commit

Permalink
0.3.0
Browse files Browse the repository at this point in the history
- Retry failing tests once, to mitigate cypress issues with docker and cy.visit
- Fix saveCurrentPost command
  • Loading branch information
Liam Defty committed Apr 9, 2020
1 parent a44b70e commit 3813a6d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## Why?

Cypress is designed to address the pain points of testing modern web applications. WP Cypress extends Cypress to address specific pain points developers and QA engineers face when testing WordPress applications.
Cypress is designed to address the pain points of testing modern web applications. WP Cypress extends Cypress to address specific pain points developers and QA engineers face when testing WordPress [5.*.*] applications.

We make it easier to:

Expand Down
6 changes: 1 addition & 5 deletions lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ const commands = {
},

saveCurrentPost() {
cy.get('body').then((body) => {
if (!body.find('.editor-post-saved-state').length > 0) {
cy.get('.editor-post-save-draft').click();
}
});
cy.window().then((win) => win.wp.data.dispatch('core/editor').savePost());
},
};

Expand Down
1 change: 1 addition & 0 deletions lib/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ before(() => {
});

beforeEach(() => {
Cypress.currentTest.retries(2);
cy.visit('/');
});

Expand Down
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// eslint-disable-next-line import/prefer-default-export

require('cypress-plugin-retries');
require('./commands');
require('./setSelection');
require('./hooks');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bigbite/wp-cypress",
"version": "0.2.3",
"version": "0.3.0",
"description": "WordPress end to end testing with Cypress.io",
"main": "lib/index.js",
"repository": "https://github.com/bigbite/wp-cypress",
Expand Down Expand Up @@ -35,6 +35,7 @@
},
"dependencies": {
"commander": "^5.0.0",
"cypress-plugin-retries": "^1.5.2",
"ora": "^4.0.3",
"shelljs": "^0.8.3",
"unfetch": "^4.1.0"
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ cross-spawn@^6.0.5:
shebang-command "^1.2.0"
which "^1.2.9"

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"

debug@^2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
Expand Down

0 comments on commit 3813a6d

Please sign in to comment.