4 changed files with 54 additions and 38 deletions
@ -0,0 +1 @@ |
|||
tests/**/*.png filter=lfs diff=lfs merge=lfs -text |
|||
@ -1,18 +1,37 @@ |
|||
import { test, expect } from '@playwright/test'; |
|||
import { expect, test } from "@playwright/test"; |
|||
|
|||
test('has title', async ({ page }) => { |
|||
await page.goto('https://playwright.dev/'); |
|||
test("Basic page load", async ({ page }) => { |
|||
await page.goto("/"); |
|||
await expect(page).toHaveTitle("Meshtastic Web"); |
|||
}); |
|||
|
|||
test("Prompts adding a new connection as the call to action when there are no devices", async ({page}) => { |
|||
await page.goto("/"); |
|||
|
|||
await expect(page).toHaveScreenshot(); |
|||
|
|||
// Expect a title "to contain" a substring.
|
|||
await expect(page).toHaveTitle(/Playwright/); |
|||
await expect(page.getByRole("heading", { name: "No Devices" })).toBeVisible(); |
|||
await expect(page.getByRole("button", { name: "New Connection" })).toBeVisible(); |
|||
}); |
|||
|
|||
test('get started link', async ({ page }) => { |
|||
await page.goto('https://playwright.dev/'); |
|||
test("Shows the protocols as the first step of adding a device", async ({page}) => { |
|||
await page.goto("/"); |
|||
await page.getByRole("button", { name: "New Connection" }).click(); |
|||
await expect(page.getByRole("heading", { name: "Connect New Device" })).toBeVisible(); |
|||
await expect(page).toHaveScreenshot(); |
|||
}); |
|||
|
|||
// Click the get started link.
|
|||
await page.getByRole('link', { name: 'Get started' }).click(); |
|||
test("Requests the IP address or hostname as input when connecting over HTTP", async ({page}) => { |
|||
await page.goto("/"); |
|||
await page.getByRole("button", { name: "New Connection" }).click(); |
|||
await page.getByRole("tab", { name: "HTTP" }).click(); |
|||
await expect(page.getByRole('dialog')).toHaveScreenshot('connect-over-http.png'); |
|||
}); |
|||
|
|||
// Expects page to have a heading with the name of Installation.
|
|||
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); |
|||
test("New Device button for the brower's dialog UI is presented when connecting over serial", async ({page}) => { |
|||
await page.goto("/"); |
|||
await page.getByRole("button", { name: "New Connection" }).click(); |
|||
await page.getByRole("tab", { name: "Serial" }).click(); |
|||
await expect(page.getByRole("button", { name: "New Device" })).toBeVisible(); |
|||
await expect(page.getByRole('dialog')).toHaveScreenshot('connect-over-serial.png'); |
|||
}); |
|||
|
|||
Loading…
Reference in new issue