build(deps): bump ws, @wdio/browserstack-service, @wdio/cli, @wdio/local-runner and webdriverio

Plus manual changes:
 - Follow getHTML() API change.
 - Take ChainablePromiseElement in utils.ts functions.
 - Make config typeless.
 - Make element selector valid for BiDi.

Bumps [ws](https://github.com/websockets/ws) to 8.18.0 and updates ancestor dependencies [ws](https://github.com/websockets/ws), [@wdio/browserstack-service](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/wdio-browserstack-service), [@wdio/cli](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/wdio-cli), [@wdio/local-runner](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/wdio-local-runner) and [webdriverio](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/webdriverio). These dependencies need to be updated together.

Updates `ws` from 8.16.0 to 8.18.0
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.16.0...8.18.0)

Updates `@wdio/browserstack-service` from 8.40.2 to 9.0.2
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/commits/v9.0.2/packages/wdio-browserstack-service)

Updates `@wdio/cli` from 8.40.2 to 9.0.1
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/commits/v9.0.1/packages/wdio-cli)

Updates `@wdio/local-runner` from 8.40.2 to 9.0.1
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/commits/v9.0.1/packages/wdio-local-runner)

Updates `webdriverio` from 8.40.2 to 9.0.1
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/commits/v9.0.1/packages/webdriverio)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
- dependency-name: "@wdio/browserstack-service"
  dependency-type: direct:development
- dependency-name: "@wdio/cli"
  dependency-type: direct:development
- dependency-name: "@wdio/local-runner"
  dependency-type: direct:development
- dependency-name: webdriverio
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

make wdio config typeless
This commit is contained in:
TÖRÖK Attila 2024-08-20 17:39:21 +02:00
parent 90adab7015
commit a1d02783aa
45 changed files with 942 additions and 1618 deletions

2321
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,8 @@
"@eslint/js": "^9.10.0", "@eslint/js": "^9.10.0",
"@types/eslint__js": "^8.42.3", "@types/eslint__js": "^8.42.3",
"@wdio/browserstack-service": "^9.0.9", "@wdio/browserstack-service": "^9.0.9",
"@wdio/cli": "^8.40.2", "@wdio/cli": "^9.0.9",
"@wdio/local-runner": "^8.40.2", "@wdio/local-runner": "^9.0.9",
"@wdio/mocha-framework": "^9.0.8", "@wdio/mocha-framework": "^9.0.8",
"@wdio/spec-reporter": "^9.0.8", "@wdio/spec-reporter": "^9.0.8",
"@wdio/static-server-service": "^9.0.8", "@wdio/static-server-service": "^9.0.8",
@ -37,7 +37,7 @@
"tsx": "^4.19.1", "tsx": "^4.19.1",
"typescript": "^5.6.2", "typescript": "^5.6.2",
"typescript-eslint": "^8.6.0", "typescript-eslint": "^8.6.0",
"webdriverio": "^8.40.0", "webdriverio": "^9.0.9",
"webpack": "^5.94.0", "webpack": "^5.94.0",
"webpack-cli": "^5.1.4" "webpack-cli": "^5.1.4"
}, },

View File

