-
Notifications
You must be signed in to change notification settings - Fork 26
Refresh: Part 1 #582
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
Merged
Merged
Refresh: Part 1 #582
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
055f48d
Update cursor and nx console settings
daiscog c930897
Add .nvmrc file
daiscog 228d1e8
Revert to Angular 19 and nx 20 and fix build issues
daiscog c1d8c10
Linting clean up
daiscog f2d3719
Switch to esbuild for building app
daiscog 6ad7d58
Update jest configs
daiscog cfac930
Bootstrap standalone, refactor environment file structure.
daiscog 153fff9
Align app tsconfigs with latest nx defaults
daiscog 72fcb4b
Rejig e2e test structure a bit
daiscog 62d3963
Fix proxy configs and mock auth service
daiscog aca26cb
Do not setup mocks when useMocks option is false
daiscog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "mcpServers": { | ||
| "nx-mcp": { | ||
| "command": "npx", | ||
| "args": ["-y", "nx-mcp@latest"] | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
|
|
||
| # Don't index SpecStory auto-save files, but allow explicit context inclusion via @ references | ||
| .specstory/** |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,3 +62,5 @@ accessibility-reports/ | |
| reports | ||
| .cursor/rules/nx-rules.mdc | ||
| .github/instructions/nx.instructions.md | ||
|
|
||
| .specstory | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 22.18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "nxConsole.generateAiAgentRules": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| FROM repo.backbase.com/backbase-docker-releases/web-base:2.3.1 | ||
|
|
||
| COPY ./dist/apps/golden-sample-app /statics | ||
| COPY ./dist/apps/golden-sample-app/browser /statics |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import playwright from 'eslint-plugin-playwright'; | ||
| import baseConfig from '../../eslint.config.mjs'; | ||
|
|
||
| export default [ | ||
| playwright.configs['flat/recommended'], | ||
| ...baseConfig, | ||
| { | ||
| files: ['**/*.ts', '**/*.js'], | ||
| // Override or add rules here | ||
| rules: {}, | ||
| }, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| import { workspaceRoot } from '@nx/devkit'; | ||
| import { devices, PlaywrightTestConfig } from '@playwright/test'; | ||
| import { join, relative } from 'node:path'; | ||
| import { ProjectTestArgs } from './src/fixtures/environment'; | ||
|
|
||
| // Calculate standard output dirs based on nx project root | ||
| const projectPath = relative(workspaceRoot, __dirname); | ||
| const distDir = join(workspaceRoot, 'dist', '.playwright', projectPath); | ||
|
|
||
| /** | ||
| * See https://playwright.dev/docs/test-configuration. | ||
| */ | ||
| export const baseConfig: PlaywrightTestConfig<ProjectTestArgs> = { | ||
| outputDir: join(distDir, 'test-output'), | ||
| globalSetup: require.resolve('./src/global-setup'), | ||
| expect: { | ||
| toHaveScreenshot: { | ||
| maxDiffPixelRatio: 0.01, | ||
| }, | ||
| }, | ||
| /* Run tests in files in parallel */ | ||
| fullyParallel: true, | ||
| /* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
| forbidOnly: !!process.env.CI, | ||
| /* Retry on CI only */ | ||
| retries: process.env.CI ? 2 : 0, | ||
| /* Opt out of parallel tests on CI. */ | ||
| workers: process.env.CI ? 1 : undefined, | ||
| /* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
| reporter: [ | ||
| ['list'], | ||
| [ | ||
| 'allure-playwright', | ||
| { | ||
| detail: false, | ||
| resultsDir: join(distDir, 'reports/allure'), | ||
| suiteTitle: true, | ||
| links: { | ||
| issue: { | ||
| nameTemplate: 'Issue #%s', | ||
| urlTemplate: 'https://golden-sample-app.com/jira/browse/%s', | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| [ | ||
| 'html', | ||
| { | ||
| outputFolder: join(distDir, 'reports/html'), | ||
| }, | ||
| ], | ||
| ], | ||
| /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
| use: { | ||
| // baseURL, | ||
| screenshot: 'only-on-failure', | ||
| /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
| trace: 'on-first-retry', | ||
| video: 'on-first-retry', | ||
| viewport: { | ||
| width: 1280, | ||
| height: 720, | ||
| }, | ||
| contextOptions: { | ||
| acceptDownloads: true, | ||
| }, | ||
| }, | ||
| projects: [ | ||
| // projects are defined in the other config files | ||
| // that extend this one | ||
| ], | ||
| }; | ||
|
|
||
| export interface DeviceConfig { | ||
| name: string; | ||
| config: (typeof devices)[string]; | ||
| } | ||
|
|
||
| const defaultDevices: DeviceConfig[] = [ | ||
| { | ||
| name: 'chrome', | ||
| config: devices['Desktop Chrome'], | ||
| }, | ||
| { | ||
| name: 'firefox', | ||
| config: devices['Desktop Firefox'], | ||
| }, | ||
| { | ||
| name: 'safari', | ||
| config: devices['Desktop Safari'], | ||
| }, | ||
| ]; | ||
|
|
||
| export type Projects = NonNullable< | ||
| PlaywrightTestConfig<ProjectTestArgs>['projects'] | ||
| >; | ||
|
|
||
| export function withDevices( | ||
| projects: Projects, | ||
| devices = defaultDevices | ||
| ): Projects { | ||
| return projects.flatMap((p) => | ||
| devices.map((d) => ({ | ||
| ...p, | ||
| name: `${p.name}-${d.name}`, | ||
| use: { | ||
| ...p.use, | ||
| ...d.config, | ||
| }, | ||
| })) | ||
| ); | ||
| } |
71 changes: 71 additions & 0 deletions
71
apps/golden-sample-app-e2e/playwright.localhost-mocks.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import { workspaceRoot } from '@nx/devkit'; | ||
| import { defineConfig } from '@playwright/test'; | ||
| import { baseConfig, withDevices } from './playwright.config'; | ||
| import { mocksConfig } from './src/config/mocks.config'; | ||
| import { ProjectTestArgs } from './src/fixtures/environment'; | ||
|
|
||
| const baseURL = 'http://localhost:4200'; | ||
|
|
||
| /** | ||
| * nx executor target name for serving the app locally. | ||
| * Using serve-static for CI as it's faster and less memory-intensive | ||
| */ | ||
| const serveTarget = process.env.CI ? 'serve-static' : 'serve'; | ||
|
|
||
| /** | ||
| * See https://playwright.dev/docs/test-configuration. | ||
| */ | ||
| export default defineConfig<ProjectTestArgs>({ | ||
| ...baseConfig, | ||
| use: { | ||
| ...baseConfig.use, | ||
| baseURL, | ||
| useMocks: true, | ||
| environmentConfig: mocksConfig, | ||
| }, | ||
| /* Run your local dev server before starting the tests (unless a non-default URL is provided in the env vars) */ | ||
| webServer: { | ||
| command: `npx nx run golden-sample-app:${serveTarget}:mocks`, | ||
| url: baseURL, | ||
| reuseExistingServer: true, | ||
| cwd: workspaceRoot, | ||
| }, | ||
| projects: withDevices([ | ||
| { | ||
| name: 'localhost-mocks', | ||
| grep: /@mocks/, | ||
| grepInvert: [/@visual/, /@a11y/], | ||
| use: { | ||
| headless: true, | ||
| launchOptions: { | ||
| chromiumSandbox: false, | ||
| args: ['--disable-infobars', '--no-sandbox', '--incognito'], | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: 'localhost-mocks-visual', | ||
| grep: /@visual/, | ||
| workers: 2, | ||
| use: { | ||
| headless: true, | ||
| launchOptions: { | ||
| chromiumSandbox: false, | ||
| args: ['--disable-infobars', '--no-sandbox', '--incognito'], | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: 'localhost-mocks-a11y', | ||
| grep: /@a11y/, | ||
| workers: 2, | ||
| use: { | ||
| headless: true, | ||
| launchOptions: { | ||
| chromiumSandbox: false, | ||
| args: ['--disable-infobars', '--no-sandbox', '--incognito'], | ||
| }, | ||
| }, | ||
| }, | ||
| ]), | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.