Execute tests within browser page context

This commit is contained in:
hensm
2019-01-11 13:47:19 +00:00
parent ab82229228
commit 242142313b
18 changed files with 7945 additions and 272 deletions

View File

@@ -1,40 +1,17 @@
"use strict";
const { create } = require("../../../driver");
describe("chrome.cast.DialRequest", () => {
let driver;
beforeAll(async () => {
driver = await create();
});
afterAll(() => {
driver.quit();
})
it("should have all properties", async () => {
const [ typeof_appName
, dialRequest ] = await driver.executeScript(() => {
const dialRequest = new chrome.cast.DialRequest();
const dialRequest = new chrome.cast.DialRequest();
return [
typeof dialRequest.appName
, dialRequest
];
});
expect(typeof_appName).toBe("undefined");
expect(typeof dialRequest.appName).toBe("undefined");
expect(dialRequest.launchParameter).toBe(null);
});
it("should have expected assigned properties", async () => {
const dialRequest = await driver.executeScript(() => {
return new chrome.cast.DialRequest(
"testAppName"
, "testLaunchParameter");
});
const dialRequest = new chrome.cast.DialRequest(
"testAppName"
, "testLaunchParameter");
expect(dialRequest.appName).toBe("testAppName");
expect(dialRequest.launchParameter).toBe("testLaunchParameter");