From c795e167cc1a9f4bba7cf01cdb35862b43bdce73 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 11 Aug 2024 21:25:04 +0200 Subject: [PATCH] test: Move from CDP to BiDi See https://github.com/cockpit-project/cockpit/pull/20832 Explicitly add a "glob" devDependency to follow suit with https://github.com/cockpit-project/cockpit/commit/680decc155a It was previously used implicitly through a transient dependency of something else, but our esbuild po-plugin uses it explicitly. Adjust `waitDownloadFile()` to the new download directory attribute. This is a `Path` object now, which is more convenient. --- Makefile | 2 +- node_modules | 2 +- package.json | 2 +- test/check-application | 9 ++++----- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b5d8929f..5468d73d 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ COCKPIT_REPO_FILES = \ $(NULL) COCKPIT_REPO_URL = https://github.com/cockpit-project/cockpit.git -COCKPIT_REPO_COMMIT = 07fddba43934fb256ec8da03812f081eab3baa18 # 321 + 117 commits +COCKPIT_REPO_COMMIT = 8ede522e5066e680850dd2ae049e2e24f99c4230 # 322 + 30 commits $(COCKPIT_REPO_FILES): $(COCKPIT_REPO_STAMP) COCKPIT_REPO_TREE = '$(strip $(COCKPIT_REPO_COMMIT))^{tree}' diff --git a/node_modules b/node_modules index a475090c..ba195cf9 160000 --- a/node_modules +++ b/node_modules @@ -1 +1 @@ -Subproject commit a475090c09d8fd08c7936ea8c1c2a2f3daa066b3 +Subproject commit ba195cf9ce2b9b04e3db1b9071386f2ac1b70d01 diff --git a/package.json b/package.json index b3f4b2b8..3cea436a 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "@types/throttle-debounce": "5.0.2", "@typescript-eslint/eslint-plugin": "8.0.1", "argparse": "2.0.1", - "chrome-remote-interface": "0.33.2", "esbuild": "0.23.0", "esbuild-plugin-copy": "2.1.1", "esbuild-plugin-replace": "1.4.0", @@ -37,6 +36,7 @@ "eslint-plugin-react": "7.35.0", "eslint-plugin-react-hooks": "4.6.2", "gettext-parser": "8.0.0", + "glob": "11.0.0", "htmlparser": "1.7.7", "jed": "1.1.1", "language-map": "1.5.0", diff --git a/test/check-application b/test/check-application index 793365b4..05cb5e54 100755 --- a/test/check-application +++ b/test/check-application @@ -83,17 +83,16 @@ class TestFiles(testlib.MachineCase): def waitDownloadFile(self, filename: str, expected_size: int | None = None, content: str | None = None) -> None: b = self.browser - filepath = os.path.join(b.cdp.download_dir, filename) + filepath = b.driver.download_dir / filename # Big downloads can take a while with b.wait_timeout(120): - testlib.wait(lambda: os.path.exists(filepath)) + testlib.wait(filepath.exists) if expected_size is not None: - testlib.wait(lambda: os.stat(filepath).st_size == expected_size) + testlib.wait(lambda: filepath.stat().st_size == expected_size) if content is not None: - with open(filepath) as fp: - self.assertEqual(fp.read(), content) + self.assertEqual(filepath.read_text(), content) def file_action_modal(self, filename: str, action: str) -> None: b = self.browser