playwright-fluent
Version:
Fluent API around playwright
41 lines (40 loc) • 1.42 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const SUT = tslib_1.__importStar(require("../../playwright-fluent"));
describe('Playwright Fluent - expect is visible', () => {
let p;
beforeEach(() => {
p = new SUT.PlaywrightFluent();
});
afterEach(async () => {
await p.close();
});
test('should give back an error on expectThat.isVisible when browser has not been launched', async () => {
// Given
// When
let result = undefined;
try {
await p.expectThatSelector('foobar').isVisible();
}
catch (error) {
result = error;
}
// Then
expect(result && result.message).toContain("Cannot get visibility status of 'foobar' because no browser has been launched");
});
test('should give back an error on expectThat(selector-fluent).isVisible when browser has not been launched', async () => {
// Given
const selector = p.selector('foobar');
// When
let result = undefined;
try {
await p.expectThatSelector(selector).isVisible();
}
catch (error) {
result = error;
}
// Then
expect(result && result.message).toContain("Cannot get visibility status of 'selector(foobar)' because no browser has been launched");
});
});
;