Skip to content

Commit

Permalink
test: fix search E2E tests FTW
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Nov 26, 2024
1 parent 44d278b commit e0041aa
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
28 changes: 16 additions & 12 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions tests/search/e2e/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = defineConfig({
"numTestsKeptInMemory": 0,
reporter: 'cypress-multi-reporters',
reporterOptions: {
configFile: 'tests/search/e2e/cypress-reporter-config.json'
},
experimentalSessionAndOrigin: true,
configFile: 'tests/search/e2e/cypress-reporter-config.json'
},
experimentalSessionAndOrigin: true,
})
6 changes: 3 additions & 3 deletions tests/search/e2e/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Cypress.Commands.add('openWidgetsPage', () => {
cy.get('body').then(($body) => {
const $button = $body.find('.edit-widgets-welcome-guide .components-modal__header button');
if ($button.is(':visible')) {
$button.click();
$button.trigger('click');
}
});
});
Expand Down Expand Up @@ -136,11 +136,11 @@ Cypress.Commands.add('publishPost', (postData, viewPost) => {
cy.get('.block-editor-default-block-appender__content').type(newPostData.content);

if (newPostData.status && newPostData.status === 'draft') {
cy.get('.editor-post-save-draft').click();
cy.get('.editor-post-save-draft').click({ force: true });
cy.get('.editor-post-saved-state').should('have.text', 'Saved');
} else {
cy.get('.editor-post-publish-panel__toggle').should('be.enabled');
cy.get('.editor-post-publish-panel__toggle').click();
cy.get('.editor-post-publish-panel__toggle').click({ force: true });

cy.get('.editor-post-publish-button').click();

Expand Down
2 changes: 1 addition & 1 deletion tests/search/e2e/support/commands/block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Cypress.Commands.add('openBlockSettingsSidebar', () => {
} else {
cy.get('.editor-header__settings button[aria-label="Settings"]').then(($btn) => {
if (!$btn.hasClass('is-pressed')) {
$btn.click();
$btn.trigger('click');
}
cy.get('.editor-sidebar__panel-tabs').contains('Block').click();
});
Expand Down

0 comments on commit e0041aa

Please sign in to comment.