@ -9,7 +9,7 @@ describe("Key up and down events work", () => {
loadJsAPI("/test/integration_tests/keyboard_input/test.swf"); loadJsAPI("/test/integration_tests/keyboard_input/test.swf");
it("'a' key is recognised", async () => { it("'a' key is recognised", async () => {
const player = await browser.$("<ruffle-player>"); const player = await browser.$("ruffle-player");
await player.click(); await player.click();
// Extra safety click in case there's a modal // Extra safety click in case there's a modal
await player.click(); await player.click();
@ -30,7 +30,7 @@ event.keyCode = 65
}); });
it("enter key is recognised", async () => { it("enter key is recognised", async () => {
const player = await browser.$("<ruffle-player>"); const player = await browser.$("ruffle-player");
await player.click(); await player.click();
await browser.keys([Key.Enter]); await browser.keys([Key.Enter]);

View File

@ -9,7 +9,7 @@ describe("RufflePlayer.load", () => {
loadJsAPI(); loadJsAPI();
it("loads and plays a URL", async () => { it("loads and plays a URL", async () => {
const player = await browser.$("<ruffle-player>"); const player = await browser.$("ruffle-player");
await browser.execute(async (playerElement) => { await browser.execute(async (playerElement) => {
// https://github.com/webdriverio/webdriverio/issues/6486 // https://github.com/webdriverio/webdriverio/issues/6486
const player = playerElement as unknown as Player; const player = playerElement as unknown as Player;

View File

@ -9,7 +9,7 @@ describe("RufflePlayer.metadata", () => {
loadJsAPI("/test_assets/example.swf"); loadJsAPI("/test_assets/example.swf");
it("has metadata after load", async () => { it("has metadata after load", async () => {
const player = await browser.$("<ruffle-player>"); const player = await browser.$("ruffle-player");
const metadata = await browser.execute( const metadata = await browser.execute(
// https://github.com/webdriverio/webdriverio/issues/6486 // https://github.com/webdriverio/webdriverio/issues/6486
(player) => (player as unknown as Player).metadata, (player) => (player as unknown as Player).metadata,

View File

@ -15,7 +15,9 @@ describe("Flash inside frame with injected ruffle", () => {
await browser.switchToFrame(await browser.$("#test-frame")); await browser.switchToFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",
@ -39,7 +41,9 @@ describe("Flash inside frame with injected ruffle", () => {
await browser.switchToFrame(await browser.$("#test-frame")); await browser.switchToFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("Flash inside frame with provided ruffle", () => {
await browser.switchToFrame(await browser.$("#test-frame")); await browser.switchToFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",
@ -38,7 +40,9 @@ describe("Flash inside frame with provided ruffle", () => {
await browser.switchToFrame(await browser.$("#test-frame")); await browser.switchToFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Embed tag", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("Embed with case-insensitive MIME type", () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
await browser.$("<ruffle-embed />").waitForExist(); await browser.$("<ruffle-embed />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Embed inside audio node", () => {
it("doesn't polyfill with ruffle", async () => { it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Embed without src attribute", () => {
it("doesn't polyfill with ruffle", async () => { it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Embed without type attribute", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Embed with unexpected string", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Embed with wrong type attribute value", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Embed with Flash YouTube video", () => {
it("doesn't polyfill with ruffle", async () => { it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -15,7 +15,9 @@ describe("Flash inside iframe with injected ruffle", () => {
await browser.switchToFrame(await browser.$("#test-frame")); await browser.switchToFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",
@ -38,7 +40,9 @@ describe("Flash inside iframe with injected ruffle", () => {
await browser.switchToFrame(await browser.$("#test-frame")); await browser.switchToFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("iframe onload", () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
await browser.$("<div />").waitForExist(); await browser.$("<div />").waitForExist();
const actual = await browser.$("#container").getHTML(false); const actual = await browser
.$("#container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("Flash inside iframe with provided ruffle", () => {
await browser.switchToFrame(await browser.$("#test-frame")); await browser.switchToFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",
@ -37,7 +39,9 @@ describe("Flash inside iframe with provided ruffle", () => {
await browser.switchToFrame(await browser.$("#test-frame")); await browser.switchToFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("Object with case-insensitive MIME type", () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("Object with case-insensitive clsid", () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object with clsid and embed", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("Object with only data attribute", () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object tag", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object with another object tag", () => {
it("polyfills only the first tag with ruffle", async () => { it("polyfills only the first tag with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object using classid with another object tag without classid", () => {
it("polyfills only the second tag with ruffle", async () => { it("polyfills only the second tag with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object tag", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object tag", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object for old IE must work everywhere", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object inside audio node", () => {
it("doesn't polyfill with ruffle", async () => { it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object without data attribute", () => {
it("doesn't polyfill with ruffle", async () => { it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object without type attribute", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object without type and classid attributes", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object with unexpected string", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object with ruffle-embed tag", () => {
it("already polyfilled with ruffle", async () => { it("already polyfilled with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object with wrong type attribute value", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Object with Flash YouTube video", () => {
it("doesn't polyfill with ruffle", async () => { it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("PDF object", () => {
it("doesn't polyfill with ruffle", async () => { it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("PDF with .swf GET", () => {
it("doesn't polyfill with ruffle", async () => { it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -12,7 +12,9 @@ describe("Remove object", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",
@ -25,7 +27,9 @@ describe("Remove object", () => {
const obj = document.getElementById("foo"); const obj = document.getElementById("foo");
obj?.remove(); obj?.remove();
}); });
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = ""; const expected = "";
expect(actual).html.to.equal(expected); expect(actual).html.to.equal(expected);
}); });

View File

@ -12,7 +12,9 @@ describe("SPL", () => {
it("polyfills with ruffle", async () => { it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("SWF extension insensitive", () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("SWF extension, file with fragment", () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -14,7 +14,9 @@ describe("SWF extension, file with GET parameter", () => {
await injectRuffleAndWait(browser); await injectRuffleAndWait(browser);
await browser.$("<ruffle-object />").waitForExist(); await browser.$("<ruffle-object />").waitForExist();
const actual = await browser.$("#test-container").getHTML(false); const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false });
const expected = fs.readFileSync( const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`, `${import.meta.dirname}/expected.html`,
"utf8", "utf8",

View File

@ -24,7 +24,7 @@ export async function isRuffleLoaded(browser: WebdriverIO.Browser) {
export async function isRufflePlayerLoaded( export async function isRufflePlayerLoaded(
browser: WebdriverIO.Browser, browser: WebdriverIO.Browser,
player: WebdriverIO.Element, player: ChainablePromiseElement,
) { ) {
return ( return (
(await browser.execute( (await browser.execute(
@ -32,7 +32,7 @@ export async function isRufflePlayerLoaded(
// https://github.com/webdriverio/webdriverio/issues/6486 // https://github.com/webdriverio/webdriverio/issues/6486
// TODO: How can we import ReadyState enum? // TODO: How can we import ReadyState enum?
(player as unknown as Player).readyState, (player as unknown as Player).readyState,
player, await player,
)) === 2 )) === 2
); );
} }
@ -86,12 +86,12 @@ export async function injectRuffle(browser: WebdriverIO.Browser) {
export async function playAndMonitor( export async function playAndMonitor(
browser: WebdriverIO.Browser, browser: WebdriverIO.Browser,
player: WebdriverIO.Element, player: ChainablePromiseElement,
expectedOutput: string = "Hello from Flash!\n", expectedOutput: string = "Hello from Flash!\n",
) { ) {
await throwIfError(browser); await throwIfError(browser);
await waitForPlayerToLoad(browser, player); await waitForPlayerToLoad(browser, await player);
await setupAndPlay(browser, player); await setupAndPlay(browser, await player);
const actualOutput = await getTraceOutput(browser, player); const actualOutput = await getTraceOutput(browser, player);
expect(actualOutput).to.eql(expectedOutput); expect(actualOutput).to.eql(expectedOutput);
@ -99,31 +99,37 @@ export async function playAndMonitor(
export async function setupAndPlay( export async function setupAndPlay(
browser: WebdriverIO.Browser, browser: WebdriverIO.Browser,
player: WebdriverIO.Element, player: ChainablePromiseElement,
) { ) {
await browser.execute((playerElement) => { await browser.execute(
// https://github.com/webdriverio/webdriverio/issues/6486 (playerElement) => {
const player = playerElement as unknown as Player; // https://github.com/webdriverio/webdriverio/issues/6486
player.__ruffle_log__ = ""; const player = playerElement as unknown as Player;
player.traceObserver = (msg) => { player.__ruffle_log__ = "";
player.__ruffle_log__ += msg + "\n"; player.traceObserver = (msg) => {
}; player.__ruffle_log__ += msg + "\n";
player.play(); };
}, player); player.play();
},
await player,
);
} }
export async function getTraceOutput( export async function getTraceOutput(
browser: WebdriverIO.Browser, browser: WebdriverIO.Browser,
player: WebdriverIO.Element, player: ChainablePromiseElement,
) { ) {
// Await any trace output // Await any trace output
await browser.waitUntil( await browser.waitUntil(
async () => { async () => {
return ( return (
(await browser.execute((player) => { (await browser.execute(
// https://github.com/webdriverio/webdriverio/issues/6486 (player) => {
return (player as unknown as Player).__ruffle_log__; // https://github.com/webdriverio/webdriverio/issues/6486
}, player)) !== "" return (player as unknown as Player).__ruffle_log__;
},
await player,
)) !== ""
); );
}, },
{ {
@ -148,7 +154,7 @@ export async function injectRuffleAndWait(browser: WebdriverIO.Browser) {
export async function waitForPlayerToLoad( export async function waitForPlayerToLoad(
browser: WebdriverIO.Browser, browser: WebdriverIO.Browser,
player: WebdriverIO.Element, player: ChainablePromiseElement,
) { ) {
await browser.waitUntil( await browser.waitUntil(
async () => await isRufflePlayerLoaded(browser, player), async () => await isRufflePlayerLoaded(browser, player),

View File

@ -1,4 +1,4 @@
import type { Options, Services } from "@wdio/types"; import type { Services } from "@wdio/types";
import { BrowserStackCapabilities } from "@wdio/types/build/Capabilities"; import { BrowserStackCapabilities } from "@wdio/types/build/Capabilities";
const capabilities: WebdriverIO.Capabilities[] = []; const capabilities: WebdriverIO.Capabilities[] = [];
@ -204,8 +204,7 @@ declare global {
} }
} }
// @ts-expect-error TS2375 Undefined is the same as not specified here export const config = {
export const config: Options.Testrunner = {
user, user,
key, key,
runner: "local", runner: "local",