File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,14 @@ test.describe( 'Block Editor', () => {
6868
6969 // Verify block attributes
7070 const clientId = await editor . canvas . getByLabel ( 'Block: Text' ) . getAttribute ( 'data-block' )
71- const attributes = await editor . getBlockAttributes ( clientId )
7271
73- expect ( attributes ) . toHaveProperty ( 'textColor1' , '#ff0000' )
74- expect ( attributes ) . toHaveProperty ( 'text' , 'test' )
72+ // Block attributes may not update immediately
73+ await expect ( async ( ) => {
74+ const attributes = await editor . getBlockAttributes ( clientId )
75+
76+ expect ( attributes ) . toHaveProperty ( 'textColor1' , '#ff0000' )
77+ expect ( attributes ) . toHaveProperty ( 'text' , 'test' )
78+ } ) . toPass ( { intervals : [ 1_000 , 2_000 , 5_000 ] } )
7579 } )
7680
7781 test ( 'The Stackable block added in the editor should be visible in the frontend' , async ( {
Original file line number Diff line number Diff line change @@ -117,7 +117,14 @@ test.describe( 'Global Settigs', () => {
117117 await defaultBlockPage . locator ( '.stk-color-palette-control .stk-control-content > .components-dropdown > .components-button' ) . first ( ) . click ( )
118118 await defaultBlockPage . getByLabel ( 'Hex color' ) . fill ( color )
119119 await defaultBlockPage . locator ( '.stk-color-palette-control .stk-control-content > .components-dropdown > .components-button' ) . first ( ) . click ( )
120- await defaultBlockPage . getByRole ( 'button' , { name : 'Save' , exact : true } ) . click ( )
120+
121+ // In older WP versions, the button text is 'Update' instead of 'Save'
122+ if ( await defaultBlockPage . getByRole ( 'button' , { name : 'Save' , exact : true } ) . isVisible ( ) ) {
123+ await defaultBlockPage . getByRole ( 'button' , { name : 'Save' , exact : true } ) . click ( )
124+ } else {
125+ await defaultBlockPage . getByRole ( 'button' , { name : 'Update' } ) . click ( )
126+ }
127+
121128 await defaultBlockPage . close ( )
122129
123130 // Insert a Stackable Text Block, and check if the color is the same as the one set in the default block
You can’t perform that action at this time.
0 commit comments