Skip to content

Commit

Permalink
update commands.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sksaju committed Nov 24, 2024
1 parent dbfa7d8 commit c4f166f
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Cypress.Commands.add('setLocalStorage', (key, value) => {
});

Cypress.Commands.add('createPost', (options = {}) => {
const { postType = 'page', title = '' } = options;
const { postType = 'post', title = '' } = options;
const userId = '1';

cy.setLocalStorage(
Expand Down Expand Up @@ -75,25 +75,3 @@ Cypress.Commands.add('insertBlock', (blockName) => {
cy.focused().type(blockName);
cy.get('button').contains(blockName).click();
});

Cypress.Commands.add('openSettingsSidebar', () => {
cy.get('button[aria-label="Settings"]').click();
});

Cypress.Commands.add('deletePost', () => {
cy.get('button[aria-label="Settings"][aria-expanded="false"]').click();
cy.get('button[aria-label="Page"].edit-post-sidebar__panel-tab').click();
cy.get('button').contains('Move to trash').click();
});

Cypress.Commands.add('goToAdmin', () => {
cy.get('#wp-admin-bar-site-name #wp-admin-bar-dashboard > a').click({ force: true });
});

Cypress.Commands.add('updatePost', () => {
cy.get('[type="button"]').then(($button) => {
if ($button.val() === 'Update' || $button.val() === 'Publish') {
cy.wrap($button).click();
}
});
});

0 comments on commit c4f166f

Please sign in to comment.