Unverified Commit 51e82323 authored by Johannes Tomren Røsvik's avatar Johannes Tomren Røsvik
Browse files

Fix small screen fix

parent e5ed9f20
Pipeline #76831 passed with stage
in 1 minute and 19 seconds
......@@ -35,15 +35,18 @@ class AgreelanceDarkMode(unittest.TestCase):
def test_dark_mode_clicked(self):
driver = self.driver
driver.get(url)
# Try to open navbar in case the screen is small
try:
toggler = driver.find_element_by_class_name("navbar-toggler")
toggler.click()
time.sleep(1)
finally:
darkmode_click = driver.find_element_by_class_name("custom-control-label")
darkmode_click.click()
time.sleep(1)
except Exception:
pass
darkmode_click = driver.find_element_by_class_name("custom-control-label")
darkmode_click.click()
time.sleep(1)
self.assertEqual(driver.find_element_by_tag_name("body").value_of_css_property("background-color"), "rgba(0, 0, 0, 1)")
......@@ -52,4 +55,4 @@ class AgreelanceDarkMode(unittest.TestCase):
self.driver.close()
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
unittest.main()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment