Skip to content

Commit

Permalink
#34: Improve e2e test setup. (#47)
Browse files Browse the repository at this point in the history
* #34: Improve e2e test setup.
* #34: More tests
  • Loading branch information
sevensolutions authored Jan 8, 2025
1 parent 7f15368 commit 2898b43
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 90 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig is awesome: https://editorconfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

[*.{yml,yaml}]
charset = utf-8
indent_style = space
indent_size = 2

[*.ts]
charset = utf-8
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
/playwright-report/
/blob-report/
/playwright/.cache/
.http.yml
13 changes: 13 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# E2E Tests

## How to run the tests

```
npx playwright test
```

You can also run the tests and watch the browser by running:

```
npx playwright test --headed
```
31 changes: 0 additions & 31 deletions e2e/http.yml

This file was deleted.

29 changes: 28 additions & 1 deletion e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"description": "",
"devDependencies": {
"@playwright/test": "^1.49.1",
"@types/node": "^22.10.3"
"@types/node": "^22.10.3",
"docker-compose": "^1.1.0"
}
}
9 changes: 1 addition & 8 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,5 @@ export default defineConfig({
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
webServer: {
command: 'docker compose up',
url: 'http://localhost:9080',
reuseExistingServer: !process.env.CI,
},
]
});
10 changes: 9 additions & 1 deletion e2e/dex.config.yml → e2e/tests/dex/dex.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ staticPasswords:
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W"
username: "admin"
userID: "08a8684b-db88-4b73-90a9-3cd1661f5466"
- email: "[email protected]"
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W"
username: "alice"
userID: "7134d97d-58b0-417d-936f-762661122b00"
- email: "[email protected]"
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W"
username: "bob"
userID: "4cbac28e-39f8-4d88-8408-079a97d60c9c"

# Allow password grants with local users
oauth2:
skipApprovalScreen: true
# passwordConnector: local
# passwordConnector: local
6 changes: 3 additions & 3 deletions e2e/docker-compose.yml → e2e/tests/dex/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ services:
extra_hosts:
- "localhost:172.17.0.1" # To make OIDC discovery work correctly
volumes:
- "../traefik-config.yml:/etc/traefik/traefik.yml:ro"
- "./http.yml:/etc/traefik/configs/http.yml:ro"
- "..:/plugins-local/src/github.com/sevensolutions/traefik-oidc-auth:ro"
- /var/run/docker.sock:/var/run/docker.sock
- "../../../traefik-config.yml:/etc/traefik/traefik.yml:ro"
- "../../..:/plugins-local/src/github.com/sevensolutions/traefik-oidc-auth:ro"
- "../../.http.yml:/etc/traefik/configs/http.yml:ro" # Will be generated by tests
environment:
PROVIDER_URL: http://dex:5556/dex
CLIENT_ID: traefik
Expand Down
Loading

0 comments on commit 2898b43

Please sign in to comment.