1

I my code I have:

expect(element(by.className('nea-navbar')).getCssValue('background')).toBe('#264367');

When I run, the expect returns:

  • Expected 'rgb(38, 67, 103) none repeat scroll 0% 0% / auto padding-box border-box' to be '#264367'.

Do you know with it returns so many info and how to pass from rgb to hex?

ascripter
  • 5,665
  • 12
  • 45
  • 68
Carlos Rodrigues
  • 127
  • 1
  • 2
  • 11

1 Answers1

1

It's passing back the entire background property, whereas you just want background-color:

expect(element(by.className('nea-navbar')).getCssValue('background-color')).toBe(...);

Your second question on converting rgb to hex has an answer here: RGB to Hex and Hex to RGB

...and this library also claims to support that: https://www.npmjs.com/package/rgb-hex

Will
  • 6,601
  • 3
  • 31
  • 42