Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea committed Dec 17, 2024
1 parent 72c1c5a commit 932a493
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import {DemoRoute} from '@demo/routes';
import {TuiDocumentationPagePO, tuiGoto} from '@demo-playwright/utils';
import {
TuiDocumentationPagePO,
tuiGoto,
TuiInputPhoneInternationalPO,
} from '@demo-playwright/utils';
import type {Locator} from '@playwright/test';
import {expect, test} from '@playwright/test';

test.describe('InputPhoneInternational', () => {
test.describe('API page', () => {
let example: Locator;
let select!: Locator;
let dropdown!: Locator;
let inputPhoneInternational!: TuiInputPhoneInternationalPO;

test.beforeEach(({page}) => {
example = new TuiDocumentationPagePO(page).apiPageExample;
select = example.locator('tui-textfield .t-ipi-select');
dropdown = page.locator('tui-dropdown');
inputPhoneInternational = new TuiInputPhoneInternationalPO(
example.locator('tui-textfield'),
);
});

test('Open dropdown if readonly=false', async ({page}) => {
Expand All @@ -23,7 +29,7 @@ test.describe('InputPhoneInternational', () => {

await expect(dropdown).not.toBeAttached();

await select.click();
await inputPhoneInternational.select.click();

Check failure on line 32 in projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / ubuntu-latest / 8 of 9

[chromium] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false

1) [chromium] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#demo-content').locator('tui-textfield').locator('.t-ipi-select') 30 | await expect(dropdown).not.toBeAttached(); 31 | > 32 | await inputPhoneInternational.select.click(); | ^ 33 | 34 | await expect(dropdown).toBeAttached(); 35 | }); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:32:50

Check failure on line 32 in projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / ubuntu-latest / 8 of 9

[chromium] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false

1) [chromium] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#demo-content').locator('tui-textfield').locator('.t-ipi-select') 30 | await expect(dropdown).not.toBeAttached(); 31 | > 32 | await inputPhoneInternational.select.click(); | ^ 33 | 34 | await expect(dropdown).toBeAttached(); 35 | }); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:32:50

Check failure on line 32 in projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / ubuntu-latest / 8 of 9

[chromium] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false

1) [chromium] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#demo-content').locator('tui-textfield').locator('.t-ipi-select') 30 | await expect(dropdown).not.toBeAttached(); 31 | > 32 | await inputPhoneInternational.select.click(); | ^ 33 | 34 | await expect(dropdown).toBeAttached(); 35 | }); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:32:50

Check failure on line 32 in projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 8 of 9

[webkit] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false

1) [webkit] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#demo-content').locator('tui-textfield').locator('.t-ipi-select') 30 | await expect(dropdown).not.toBeAttached(); 31 | > 32 | await inputPhoneInternational.select.click(); | ^ 33 | 34 | await expect(dropdown).toBeAttached(); 35 | }); at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:32:50

Check failure on line 32 in projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 8 of 9

[webkit] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false

1) [webkit] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#demo-content').locator('tui-textfield').locator('.t-ipi-select') 30 | await expect(dropdown).not.toBeAttached(); 31 | > 32 | await inputPhoneInternational.select.click(); | ^ 33 | 34 | await expect(dropdown).toBeAttached(); 35 | }); at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:32:50

Check failure on line 32 in projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 8 of 9

[webkit] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false

1) [webkit] › tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:24:13 › InputPhoneInternational › API page › Open dropdown if readonly=false Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for locator('#demo-content').locator('tui-textfield').locator('.t-ipi-select') 30 | await expect(dropdown).not.toBeAttached(); 31 | > 32 | await inputPhoneInternational.select.click(); | ^ 33 | 34 | await expect(dropdown).toBeAttached(); 35 | }); at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/legacy/input-phone-international/input-phone-international.pw.spec.ts:32:50

await expect(dropdown).toBeAttached();
});
Expand All @@ -33,7 +39,9 @@ test.describe('InputPhoneInternational', () => {

await expect(dropdown).not.toBeAttached();

await select.click();
await expect(async () => {
await inputPhoneInternational.select.click();
}).rejects.toThrow();

await expect(dropdown).not.toBeAttached();
});
Expand Down
1 change: 1 addition & 0 deletions projects/demo-playwright/utils/page-objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export * from './input-date-time.po';
export * from './input-month.po';
export * from './input-month-range.po';
export * from './input-phone.po';
export * from './input-phone-international.po';
export * from './input-range.po';
export * from './input-slider.po';
export * from './input-tag.po';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type {Locator} from '@playwright/test';

import {TuiTextfieldWithDataListPO} from './textfield-with-data-list.po';

export class TuiInputPhoneInternationalPO extends TuiTextfieldWithDataListPO {
public select: Locator = this.host.locator('.t-ipi-select');
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
[tuiTextfieldSize]="size() === 's' ? 's' : 'm'"
>
<input
autocomplete="off"
tuiTextfield
type="text"
[focused]="true"
[ngModel]="search()"
[ngModelOptions]="{standalone: true}"
Expand Down

0 comments on commit 932a493

Please sign in to comment.