-
Notifications
You must be signed in to change notification settings - Fork 1
chore(test cases): add playwright for e2e tests #132
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: master
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR implements Playwright E2E testing infrastructure for a multi-project Angular workspace, establishing project-specific test configurations for arc-docs, arc, and saas-ui applications. The implementation includes comprehensive test coverage for the arc-docs application with 7 test scenarios covering navigation, page loading, and content verification, along with detailed test plans and documentation.
Key Changes:
- Added Playwright v1.56.1 as a dev dependency with project-specific configurations in
e2e/<project-name>/directories - Implemented comprehensive E2E test suite for arc-docs with tests organized by feature (navigation, getting-started, guide, auth)
- Created supporting documentation (PLAYWRIGHT.md, e2e/README.md) and a detailed 782-line test plan for arc-docs
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| playwright.config.ts | Root Playwright config with minimal settings for cross-project test orchestration |
| package.json | Added Playwright dependency and e2e npm scripts for running tests per project |
| package-lock.json | Locked Playwright v1.56.1 and dependencies; contains unrelated @stripe/stripe-js downgrade |
| e2e/arc-docs/playwright.config.ts | Project-specific config for arc-docs (port 4200) with multi-browser testing setup |
| e2e/arc/playwright.config.ts | Project-specific config for arc (port 4201), but missing test files |
| e2e/saas-ui/playwright.config.ts | Project-specific config for saas-ui (port 4202), but missing test files |
| e2e/arc-docs/tests/seed.spec.ts | Basic smoke test serving as template for arc-docs tests |
| e2e/arc-docs/tests/navigation-and-page-loading/*.spec.ts | Tests for initial page load, direct URL navigation, and menu expansion |
| e2e/arc-docs/tests/getting-started/*.spec.ts | Tests for Getting Started section navigation |
| e2e/arc-docs/tests/guide/*.spec.ts | Tests for Guide section navigation |
| e2e/arc-docs/tests/auth/*.spec.ts | Tests for Auth section navigation and UI components |
| e2e/arc-docs/tests/arc-docs-test-plan.md | Comprehensive 782-line test plan with 15 test scenarios (contains spelling errors) |
| e2e/README.md | Quick reference guide for running E2E tests (references missing npm scripts) |
| PLAYWRIGHT.md | Detailed 427-line documentation covering setup, configuration, and best practices (references missing npm scripts) |
| .vscode/mcp.json | VS Code configuration for Playwright MCP server (command may be invalid) |
| .gitignore | Added Playwright-related directories to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
package.json
Outdated
| "e2e": "playwright test --config=e2e/arc-docs/playwright.config.ts", | ||
| "e2e:all": "npm run e2e:arc-docs && npm run e2e:arc && npm run e2e:saas-ui", | ||
| "e2e:arc-docs": "playwright test --config=e2e/arc-docs/playwright.config.ts", | ||
| "e2e:arc": "playwright test --config=e2e/arc/playwright.config.ts", | ||
| "e2e:headed": "playwright test --headed --config=e2e/arc-docs/playwright.config.ts", |
Copilot
AI
Nov 25, 2025
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.
Multiple npm scripts documented in e2e/README.md and PLAYWRIGHT.md are missing from package.json:
e2e:ui:arc-docs- UI mode for arc-docse2e:ui:arc- UI mode for arce2e:ui:saas-ui- UI mode for saas-uie2e:debug:arc-docs- Debug mode for arc-docse2e:debug:arc- Debug mode for arce2e:debug:saas-ui- Debug mode for saas-uie2e:report:arc-docs- View reports for arc-docse2e:report:arc- View reports for arce2e:report:saas-ui- View reports for saas-ui
These should be added or the documentation should be updated to remove references to non-existent scripts.
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.
removed
| - Introduction | ||
| - Installation | ||
| - Getting User Token | ||
| - Setting Up Api Configration |
Copilot
AI
Nov 25, 2025
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.
Spelling error: "Configration" should be "Configuration"
| - Setting Up Api Configration | |
| - Setting Up Api Configuration |
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.
fixed
| // This config is intentionally minimal as project-specific configs are in subdirectories | ||
| // You can run tests from specific project directories or use the npm scripts | ||
|
|
||
| testDir: './e2e', |
Copilot
AI
Nov 25, 2025
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.
[nitpick] The root config sets testDir: './e2e', but project-specific configs are nested within subdirectories. This configuration may not work as intended since tests are actually in ./e2e/arc-docs/tests/, ./e2e/arc/tests/, etc. Consider either removing the root config entirely (since all tests run through project-specific configs) or clarifying its purpose if it's meant as a template only.
| testDir: './e2e', |
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.
kept for reference
| "e2e": "playwright test --config=e2e/arc-docs/playwright.config.ts", | ||
| "e2e:all": "npm run e2e:arc-docs && npm run e2e:arc && npm run e2e:saas-ui", | ||
| "e2e:arc-docs": "playwright test --config=e2e/arc-docs/playwright.config.ts", | ||
| "e2e:arc": "playwright test --config=e2e/arc/playwright.config.ts", |
Copilot
AI
Nov 25, 2025
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.
Missing npm script definition for e2e:saas-ui. The script is referenced in e2e:all on line 15, and extensively documented in PLAYWRIGHT.md and e2e/README.md, but is not defined in the scripts section. Add:
"e2e:saas-ui": "playwright test --config=e2e/saas-ui/playwright.config.ts",| "e2e:arc": "playwright test --config=e2e/arc/playwright.config.ts", | |
| "e2e:arc": "playwright test --config=e2e/arc/playwright.config.ts", | |
| "e2e:saas-ui": "playwright test --config=e2e/saas-ui/playwright.config.ts", |
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.
added
| 3. Click on "Setting Up Api Configration" | ||
| 4. Verify page loads | ||
|
|
||
| **Expected Results:** | ||
|
|
||
| - URL changes to `/docs/auth-doc/configureEnvs` | ||
| - Page content loads successfully | ||
| - "Setting Up Api Configration" menu item is highlighted as active |
Copilot
AI
Nov 25, 2025
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.
Spelling error: "Configration" should be "Configuration"
| 3. Click on "Setting Up Api Configration" | |
| 4. Verify page loads | |
| **Expected Results:** | |
| - URL changes to `/docs/auth-doc/configureEnvs` | |
| - Page content loads successfully | |
| - "Setting Up Api Configration" menu item is highlighted as active | |
| 3. Click on "Setting Up Api Configuration" | |
| 4. Verify page loads | |
| **Expected Results:** | |
| - URL changes to `/docs/auth-doc/configureEnvs` | |
| - Page content loads successfully | |
| - "Setting Up Api Configuration" menu item is highlighted as active |
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.
fixed
| 3. Click on "Setting Up Api Configration" | ||
| 4. Verify page loads | ||
|
|
||
| **Expected Results:** | ||
|
|
||
| - URL changes to `/docs/auth-doc/configureEnvs` | ||
| - Page content loads successfully | ||
| - "Setting Up Api Configration" menu item is highlighted as active |
Copilot
AI
Nov 25, 2025
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.
Spelling error: "Configration" should be "Configuration"
| 3. Click on "Setting Up Api Configration" | |
| 4. Verify page loads | |
| **Expected Results:** | |
| - URL changes to `/docs/auth-doc/configureEnvs` | |
| - Page content loads successfully | |
| - "Setting Up Api Configration" menu item is highlighted as active | |
| 3. Click on "Setting Up Api Configuration" | |
| 4. Verify page loads | |
| **Expected Results:** | |
| - URL changes to `/docs/auth-doc/configureEnvs` | |
| - Page content loads successfully | |
| - "Setting Up Api Configuration" menu item is highlighted as active |
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.
fixed
| "command": "npx", | ||
| "args": [ | ||
| "playwright", | ||
| "run-test-mcp-server" |
Copilot
AI
Nov 25, 2025
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.
The command playwright run-test-mcp-server does not appear to be a valid Playwright CLI command. The standard Playwright commands are test, show-report, codegen, etc. This configuration may not work as intended. Verify this command exists or update to use valid Playwright commands.
| "run-test-mcp-server" | |
| "test" |
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.
false positive
|
This PR lays out a strong foundation for Playwright E2E across multiple Angular apps with clean configuration and project separation. However, a few things should be addressed to make the E2E setup robust and future-proof: 1. Missing Tests for arc and saas-ui There's no working test suite or even a basic smoke test for // e2e/arc/tests/smoke.spec.ts
import { test, expect } from '@playwright/test';
test('arc home page loads', async ({ page }) => {
await page.goto('http://localhost:4201');
await expect(page.getByRole('heading')).toHaveText(/Arc Home/i);
});Similar is needed for 2. Page Object Pattern Shared selectors and repeated logic should move into page objects. Example structure: // e2e/arc/page-objects/header.po.ts
export class Header {
constructor(private readonly page) {}
logo() { return this.page.getByRole('img', { name: 'Logo' }); }
navLink(name: string) { return this.page.getByRole('link', { name }); }
}
// Usage:
import { Header } from '../page-objects/header.po';
const header = new Header(page);
await expect(header.logo()).toBeVisible();3. Negative/Edge Case Coverage All tests currently cover only positive paths. Please include cases for 404s, invalid inputs, route guards, and error states. Example: test('shows 404 for unknown page', async ({ page }) => {
await page.goto('http://localhost:4201/non-existent-page');
await expect(page.getByText('Page Not Found')).toBeVisible();
});4. CI/CD Integration No CI config is provided for E2E. Recommend adding GitHub Actions that runs Playwright, collects traces/videos, and fails the build on test errors. 5. Test Naming Add and enforce clear naming conventions for test/spec files, e.g. Potential Issues
Summary: Expand coverage for all projects, build out shared page objects, include negative testing, and clarify CI handling. These changes will enhance reliability and help the E2E suite scale with the monorepo. |
Description
Implemented Playwright E2E testing with project-specific configurations in e2e folder for arc-docs, arc, and saas-ui projects, each with isolated test suites, dedicated ports, and independent execution capabilities.
Fixes # (131)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: