2020-09-05 23:39:17 +00:00
|
|
|
const {
|
2023-05-30 20:24:43 +00:00
|
|
|
injectRuffleAndWait,
|
|
|
|
openTest,
|
|
|
|
playAndMonitor,
|
2021-04-21 23:48:50 +00:00
|
|
|
} = require("../../utils");
|
2020-05-23 09:43:22 +00:00
|
|
|
const { expect, use } = require("chai");
|
|
|
|
const chaiHtml = require("chai-html");
|
|
|
|
const fs = require("fs");
|
|
|
|
|
|
|
|
use(chaiHtml);
|
|
|
|
|
2020-09-05 18:36:44 +00:00
|
|
|
describe("Embed tag", () => {
|
2021-08-21 14:34:08 +00:00
|
|
|
it("loads the test", async () => {
|
2023-05-30 20:24:43 +00:00
|
|
|
await openTest(browser, __dirname);
|
2020-05-23 09:43:22 +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);
|
2020-05-23 09:43:22 +00:00
|
|
|
const expected = fs.readFileSync(`${__dirname}/expected.html`, "utf8");
|
|
|
|
expect(actual).html.to.equal(expected);
|
|
|
|
});
|
2020-09-05 23:39:17 +00:00
|
|
|
|
2021-08-21 14:34:08 +00:00
|
|
|
it("Plays a movie", async () => {
|
2023-05-30 20:24:43 +00:00
|
|
|
await playAndMonitor(
|
2020-09-05 23:39:17 +00:00
|
|
|
browser,
|
2023-07-20 11:19:39 +00:00
|
|
|
await browser.$("#test-container").$("<ruffle-embed />"),
|
2020-09-05 23:39:17 +00:00
|
|
|
);
|
|
|
|
});
|
2020-05-23 09:43:22 +00:00
|
|
|
});
|