Skip to content

Commit

Permalink
test: Move from CDP to BiDi
Browse files Browse the repository at this point in the history
See cockpit-project/cockpit#20832

Explicitly add a "glob" devDependency to follow suit with
cockpit-project/cockpit@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.
  • Loading branch information
martinpitt authored and allisonkarlitskaya committed Aug 13, 2024
1 parent 4ef7efa commit 06cb959
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand Down
2 changes: 1 addition & 1 deletion node_modules
Submodule node_modules updated 1517 files
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
9 changes: 4 additions & 5 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06cb959

Please sign in to comment.