Skip to content

Commit

Permalink
[webdriver]: add test to verify consistency in color serialization
Browse files Browse the repository at this point in the history
An issue has been raised in w3c/webdriver#1447 describing
discrepancies serializing colors using the element css value command. The specification
refers to the [computed value](https://drafts.csswg.org/css-cascade-4/#computed-value)
which doesn't have clear definition on this for colors. However the WebDriver specification
should have an interest normalizing these values as it is used for testing purposes.
  • Loading branch information
christian-bromann committed Mar 14, 2024
1 parent efe5a26 commit 98f4345
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions webdriver/tests/classic/get_element_css_value/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,10 @@ def test_property_name_not_existent(session, inline):

result = get_element_css_value(session, element.id, "foo")
assert_success(result, "")

def test_consistent_color_serialization(session):
session.url = inline("""<div style="background-color: red">""")
element = session.find.css("div", all=False)

result = get_element_css_value(session, element.id, "background-color")
assert_success(result, "rgba(255, 0, 0, 1)")

0 comments on commit 98f4345

Please sign in to comment.