-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
cdbec05
commit 5fe020d
Showing
6 changed files
with
101 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { expect, test } from "@playwright/test"; | ||
import { goToApplicationSummaryPage } from "../utils/navigation"; | ||
import { createConnection, graphqlEndpoint } from "../utils/connection"; | ||
|
||
test.beforeEach(goToApplicationSummaryPage); | ||
|
||
test("should have correct page title", async ({ page }) => { | ||
const [address] = page.url().split("/").reverse(); | ||
await expect(page).toHaveTitle(`Application ${address} | CartesiScan`); | ||
}); | ||
|
||
test("should have correct title", async ({ page }) => { | ||
const title = page.getByRole("heading", { name: "Summary" }); | ||
await expect(title.first()).toBeVisible(); | ||
}); | ||
|
||
test("should display latest inputs table", async ({ page }) => { | ||
await expect( | ||
page.getByRole("row", { name: "From Method Age" }), | ||
).toBeVisible(); | ||
await expect(page.getByRole("row")).toHaveCount(7); | ||
}); | ||
|
||
test("should toggle date column", async ({ page }) => { | ||
const ageHeaderColumn = page.getByText("Age"); | ||
await ageHeaderColumn.click(); | ||
|
||
await expect( | ||
page.getByRole("row", { | ||
name: "From Method Timestamp (UTC)", | ||
}), | ||
).toBeVisible(); | ||
|
||
const timestampHeaderColumn = page.getByText("Timestamp (UTC)"); | ||
await timestampHeaderColumn.click(); | ||
|
||
await expect( | ||
page.getByRole("row", { name: "From Method Age" }), | ||
).toBeVisible(); | ||
}); | ||
|
||
test("should navigate to application inputs page", async ({ page }) => { | ||
const [address] = page.url().split("/").reverse(); | ||
await page.getByText("View inputs").click(); | ||
await page.waitForURL(`/applications/${address}/inputs`); | ||
}); | ||
|
||
test("should display summary skeleton cards", async ({ page }) => { | ||
await expect(page.getByTestId("skeleton")).toBeVisible(); | ||
await expect(page.getByText("Add connection")).toBeVisible(); | ||
}); | ||
|
||
test("should be able to add a connection", async ({ page }) => { | ||
const [address] = page.url().split("/").reverse(); | ||
await createConnection( | ||
page, | ||
address as `0x${string}`, | ||
graphqlEndpoint, | ||
false, | ||
); | ||
await expect(page.getByText("Notices")).toBeVisible(); | ||
await expect(page.getByText("Vouchers")).toBeVisible(); | ||
await expect(page.getByText("Reports")).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters