Skip to content

Commit

Permalink
test: add e2e tests for simple auth mode (#2634)
Browse files Browse the repository at this point in the history
  • Loading branch information
amir20 authored Dec 29, 2023
1 parent feaf9c3 commit 45fa933
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
certs
data
/data
dist
node_modules
.cache
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ services:
- 9090:8080
build:
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:
container_name: dozzle
volumes:
Expand Down
4 changes: 4 additions & 0 deletions e2e/data/users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
users:
admin:
name: Admin
password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"
9 changes: 9 additions & 0 deletions e2e/simple.spec.ts
Original file line number Diff line number Diff line change
@@ -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");
});

0 comments on commit 45fa933

Please sign in to comment.