This commit is contained in:
Dawood 2024-10-14 11:10:58 -04:00
parent 637a798018
commit 9720f675cb

View File

@ -17,7 +17,9 @@ test("change events work as expected", async ({ page }) => {
await expect(change_text).toContainText("1");
await page.getByLabel("Draw button").first().click();
const canvas = page.locator("#image_editor canvas").first();
const canvas = page.locator("canvas").first();
await canvas.waitFor({ state: 'attached' });
await canvas.waitFor({ state: 'visible' });
await canvas.click({ position: { x: 100, y: 100 } });
await expect(change_text).toContainText("2");
@ -38,7 +40,7 @@ test("input events work as expected", async ({ page }) => {
await expect(input_text).toContainText("1");
await page.getByLabel("Draw button").first().click();
const canvas = page.locator("#image_editor canvas").first();
const canvas = page.locator("canvas").first();
await canvas.click({ position: { x: 100, y: 100 } });
await expect(input_text).toContainText("2");
@ -55,7 +57,7 @@ test("apply events work as expected", async ({ page }) => {
const apply_button = page.getByLabel("Save changes").first();
await page.getByLabel("Draw button").first().click();
const canvas = page.locator("#image_editor canvas").first();
const canvas = page.locator("canvas").first();
await canvas.click({ position: { x: 100, y: 100 } });
await apply_button.click();
await expect(apply_text).toContainText("1");