2024-04-04 21:01:36 +00:00
|
|
|
import { injectRuffleAndWait, openTest, playAndMonitor } from "../../utils.js";
|
|
|
|
import { expect, use } from "chai";
|
|
|
|
import chaiHtml from "chai-html";
|
|
|
|
import fs from "fs";
|
2020-10-11 18:44:25 +00:00
|
|
|
|
|
|
|
use(chaiHtml);
|
|
|
|
|
|
|
|
describe("Object tag", () => {
|
2021-08-21 14:34:08 +00:00
|
|
|
it("loads the test", async () => {
|
2024-05-27 20:19:52 +00:00
|
|
|
await openTest(browser, `polyfill/object_flashvars`);
|
2020-10-11 18:44:25 +00:00
|
|
|
});
|
|
|
|
|
2021-08-21 14:34:08 +00:00
|
|
|
it("polyfills with ruffle", async () => {
|
2023-05-30 20:24:43 +00:00
|
|
|
await injectRuffleAndWait(browser);
|
2021-08-21 14:34:08 +00:00
|
|
|
const actual = await browser.$("#test-container").getHTML(false);
|
2024-04-04 21:01:36 +00:00
|
|
|
const expected = fs.readFileSync(
|
|
|
|
`${import.meta.dirname}/expected.html`,
|
|
|
|
"utf8",
|
|
|
|
);
|
2020-10-11 18:44:25 +00:00
|
|
|
expect(actual).html.to.equal(expected);
|
|
|
|
});
|
|
|
|
|
2021-08-21 14:34:08 +00:00
|
|
|
it("Plays a movie with flashvars", async () => {
|
2023-05-30 20:24:43 +00:00
|
|
|
await playAndMonitor(
|
2020-10-11 18:44:25 +00:00
|
|
|
browser,
|
2021-08-21 14:34:08 +00:00
|
|
|
await browser.$("#test-container").$("<ruffle-embed />"),
|
2020-10-11 18:44:25 +00:00
|
|
|
`// _level0.a
|
|
|
|
1
|
|
|
|
|
|
|
|
// typeof(a)
|
|
|
|
string
|
|
|
|
|
|
|
|
// _level0.b
|
|
|
|
3 %3
|
|
|
|
|
|
|
|
// typeof(b)
|
|
|
|
string
|
|
|
|
|
|
|
|
// _level0.c
|
|
|
|
|
|
|
|
|
|
|
|
// typeof(c)
|
|
|
|
string
|
|
|
|
|
|
|
|
// _level0.d
|
|
|
|
undefined
|
|
|
|
|
|
|
|
// typeof(d)
|
|
|
|
undefined
|
|
|
|
|
2023-07-20 11:19:39 +00:00
|
|
|
`,
|
2020-10-11 18:44:25 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|