Skip to content

Commit

Permalink
try fixing dropdown spec
Browse files Browse the repository at this point in the history
  • Loading branch information
uziab committed Nov 6, 2024
1 parent 17a14e7 commit 637bd0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/testkit/__TESTS__/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe("dropdown Class with Storybook", () => {
});

test("set dropdown value", async ({page}) => {
await DropDown.selectItem("2");
await DropDown.selectItem("Option 2");
await page.waitForTimeout(500);
expect(await DropDown.getText()).toContain("2");
});
Expand Down
2 changes: 2 additions & 0 deletions packages/testkit/inputs/Dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export class Dropdown extends BaseElement {
async selectItem(item: string): Promise<void> {
await test.step(`Select ${item} from ${this.elementReportName}`, async () => {
await this.locator.click();
await this.inputField.setText('')
await this.page.waitForTimeout(500);
await this.inputField.setText(item);
const dropdownItem = this.locator.getByRole("option", { name: item });
await dropdownItem.click();
Expand Down

0 comments on commit 637bd0d

Please sign in to comment.