mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 18:19:58 +00:00
Execute tests within browser page context
This commit is contained in:
@@ -1,42 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
const { create } = require("../../../driver");
|
||||
|
||||
describe("chrome.cast.Error", () => {
|
||||
let driver;
|
||||
|
||||
beforeAll(async () => {
|
||||
driver = await create();
|
||||
});
|
||||
afterAll(() => {
|
||||
driver.quit();
|
||||
})
|
||||
|
||||
|
||||
it("should have all properties", async () => {
|
||||
const [ typeof_code
|
||||
, error ] = await driver.executeScript(() => {
|
||||
const error = new chrome.cast.Error();
|
||||
|
||||
const error = new chrome.cast.Error();
|
||||
|
||||
return [
|
||||
typeof error.code
|
||||
, error
|
||||
];
|
||||
});
|
||||
|
||||
expect(typeof_code).toBe("undefined");
|
||||
expect(typeof error.code).toBe("undefined");
|
||||
expect(error.description).toBe(null);
|
||||
expect(error.details).toBe(null);
|
||||
});
|
||||
|
||||
it("should have expected assigned properties", async () => {
|
||||
const error = await driver.executeScript(() => {
|
||||
return new chrome.cast.Error(
|
||||
chrome.cast.ErrorCode.CANCEL
|
||||
, "testErrorDescription"
|
||||
, { testErrorDetails: "testErrorDetails" });
|
||||
});
|
||||
const error = new chrome.cast.Error(
|
||||
chrome.cast.ErrorCode.CANCEL
|
||||
, "testErrorDescription"
|
||||
, { testErrorDetails: "testErrorDetails" });
|
||||
|
||||
expect(error.code).toBe("cancel");
|
||||
expect(error.description).toBe("testErrorDescription");
|
||||
|
||||
Reference in New Issue
Block a user