@@ -17,9 +17,14 @@ const settings = {
17
17
new : 'Rancher e2e'
18
18
} ,
19
19
primaryColor : {
20
- original : '#3d98d3' , // 3D98D3
21
- new : '#f80dd8' ,
22
- newRGB : 'rgb(248, 13, 216)' , // 'rgb(220, 222, 231)'
20
+ original : '#3d98d3' , // 3D98D3
21
+ new : '#f80dd8' ,
22
+ newRGB : 'rgb(248, 13, 216)' , // 'rgb(220, 222, 231)'
23
+ // the browser seems to sometimes slightly change the color
24
+ // don't know if it's related to the actual color input output
25
+ // OR the application of the color in the css
26
+ // check PR https://github.com/rancher/dashboard/pull/13954 description
27
+ validNewRGBs : [ 'rgb(248, 13, 216)' , 'rgb(249, 63, 224)' ]
23
28
} ,
24
29
linkColor : {
25
30
original : '#3d98d3' , // #3D98D3
@@ -352,39 +357,39 @@ describe('Branding', { testIsolation: 'off' }, () => {
352
357
353
358
BrandingPagePo . navTo ( ) ;
354
359
355
- // Set
356
360
brandingPage . primaryColorCheckbox ( ) . set ( ) ;
357
361
brandingPage . primaryColorPicker ( ) . value ( ) . should ( 'not.eq' , settings . primaryColor . new ) ;
358
362
brandingPage . primaryColorPicker ( ) . set ( settings . primaryColor . new ) ;
359
363
brandingPage . applyAndWait ( '**/ui-primary-color' , 200 ) ;
364
+ brandingPage . applyButton ( ) . waitForDisabledAppearanceToDisappear ( ) ;
360
365
361
366
// Check in session
362
367
brandingPage . primaryColorPicker ( ) . value ( ) . should ( 'eq' , settings . primaryColor . new ) ;
363
368
brandingPage . primaryColorPicker ( ) . previewColor ( ) . should ( 'eq' , settings . primaryColor . newRGB ) ;
364
369
brandingPage . applyButton ( ) . self ( ) . should ( 'have.css' , 'background' ) . should ( ( background : string ) => {
365
- expect ( background ) . to . satisfy ( ( b ) => b . startsWith ( settings . primaryColor . newRGB ) ) ;
370
+ expect ( background ) . to . satisfy ( ( b ) => b . startsWith ( settings . primaryColor . validNewRGBs [ 0 ] ) || b . startsWith ( settings . primaryColor . validNewRGBs [ 1 ] ) ) ;
366
371
} ) ;
367
372
368
373
// Check over reload
369
374
cy . reload ( ) ;
370
375
brandingPage . primaryColorPicker ( ) . value ( ) . should ( 'eq' , settings . primaryColor . new ) ;
371
376
brandingPage . primaryColorPicker ( ) . previewColor ( ) . should ( 'eq' , settings . primaryColor . newRGB ) ;
372
377
brandingPage . applyButton ( ) . self ( ) . should ( 'have.css' , 'background' ) . should ( ( background : string ) => {
373
- expect ( background ) . to . satisfy ( ( b ) => b . startsWith ( settings . primaryColor . newRGB ) ) ;
378
+ expect ( background ) . to . satisfy ( ( b ) => b . startsWith ( settings . primaryColor . validNewRGBs [ 0 ] ) || b . startsWith ( settings . primaryColor . validNewRGBs [ 1 ] ) ) ;
374
379
} ) ;
375
380
376
381
// check that login page has new styles applied
377
382
// https://github.com/rancher/dashboard/issues/10788
378
383
loginPage . goTo ( ) ;
379
384
380
385
loginPage . submitButton ( ) . self ( ) . should ( 'have.css' , 'background' ) . should ( ( background : string ) => {
381
- expect ( background ) . to . satisfy ( ( b ) => b . startsWith ( settings . primaryColor . newRGB ) ) ;
386
+ expect ( background ) . to . satisfy ( ( b ) => b . startsWith ( settings . primaryColor . validNewRGBs [ 0 ] ) || b . startsWith ( settings . primaryColor . validNewRGBs [ 1 ] ) ) ;
382
387
} ) ;
383
388
384
389
cy . reload ( ) ;
385
390
386
391
loginPage . submitButton ( ) . self ( ) . should ( 'have.css' , 'background' ) . should ( ( background : string ) => {
387
- expect ( background ) . to . satisfy ( ( b ) => b . startsWith ( settings . primaryColor . newRGB ) ) ;
392
+ expect ( background ) . to . satisfy ( ( b ) => b . startsWith ( settings . primaryColor . validNewRGBs [ 0 ] ) || b . startsWith ( settings . primaryColor . validNewRGBs [ 1 ] ) ) ;
388
393
} ) ;
389
394
// EO test https://github.com/rancher/dashboard/issues/10788
390
395
0 commit comments