From 42cd60b84728439efd15003b9595532e5a413c2a Mon Sep 17 00:00:00 2001 From: Sri Harsha Date: Fri, 1 Nov 2024 23:17:48 +0530 Subject: [PATCH] fix(ci): add missing awaits for driver.quit --- examples/javascript/package-lock.json | 19 +++++++++++-------- examples/javascript/package.json | 2 +- .../test/actionsApi/actionsTest.spec.js | 2 +- .../test/actionsApi/keysTest.spec.js | 2 +- .../actionsApi/mouse/clickAndHold.spec.js | 2 +- .../actionsApi/mouse/clickAndRelease.spec.js | 2 +- .../actionsApi/wheel/scrollByAmount.spec.js | 2 +- .../wheel/wheelScrollToElement.spec.js | 2 +- .../test/elements/fileUpload.spec.js | 2 +- .../virtualAuthenticator.spec.js | 4 ++-- 10 files changed, 21 insertions(+), 18 deletions(-) diff --git a/examples/javascript/package-lock.json b/examples/javascript/package-lock.json index 972cb351bdb7..19e819966834 100644 --- a/examples/javascript/package-lock.json +++ b/examples/javascript/package-lock.json @@ -13,13 +13,14 @@ "selenium-webdriver": "4.26.0" }, "devDependencies": { - "mocha": "10.7.3" + "mocha": "10.8.2" } }, "node_modules/@bazel/runfiles": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/@bazel/runfiles/-/runfiles-6.3.1.tgz", - "integrity": "sha512-1uLNT5NZsUVIGS4syuHwTzZ8HycMPyr6POA3FCE4GbMtc4rhoJk8aZKtNIRthJYfL+iioppi+rTfH3olMPr9nA==" + "integrity": "sha512-1uLNT5NZsUVIGS4syuHwTzZ8HycMPyr6POA3FCE4GbMtc4rhoJk8aZKtNIRthJYfL+iioppi+rTfH3olMPr9nA==", + "license": "Apache-2.0" }, "node_modules/ansi-colors": { "version": "4.1.3", @@ -808,10 +809,11 @@ } }, "node_modules/mocha": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", - "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, + "license": "MIT", "dependencies": { "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", @@ -1026,6 +1028,7 @@ "version": "4.26.0", "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.26.0.tgz", "integrity": "sha512-nA7jMRIPV17mJmAiTDBWN96Sy0Uxrz5CCLb7bLVV6PpL417SyBMPc2Zo/uoREc2EOHlzHwHwAlFtgmSngSY4WQ==", + "license": "Apache-2.0", "dependencies": { "@bazel/runfiles": "^6.3.1", "jszip": "^3.10.1", @@ -1851,9 +1854,9 @@ } }, "mocha": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", - "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, "requires": { "ansi-colors": "^4.1.3", diff --git a/examples/javascript/package.json b/examples/javascript/package.json index 625eb1b5f5f0..e99f6226ce59 100644 --- a/examples/javascript/package.json +++ b/examples/javascript/package.json @@ -11,6 +11,6 @@ "selenium-webdriver": "4.26.0" }, "devDependencies": { - "mocha": "10.7.3" + "mocha": "10.8.2" } } diff --git a/examples/javascript/test/actionsApi/actionsTest.spec.js b/examples/javascript/test/actionsApi/actionsTest.spec.js index 31ec38018364..b67cb668914a 100644 --- a/examples/javascript/test/actionsApi/actionsTest.spec.js +++ b/examples/javascript/test/actionsApi/actionsTest.spec.js @@ -8,7 +8,7 @@ describe('Actions API - Pause and Release All Actions', function() { driver = await new Builder().forBrowser('chrome').build(); }) - after(() => driver.quit()) + after(async () => await driver.quit()) it('Pause', async function() { await driver.get('https://selenium.dev/selenium/web/mouse_interaction.html') diff --git a/examples/javascript/test/actionsApi/keysTest.spec.js b/examples/javascript/test/actionsApi/keysTest.spec.js index 830d7f1ece72..30682b9065ea 100644 --- a/examples/javascript/test/actionsApi/keysTest.spec.js +++ b/examples/javascript/test/actionsApi/keysTest.spec.js @@ -9,7 +9,7 @@ describe('Keyboard Action - Keys test', function() { driver = await new Builder().forBrowser('chrome').build(); }) - after(() => driver.quit()) + after(async () => await driver.quit()) it('KeyDown', async function() { await driver.get('https://www.selenium.dev/selenium/web/single_text_input.html') diff --git a/examples/javascript/test/actionsApi/mouse/clickAndHold.spec.js b/examples/javascript/test/actionsApi/mouse/clickAndHold.spec.js index 8d28f54ae42e..2e6dbf286afa 100644 --- a/examples/javascript/test/actionsApi/mouse/clickAndHold.spec.js +++ b/examples/javascript/test/actionsApi/mouse/clickAndHold.spec.js @@ -7,7 +7,7 @@ describe('Click and hold', function () { driver = new Builder().forBrowser('chrome').build(); }); - after(() => driver.quit()); + after(async () => await driver.quit()); it('Mouse move and mouseDown on an element', async function () { await driver.get('https://www.selenium.dev/selenium/web/mouse_interaction.html'); diff --git a/examples/javascript/test/actionsApi/mouse/clickAndRelease.spec.js b/examples/javascript/test/actionsApi/mouse/clickAndRelease.spec.js index 268804b59d8d..97e2b2ceb5cc 100644 --- a/examples/javascript/test/actionsApi/mouse/clickAndRelease.spec.js +++ b/examples/javascript/test/actionsApi/mouse/clickAndRelease.spec.js @@ -7,7 +7,7 @@ describe('Click and release', function () { driver = new Builder().forBrowser('chrome').build(); }); - after(() => driver.quit()); + after(async () => await driver.quit()); it('Mouse move and click on an element', async function () { await driver.get('https://www.selenium.dev/selenium/web/mouse_interaction.html'); diff --git a/examples/javascript/test/actionsApi/wheel/scrollByAmount.spec.js b/examples/javascript/test/actionsApi/wheel/scrollByAmount.spec.js index c3b3b3adf795..8bcb307fe475 100644 --- a/examples/javascript/test/actionsApi/wheel/scrollByAmount.spec.js +++ b/examples/javascript/test/actionsApi/wheel/scrollByAmount.spec.js @@ -7,7 +7,7 @@ describe('Scroll by given amount from element', function() { driver = await new Builder().forBrowser('chrome').build(); }); - after(() => driver.quit()); + after(async() => await driver.quit()); it('Scroll to element by 300', async function() { await driver.manage().window().setRect({ width: 500, height: 400 }); diff --git a/examples/javascript/test/actionsApi/wheel/wheelScrollToElement.spec.js b/examples/javascript/test/actionsApi/wheel/wheelScrollToElement.spec.js index 1057bb8413a3..4341d237359a 100644 --- a/examples/javascript/test/actionsApi/wheel/wheelScrollToElement.spec.js +++ b/examples/javascript/test/actionsApi/wheel/wheelScrollToElement.spec.js @@ -7,7 +7,7 @@ describe('Wheel scroll to element', function() { driver = await new Builder().forBrowser('chrome').build(); }); - after(() => driver.quit()); + after(async () => await driver.quit()); it('Scroll to the element', async function() { // Navigate to the url diff --git a/examples/javascript/test/elements/fileUpload.spec.js b/examples/javascript/test/elements/fileUpload.spec.js index 0992daa91aed..feb7d0402cfb 100644 --- a/examples/javascript/test/elements/fileUpload.spec.js +++ b/examples/javascript/test/elements/fileUpload.spec.js @@ -13,7 +13,7 @@ describe('File Upload Test', function() { .build(); }); - after(() => driver.quit()); + after(async() => await driver.quit()); it('Should be able to upload a file successfully', async function() { const image = path.resolve('./test/resources/selenium-snapshot.png') diff --git a/examples/javascript/test/virtual_authenticator/virtualAuthenticator.spec.js b/examples/javascript/test/virtual_authenticator/virtualAuthenticator.spec.js index ec787ffd6605..7e6b5ea13340 100644 --- a/examples/javascript/test/virtual_authenticator/virtualAuthenticator.spec.js +++ b/examples/javascript/test/virtual_authenticator/virtualAuthenticator.spec.js @@ -39,7 +39,7 @@ describe('Virtual authenticator', function() { driver = await new Builder().forBrowser('chrome').build(); }); - after(() => driver.quit()); + after(async() => await driver.quit()); function arraysEqual(array1, array2) { return (array1.length === array2.length && @@ -187,7 +187,7 @@ describe('Virtual authenticator', function() { 0); await driver.addCredential(nonResidentCredential); - driver.removeAllCredentials(); + await driver.removeAllCredentials(); let credentialList = await driver.getCredentials(); assert.equal(0, credentialList.length);