Commit 74c23b08 authored by dennisjl's avatar dennisjl
Browse files

Adds 2 tests regarding darkmode

parent 9641ee2e
Pipeline #74185 passed with stage
in 1 minute and 7 seconds
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class AgreelanceDarkMode(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome("./bin/chromedriver")
def test_dark_mode_toggle(self):
#Checks that toggleelement should be availeble through togglebar
def test_dark_mode_in_toggle(self):
driver = self.driver
driver.get("http://127.0.0.1:8000/")
#not in bullshits
self.assertNotIn(driver.find_element_by_class_name("custom-control-label"), driver.find_elements_by_class_name("navbar navbar-expand-lg navbar-light bg-light"))
#todo: check whats tarded
"""toggler = driver.find_elements_by_class_name("navbar-toggler")
toggler.click()
time.sleep(1)
#Find the darkmode elements
def test_dark_mode_elements(self):
driver = self.driver
driver.get("http://127.0.0.1:8000/")
darkmode_control_label = driver.find_element_by_class_name("custom-control-label")
darkmode_control_input = driver.find_element_by_class_name("custom-control-input")
darkmode_click = driver.find_element_by_class_name("custom-control-label")
darkmode_click.click()
self.assertTrue(darkmode_control_label)
self.assertTrue(darkmode_control_input)
#assert "No results found." not in driver.page_source
"""
def tearDown(self):
self.driver.close()
......
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