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) {
|
||||
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();
|
||||
}
|
||||
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").fill("ollama");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForSelector('[data-testid="modelsOllama"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByTestId("modelsOllama")
|
||||
|
|
@ -47,33 +51,25 @@ test(
|
|||
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"]').fill("");
|
||||
await page.waitForTimeout(1000);
|
||||
await page.locator('//*[@id="float_float_temperature"]').fill("3");
|
||||
|
||||
let value = await page
|
||||
.locator('//*[@id="float_float_temperature"]')
|
||||
.inputValue();
|
||||
|
||||
if (value != "2") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
expect(value).toBe("2");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.locator('//*[@id="float_float_temperature"]').click();
|
||||
await page.locator('//*[@id="float_float_temperature"]').fill("");
|
||||
await page.waitForTimeout(1000);
|
||||
await page.locator('//*[@id="float_float_temperature"]').fill("-3");
|
||||
|
||||
value = await page
|
||||
.locator('//*[@id="float_float_temperature"]')
|
||||
.inputValue();
|
||||
|
||||
if (value != "-2") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
expect(value).toBe("-2");
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
await page.getByTestId("advanced-button-modal").click();
|
||||
|
|
@ -136,9 +132,7 @@ test(
|
|||
.locator('//*[@id="float_float_temperature"]')
|
||||
.inputValue();
|
||||
|
||||
if (value != "1") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
expect(value).toBe("1");
|
||||
|
||||
await page.locator('//*[@id="float_float_temperature"]').click();
|
||||
await page.getByTestId("float_float_temperature").fill("");
|
||||
|
|
@ -149,9 +143,7 @@ test(
|
|||
.locator('//*[@id="float_float_temperature"]')
|
||||
.inputValue();
|
||||
|
||||
if (value != "-1") {
|
||||
expect(false).toBeTruthy();
|
||||
}
|
||||
expect(value).toBe("-1");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue