Skip to content

Commit

Permalink
build(deps): bump ws, @wdio/browserstack-service, @wdio/cli, @wdio/lo…
Browse files Browse the repository at this point in the history
…cal-runner and webdriverio

Plus manual changes:
 - Follow getHTML() API change.
 - Take ChainablePromiseElement in utils.ts functions.
 - Make config typeless.
 - Use switchFrame instead of switchToFrame.
  • Loading branch information
torokati44 committed Oct 28, 2024
1 parent 24baf15 commit e0540fd
Show file tree
Hide file tree
Showing 45 changed files with 3,181 additions and 3,834 deletions.
6,733 changes: 2,993 additions & 3,740 deletions web/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"@eslint/js": "^9.13.0",
"@types/eslint__js": "^8.42.3",
"@wdio/browserstack-service": "^9.2.2",
"@wdio/cli": "^8.40.2",
"@wdio/local-runner": "^8.40.2",
"@wdio/cli": "^9.2.2",
"@wdio/local-runner": "^9.2.2",
"@wdio/mocha-framework": "^9.2.2",
"@wdio/spec-reporter": "^9.2.2",
"@wdio/static-server-service": "^9.2.2",
Expand All @@ -38,7 +38,7 @@
"typedoc-plugin-mdn-links": "^3.3.5",
"typescript": "^5.6.3",
"typescript-eslint": "^8.11.0",
"webdriverio": "^8.40.0",
"webdriverio": "^9.2.2",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function supportsClipboardReadText(): Promise<boolean> {
});
}

async function focusFlashInput(player: WebdriverIO.Element) {
async function focusFlashInput(player: ChainablePromiseElement) {
await player.click({ x: 10 - 200, y: 110 - 200 });
expect(await getTraceOutput(browser, player)).to.equal(
"onMouseDown()\nonMouseUp()\n",
Expand All @@ -35,16 +35,16 @@ async function focusHtmlInput() {
});
}

async function openContextMenu(player: WebdriverIO.Element) {
async function openContextMenu(player: ChainablePromiseElement) {
await player.click({ x: 10 - 200, y: 10 - 200, button: "right" });
}

async function openContextMenuOnInput(player: WebdriverIO.Element) {
async function openContextMenuOnInput(player: ChainablePromiseElement) {
await player.click({ x: 10 - 200, y: 110 - 200, button: "right" });
}

async function clickContextMenuEntry(
player: WebdriverIO.Element,
player: ChainablePromiseElement,
text: string,
button: string = "left",
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import chaiHtml from "chai-html";

use(chaiHtml);

async function focusElement(element: WebdriverIO.Element) {
async function focusElement(element: ChainablePromiseElement) {
await browser.execute((element) => {
const el = element as unknown as HTMLElement;
el.focus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ describe("Flash inside frame with injected ruffle", () => {

it("polyfills inside a frame", async () => {
await injectRuffleAndWait(browser);
await browser.switchToFrame(await browser.$("#test-frame"));
await browser.switchFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand All @@ -30,16 +32,18 @@ describe("Flash inside frame with injected ruffle", () => {
});

// Then reload
await browser.switchToFrame(null);
await browser.switchToFrame(await browser.$("#nav-frame"));
await browser.switchFrame(null);
await browser.switchFrame(await browser.$("#nav-frame"));
await browser.$("#reload-link").click();

// And finally, check
await browser.switchToFrame(null);
await browser.switchToFrame(await browser.$("#test-frame"));
await browser.switchFrame(null);
await browser.switchFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ describe("Flash inside frame with provided ruffle", () => {
});

it("polyfills inside a frame", async () => {
await browser.switchToFrame(await browser.$("#test-frame"));
await browser.switchFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand All @@ -29,16 +31,18 @@ describe("Flash inside frame with provided ruffle", () => {
});

// Then reload
await browser.switchToFrame(null);
await browser.switchToFrame(await browser.$("#nav-frame"));
await browser.switchFrame(null);
await browser.switchFrame(await browser.$("#nav-frame"));
await browser.$("#reload-link").click();

// And finally, check
await browser.switchToFrame(null);
await browser.switchToFrame(await browser.$("#test-frame"));
await browser.switchFrame(null);
await browser.switchFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
4 changes: 3 additions & 1 deletion web/packages/selfhosted/test/polyfill/embed_default/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe("Embed tag", () => {

it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ describe("Embed with case-insensitive MIME type", () => {
await injectRuffleAndWait(browser);
await browser.$("<ruffle-embed />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe("Embed inside audio node", () => {

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

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

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

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

it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
4 changes: 3 additions & 1 deletion web/packages/selfhosted/test/polyfill/embed_youtube/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe("Embed with Flash YouTube video", () => {

it("doesn't polyfill with ruffle", async () => {
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
16 changes: 10 additions & 6 deletions web/packages/selfhosted/test/polyfill/iframes_injected/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ describe("Flash inside iframe with injected ruffle", () => {

it("polyfills inside an iframe", async () => {
await injectRuffleAndWait(browser);
await browser.switchToFrame(await browser.$("#test-frame"));
await browser.switchFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand All @@ -30,15 +32,17 @@ describe("Flash inside iframe with injected ruffle", () => {
});

// Then reload
await browser.switchToFrame(null);
await browser.switchFrame(null);
await browser.$("#reload-link").click();

// And finally, check
await browser.switchToFrame(null);
await browser.switchToFrame(await browser.$("#test-frame"));
await browser.switchFrame(null);
await browser.switchFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
4 changes: 3 additions & 1 deletion web/packages/selfhosted/test/polyfill/iframes_onload/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ describe("iframe onload", () => {
await injectRuffleAndWait(browser);
await browser.$("<div />").waitForExist();

const actual = await browser.$("#container").getHTML(false);
const actual = await browser
.$("#container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
16 changes: 10 additions & 6 deletions web/packages/selfhosted/test/polyfill/iframes_provided/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ describe("Flash inside iframe with provided ruffle", () => {
});

it("polyfills inside an iframe", async () => {
await browser.switchToFrame(await browser.$("#test-frame"));
await browser.switchFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand All @@ -29,15 +31,17 @@ describe("Flash inside iframe with provided ruffle", () => {
});

// Then reload
await browser.switchToFrame(null);
await browser.switchFrame(null);
await browser.$("#reload-link").click();

// And finally, check
await browser.switchToFrame(null);
await browser.switchToFrame(await browser.$("#test-frame"));
await browser.switchFrame(null);
await browser.switchFrame(await browser.$("#test-frame"));
await browser.$("<ruffle-object />").waitForExist();

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

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

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe("Object with clsid and embed", () => {

it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
4 changes: 3 additions & 1 deletion web/packages/selfhosted/test/polyfill/object_data/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ describe("Object with only data attribute", () => {
await injectRuffleAndWait(browser);
await browser.$("<ruffle-object />").waitForExist();

const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
4 changes: 3 additions & 1 deletion web/packages/selfhosted/test/polyfill/object_default/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe("Object tag", () => {

it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe("Object with another object tag", () => {

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

it("polyfills only the second tag with ruffle", async () => {
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe("Object tag", () => {

it("polyfills with ruffle", async () => {
await injectRuffleAndWait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const actual = await browser
.$("#test-container")
.getHTML({ includeSelectorTag: false, pierceShadowRoot: false });
const expected = fs.readFileSync(
`${import.meta.dirname}/expected.html`,
"utf8",
Expand Down
Loading

0 comments on commit e0540fd

Please sign in to comment.