mirror of
https://github.com/logos-storage/logos-storage-marketplace-ui.git
synced 2026-01-08 00:13:06 +00:00
Update tests
This commit is contained in:
parent
5549f1336d
commit
3cac23cd3b
@ -1,58 +1,87 @@
|
|||||||
import { test, expect, } from '@playwright/test';
|
import { test, expect } from "@playwright/test";
|
||||||
|
|
||||||
test.describe('onboarding', () => {
|
test.describe("onboarding", () => {
|
||||||
test('onboarding steps', async ({ page, browserName }) => {
|
test("onboarding steps", async ({ page, browserName }) => {
|
||||||
await page.context().setOffline(false)
|
await page.context().setOffline(false);
|
||||||
await page.goto('/');
|
await page.goto("/");
|
||||||
await expect(page.getByText("Codex is a durable, decentralised data storage protocol, created so the world community can preserve its most important knowledge without risk of censorship.")).toBeVisible()
|
await expect(
|
||||||
await page.locator('.navigation').click();
|
page.getByText(
|
||||||
await expect(page.locator('.navigation')).toHaveAttribute("aria-disabled");
|
"Codex is a durable, decentralised data storage protocol, created so the world community can preserve its most important knowledge without risk of censorship."
|
||||||
await page.getByLabel('Preferred name').fill('Arnaud');
|
)
|
||||||
await expect(page.locator('.navigation')).not.toHaveAttribute("aria-disabled");
|
).toBeVisible();
|
||||||
await page.locator('.navigation').click();
|
await page.locator(".navigation").click();
|
||||||
|
await expect(page.locator(".navigation")).toHaveAttribute("aria-disabled");
|
||||||
|
await page.getByLabel("Preferred name").fill("Arnaud");
|
||||||
|
await expect(page.locator(".navigation")).not.toHaveAttribute(
|
||||||
|
"aria-disabled"
|
||||||
|
);
|
||||||
|
await page.locator(".navigation").click();
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
await expect(page.locator(".health-checks ul li").nth(1).getByTestId("icon-error")).not.toBeVisible()
|
await expect(
|
||||||
await expect(page.locator(".health-checks ul li").nth(1).getByTestId("icon-success")).toBeVisible()
|
page.locator(".health-checks ul li").nth(1).getByTestId("icon-error")
|
||||||
|
).not.toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator(".health-checks ul li").nth(1).getByTestId("icon-success")
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
// Port forwarding
|
// Port forwarding
|
||||||
await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")).not.toBeVisible()
|
await expect(
|
||||||
await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")).toBeVisible()
|
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();
|
||||||
|
|
||||||
// Codex node
|
// Codex node
|
||||||
await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-error")).not.toBeVisible()
|
await expect(
|
||||||
await expect(page.locator(".health-checks ul li").nth(2).getByTestId("icon-success")).toBeVisible()
|
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();
|
||||||
|
|
||||||
// Marketplace
|
// Marketplace
|
||||||
await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-warning")).toBeVisible({ timeout: 10_000 })
|
//await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-warning")).toBeVisible({ timeout: 10_000 })
|
||||||
await expect(page.locator(".health-checks ul li").nth(3).getByTestId("icon-success")).not.toBeVisible()
|
await expect(
|
||||||
|
page.locator(".health-checks ul li").nth(3).getByTestId("icon-success")
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
// Can be simulated with File -> Work offline
|
// Can be simulated with File -> Work offline
|
||||||
if (browserName.toLowerCase() !== 'firefox') {
|
if (browserName.toLowerCase() !== "firefox") {
|
||||||
await page.context().setOffline(true)
|
await page.context().setOffline(true);
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
await expect(page.locator(".health-checks ul li").nth(1).getByTestId("icon-error")).toBeVisible()
|
await expect(
|
||||||
await expect(page.locator(".health-checks ul li").nth(1).getByTestId("icon-success")).not.toBeVisible()
|
page.locator(".health-checks ul li").nth(1).getByTestId("icon-error")
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator(".health-checks ul li").nth(1).getByTestId("icon-success")
|
||||||
|
).not.toBeVisible();
|
||||||
|
|
||||||
await page.context().setOffline(false)
|
await page.context().setOffline(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.context().setOffline(false)
|
await page.context().setOffline(false);
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
test('does not display undefined when delete the url value', async ({ page }) => {
|
test("does not display undefined when delete the url value", async ({
|
||||||
await page.goto('/onboarding-checks');
|
page,
|
||||||
await page.locator('#url').focus()
|
}) => {
|
||||||
|
await page.goto("/onboarding-checks");
|
||||||
|
await page.locator("#url").focus();
|
||||||
|
|
||||||
for (let i = 0; i < "http://localhost:8080".length; i++) {
|
for (let i = 0; i < "http://localhost:8080".length; i++) {
|
||||||
await page.keyboard.press('Backspace');
|
await page.keyboard.press("Backspace");
|
||||||
}
|
}
|
||||||
|
|
||||||
await expect(page.locator('#url')).toHaveValue("");
|
await expect(page.locator("#url")).toHaveValue("");
|
||||||
await expect(page.locator('#url')).toHaveAttribute("aria-invalid")
|
await expect(page.locator("#url")).toHaveAttribute("aria-invalid");
|
||||||
await expect(page.locator('.refresh svg')).toHaveAttribute("color", "#494949")
|
await expect(page.locator(".refresh svg")).toHaveAttribute(
|
||||||
});
|
"color",
|
||||||
|
"#494949"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|||||||
@ -133,7 +133,7 @@ test("create a storage request by using decimal values", async ({ page }) => {
|
|||||||
"disabled"
|
"disabled"
|
||||||
);
|
);
|
||||||
|
|
||||||
const days = Math.random() * 7;
|
const days = 4;
|
||||||
|
|
||||||
await page.getByLabel("Full period of the contract").fill(days.toFixed(1));
|
await page.getByLabel("Full period of the contract").fill(days.toFixed(1));
|
||||||
await expect(page.locator("footer .button--primary")).not.toHaveAttribute(
|
await expect(page.locator("footer .button--primary")).not.toHaveAttribute(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user