|
3 | 3 |
|
4 | 4 | from modules.browser_object import Navigation
|
5 | 5 |
|
6 |
| -LIGHT_MODE_BEFORE_RBG_VALUE = "rgba(207, 207, 216, 0.33)" |
7 |
| -DARK_MODE_BEFORE_RGB_VALUE = "rgba(0, 0, 0, 0.33)" |
8 |
| - |
9 |
| -LIGHT_MODE_AFTER_RGB_VALUE = "color(srgb 0 0 0 / 0.6)" |
10 |
| -DARK_MODE_AFTER_RGB_VALUE = "color(srgb 0.984314 0.984314 0.996078 / 0.6)" |
11 |
| - |
| 6 | +ALLOWED_RGB_BEFORE_VALUES = set(["rgba(207, 207, 216, 0.33)", "color(srgb 0 0 0 / 0.13)", "rgba(0, 0, 0, 0.33)"]) |
| 7 | +ALLOWED_RGB_AFTER_VALUES = set(["color(srgb 0 0 0 / 0.6)", "color(srgb 0.984314 0.984314 0.996078 / 0.6)"]) |
12 | 8 |
|
13 | 9 | # Set search region
|
14 | 10 | @pytest.fixture()
|
@@ -40,35 +36,22 @@ def test_intervention_card_refresh(driver: Firefox):
|
40 | 36 |
|
41 | 37 | # ensure the color before hover
|
42 | 38 | button_background = refresh_button.value_of_css_property("background-color")
|
43 |
| - assert ( |
44 |
| - button_background == LIGHT_MODE_BEFORE_RBG_VALUE |
45 |
| - or button_background == DARK_MODE_BEFORE_RGB_VALUE |
46 |
| - ) |
| 39 | + assert button_background in ALLOWED_RGB_BEFORE_VALUES |
47 | 40 | nav.hover_over_element(refresh_button, chrome=True)
|
48 | 41 |
|
49 | 42 | # ensure there is a hover state
|
50 | 43 | new_button_background = refresh_button.value_of_css_property("background-color")
|
51 |
| - assert ( |
52 |
| - new_button_background == LIGHT_MODE_AFTER_RGB_VALUE |
53 |
| - or new_button_background == DARK_MODE_AFTER_RGB_VALUE |
54 |
| - ) |
55 |
| - |
| 44 | + assert new_button_background in ALLOWED_RGB_AFTER_VALUES |
56 | 45 | # repeated from before but with the 3 dots menu button
|
57 | 46 | help_menu_background = help_menu_button.value_of_css_property("background-color")
|
58 |
| - assert ( |
59 |
| - help_menu_background == LIGHT_MODE_BEFORE_RBG_VALUE |
60 |
| - or help_menu_background == DARK_MODE_BEFORE_RGB_VALUE |
61 |
| - ) |
| 47 | + assert help_menu_background in ALLOWED_RGB_BEFORE_VALUES |
62 | 48 | assert help_menu_button.get_attribute("open") is None
|
63 | 49 | nav.hover_over_element(help_menu_button, chrome=True)
|
64 | 50 |
|
65 | 51 | new_help_menu_background = help_menu_button.value_of_css_property(
|
66 | 52 | "background-color"
|
67 | 53 | )
|
68 |
| - assert ( |
69 |
| - new_help_menu_background == LIGHT_MODE_AFTER_RGB_VALUE |
70 |
| - or new_help_menu_background == DARK_MODE_AFTER_RGB_VALUE |
71 |
| - ) |
| 54 | + assert new_help_menu_background in ALLOWED_RGB_AFTER_VALUES |
72 | 55 |
|
73 | 56 | # ensure the popup appears
|
74 | 57 | help_menu_button.click()
|
|
0 commit comments