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

Drop chrome-remote-interface NPM dependency.

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 the exception handling tests to not wait for RuntimeError, this
is no longer raised.
  • Loading branch information
KKoukiou committed Aug 15, 2024
1 parent 5fed39b commit 2f71e52
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,9 @@ install: $(DIST_TEST) po/LINGUAS
cp webui-desktop $(DESTDIR)/usr/libexec/
ln -sTfr $(DESTDIR)/usr/share/pixmaps/fedora-logo-sprite.svg $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)/logo.svg

# required for running integration tests; commander and ws are deps of chrome-remote-interface
# required for running integration tests;
TEST_NPMS = \
node_modules/chrome-remote-interface \
node_modules/commander \
node_modules/sizzle \
node_modules/ws \
$(NULL)

dist: $(TARFILE)
Expand Down Expand Up @@ -155,7 +152,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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"stylelint:fix": "stylelint --fix 'src/**/*{.css,scss}'"
},
"devDependencies": {
"chrome-remote-interface": "0.33.2",
"esbuild": "0.23.0",
"esbuild-plugin-copy": "2.1.1",
"esbuild-plugin-replace": "1.4.0",
Expand All @@ -32,6 +31,7 @@
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"gettext-parser": "8.0.0",
"glob": "11.0.0",
"htmlparser": "1.7.7",
"jed": "1.1.1",
"qunit": "2.21.1",
Expand Down
8 changes: 2 additions & 6 deletions test/check-basic
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,8 @@ class TestBasic(VirtInstallMachineCase):

b.wait_not_present("#critical-error-bz-report-modal.pf-v5-c-modal-box")

with self.assertRaises(RuntimeError):
b.eval_js("window.setTimeout(function() { myNonExistingFunction()}, 0);")
# Some round trips, one of which should update the deferred exception
for _ in range(0, 5):
b.wait_in_text("#critical-error-bz-report-modal-details", "myNonExistingFunction is not defined")
time.sleep(2)
b.eval_js("window.setTimeout(function() { myNonExistingFunction()}, 0);")
b.wait_in_text("#critical-error-bz-report-modal-details", "myNonExistingFunction is not defined")

b.wait_visible("a:contains('Report issue'):not([disabled])")
b.assert_pixels(
Expand Down
7 changes: 3 additions & 4 deletions test/check-storage-basic
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,9 @@ class TestStorage(VirtInstallMachineCase, StorageHelpers):

b.wait_not_present("#critical-error-bz-report-modal.pf-v5-c-modal-box")

with self.assertRaises(RuntimeError):
b.eval_js("window.setTimeout(function() {throw new Error('Unexpected storage JS error')}, 0);")
b.wait_in_text("#critical-error-bz-report-modal-details", "Unexpected storage JS error")
b.wait_in_text("#critical-error-bz-report-modal header", "The installer cannot continue due to a critical error: Storage plugin failed")
b.eval_js("window.setTimeout(function() {throw new Error('Unexpected storage JS error')}, 0);")
b.wait_in_text("#critical-error-bz-report-modal-details", "Unexpected storage JS error")
b.wait_in_text("#critical-error-bz-report-modal header", "The installer cannot continue due to a critical error: Storage plugin failed")

@nondestructive
class TestMultipleDisks(VirtInstallMachineCase, StorageHelpers):
Expand Down

0 comments on commit 2f71e52

Please sign in to comment.