-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Budget more time for playwright tests & disable retries (#607)
- Loading branch information
1 parent
cdc2312
commit 0e0cb95
Showing
2 changed files
with
35 additions
and
31 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 |
---|---|---|
@@ -1,35 +1,39 @@ | ||
import {test, expect, Page} from '@playwright/test'; | ||
|
||
test('web components - slot', async ({page}) => { | ||
await page.goto('http://localhost:32123/web_component/slot/slot_app'); | ||
// Make sure the page has loaded: | ||
expect(page.getByRole('button', {name: 'Decrement'})).toBeVisible(); | ||
test.describe(() => { | ||
// All tests in this describe group will get 2 retry attempts. | ||
test.describe.configure({retries: 2}); | ||
test('web components - slot', async ({page}) => { | ||
await page.goto('http://localhost:32123/web_component/slot/slot_app'); | ||
// Make sure the page has loaded: | ||
expect(page.getByRole('button', {name: 'Decrement'})).toBeVisible(); | ||
|
||
assertValue(10); | ||
await page.getByRole('button', {name: 'increment'}).click(); | ||
assertValue(11); | ||
await page.getByRole('button', {name: 'increment'}).click(); | ||
assertValue(12); | ||
await page.getByRole('button', {name: 'Decrement'}).click(); | ||
assertValue(11); | ||
await page.getByRole('button', {name: 'Decrement'}).click(); | ||
assertValue(10); | ||
assertValue(10); | ||
await page.getByRole('button', {name: 'increment'}).click(); | ||
assertValue(11); | ||
await page.getByRole('button', {name: 'increment'}).click(); | ||
assertValue(12); | ||
await page.getByRole('button', {name: 'Decrement'}).click(); | ||
assertValue(11); | ||
await page.getByRole('button', {name: 'Decrement'}).click(); | ||
assertValue(10); | ||
|
||
async function assertValue(value: number) { | ||
// Check that the outer component is displaying the right value. | ||
expect( | ||
await page | ||
.locator('div') | ||
.filter({hasText: `Value: ${value} increment Start of`}) | ||
.textContent(), | ||
).toContain(value.toString()); | ||
async function assertValue(value: number) { | ||
// Check that the outer component is displaying the right value. | ||
expect( | ||
await page | ||
.locator('div') | ||
.filter({hasText: `Value: ${value} increment Start of`}) | ||
.textContent(), | ||
).toContain(value.toString()); | ||
|
||
// Check that the inner component is displaying the right value. | ||
expect( | ||
await page | ||
.locator('slot-counter-component') | ||
.getByText('Value:') | ||
.textContent(), | ||
).toContain(value.toString()); | ||
} | ||
// Check that the inner component is displaying the right value. | ||
expect( | ||
await page | ||
.locator('slot-counter-component') | ||
.getByText('Value:') | ||
.textContent(), | ||
).toContain(value.toString()); | ||
} | ||
}); | ||
}); |
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