mirror of
https://github.com/penpot/penpot.git
synced 2025-07-31 21:38:30 +02:00
🔧 Fix race condition in colorpicket gradient tests (#6722)
This commit is contained in:
parent
386c729507
commit
70a29c43ec
2 changed files with 29 additions and 16 deletions
|
@ -61,24 +61,28 @@ test("Create a LINEAR gradient", async ({ page }) => {
|
||||||
|
|
||||||
const removeBtn = workspacePage.colorpicker
|
const removeBtn = workspacePage.colorpicker
|
||||||
.getByRole("button", { name: "Remove color" })
|
.getByRole("button", { name: "Remove color" })
|
||||||
.nth(2);
|
.last();
|
||||||
await removeBtn.click();
|
await removeBtn.click();
|
||||||
await removeBtn.click();
|
await removeBtn.click();
|
||||||
|
|
||||||
const inputColor1 = workspacePage.colorpicker
|
const inputColor1 = workspacePage.colorpicker
|
||||||
.getByPlaceholder("Mixed")
|
.getByRole("textbox", { name: "Color" })
|
||||||
.nth(1);
|
.first();
|
||||||
await inputColor1.fill("fabada");
|
await inputColor1.fill("#fabada");
|
||||||
|
|
||||||
const inputOpacity1 = workspacePage.colorpicker.getByPlaceholder("--").nth(1);
|
const inputOpacity1 = workspacePage.colorpicker
|
||||||
|
.getByTestId("opacity-input")
|
||||||
|
.first();
|
||||||
await inputOpacity1.fill("100");
|
await inputOpacity1.fill("100");
|
||||||
|
|
||||||
const inputColor2 = workspacePage.colorpicker
|
const inputColor2 = workspacePage.colorpicker
|
||||||
.getByPlaceholder("Mixed")
|
.getByRole("textbox", { name: "Color" })
|
||||||
.nth(2);
|
.last();
|
||||||
await inputColor2.fill("red");
|
await inputColor2.fill("#ff0000");
|
||||||
|
|
||||||
const inputOpacity2 = workspacePage.colorpicker.getByPlaceholder("--").nth(2);
|
const inputOpacity2 = workspacePage.colorpicker
|
||||||
|
.getByTestId("opacity-input")
|
||||||
|
.last();
|
||||||
await inputOpacity2.fill("40");
|
await inputOpacity2.fill("40");
|
||||||
|
|
||||||
const inputOpacityGlobal = workspacePage.colorpicker.getByTestId(
|
const inputOpacityGlobal = workspacePage.colorpicker.getByTestId(
|
||||||
|
@ -139,20 +143,28 @@ test("Create a RADIAL gradient", async ({ page }) => {
|
||||||
|
|
||||||
const removeBtn = workspacePage.colorpicker
|
const removeBtn = workspacePage.colorpicker
|
||||||
.getByRole("button", { name: "Remove color" })
|
.getByRole("button", { name: "Remove color" })
|
||||||
.nth(2);
|
.last();
|
||||||
await removeBtn.click();
|
await removeBtn.click();
|
||||||
await removeBtn.click();
|
await removeBtn.click();
|
||||||
|
|
||||||
const inputColor1 = workspacePage.page.getByPlaceholder("Mixed").nth(1);
|
const inputColor1 = workspacePage.page
|
||||||
await inputColor1.fill("fabada");
|
.getByRole("textbox", { name: "Color" })
|
||||||
|
.first();
|
||||||
|
await inputColor1.fill("#fabada");
|
||||||
|
|
||||||
const inputOpacity1 = workspacePage.colorpicker.getByPlaceholder("--").nth(1);
|
const inputOpacity1 = workspacePage.colorpicker
|
||||||
|
.getByTestId("opacity-input")
|
||||||
|
.first();
|
||||||
await inputOpacity1.fill("100");
|
await inputOpacity1.fill("100");
|
||||||
|
|
||||||
const inputColor2 = workspacePage.page.getByPlaceholder("Mixed").nth(2);
|
const inputColor2 = workspacePage.page
|
||||||
await inputColor2.fill("red");
|
.getByRole("textbox", { name: "Color" })
|
||||||
|
.last();
|
||||||
|
await inputColor2.fill("#ff0000");
|
||||||
|
|
||||||
const inputOpacity2 = workspacePage.colorpicker.getByPlaceholder("--").nth(2);
|
const inputOpacity2 = workspacePage.colorpicker
|
||||||
|
.getByTestId("opacity-input")
|
||||||
|
.last();
|
||||||
await inputOpacity2.fill("100");
|
await inputOpacity2.fill("100");
|
||||||
|
|
||||||
const inputOpacityGlobal = workspacePage.colorpicker.getByTestId(
|
const inputOpacityGlobal = workspacePage.colorpicker.getByTestId(
|
||||||
|
|
|
@ -268,6 +268,7 @@
|
||||||
:on-focus on-focus
|
:on-focus on-focus
|
||||||
:on-blur on-blur
|
:on-blur on-blur
|
||||||
:on-change handle-opacity-change
|
:on-change handle-opacity-change
|
||||||
|
:data-testid "opacity-input"
|
||||||
:default 100
|
:default 100
|
||||||
:min 0
|
:min 0
|
||||||
:max 100}]])]
|
:max 100}]])]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue