Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions playwright-e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
14 changes: 14 additions & 0 deletions playwright-e2e/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "playwright-e2e",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.54.1",
"@types/node": "^24.1.0"
}
}
29 changes: 29 additions & 0 deletions playwright-e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { defineConfig, devices } from "@playwright/test";

const BASE_URL = `http://frontend.${process.env.HOTROD_NAMESPACE}:8080`;

export default defineConfig({
testDir: "./tests",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 0 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [["html", { open: "never" }]],
use: {
baseURL: BASE_URL,
trace: "on",
video: "on",
extraHTTPHeaders: {
baggage: `sd-routing-key=${process.env.SIGNADOT_ROUTING_KEY}`,
},
},
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
baseURL: BASE_URL,
},
},
],
});
29 changes: 29 additions & 0 deletions playwright-e2e/tests/main.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { test, expect } from "@playwright/test";

test.describe("Request a ride", () => {
test("check route resolve routes", async ({ page }) => {
await page.goto("/");
await page.waitForLoadState();

await page.getByRole("combobox").first().selectOption("1");
await page.getByRole("combobox").nth(1).selectOption("123");
await page.getByRole("button", { name: "Request Ride" }).click();

await expect(
page.locator("//div[p[2][contains(text(), 'route')]]/p[4]"),
).toHaveText("Resolving routes")
});

test("check driver series", async ({ page }) => {
await page.goto("/");
await page.waitForLoadState();

await page.getByRole("combobox").first().selectOption("1");
await page.getByRole("combobox").nth(1).selectOption("123");
await page.getByRole("button", { name: "Request Ride" }).click();

await expect(
page.locator("//div[p[2][contains(text(), 'driver')]]/p[4]").last(),
).toHaveText(/.*T7\d{5}C.*/);
});
});