From e3e526cbdab4f3c7408a846d15ff7d7edfe27016 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Tue, 7 Mar 2023 20:38:17 +0100 Subject: disable cache for transformer tests --- tests/playwright/test_transformers.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/playwright/test_transformers.py b/tests/playwright/test_transformers.py index 0b2e4de..a7638a0 100644 --- a/tests/playwright/test_transformers.py +++ b/tests/playwright/test_transformers.py @@ -5,6 +5,13 @@ from testutils import extract_and_upload from fietsboek import models +def disable_cache(page: Page): + """Disable HTTP caching for the given page.""" + # A little workaround, as there is no direct HTTP cache setting: + # Enabling routing disables http cache. + page.route("**", lambda route: route.continue_()) + + def test_transformer_zero_elevation_disabled(page: Page, playwright_helper, tmp_path, dbaccess): playwright_helper.login() @@ -46,6 +53,7 @@ def test_transformer_zero_elevation_enabled(page: Page, playwright_helper, tmp_p def test_transformer_zero_elevation_edited(page: Page, playwright_helper, tmp_path, dbaccess): + disable_cache(page) playwright_helper.login() page.goto("/") @@ -107,6 +115,7 @@ def test_transformer_steep_slope_enabled(page: Page, playwright_helper, tmp_path def test_transformer_steep_slope_edited(page: Page, playwright_helper, tmp_path, dbaccess): + disable_cache(page) playwright_helper.login() page.goto("/") -- cgit v1.2.3