Refactor: floatComponent.spec.ts for improved readability, performance, and reliability (#4857)
Refactor floatComponent.spec.ts to improve readability, performance and reliability
This commit is contained in:
parent
1a057571c9
commit
f90e980cb5
1 changed files with 10 additions and 18 deletions
|
|
@ -25,7 +25,9 @@ test(
|
||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||||
|
|
@ -35,7 +37,9 @@ test(
|
||||||
await page.getByTestId("sidebar-search-input").click();
|
await page.getByTestId("sidebar-search-input").click();
|
||||||
await page.getByTestId("sidebar-search-input").fill("ollama");
|
await page.getByTestId("sidebar-search-input").fill("ollama");
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForSelector('[data-testid="modelsOllama"]', {
|
||||||
|
timeout: 30000,
|
||||||
|
});
|
||||||
|
|
||||||
await page
|
await page
|
||||||
.getByTestId("modelsOllama")
|
.getByTestId("modelsOllama")
|
||||||
|
|
@ -47,33 +51,25 @@ test(
|
||||||
await page.getByTestId("zoom_out").click();
|
await page.getByTestId("zoom_out").click();
|
||||||
await page.getByTestId("zoom_out").click();
|
await page.getByTestId("zoom_out").click();
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
await page.locator('//*[@id="float_float_temperature"]').click();
|
await page.locator('//*[@id="float_float_temperature"]').click();
|
||||||
await page.locator('//*[@id="float_float_temperature"]').fill("");
|
await page.locator('//*[@id="float_float_temperature"]').fill("");
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
await page.locator('//*[@id="float_float_temperature"]').fill("3");
|
await page.locator('//*[@id="float_float_temperature"]').fill("3");
|
||||||
|
|
||||||
let value = await page
|
let value = await page
|
||||||
.locator('//*[@id="float_float_temperature"]')
|
.locator('//*[@id="float_float_temperature"]')
|
||||||
.inputValue();
|
.inputValue();
|
||||||
|
|
||||||
if (value != "2") {
|
expect(value).toBe("2");
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
await page.locator('//*[@id="float_float_temperature"]').click();
|
await page.locator('//*[@id="float_float_temperature"]').click();
|
||||||
await page.locator('//*[@id="float_float_temperature"]').fill("");
|
await page.locator('//*[@id="float_float_temperature"]').fill("");
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
await page.locator('//*[@id="float_float_temperature"]').fill("-3");
|
await page.locator('//*[@id="float_float_temperature"]').fill("-3");
|
||||||
|
|
||||||
value = await page
|
value = await page
|
||||||
.locator('//*[@id="float_float_temperature"]')
|
.locator('//*[@id="float_float_temperature"]')
|
||||||
.inputValue();
|
.inputValue();
|
||||||
|
|
||||||
if (value != "-2") {
|
expect(value).toBe("-2");
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.getByTestId("more-options-modal").click();
|
await page.getByTestId("more-options-modal").click();
|
||||||
await page.getByTestId("advanced-button-modal").click();
|
await page.getByTestId("advanced-button-modal").click();
|
||||||
|
|
@ -136,9 +132,7 @@ test(
|
||||||
.locator('//*[@id="float_float_temperature"]')
|
.locator('//*[@id="float_float_temperature"]')
|
||||||
.inputValue();
|
.inputValue();
|
||||||
|
|
||||||
if (value != "1") {
|
expect(value).toBe("1");
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.locator('//*[@id="float_float_temperature"]').click();
|
await page.locator('//*[@id="float_float_temperature"]').click();
|
||||||
await page.getByTestId("float_float_temperature").fill("");
|
await page.getByTestId("float_float_temperature").fill("");
|
||||||
|
|
@ -149,9 +143,7 @@ test(
|
||||||
.locator('//*[@id="float_float_temperature"]')
|
.locator('//*[@id="float_float_temperature"]')
|
||||||
.inputValue();
|
.inputValue();
|
||||||
|
|
||||||
if (value != "-1") {
|
expect(value).toBe("-1");
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue