Skip to content

Commit 68d2d81

Browse files
committed
fix featured image spec
1 parent 47ec2aa commit 68d2d81

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

cypress/e2e/PostFeaturedImage.spec.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,8 @@ context('PostFeaturedImage', () => {
4444

4545
cy.get('[data-tab-id="edit-post/document"]').click();
4646

47-
cy.get('.components-button.components-panel__body-toggle').contains('Featured image').then($button => {
48-
if ($button.attr('aria-expanded') === 'false') {
49-
cy.get('.components-button.components-panel__body-toggle').contains('Featured image').click();
50-
}
51-
})
5247

53-
cy.get('.editor-post-featured-image img').should('exist').then(($a) => {
48+
cy.get('.editor-post-featured-image__preview-image').should('exist').then(($a) => {
5449
const src1 = $a.attr('src');
5550
const cleanedSrc1 = src1.replace(/-\d+x\d+(?=\.\w+$)/, '');
5651

@@ -65,7 +60,7 @@ context('PostFeaturedImage', () => {
6560
});
6661
});
6762

68-
cy.get('.components-button.editor-post-featured-image__action').contains('Remove').click();
63+
cy.get('.editor-post-featured-image__action').contains('Remove').click({force: true});
6964
cy.get('.wp-block-example-custom-post-featured-image__image').should('not.exist');
7065
})
7166
})

0 commit comments

Comments
 (0)