-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathbase.typing.spec.ts
More file actions
34 lines (25 loc) · 947 Bytes
/
Copy pathbase.typing.spec.ts
File metadata and controls
34 lines (25 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { test, expect } from '@playwright/test'
import { modifier } from './util/modifier'
test.beforeEach(async ({ page }) => {
await page.goto('/base')
})
test.describe('Base tests - Typing', () => {
test('should start as empty value', async ({ page }) => {
const input = page.getByRole('textbox')
await expect(input).toHaveValue('')
})
test('should change the input value', async ({ page }) => {
const input = page.getByRole('textbox')
await input.pressSequentially('1')
await expect(input).toHaveValue('1')
await input.pressSequentially('23456')
await expect(input).toHaveValue('123456')
})
test('should prevent typing greater than max length', async ({ page }) => {
const input = page.getByRole('textbox')
await input.pressSequentially('123456')
await expect(input).toHaveValue('123456')
await input.pressSequentially('7')
await expect(input).toHaveValue('123457')
})
})