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 (v9 => v10) #3066

Merged
merged 20 commits into from
Oct 20, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Refresh specific index
Otherwise it fails in EP.io
  • Loading branch information
felipeelia committed Oct 20, 2022
commit 8236727c4a804572c701ea653c3d4acc9cca1d6b
12 changes: 10 additions & 2 deletions tests/cypress/integration/features/comments.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ describe('Comments Feature', () => {
cy.get('#submit').click();

// Check if the new comment was indexed
cy.wpCliEval('\\ElasticPress\\Elasticsearch::factory()->refresh_indices();').then(() => {
cy.wpCliEval(
`
$comments_index = \\ElasticPress\\Indexables::factory()->get( "comment" )->get_index_name();
WP_CLI::runcommand("elasticpress request {$comments_index}/_refresh --method=POST");`,
).then(() => {
cy.wpCli('wp elasticpress stats')
.its('stdout')
.should('contain', `Documents: ${defaultApprovedComments + 1}`);
Expand Down Expand Up @@ -142,7 +146,11 @@ describe('Comments Feature', () => {
cy.get('#comment').type('This is a anonymous comment');
cy.get('#submit').click();

cy.wpCliEval('\\ElasticPress\\Elasticsearch::factory()->refresh_indices();').then(() => {
cy.wpCliEval(
`
$comments_index = \\ElasticPress\\Indexables::factory()->get( "comment" )->get_index_name();
WP_CLI::runcommand("elasticpress request {$comments_index}/_refresh --method=POST");`,
).then(() => {
cy.wpCli('wp elasticpress stats')
.its('stdout')
.should('contain', `Documents: ${defaultApprovedComments + 1}`);
Expand Down