Skip to content

Commit

Permalink
Merge pull request #3441 from 10up/chore/issue-3433-update-cypress
Browse files Browse the repository at this point in the history
Update Cypress version
  • Loading branch information
felipeelia authored May 8, 2023
2 parents 34d5719 + f766f81 commit 5f7a244
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 23 deletions.
36 changes: 18 additions & 18 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"license": "GPL-2.0-or-later",
"description": "A fast and flexible search and query engine for WordPress.",
"devDependencies": {
"@4tw/cypress-drag-drop": "^2.2.1",
"@4tw/cypress-drag-drop": "^2.2.3",
"@cypress/grep": "^3.1.3",
"@wordpress/env": "^5.0.0",
"10up-toolkit": "^4.3.1",
"classnames": "^2.3.1",
"cypress": "^10.10.0",
"cypress": "^12.9.0",
"cypress-file-upload": "^5.0.8",
"eslint-plugin-cypress": "^2.12.1",
"husky": "^8.0.3",
Expand Down
7 changes: 7 additions & 0 deletions tests/cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ Run `sudo apt update && sudo apt install libatk1.0-0 libatk-bridge2.0-0 libcups2

Make sure you have `xvfb` installed

#### `Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")`

```
export LIBGL_ALWAYS_INDIRECT=1
export DISPLAY=:0
```

### Running tests with ElasticPress.io

To run tests locally using an ElasticPress.io endpoint, in place of running `npm run cypress:setup` during setup, run: `./bin/setup-cypress-env.sh --ep-host="https://" --es-shield="username:password" --ep-index-prefix="username"`, with the arguments populated with the details for your ElasticPress.io endpoint.
2 changes: 1 addition & 1 deletion tests/cypress/integration/features/comments.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ describe('Comments Feature', { tags: '@slow' }, () => {
cy.get('@syncPanel').find('.components-form-toggle').click();
cy.get('@syncPanel')
.find('.ep-sync-messages', { timeout: Cypress.config('elasticPressIndexTimeout') })
.should('contain.text', 'Mapping sent')
.should('contain.text', 'Sync complete')
.should('contain.text', 'Mapping sent')
// check that the number of approved comments is the same as the default.
.should('contain.text', `Number of comments indexed: ${defaultApprovedComments}`);

Expand Down
6 changes: 4 additions & 2 deletions tests/cypress/integration/features/terms.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ describe('Terms Feature', { tags: '@slow' }, () => {
it('Can turn the feature on', () => {
cy.login();

cy.maybeDisableFeature('terms');

cy.visitAdminPage('admin.php?page=elasticpress');
cy.get('.ep-feature-terms .settings-button').click();
cy.get('.ep-feature-terms [name="settings[active]"][value="1"]').click();
Expand All @@ -31,8 +33,8 @@ describe('Terms Feature', { tags: '@slow' }, () => {
cy.get('@syncPanel').find('.components-form-toggle').click();
cy.get('@syncPanel')
.find('.ep-sync-messages', { timeout: Cypress.config('elasticPressIndexTimeout') })
.should('contain.text', 'Mapping sent')
.should('contain.text', 'Sync complete');
.should('contain.text', 'Sync complete')
.should('contain.text', 'Mapping sent');

cy.wpCli('wp elasticpress list-features').its('stdout').should('contain', 'terms');
});
Expand Down

0 comments on commit 5f7a244

Please sign in to comment.