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,39 +1,16 @@
"use strict";
const { create } = require("../../../driver");
describe("chrome.cast.Image", () => {
let driver;
beforeAll(async () => {
driver = await create();
});
afterAll(() => {
driver.quit();
})
it("should have all properties", async () => {
const [ typeof_url
, image ] = await driver.executeScript(() => {
const image = new chrome.cast.Image();
const image = new chrome.cast.Image();
return [
typeof image.url
, image
];
});
expect(typeof_url).toBe("undefined");
expect(typeof image.url).toBe("undefined");
expect(image.height).toBe(null);
expect(image.width).toBe(null);
});
it("should have expected assigned properties", async () => {
const image = await driver.executeScript(() => {
return new chrome.cast.Image("http://example.com");
});
const image = new chrome.cast.Image("http://example.com");
expect(image.url).toBe("http://example.com");
});