diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4982209de5b51faf5706117fd67ad588c4c5e8a..ff2b57e4672cf437e2174176a95f1b2a6837d42d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -108,7 +108,8 @@ test_frontend: - HEADLESS_TESTS=True pytest --ds=grady.settings.test functional_tests artifacts: paths: - - .screenshots/ + - functional_tests/screenshots/ + when: on_failure expire_in: 30 days test_frontend_unit: diff --git a/functional_tests/.gitignore b/functional_tests/.gitignore index 8380e4bf3e5e9f462a34d555d8371a6c435293c3..975c04dbfa8a288635c37f9f5e1ddc87f51fbd54 100644 --- a/functional_tests/.gitignore +++ b/functional_tests/.gitignore @@ -1,3 +1,3 @@ export.json export.csv - +screenshots diff --git a/functional_tests/test_export_modal.py b/functional_tests/test_export_modal.py index 4754e72a4acb47346d9ae2dab0af548d52ad1679..92d08bcc78500937d9b61cd70a9207fd86fdcac9 100644 --- a/functional_tests/test_export_modal.py +++ b/functional_tests/test_export_modal.py @@ -26,6 +26,7 @@ def expect_file_to_be_downloaded(path): JSON_EXPORT_FILE = os.path.join(os.path.dirname(__file__), 'export.json') +SCREENSHOTS = os.path.join(os.path.dirname(__file__), 'screenshots') class ExportTestModal(LiveServerTestCase): @@ -56,12 +57,14 @@ class ExportTestModal(LiveServerTestCase): def tearDown(self): try: - os.mkdir('.screenshots') + os.mkdir(SCREENSHOTS) except FileExistsError: pass for method, error in self._outcome.errors: if error: - self.browser.get_screenshot_as_file(".screenshots/" + self.id() + ".png") + self.browser.get_screenshot_as_file( + os.path.join(SCREENSHOTS, self.id() + ".png") + ) reset_browser_after_test(self.browser, self.live_server_url) def _login(self):