Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cypress version #3441

Merged
merged 7 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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