e2e: save screenshots with timestamp instead of class name

This commit is contained in:
Jens Langhammer 2020-06-21 18:44:08 +02:00
parent 887163c45c
commit ed4daa64fe
3 changed files with 4 additions and 3 deletions

View File

@ -286,7 +286,7 @@ class TestEnroll2Step(SeleniumTestCase):
self.driver.get(self.live_server_url) self.driver.get(self.live_server_url)
self.setup_test_enroll_2_step() self.setup_test_enroll_2_step()
self.wait.until( self.wait.until(
ec.presence_of_element_located(By.CSS_SELECTOR, "[role=enroll]") ec.presence_of_element_located((By.CSS_SELECTOR, "[role=enroll]"))
) )
self.driver.find_element(By.CSS_SELECTOR, "[role=enroll]").click() self.driver.find_element(By.CSS_SELECTOR, "[role=enroll]").click()

View File

@ -219,7 +219,7 @@ class TestProviderOIDC(SeleniumTestCase):
self.driver.find_element(By.CSS_SELECTOR, "[type=submit]").click() self.driver.find_element(By.CSS_SELECTOR, "[type=submit]").click()
self.wait.until( self.wait.until(
ec.presence_of_element_located(By.XPATH, "//a[contains(@href, '/profile')]") ec.presence_of_element_located((By.XPATH, "//a[contains(@href, '/profile')]"))
) )
self.driver.find_element(By.XPATH, "//a[contains(@href, '/profile')]").click() self.driver.find_element(By.XPATH, "//a[contains(@href, '/profile')]").click()
self.assertEqual( self.assertEqual(

View File

@ -1,4 +1,5 @@
"""passbook e2e testing utilities""" """passbook e2e testing utilities"""
from time import time
from functools import lru_cache from functools import lru_cache
from glob import glob from glob import glob
from importlib.util import module_from_spec, spec_from_file_location from importlib.util import module_from_spec, spec_from_file_location
@ -55,7 +56,7 @@ class SeleniumTestCase(StaticLiveServerTestCase):
) )
def tearDown(self): def tearDown(self):
self.driver.save_screenshot(f"out/{self.__class__.__name__}.png") self.driver.save_screenshot(f"out/{time()}.png")
self.driver.quit() self.driver.quit()
super().tearDown() super().tearDown()