create-mercato-app 0.4.9-develop.1046.dc78a8fe63 → 0.4.9-develop.1055.9d8322982d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineConfig } from '@playwright/test';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { discoverIntegrationSpecFiles } from '@open-mercato/cli/lib/testing/integration-discovery';
|
|
5
|
+
|
|
6
|
+
const captureScreenshots = process.env.PW_CAPTURE_SCREENSHOTS === '1';
|
|
7
|
+
const isGitHubActions = process.env.GITHUB_ACTIONS === 'true';
|
|
8
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const projectRoot = path.resolve(__dirname, '..', '..', '..');
|
|
10
|
+
const qaTestResultsRoot = path.join(projectRoot, '.ai', 'qa', 'test-results');
|
|
11
|
+
const normalizePath = (value: string) => value.split(path.sep).join('/');
|
|
12
|
+
const STATIC_TEST_IGNORES = [
|
|
13
|
+
`${normalizePath(path.join(projectRoot, '.claude'))}/**`,
|
|
14
|
+
`${normalizePath(path.join(projectRoot, '.codex'))}/**`,
|
|
15
|
+
];
|
|
16
|
+
const discoveredSpecs = discoverIntegrationSpecFiles(projectRoot, path.join(projectRoot, '.ai', 'qa', 'tests'));
|
|
17
|
+
const discoveredSpecPaths = discoveredSpecs.map((entry) => entry.path);
|
|
18
|
+
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
testDir: projectRoot,
|
|
21
|
+
testMatch: discoveredSpecPaths.length > 0 ? discoveredSpecPaths : ['.ai/qa/tests/__no_tests__/*.spec.ts'],
|
|
22
|
+
testIgnore: [
|
|
23
|
+
...STATIC_TEST_IGNORES,
|
|
24
|
+
],
|
|
25
|
+
timeout: 20_000,
|
|
26
|
+
expect: {
|
|
27
|
+
timeout: 20_000,
|
|
28
|
+
},
|
|
29
|
+
retries: 1,
|
|
30
|
+
workers: 1,
|
|
31
|
+
use: {
|
|
32
|
+
baseURL: process.env.BASE_URL || 'http://localhost:3000',
|
|
33
|
+
headless: true,
|
|
34
|
+
screenshot: captureScreenshots ? 'on' : 'only-on-failure',
|
|
35
|
+
trace: 'on-first-retry',
|
|
36
|
+
},
|
|
37
|
+
reporter: isGitHubActions
|
|
38
|
+
? [
|
|
39
|
+
['github'],
|
|
40
|
+
['list'],
|
|
41
|
+
['json', { outputFile: path.join(qaTestResultsRoot, 'results.json') }],
|
|
42
|
+
['html', { outputFolder: path.join(qaTestResultsRoot, 'html'), open: 'never' }],
|
|
43
|
+
]
|
|
44
|
+
: [
|
|
45
|
+
['list'],
|
|
46
|
+
['json', { outputFile: path.join(qaTestResultsRoot, 'results.json') }],
|
|
47
|
+
['html', { outputFolder: path.join(qaTestResultsRoot, 'html'), open: 'never' }],
|
|
48
|
+
],
|
|
49
|
+
outputDir: path.join(qaTestResultsRoot, 'artifacts'),
|
|
50
|
+
});
|
package/template/AGENTS.md
CHANGED
|
@@ -35,12 +35,21 @@ yarn typecheck
|
|
|
35
35
|
# Linting
|
|
36
36
|
yarn lint
|
|
37
37
|
|
|
38
|
-
# Run tests
|
|
38
|
+
# Run unit tests
|
|
39
39
|
yarn test
|
|
40
40
|
|
|
41
|
-
# Run a single test
|
|
41
|
+
# Run a single unit test
|
|
42
42
|
yarn test path/to/test.spec.ts
|
|
43
43
|
|
|
44
|
+
# Run integration tests (spins up fresh ephemeral app + DB, runs Playwright)
|
|
45
|
+
mercato test integration
|
|
46
|
+
|
|
47
|
+
# Start ephemeral app only (for manual QA exploration)
|
|
48
|
+
mercato test ephemeral
|
|
49
|
+
|
|
50
|
+
# View HTML integration test report
|
|
51
|
+
mercato test coverage
|
|
52
|
+
|
|
44
53
|
# Generate code from modules
|
|
45
54
|
yarn generate
|
|
46
55
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"lint": "next lint",
|
|
11
11
|
"typecheck": "tsc --noEmit",
|
|
12
12
|
"test": "jest --config jest.config.cjs",
|
|
13
|
+
"test:integration": "npx playwright test --config .ai/qa/tests/playwright.config.ts",
|
|
13
14
|
"generate": "mercato generate",
|
|
14
15
|
"db:generate": "mercato db generate",
|
|
15
16
|
"db:migrate": "mercato db migrate",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"@open-mercato/sync-akeneo": "{{PACKAGE_VERSION}}"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
75
|
+
"@playwright/test": "^1.58.2",
|
|
74
76
|
"@tailwindcss/postcss": "^4.1.17",
|
|
75
77
|
"@testing-library/dom": "^10.4.0",
|
|
76
78
|
"@testing-library/jest-dom": "^6.9.1",
|