Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .cursor/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"nx-mcp": {
"command": "npx",
"args": ["-y", "nx-mcp@latest"]
}
}
}
3 changes: 3 additions & 0 deletions .cursorindexingignore
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/**
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

125 changes: 0 additions & 125 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ accessibility-reports/
reports
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md

.specstory
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.18
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"nxConsole.generateAiAgentRules": true
}
2 changes: 1 addition & 1 deletion Dockerfile
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
11 changes: 0 additions & 11 deletions allure-report.config.ts

This file was deleted.

11 changes: 0 additions & 11 deletions apps/golden-sample-app-e2e/config/ebp-sndbx.config.json

This file was deleted.

1 change: 0 additions & 1 deletion apps/golden-sample-app-e2e/config/localhost.config.json

This file was deleted.

12 changes: 12 additions & 0 deletions apps/golden-sample-app-e2e/eslint.config.mjs
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: {},
},
];
112 changes: 112 additions & 0 deletions apps/golden-sample-app-e2e/playwright.config.ts
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 apps/golden-sample-app-e2e/playwright.localhost-mocks.config.ts
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'],
},
},
},
]),
});
Loading
Loading