playwright-fluent
Version:
Fluent API around playwright
35 lines (34 loc) • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path = tslib_1.__importStar(require("path"));
const SUT = tslib_1.__importStar(require("../../playwright-fluent"));
describe('Playwright Fluent - hold and release key', () => {
let p;
beforeEach(() => {
p = new SUT.PlaywrightFluent();
});
afterEach(async () => {
await p.close();
});
test('should hold and release SHIFT key - chromium', async () => {
// Given
const url = `file:${path.join(__dirname, 'hold-down-and-release-key.test.html')}`;
const selector = '#emptyInput';
// When
await p
.withBrowser('chromium')
.withOptions({ headless: false })
.withCursor()
.navigateTo(url)
.click(selector)
.holdDownKey('Shift')
.pressKey('KeyA')
.pressKey('KeyB')
.releaseKey('Shift')
.pressKey('KeyA');
// Then
const currentValue = await p.getValueOf(selector);
expect(currentValue).toBe('ABa');
});
});