mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 17:36:15 -08:00
21 lines
486 B
TypeScript
21 lines
486 B
TypeScript
import type { Locator } from '@playwright/test';
|
|
import { expect } from './fixtures';
|
|
|
|
export async function setInputValue(
|
|
input: Locator,
|
|
value: string
|
|
): Promise<void> {
|
|
await input.fill('');
|
|
await input.fill(value);
|
|
|
|
if ((await input.inputValue()) === value) {
|
|
return;
|
|
}
|
|
|
|
await input.click();
|
|
await input.press('ControlOrMeta+A');
|
|
await input.press('Backspace');
|
|
await input.type(value);
|
|
await expect(input).toHaveValue(value);
|
|
}
|