diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d0d9c598..697d18ee2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,9 @@ jobs: - name: 🚀 Run Playwright working-directory: ./tests/playwright run: | - OCTOPRINT_SERVER_BASE=${{ github.workspace }}/e2econfig npx playwright test + npx playwright test + env: + OCTOPRINT_SERVER_BASE: ${{ github.workspace }}/e2econfig - name: ⬆ Upload report uses: actions/upload-artifact@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d42709880..6ca5d8d6f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,3 +73,4 @@ repos: rev: v2.1.0 hooks: - id: codespell + exclude: ^(src/octoprint/vendor/|tests/static/js/lib|tests/util/_files|tests/playwright|scripts/) diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py index 12500c83a..a41fb2a7c 100644 --- a/src/octoprint/__init__.py +++ b/src/octoprint/__init__.py @@ -322,6 +322,7 @@ def init_logging( "class": "octoprint.logging.handlers.TornadoLogHandler", "level": "DEBUG", "formatter": "tornado", + "when": "D", "backupCount": 1, "filename": os.path.join( settings.getBaseFolder("logs"), "tornado.log" @@ -331,6 +332,7 @@ def init_logging( "class": "octoprint.logging.handlers.AuthLogHandler", "level": "DEBUG", "formatter": "auth", + "when": "D", "backupCount": 1, "filename": os.path.join(settings.getBaseFolder("logs"), "auth.log"), }, diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index fb0ea2e80..fcd020b7c 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -1196,7 +1196,7 @@ class Server: nonlocal autorefresh if autorefresh is not None: - autorefresh.stop() + autorefresh.cancel() autorefresh = None autorefresh = octoprint.util.RepeatedTimer( diff --git a/tests/playwright/playwright.config.js b/tests/playwright/playwright.config.js index fd7fbdda6..370284b3f 100644 --- a/tests/playwright/playwright.config.js +++ b/tests/playwright/playwright.config.js @@ -14,7 +14,7 @@ const config = { max: 30_000, threshold: 50_000 }, - reporter: "html", + reporter: [["list"], ["html"], ...(process.env.CI ? [["github"]] : [])], use: { actionTimeout: 0, baseURL: process.env.PLAYWRIGHT_BASEURL || "http://localhost:5000", diff --git a/tests/playwright/specs/login.spec.js b/tests/playwright/specs/login.spec.js index cd8409772..924d51cee 100644 --- a/tests/playwright/specs/login.spec.js +++ b/tests/playwright/specs/login.spec.js @@ -25,20 +25,19 @@ test.describe.parallel("Successful login", async () => { await util.loginCookiesWithRememberMe(); }); - test.fixme("by keyboard", async ({page, ui, util, credentials}) => { - // TODO: this doesn't work yet + test("by keyboard", async ({page, ui, util, credentials}) => { await expect(page.getByTestId("login-username")).toBeFocused(); await page.getByTestId("login-username").type(credentials.username); - await page.getByTestId("login-username").press("Tab"); + await page.getByTestId("login-username").press("Tab"); await expect(page.getByTestId("login-password")).toBeFocused(); await page.getByTestId("login-password").type(credentials.password); - await page.getByTestId("login-password").press("Tab"); + await page.getByTestId("login-password").press("Tab"); await expect(page.getByTestId("login-remember-me")).toBeFocused(); await page.getByTestId("login-remember-me").press("Space"); - await page.getByTestId("login-remember-me").press("Tab"); + await page.getByTestId("login-remember-me").press("Tab"); await expect(page.getByTestId("login-submit")).toBeFocused(); await page.getByTestId("login-submit").press("Enter"); diff --git a/tests/playwright/specs/settings.spec.js b/tests/playwright/specs/settings.spec.js index 5cc5ec93b..060a936af 100644 --- a/tests/playwright/specs/settings.spec.js +++ b/tests/playwright/specs/settings.spec.js @@ -30,9 +30,8 @@ test.describe.parallel("Close settings", () => { await page.getByTestId("settings-dialog").press("Escape"); }); - test.fixme("via click outside", async ({page}) => { - // TODO: this doesn't work yet - await page.locator(".modal-scrollable").click(); + test("via click outside", async ({page}) => { + await page.locator(".modal-scrollable").click({position: {x: 10, y: 10}}); }); test.afterEach(async ({page}) => {