Refactor: Improve wait times and selectors in sticky-notes.spec.ts (#5100)
* refactor: Improve wait times and selectors in sticky-notes.spec.ts
This commit is contained in:
parent
c6ddb2905f
commit
f673630fd4
1 changed files with 9 additions and 17 deletions
|
|
@ -57,7 +57,9 @@ The future of AI is both exciting and uncertain. As the technology continues to
|
||||||
|
|
||||||
while (modalCount === 0) {
|
while (modalCount === 0) {
|
||||||
await page.getByText("New Flow", { exact: true }).click();
|
await page.getByText("New Flow", { exact: true }).click();
|
||||||
await page.waitForTimeout(3000);
|
await page.waitForSelector('[data-testid="modal-title"]', {
|
||||||
|
timeout: 3000,
|
||||||
|
});
|
||||||
modalCount = await page.getByTestId("modal-title")?.count();
|
modalCount = await page.getByTestId("modal-title")?.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -67,9 +69,7 @@ The future of AI is both exciting and uncertain. As the technology continues to
|
||||||
await page.getByTestId("blank-flow").click();
|
await page.getByTestId("blank-flow").click();
|
||||||
await page.getByTestId("add_note").click();
|
await page.getByTestId("add_note").click();
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
const targetElement = page.locator('//*[@id="react-flow-id"]');
|
||||||
|
|
||||||
const targetElement = await page.locator('//*[@id="react-flow-id"]');
|
|
||||||
await targetElement.click();
|
await targetElement.click();
|
||||||
|
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
|
|
@ -116,6 +116,7 @@ The future of AI is both exciting and uncertain. As the technology continues to
|
||||||
await page.getByTestId("color_picker").click();
|
await page.getByTestId("color_picker").click();
|
||||||
|
|
||||||
await page.getByTestId("color_picker_button_rose").click();
|
await page.getByTestId("color_picker_button_rose").click();
|
||||||
|
//await for the animation to complete
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
|
|
||||||
await page.getByTestId("note_node").click();
|
await page.getByTestId("note_node").click();
|
||||||
|
|
@ -145,31 +146,22 @@ The future of AI is both exciting and uncertain. As the technology continues to
|
||||||
|
|
||||||
await page.getByText("Copy").click();
|
await page.getByText("Copy").click();
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
|
|
||||||
await page.getByTestId("fit_view").click();
|
await page.getByTestId("fit_view").click();
|
||||||
await page.getByTestId("zoom_out").click();
|
await page.getByTestId("zoom_out").click();
|
||||||
await page.getByTestId("zoom_out").click();
|
await page.getByTestId("zoom_out").click();
|
||||||
|
|
||||||
targetElement.focus();
|
//double click
|
||||||
targetElement.click();
|
await targetElement.click();
|
||||||
await page.waitForTimeout(1000);
|
await targetElement.click();
|
||||||
targetElement.click();
|
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
targetElement.click();
|
|
||||||
await page.keyboard.press(`ControlOrMeta+v`);
|
await page.keyboard.press(`ControlOrMeta+v`);
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
|
|
||||||
titleNumber = await page.getByText(randomTitle).count();
|
titleNumber = await page.getByText(randomTitle).count();
|
||||||
expect(titleNumber).toBe(3);
|
expect(titleNumber).toBe(3);
|
||||||
|
|
||||||
await page.getByTestId("note_node").nth(0).focus();
|
await page.getByTestId("note_node").last().click();
|
||||||
await page.getByTestId("more-options-modal").click();
|
await page.getByTestId("more-options-modal").click();
|
||||||
await page.getByText("Delete").first().click();
|
await page.getByText("Delete").first().click();
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
|
|
||||||
titleNumber = await page.getByText(randomTitle).count();
|
titleNumber = await page.getByText(randomTitle).count();
|
||||||
|
|
||||||
expect(titleNumber).toBe(2);
|
expect(titleNumber).toBe(2);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue