test: Update regression test to use data-testid for input fields (#8762)
This commit is contained in:
parent
f4d761e63d
commit
03537b5dcc
1 changed files with 19 additions and 22 deletions
|
|
@ -55,42 +55,39 @@ test(
|
|||
timeout: 3000,
|
||||
});
|
||||
|
||||
// Wait for the modal inputs to be visible
|
||||
await page.waitForSelector(
|
||||
'[data-testid="popover-anchor-input-base_url-edit"]',
|
||||
{
|
||||
timeout: 5000,
|
||||
state: "visible",
|
||||
},
|
||||
);
|
||||
|
||||
// Fill the first input (base_url field)
|
||||
await page
|
||||
.getByPlaceholder("Type something...")
|
||||
.first()
|
||||
.getByTestId("popover-anchor-input-base_url-edit")
|
||||
.fill("ollama_test_ctrl_a_first_input");
|
||||
let value = await page
|
||||
.getByPlaceholder("Type something...")
|
||||
.first()
|
||||
.getByTestId("popover-anchor-input-base_url-edit")
|
||||
.inputValue();
|
||||
expect(value).toBe("ollama_test_ctrl_a_first_input");
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Type something...")
|
||||
.last()
|
||||
.fill("ollama_test_ctrl_a_second_input");
|
||||
let secondValue = await page
|
||||
.getByPlaceholder("Type something...")
|
||||
.last()
|
||||
.inputValue();
|
||||
expect(secondValue).toBe("ollama_test_ctrl_a_second_input");
|
||||
|
||||
await page.getByPlaceholder("Type something...").last().click();
|
||||
|
||||
await page.keyboard.press("ControlOrMeta+a");
|
||||
|
||||
await page.keyboard.press("ControlOrMeta+c");
|
||||
|
||||
await page.getByPlaceholder("Type something...").first().click();
|
||||
|
||||
await page.keyboard.press("ControlOrMeta+a");
|
||||
await page.keyboard.press("Backspace");
|
||||
value = await page
|
||||
.getByTestId("popover-anchor-input-base_url-edit")
|
||||
.inputValue();
|
||||
expect(value).toBe("");
|
||||
|
||||
await page.keyboard.press("ControlOrMeta+v");
|
||||
|
||||
value = await page
|
||||
.getByPlaceholder("Type something...")
|
||||
.first()
|
||||
.getByTestId("popover-anchor-input-base_url-edit")
|
||||
.inputValue();
|
||||
expect(value).toBe("ollama_test_ctrl_a_second_input");
|
||||
expect(value).toBe("ollama_test_ctrl_a_first_input");
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue