@o3r/core 10.3.0-prerelease.18 → 10.3.0-prerelease.19

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/core",
3
- "version": "10.3.0-prerelease.18",
3
+ "version": "10.3.0-prerelease.19",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -26,7 +26,7 @@
26
26
  "@ngrx/store": "~17.2.0",
27
27
  "@nrwl/devkit": "~18.2.0",
28
28
  "@nx/angular": "~18.2.0",
29
- "@o3r/telemetry": "^10.3.0-prerelease.18",
29
+ "@o3r/telemetry": "^10.3.0-prerelease.19",
30
30
  "@schematics/angular": "~17.3.0",
31
31
  "chokidar": "^3.5.2",
32
32
  "globby": "^11.1.0",
@@ -64,7 +64,7 @@
64
64
  }
65
65
  },
66
66
  "dependencies": {
67
- "@o3r/schematics": "^10.3.0-prerelease.18",
67
+ "@o3r/schematics": "^10.3.0-prerelease.19",
68
68
  "tslib": "^2.6.2",
69
69
  "uuid": "^9.0.0"
70
70
  },
@@ -74,7 +74,7 @@
74
74
  "@ngrx/router-store": "~17.2.0",
75
75
  "@ngrx/effects": "~17.2.0",
76
76
  "@ngrx/store-devtools": "~17.2.0",
77
- "@o3r/store-sync": "^10.3.0-prerelease.18",
77
+ "@o3r/store-sync": "^10.3.0-prerelease.19",
78
78
  "@types/jest": "~29.5.2",
79
79
  "nx": "~18.2.0",
80
80
  "@typescript-eslint/parser": "^7.2.0",
@@ -2,6 +2,5 @@ export * from './o3r-basic-updates/index';
2
2
  export * from './additional-modules/index';
3
3
  export * from './customization-environment/index';
4
4
  export * from './otter-environment/index';
5
- export * from './playwright/index';
6
5
  export * from './store/index';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC"}
@@ -5,6 +5,5 @@ tslib_1.__exportStar(require("./o3r-basic-updates/index"), exports);
5
5
  tslib_1.__exportStar(require("./additional-modules/index"), exports);
6
6
  tslib_1.__exportStar(require("./customization-environment/index"), exports);
7
7
  tslib_1.__exportStar(require("./otter-environment/index"), exports);
8
- tslib_1.__exportStar(require("./playwright/index"), exports);
9
8
  tslib_1.__exportStar(require("./store/index"), exports);
10
9
  //# sourceMappingURL=index.js.map
@@ -1,10 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { NgAddPackageOptions } from '@o3r/schematics';
3
- /**
4
- * Add Playwright to Otter application
5
- * @param options @see RuleFactory.options
6
- * @param options.projectName
7
- * @param rootPath @see RuleFactory.rootPath
8
- */
9
- export declare function updatePlaywright(rootPath: string, options?: NgAddPackageOptions): Rule;
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/playwright/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA+D,IAAI,EAAyC,MAAM,4BAA4B,CAAC;AACtJ,OAAO,EAGL,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AAMzB;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,IAAI,CAoE1F"}
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updatePlaywright = void 0;
4
- const core_1 = require("@angular-devkit/core");
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const schematics_2 = require("@o3r/schematics");
7
- const dependencies_1 = require("@schematics/angular/utility/dependencies");
8
- const path = require("node:path");
9
- const fs = require("node:fs");
10
- /**
11
- * Add Playwright to Otter application
12
- * @param options @see RuleFactory.options
13
- * @param options.projectName
14
- * @param rootPath @see RuleFactory.rootPath
15
- */
16
- function updatePlaywright(rootPath, options = {}) {
17
- const ownPackageJsonPath = path.resolve(__dirname, '..', '..', '..', 'package.json');
18
- const ownPackageJson = JSON.parse(fs.readFileSync(ownPackageJsonPath, { encoding: 'utf-8' }));
19
- return (tree, context) => {
20
- // update gitignore
21
- if (tree.exists('/.gitignore')) {
22
- let gitignore = tree.read('/.gitignore').toString();
23
- if (!gitignore.includes('dist*') && !gitignore.includes('/dist-e2e-playwright') && !gitignore.includes('/playwright-reports')) {
24
- gitignore +=
25
- `
26
- # Playwright
27
- /dist-e2e-playwright
28
- /playwright-reports
29
- `;
30
- tree.overwrite('/.gitignore', gitignore);
31
- }
32
- }
33
- // register scripts
34
- if (tree.exists('/package.json')) {
35
- const packageJson = JSON.parse(tree.read('/package.json').toString());
36
- packageJson.scripts ||= {};
37
- packageJson.scripts['test:playwright'] ||= 'playwright test --config=e2e-playwright/playwright-config.ts';
38
- packageJson.scripts['test:playwright:sanity'] ||= 'playwright test --config=e2e-playwright/playwright-config.sanity.ts';
39
- tree.overwrite('/package.json', JSON.stringify(packageJson, null, 2));
40
- }
41
- const dependencies = ['@playwright/test', 'rimraf'].reduce((acc, dep) => {
42
- acc[dep] = {
43
- inManifest: [{
44
- range: ownPackageJson.generatorDependencies[dep],
45
- types: [dependencies_1.NodeDependencyType.Dev]
46
- }]
47
- };
48
- return acc;
49
- }, {});
50
- const ngAddRules = (0, schematics_2.setupDependencies)({
51
- projectName: options.projectName || undefined,
52
- dependencies
53
- });
54
- // generate files
55
- if (!tree.exists('/e2e-playwright/playwright-config.ts')) {
56
- const name = 'my-scenario';
57
- const scenarioName = core_1.strings.capitalize(core_1.strings.camelize(name));
58
- const sanity = 'my-sanity';
59
- const sanityName = core_1.strings.capitalize(core_1.strings.camelize(sanity));
60
- const templateSource = (0, schematics_1.apply)((0, schematics_1.url)((0, schematics_2.getTemplateFolder)(rootPath, __dirname)), [
61
- (0, schematics_1.template)({
62
- ...core_1.strings,
63
- name,
64
- scenarioName,
65
- sanity,
66
- sanityName
67
- }),
68
- (0, schematics_1.renameTemplateFiles)()
69
- ]);
70
- return (0, schematics_1.chain)([
71
- ngAddRules,
72
- (0, schematics_1.mergeWith)(templateSource, schematics_1.MergeStrategy.Overwrite)
73
- ])(tree, context);
74
- }
75
- return ngAddRules(tree, context);
76
- };
77
- }
78
- exports.updatePlaywright = updatePlaywright;
79
- //# sourceMappingURL=index.js.map
@@ -1,12 +0,0 @@
1
- import {PlaywrightTestConfig} from '@playwright/test';
2
- import * as path from 'node:path';
3
-
4
- import {default as defaultConfig} from './playwright-config';
5
-
6
- const config: PlaywrightTestConfig = {
7
- ...defaultConfig,
8
- testDir: path.join(__dirname, 'sanity'),
9
- testMatch: /.*\.e2e\.ts$/
10
- };
11
-
12
- export default config;
@@ -1,34 +0,0 @@
1
- import { adjustPath } from '@o3r/testing/tools/path-replacement';
2
- import type { PlaywrightTestConfig } from '@playwright/test';
3
- import * as path from 'node:path';
4
-
5
- adjustPath('playwright');
6
-
7
- const FIVE_MINUTES = 1_000 * 60 * 5;
8
-
9
- const reportsFolder = path.join(__dirname, '..', 'playwright-reports');
10
-
11
- const config: PlaywrightTestConfig = {
12
- testDir: path.join(__dirname, '..', 'e2e-playwright'),
13
- testMatch: /.*\.e2e-playwright-spec.ts$/,
14
- reporter: [
15
- ['list'],
16
- ['junit', {outputFile: path.join(reportsFolder, 'junit', 'reporter.xml')}],
17
- ['html', {open: 'never', outputFolder: path.join(reportsFolder, 'html')}]
18
- ],
19
- retries: process.env.CI ? 3 : 0,
20
- forbidOnly: !!process.env.CI,
21
- timeout: FIVE_MINUTES,
22
- use: {
23
- ignoreHTTPSErrors: true,
24
- screenshot: 'only-on-failure',
25
- trace: 'retain-on-failure'
26
- },
27
- projects: [
28
- {name: 'Chromium', use: {browserName: 'chromium'}},
29
- {name: 'Webkit', use: {browserName: 'webkit'}},
30
- {name: 'Firefox', use: {browserName: 'firefox'}}
31
- ]
32
- };
33
-
34
- export default config;
@@ -1,7 +0,0 @@
1
- import { expect, test } from '@playwright/test';
2
-
3
- test.describe.serial('Empty <%= classify(sanityName) %> test', () => {
4
- test('Empty test', ({ page }) => {
5
- expect(page).toBeDefined();
6
- });
7
- });
@@ -1,19 +0,0 @@
1
- import { expect, test } from '@playwright/test';
2
- import { BaseScenario } from '../utils';
3
-
4
- export class <%= classify(scenarioName) %> extends BaseScenario {
5
- protected <%= camelize(scenarioName) %>() {
6
- test.describe.serial('Empty <%= classify(scenarioName) %> tests', () => {
7
- test('Empty test', async ({ page }) => {
8
- await page.goto(this.targetUrl);
9
- await expect(page).toHaveTitle('TestApp');
10
- });
11
- });
12
- }
13
-
14
- public performFlow() {
15
- this.<%= camelize(scenarioName) %>();
16
- }
17
- }
18
-
19
- new <%= classify(scenarioName) %>().run();
@@ -1,29 +0,0 @@
1
- import { test } from '@playwright/test';
2
-
3
- /**
4
- * Interface to define the interface of a flow test
5
- */
6
- export interface Flow {
7
- /**
8
- * Run the flow
9
- */
10
- performFlow(): void;
11
- }
12
-
13
- /**
14
- * Base scenario for e2e scenarios.
15
- * Init the fetch manager and call `performFlow` method.
16
- * E2E Booking flows should inherit from this class.
17
- */
18
- export abstract class BaseScenario implements Flow {
19
-
20
- public targetUrl = process.env.PLAYWRIGHT_TARGET_URL || 'http://localhost:4200/';
21
-
22
- public abstract performFlow();
23
-
24
- public run() {
25
- test.describe.serial(this.constructor.name, () => {
26
- this.performFlow();
27
- });
28
- }
29
- }
@@ -1 +0,0 @@
1
- export * from './base-scenario';