Skip to content

Commit

Permalink
Merge pull request #3599 from 10up/fix/issue-3598
Browse files Browse the repository at this point in the history
Fix e2e tests with WP 6.3
  • Loading branch information
JakePT authored Aug 14, 2023
2 parents ff2ae0b + ba58b6a commit 6ffad95
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"config": {
"WP_DEBUG": true,
"WP_DEBUG_DISPLAY": true,
"WP_DISABLE_FATAL_ERROR_HANDLER": true
},
"env": {
"tests": {
"themes": [
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/integration/features/facets.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe('Facets Feature', { tags: '@slow' }, () => {
* Widget block.
*/
cy.get('.wp-block-legacy-widget')
.should('contain.text', 'ElasticPress - Facet')
.should('contain.text', 'ElasticPress - Filter by Taxonomy')
.first()
.click();

Expand Down
33 changes: 27 additions & 6 deletions tests/cypress/support/commands/block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Cypress.Commands.add('supportsBlockTypography', { prevSubject: true }, (subject,
cy.get('.block-editor-block-inspector button[aria-label="Styles"]').click();
cy.get('.block-editor-block-inspector button[aria-label="Typography options"]').click();

cy.get('.popover-slot button[aria-label="Show Font size').click();
cy.get('.popover-slot button[aria-label="Show Line height').click().type('{esc}');
cy.get('.popover-slot button').contains('Font size').click();
cy.get('.popover-slot button').contains('Font size').click().type('{esc}');

cy.get('.block-editor-block-inspector button[aria-label="Font size"]').click();
cy.get('.block-editor-block-inspector li[role="option"]').contains('Extra small').click();
Expand All @@ -73,13 +73,34 @@ Cypress.Commands.add('supportsBlockDimensions', { prevSubject: true }, (subject,
cy.get('.block-editor-block-inspector button[aria-label="Styles"]').click();
cy.get('.block-editor-block-inspector button[aria-label="Dimensions options"]').click();

cy.get('.popover-slot button[aria-label="Show Padding').click().type('{esc}');
cy.get('.dimensions-block-support-panel').as('dimensionsPanel');

cy.get('.component-spacing-sizes-control button[aria-label="Set custom size"]').click();
cy.get('.component-spacing-sizes-control input[type="number"]').clearThenType('10');
cy.get('.popover-slot button').contains('Padding').click().type('{esc}');

cy.get('@dimensionsPanel')
.find('.component-spacing-sizes-control, .spacing-sizes-control__wrapper')
.first()
.as('verticalInputsWrapper');

cy.get('@verticalInputsWrapper')
.find('button[aria-label="Set custom size"]')
.first()
.click();
cy.get('@verticalInputsWrapper').find('input[type="number"]').clearThenType('10');

cy.get('@dimensionsPanel')
.find('.component-spacing-sizes-control, .spacing-sizes-control__wrapper')
.eq(1)
.as('horizontalInputsWrapper');

cy.get('@horizontalInputsWrapper')
.find('button[aria-label="Set custom size"]')
.first()
.click();
cy.get('@horizontalInputsWrapper').find('input[type="number"]').clearThenType('15');

cy.get('.block-editor-block-inspector button[aria-label="Settings"]').click();
}

cy.wrap(subject).should('have.css', 'padding', '10px');
cy.wrap(subject).should('have.css', 'padding', '10px 15px');
});

0 comments on commit 6ffad95

Please sign in to comment.