File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,20 @@ export const pickRandomColor = function(): Cypress.Chainable<string> {
7777
7878 const colorPreviewSelector = '[data-user-theming-background-color],[data-admin-theming-setting-primary-color]'
7979
80+ let oldColor = ''
81+ cy . get ( colorPreviewSelector ) . then ( ( $el ) => {
82+ oldColor = $el . css ( 'background-color' )
83+ } )
84+
8085 // Open picker
8186 cy . contains ( 'button' , 'Change color' ) . click ( )
8287
8388 // Click on random color
8489 cy . get ( '.color-picker__simple-color-circle' ) . eq ( randColour ) . click ( )
8590
91+ // Wait for color change
92+ cy . waitUntil ( ( ) => Cypress . $ ( colorPreviewSelector ) . css ( 'background-color' ) !== oldColor )
93+
8694 // Get the selected color from the color preview block
8795 return cy . get ( colorPreviewSelector ) . then ( ( $el ) => $el . css ( 'background-color' ) )
8896}
You can’t perform that action at this time.
0 commit comments