1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 13:23:07 +01:00

test: add e2e tests for simple auth mode (#2634)

This commit is contained in:
Amir Raminfar
2023-12-29 09:29:15 -08:00
committed by GitHub
parent feaf9c35d4
commit 45fa933f12
4 changed files with 24 additions and 1 deletions

2
.gitignore vendored
View File

@@ -1,5 +1,5 @@
certs certs
data /data
dist dist
node_modules node_modules
.cache .cache

View File

@@ -25,6 +25,16 @@ services:
- 9090:8080 - 9090:8080
build: build:
context: . context: .
simple-auth:
container_name: simple-auth
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./e2e/data:/data
environment:
- DOZZLE_AUTH_PROVIDER=simple
- DOZZLE_NO_ANALYTICS=1
build:
context: .
dozzle: dozzle:
container_name: dozzle container_name: dozzle
volumes: volumes:

4
e2e/data/users.yml Normal file
View File

@@ -0,0 +1,4 @@
users:
admin:
name: Admin
password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"

9
e2e/simple.spec.ts Normal file
View File

@@ -0,0 +1,9 @@
import { test, expect } from "@playwright/test";
test("simple authentication", async ({ page }) => {
await page.goto("http://simple-auth:8080/");
await page.locator('input[name="username"]').fill("admin");
await page.locator('input[name="password"]').fill("password");
await page.locator('button[type="submit"]').click();
await expect(page.getByTestId("containers")).toHaveText("Containers");
});