playwright-fluent
Version:
Fluent API around playwright
30 lines (29 loc) • 1.07 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const utils_1 = require("../../../utils");
const SUT = tslib_1.__importStar(require("../../playwright-fluent"));
describe('Playwright Fluent - recordDownloadsTo(directory)', () => {
let p;
beforeEach(() => {
p = new SUT.PlaywrightFluent();
});
afterEach(async () => {
await p.close();
});
test('should return an error when browser has not been launched', async () => {
// Given
// When
let result = undefined;
try {
// eslint-disable-next-line no-console
console.log(`User downloads directory : '${utils_1.userDownloadsDirectory}'`);
await p.recordDownloadsTo(utils_1.userDownloadsDirectory);
}
catch (error) {
result = error;
}
// Then
expect(result && result.message).toContain(`Cannot record downloads to '${utils_1.userDownloadsDirectory}' because no browser has been launched`);
});
});
;