Skip to content

Commit

Permalink
Merge pull request #3158 from 10up/fix/facet-e2e-tests-2971
Browse files Browse the repository at this point in the history
Fix: Facet E2E tests
  • Loading branch information
felipeelia authored Nov 28, 2022
2 parents f39c582 + a05c0b4 commit 9612fbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tests/cypress/integration/features/facets.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ describe('Facets Feature', () => {
`,
);

/**
* Give Elasticsearch some time to process the post.
*
*/
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000);

// Blog page
cy.visit('/');
cy.contains('.site-content article h2', 'A new page').should('not.exist');
Expand Down
3 changes: 2 additions & 1 deletion tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ Cypress.Commands.add('createClassicWidget', (widgetId, settings) => {
}

cy.get('input[type="submit"]').click();
cy.wait('@adminAjax').its('response.statusCode').should('eq', 200);
})
.wait('@adminAjax');
});
Expand All @@ -327,7 +328,7 @@ Cypress.Commands.add('emptyWidgets', () => {
cy.wpCliEval(
`
WP_CLI::runcommand('widget reset --all');
$inactive_widgets = WP_CLI::runcommand('widget list wp_inactive_widgets --format=ids', [ 'return' => true ] );
if ( $inactive_widgets ) {
WP_CLI::runcommand("widget delete {$inactive_widgets}" );
Expand Down

0 comments on commit 9612fbd

Please sign in to comment.