-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add playwright skeleton #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add playwright skeleton #85
Conversation
Signed-off-by: Carlos Feria <[email protected]>
Reviewer's GuideThis PR scaffolds Playwright-based end-to-end testing by introducing a dedicated e2e workspace with configuration and example, extends the existing setup with Docker Compose support for the Playwright server and new NPM scripts, and integrates reusable GitHub workflows and a composite action to run these tests in CI. Class diagram for new e2e workspace and Playwright configclassDiagram
class ConsoleUI_E2E_PackageJson {
+scripts: clean, clean:all, lint, lint:fix, format, format:fix, test, test:trace, test:ui:host
+devDependencies: @playwright/test
}
class PlaywrightConfigTs {
+testDir: './tests'
+fullyParallel: true
+forbidOnly: CI-based
+retries: CI-based
+workers: CI-based
+reporter: 'html'
+use: baseURL, trace, screenshot, ignoreHTTPSErrors
+projects: chromium, firefox, webkit
}
ConsoleUI_E2E_PackageJson --> PlaywrightConfigTs : uses config
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- The README entry for CONSOLE_API_URL still reuses the AUTH_REQUIRED description—please update its description (and the .env template) to accurately reflect its purpose.
- There’s no actual smoke test in e2e/tests/example.spec.ts—consider adding a basic placeholder test so the CI pipeline can validate something meaningful immediately.
- The start-console action defines a playwright_version input but the docker-compose service hardcodes the Playwright image; parameterize the service image in docker-compose.yml to respect that input.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The README entry for CONSOLE_API_URL still reuses the AUTH_REQUIRED description—please update its description (and the .env template) to accurately reflect its purpose.
- There’s no actual smoke test in e2e/tests/example.spec.ts—consider adding a basic placeholder test so the CI pipeline can validate something meaningful immediately.
- The start-console action defines a playwright_version input but the docker-compose service hardcodes the Playwright image; parameterize the service image in docker-compose.yml to respect that input.
## Individual Comments
### Comment 1
<location> `.github/actions/start-console/action.yml:65-67` </location>
<code_context>
+ shell: bash
+ run: |
+ # Wait for backend
+ until curl -s http://localhost:8087/healthz | jq -e '.status == "ok"' >/dev/null 2>&1; do
+ echo "Waiting for healthy service response on port 8087..."
+ sleep 2
+ done
+
</code_context>
<issue_to_address>
**issue:** The health check for backend assumes jq is available; consider adding installation step or fallback.
If 'jq' is missing, the health check will fail. Please ensure 'jq' is installed or replace it with a bash-only solution.
</issue_to_address>
### Comment 2
<location> `.github/actions/start-console/action.yml:71` </location>
<code_context>
+ done
+
+ # Wait for ui
+ until curl -s http://localhost:8088 | grep -qi "<html"; do
+ echo "Waiting for HTML page on port 8088..."
+ sleep 2
</code_context>
<issue_to_address>
**suggestion:** UI readiness check relies on HTML content; may be fragile if UI changes.
If the UI response format changes, this check could break. Using a dedicated health endpoint or status code would be more reliable.
Suggested implementation:
```
# Wait for ui
until curl -s -o /dev/null -w "%{http_code}" http://localhost:8088/healthz | grep -q "200"; do
echo "Waiting for healthy UI service response on port 8088..."
sleep 2
done
```
If your UI does not expose a `/healthz` endpoint, replace `/healthz` with the correct health/status endpoint or path that reliably indicates readiness.
</issue_to_address>
### Comment 3
<location> `e2e/playwright.config.ts:28-29` </location>
<code_context>
+ /* Opt out of parallel tests on CI. */
+ workers: process.env.CI ? 1 : undefined,
+ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
+ reporter: 'html',
+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
+ use: {
</code_context>
<issue_to_address>
**suggestion:** Only 'html' reporter is configured; consider adding 'list' or 'dot' for CI readability.
For CI, configure a text-based reporter to improve log readability. You can set the reporter conditionally based on the environment.
```suggestion
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: process.env.CI ? 'list' : 'html',
```
</issue_to_address>
### Comment 4
<location> `e2e/playwright.config.ts:33` </location>
<code_context>
+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
+ use: {
+ /* Base URL to use in actions like `await page.goto('')`. */
+ baseURL: process.env.CONSOLE_UI_URL ?? "http://localhost:3000/",
+
+ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
</code_context>
<issue_to_address>
**issue (bug_risk):** Default baseURL is set to localhost:3000; ensure this matches actual UI port (8088 in compose).
Since the UI runs on port 8088 in docker-compose, updating the default baseURL to 'http://localhost:8088/' will prevent test failures when the environment variable is unset.
</issue_to_address>
### Comment 5
<location> `README.md:61` </location>
<code_context>
| --------------- | ----------------------------- | -------------------------------------- |
| MOCK | Enables or disables mock data | `off` |
| AUTH_REQUIRED | Enable/Disable authentication | false |
+| CONSOLE_API_URL | Enable/Disable authentication | http://localhost:8080 |
| OIDC_CLIENT_ID | Set Oidc Client | frontend |
| OIDC_SERVER_URL | Set Oidc Server URL | `http://localhost:8090/realms/console` |
</code_context>
<issue_to_address>
**issue (typo):** The description for CONSOLE_API_URL appears to be incorrect.
The description for CONSOLE_API_URL should be updated to reflect its actual function, such as 'Set Console API URL'.
```suggestion
| CONSOLE_API_URL | Set Console API URL | http://localhost:8080 |
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Signed-off-by: Carlos Feria <[email protected]>
dce6ec9 to
4f520d1
Compare
Signed-off-by: Carlos Feria <[email protected]>
521b1e4 to
db76958
Compare
Summary by Sourcery
Integrate a Playwright end-to-end testing skeleton by configuring Docker, npm workspaces, GitHub workflows, and an example test
New Features:
Enhancements:
Build:
CI:
Documentation:
Tests: