-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {DemoPage} from './app.po'; | ||
import {expect, Locator, Page, test} from '@playwright/test'; | ||
|
||
test.describe('format validation', () => { | ||
let po: DemoPage; | ||
let page: Page; | ||
|
||
test.beforeAll(async ({browser}) => { | ||
page = await browser.newPage(); | ||
}); | ||
|
||
test.beforeEach(async () => { | ||
po = new DemoPage(page); | ||
await po.navigateTo(); | ||
}); | ||
|
||
test('should check that the format validation is working', async () => { | ||
const common = async (menu: Locator, input: Locator) => { | ||
await menu.click(); | ||
await input.click(); | ||
await input.clear(); | ||
await po.setText(input, 'lmaldlad'); | ||
await po.clickOnBody(); | ||
|
||
expect(await po.formatValidationMsg().textContent()).toBe('invalid format'); | ||
await input.clear(); | ||
}; | ||
|
||
await common(po.daytimePickerMenu(), po.daytimePickerInput()); | ||
await common(po.daytimeDirectiveMenu(), po.daytimeDirectiveInput()); | ||
await common(po.dayPickerMenu(), po.dayPickerInput()); | ||
await common(po.dayDirectiveMenu(), po.dayDirectiveInput()); | ||
await common(po.monthPickerMenu(), po.monthPickerInput()); | ||
await common(po.monthDirectiveMenu(), po.monthDirectiveInput()); | ||
await common(po.timePickerMenu(), po.timePickerInput()); | ||
await common(po.timeDirectiveMenu(), po.timeSelectDirectiveInput()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {DemoPage} from './app.po'; | ||
import {expect, Locator, Page, test} from '@playwright/test'; | ||
|
||
test.describe('hideInputContainer', () => { | ||
let po: DemoPage; | ||
let page: Page; | ||
|
||
test.beforeAll(async ({browser}) => { | ||
page = await browser.newPage(); | ||
}); | ||
|
||
test.beforeEach(async () => { | ||
po = new DemoPage(page); | ||
await po.navigateTo(); | ||
}); | ||
|
||
test('should hide/show InputContainer datetimepicker', async () => { | ||
await expect(po.daytimePickerInput()).toBeVisible(); | ||
await po.hideInputRadio().click(); | ||
await expect(po.daytimePickerInput()).toBeHidden(); | ||
}); | ||
}); |