mirror of
https://github.com/logos-storage/logos-storage-marketplace-ui.git
synced 2026-01-02 13:33:06 +00:00
Fix settings test
This commit is contained in:
parent
5504caed17
commit
d5549b5311
@ -8,23 +8,35 @@ import test, { expect } from "@playwright/test";
|
||||
// await expect(page.locator('span').filter({ hasText: 'success ! The log level has' }).locator('b')).toBeVisible();
|
||||
// })
|
||||
|
||||
test('update the URL with wrong URL applies', async ({ page }) => {
|
||||
await page.goto('/dashboard');
|
||||
await page.locator('a').filter({ hasText: 'Settings' }).click();
|
||||
await page.getByLabel('Address').click();
|
||||
await page.getByLabel('Address').fill('hello');
|
||||
await expect(page.getByLabel('Address')).toHaveAttribute("aria-invalid")
|
||||
await expect(page.locator(".refresh svg")).toHaveAttribute("color", "#494949")
|
||||
await page.getByLabel('Address').fill('http://127.0.0.1:8079');
|
||||
await expect(page.getByLabel('Address')).not.toHaveAttribute("aria-invalid")
|
||||
await expect(page.locator(".refresh svg")).not.toHaveAttribute("aria-disabled")
|
||||
await expect(page.getByLabel('Address')).toHaveValue("http://127.0.0.1")
|
||||
await expect(page.getByLabel('Port')).toHaveValue("8079")
|
||||
await page.locator(".refresh").click()
|
||||
await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")).toBeVisible()
|
||||
await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")).not.toBeVisible()
|
||||
await page.getByLabel('Address').fill('http://127.0.0.1:8080');
|
||||
await page.locator(".refresh").click()
|
||||
await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")).not.toBeVisible()
|
||||
await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")).toBeVisible()
|
||||
})
|
||||
test("update the URL with wrong URL applies", async ({ page }) => {
|
||||
await page.goto("/dashboard");
|
||||
await page.locator("a").filter({ hasText: "Settings" }).click();
|
||||
await page.getByLabel("Address").click();
|
||||
await page.getByLabel("Address").fill("hello");
|
||||
await expect(page.getByLabel("Address")).toHaveAttribute("aria-invalid");
|
||||
await expect(page.locator(".refresh svg")).toHaveAttribute(
|
||||
"color",
|
||||
"#494949"
|
||||
);
|
||||
await page.getByLabel("Address").fill("http://127.0.0.1:8079");
|
||||
await expect(page.getByLabel("Address")).not.toHaveAttribute("aria-invalid");
|
||||
await expect(page.locator(".refresh svg")).not.toHaveAttribute(
|
||||
"aria-disabled"
|
||||
);
|
||||
await expect(page.getByLabel("Address")).toHaveValue("http://127.0.0.1:8079");
|
||||
await page.locator(".refresh").click();
|
||||
await expect(
|
||||
page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")
|
||||
).not.toBeVisible();
|
||||
await page.getByLabel("Address").fill("http://127.0.0.1:8080");
|
||||
await page.locator(".refresh").click();
|
||||
await expect(
|
||||
page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")
|
||||
).not.toBeVisible();
|
||||
await expect(
|
||||
page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user