@o3r/testing 12.0.0-next.2 → 12.0.0-next.21

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.
@@ -1,10 +1,21 @@
1
- import type { ComponentFixtureProfile } from '../component-fixture';
2
- import { O3rElement, O3rElementConstructor } from './element';
1
+ import type { ComponentFixtureProfile as ComponentFixtureProfileCore, Constructable as ConstructableCore, FixtureWithCustom as FixtureWithCustomCore } from '../component-fixture';
2
+ import { ElementProfile, O3rElement, O3rElementConstructor } from './element';
3
3
  import { O3rGroup, O3rGroupConstructor } from './group';
4
4
  /**
5
5
  * @deprecated Will be removed in v13, please use Playwright instead
6
6
  */
7
- export type { ComponentFixtureProfile, Constructable, FixtureWithCustom } from '../component-fixture';
7
+ export interface ComponentFixtureProfile<V extends ElementProfile = ElementProfile> extends ComponentFixtureProfileCore<V> {
8
+ }
9
+ /**
10
+ * @deprecated Will be removed in v13, please use Playwright instead
11
+ */
12
+ export interface FixtureWithCustom extends FixtureWithCustomCore {
13
+ }
14
+ /**
15
+ * @deprecated Will be removed in v13, please use Playwright instead
16
+ */
17
+ export interface Constructable<T extends ComponentFixtureProfile, U extends FixtureWithCustom = FixtureWithCustom> extends ConstructableCore<T, U> {
18
+ }
8
19
  /**
9
20
  * Implementation of the fixture dedicated to protractor, hence using the webdriver to interact with the dom.
10
21
  * @deprecated Will be removed in v13, please use Playwright instead
@@ -1 +1 @@
1
- {"version":3,"file":"component-fixture.d.ts","sourceRoot":"","sources":["../../../src/core/protractor/component-fixture.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,UAAU,EACV,qBAAqB,EACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,QAAQ,EACR,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAKjB;;GAEG;AACH,YAAY,EAAE,uBAAuB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,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EAAA;;wBAApC,OAAO,GAAG,SAA0B;wBAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;4BACb,MAAM,IAAI,yBAAiB,CAAC,wBAAwB,CAAC,CAAC;wBACxD,CAAC;wBACD,sBAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAC;4BAGhC,sBAAO,QAAQ,EAAC;;;;KACjB;IAED,kBAAkB;IACX,wCAAU,GAAjB;QACE,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,kBAAkB;IACX,8CAAgB,GAAvB;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,kBAAkB;IACL,6CAAe,GAA5B,UAA6B,QAAgB,EAAE,QAAiB;;;;;;wBACxD,aAAa,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC;wBAChE,qBAAM,CAAC,aAAa,IAAI,oBAAO,CAAC,CAAC,gBAAgB,CAAC,eAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAA;4BAA5E,sBAAO,CAAC,CAAC,SAAmE,CAAC,EAAC;;;;KAC/E;IACH,0BAAC;AAAD,CAAC,AAhND,IAgNC;AAhNY,kDAAmB","sourcesContent":["import {\n browser,\n By,\n element,\n ElementFinder,\n} from 'protractor';\nimport {\n FixtureUsageError,\n} from '../../errors/index';\nimport type {\n ComponentFixtureProfile,\n} from '../component-fixture';\nimport {\n withTimeout,\n} from '../helpers';\nimport {\n O3rElement,\n O3rElementConstructor,\n} from './element';\nimport {\n O3rGroup,\n O3rGroupConstructor,\n} from './group';\nimport {\n convertPromise,\n} from './utils';\n\n/**\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport type { ComponentFixtureProfile, Constructable, FixtureWithCustom } from '../component-fixture';\n\n/**\n * Implementation of the fixture dedicated to protractor, hence using the webdriver to interact with the dom.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n /**\n * DOM element linked to the fixture.\n */\n protected rootElement?: V;\n\n /**\n * Root element of this fixture. Optional in a Protractor.\n * All further queries will be applied to the element tree if any, otherwise they will be applied to the whole DOM.\n * @param rootElement\n */\n constructor(rootElement?: V) {\n this.rootElement = rootElement;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param elemnt ElementProfile to test\n * @param _timeout specific timeout that will throw when reach\n */\n protected throwOnUndefinedElement<T extends O3rElement>(elemnt?: T, _timeout?: number): Promise<T> {\n if (!elemnt) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return Promise.resolve(elemnt);\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param elemnt ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefined<T extends O3rElement>(elemnt: Promise<T | undefined>, timeout?: number): Promise<T> {\n return withTimeout(elemnt, timeout)\n .then((el) => {\n if (!el) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return el;\n });\n }\n\n /**\n * Get the element associated to the selector if present\n * @param selector Selector to access the element\n * @param elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options Options supported\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async queryWithOptions(\n selector: string,\n elementConstructor?: O3rElementConstructor<O3rElement>,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}\n ): Promise<O3rElement | undefined> {\n const queryElement: O3rElement | undefined = await (\n options.index === undefined\n ? this.query(selector, elementConstructor as any)\n : this.queryNth(selector, options.index, elementConstructor as any)\n );\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(queryElement, options.timeout);\n }\n return queryElement;\n }\n\n /**\n * Get text from the element associated to the given selector, or undefined if the element is not found or not visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async getText<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<string | undefined> {\n const getTextElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (!getTextElement || !await getTextElement.isVisible()) {\n return;\n }\n return await getTextElement.getText();\n }\n\n /**\n * Check if the element associated to the given selector is visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async isVisible<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<boolean> {\n const isVisibleElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n return !!isVisibleElement && await isVisibleElement.isVisible();\n }\n\n /**\n * Click on the element associated to the given selector if it exists and is visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async click<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<void> {\n const clickElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (!!clickElement && await clickElement.isVisible()) {\n await clickElement.click();\n }\n }\n\n /** @inheritdoc */\n public async query(selector: string, returnType?: undefined): Promise<O3rElement | undefined>;\n public async query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public async query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n const cssSelector = By.css(selector);\n const isElPresent = await (sourceElement ? sourceElement.isElementPresent(cssSelector) : browser.isElementPresent(cssSelector));\n if (!isElPresent) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`No component matching ${selector} found`);\n return;\n }\n const queriedElement = sourceElement ? sourceElement.element(cssSelector) : element(cssSelector);\n return returnType ? new returnType(queriedElement) : new O3rElement(queriedElement);\n }\n\n /** @inheritdoc */\n public async queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement | undefined>;\n public async queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public async queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n const item = (sourceElement || element).all(By.css(selector)).get(index);\n if (!(await item.isPresent())) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`No component matching ${selector}:nth(${index}) found`);\n return;\n }\n return new (returnType || O3rElement)(item);\n }\n\n /** @inheritdoc */\n public async queryAll(_selector: string, _returnType?: undefined, groupType?: undefined, timeout?: number): Promise<O3rElement[]>;\n public async queryAll<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>, groupType?: undefined, timeout?: number): Promise<T[]>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(selector: string, returnType: O3rElementConstructor<T>, groupType: O3rGroupConstructor<K, T>, timeout?: number): Promise<K>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(\n selector: string,\n returnType: O3rElementConstructor<T> | undefined,\n groupType: O3rGroupConstructor<K, T> | undefined,\n _timeout?: number\n ): Promise<(T | O3rElement)[] | K> {\n const pElements = (this.rootElement ? this.rootElement.sourceElement.all(By.css(selector)) : element.all(By.css(selector)))\n .filter((item) => typeof item !== 'undefined')\n .then((elf: ElementFinder[]) => elf.map((item) => (returnType ? new returnType(item) : new O3rElement(item))));\n const elements = await convertPromise(pElements);\n\n if (groupType) {\n const group = new groupType(elements as T[]);\n const isValid = await group.isValidGroup();\n\n if (!isValid) {\n throw new FixtureUsageError('invalid group of items');\n }\n return Promise.resolve(group);\n }\n\n return elements;\n }\n\n /** @inheritdoc */\n public getElement() {\n return this.rootElement;\n }\n\n /** @inheritdoc */\n public getSubComponents(): Promise<{ [componentName: string]: ComponentFixtureProfile[] }> {\n return Promise.resolve({ block: [this] });\n }\n\n /** @inheritDoc */\n public async queryNotPresent(selector: string, _timeout?: number): Promise<boolean> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n return !(await (sourceElement || browser).isElementPresent(By.css(selector)));\n }\n}\n"]}
1
+ {"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/protractor/component-fixture.ts"],"names":[],"mappings":";;;;AAAA,yCAKoB;AACpB,4CAE4B;AAM5B,sCAEoB;AACpB,qCAImB;AAKnB,iCAEiB;AAiBjB;;;GAGG;AACH;IAME;;;;OAIG;IACH,6BAAY,WAAe;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACO,qDAAuB,GAAjC,UAAwD,MAAU,EAAE,QAAiB;QACnF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACa,8CAAgB,GAAhC,UAAuD,MAA8B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;;;wBACxD,aAAa,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC;wBAChE,qBAAM,CAAC,aAAa,IAAI,oBAAO,CAAC,CAAC,gBAAgB,CAAC,eAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAA;4BAA5E,sBAAO,CAAC,CAAC,SAAmE,CAAC,EAAC;;;;KAC/E;IACH,0BAAC;AAAD,CAAC,AAhND,IAgNC;AAhNY,kDAAmB","sourcesContent":["import {\n browser,\n By,\n element,\n ElementFinder,\n} from 'protractor';\nimport {\n FixtureUsageError,\n} from '../../errors/index';\nimport type {\n ComponentFixtureProfile as ComponentFixtureProfileCore,\n Constructable as ConstructableCore,\n FixtureWithCustom as FixtureWithCustomCore,\n} from '../component-fixture';\nimport {\n withTimeout,\n} from '../helpers';\nimport {\n ElementProfile,\n O3rElement,\n O3rElementConstructor,\n} from './element';\nimport {\n O3rGroup,\n O3rGroupConstructor,\n} from './group';\nimport {\n convertPromise,\n} from './utils';\n\n/**\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport interface ComponentFixtureProfile<V extends ElementProfile = ElementProfile> extends ComponentFixtureProfileCore<V> {}\n\n/**\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport interface FixtureWithCustom extends FixtureWithCustomCore {}\n\n/**\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport interface Constructable<T extends ComponentFixtureProfile, U extends FixtureWithCustom = FixtureWithCustom> extends ConstructableCore<T, U> {}\n\n/**\n * Implementation of the fixture dedicated to protractor, hence using the webdriver to interact with the dom.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n /**\n * DOM element linked to the fixture.\n */\n protected rootElement?: V;\n\n /**\n * Root element of this fixture. Optional in a Protractor.\n * All further queries will be applied to the element tree if any, otherwise they will be applied to the whole DOM.\n * @param rootElement\n */\n constructor(rootElement?: V) {\n this.rootElement = rootElement;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param elemnt ElementProfile to test\n * @param _timeout specific timeout that will throw when reach\n */\n protected throwOnUndefinedElement<T extends O3rElement>(elemnt?: T, _timeout?: number): Promise<T> {\n if (!elemnt) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return Promise.resolve(elemnt);\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param elemnt ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefined<T extends O3rElement>(elemnt: Promise<T | undefined>, timeout?: number): Promise<T> {\n return withTimeout(elemnt, timeout)\n .then((el) => {\n if (!el) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return el;\n });\n }\n\n /**\n * Get the element associated to the selector if present\n * @param selector Selector to access the element\n * @param elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options Options supported\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async queryWithOptions(\n selector: string,\n elementConstructor?: O3rElementConstructor<O3rElement>,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}\n ): Promise<O3rElement | undefined> {\n const queryElement: O3rElement | undefined = await (\n options.index === undefined\n ? this.query(selector, elementConstructor as any)\n : this.queryNth(selector, options.index, elementConstructor as any)\n );\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(queryElement, options.timeout);\n }\n return queryElement;\n }\n\n /**\n * Get text from the element associated to the given selector, or undefined if the element is not found or not visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async getText<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<string | undefined> {\n const getTextElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (!getTextElement || !await getTextElement.isVisible()) {\n return;\n }\n return await getTextElement.getText();\n }\n\n /**\n * Check if the element associated to the given selector is visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async isVisible<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<boolean> {\n const isVisibleElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n return !!isVisibleElement && await isVisibleElement.isVisible();\n }\n\n /**\n * Click on the element associated to the given selector if it exists and is visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async click<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<void> {\n const clickElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (!!clickElement && await clickElement.isVisible()) {\n await clickElement.click();\n }\n }\n\n /** @inheritdoc */\n public async query(selector: string, returnType?: undefined): Promise<O3rElement | undefined>;\n public async query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public async query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n const cssSelector = By.css(selector);\n const isElPresent = await (sourceElement ? sourceElement.isElementPresent(cssSelector) : browser.isElementPresent(cssSelector));\n if (!isElPresent) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`No component matching ${selector} found`);\n return;\n }\n const queriedElement = sourceElement ? sourceElement.element(cssSelector) : element(cssSelector);\n return returnType ? new returnType(queriedElement) : new O3rElement(queriedElement);\n }\n\n /** @inheritdoc */\n public async queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement | undefined>;\n public async queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public async queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n const item = (sourceElement || element).all(By.css(selector)).get(index);\n if (!(await item.isPresent())) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`No component matching ${selector}:nth(${index}) found`);\n return;\n }\n return new (returnType || O3rElement)(item);\n }\n\n /** @inheritdoc */\n public async queryAll(_selector: string, _returnType?: undefined, groupType?: undefined, timeout?: number): Promise<O3rElement[]>;\n public async queryAll<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>, groupType?: undefined, timeout?: number): Promise<T[]>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(selector: string, returnType: O3rElementConstructor<T>, groupType: O3rGroupConstructor<K, T>, timeout?: number): Promise<K>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(\n selector: string,\n returnType: O3rElementConstructor<T> | undefined,\n groupType: O3rGroupConstructor<K, T> | undefined,\n _timeout?: number\n ): Promise<(T | O3rElement)[] | K> {\n const pElements = (this.rootElement ? this.rootElement.sourceElement.all(By.css(selector)) : element.all(By.css(selector)))\n .filter((item) => typeof item !== 'undefined')\n .then((elf: ElementFinder[]) => elf.map((item) => (returnType ? new returnType(item) : new O3rElement(item))));\n const elements = await convertPromise(pElements);\n\n if (groupType) {\n const group = new groupType(elements as T[]);\n const isValid = await group.isValidGroup();\n\n if (!isValid) {\n throw new FixtureUsageError('invalid group of items');\n }\n return Promise.resolve(group);\n }\n\n return elements;\n }\n\n /** @inheritdoc */\n public getElement() {\n return this.rootElement;\n }\n\n /** @inheritdoc */\n public getSubComponents(): Promise<{ [componentName: string]: ComponentFixtureProfile[] }> {\n return Promise.resolve({ block: [this] });\n }\n\n /** @inheritDoc */\n public async queryNotPresent(selector: string, _timeout?: number): Promise<boolean> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n return !(await (sourceElement || browser).isElementPresent(By.css(selector)));\n }\n}\n"]}
@@ -53,7 +53,7 @@ var LocalizationDependencyMocks = /** @class */ (function () {
53
53
  if (pipeWithPrefix === void 0) { pipeWithPrefix = false; }
54
54
  return {
55
55
  ngModule: LocalizationDependencyMocks_1,
56
- providers: [{ provide: localization_1.LocalizationTranslatePipe, useClass: pipeWithPrefix ? O3rTranslatePipeMock : TranslatePipeMock }]
56
+ providers: [{ provide: localization_1.O3rLocalizationTranslatePipe, useClass: pipeWithPrefix ? O3rTranslatePipeMock : TranslatePipeMock }]
57
57
  };
58
58
  };
59
59
  var LocalizationDependencyMocks_1;
@@ -1 +1 @@
1
- {"version":3,"file":"localization-mock.js","sourceRoot":"","sources":["../../src/localization/localization-mock.ts"],"names":[],"mappings":";;;AAsEA,wDAoBC;;AA1FD,sCAMuB;AACvB,4CAG6B;AAC7B,kDAI2B;AAC3B,6BAEc;AAEd,IAAM,gCAAgC,GAAG;IACvC,gBAAgB,EAAE,CAAC,IAAI,CAAC;IACxB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,EAAE;IACf,gBAAgB,EAAE,IAAI;CAC+B,CAAC;AAGxD;IAAA;IAIA,CAAC;IAHQ,qCAAS,GAAhB;QAAiB,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QAC7B,OAAO,IAAI,I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A,AAPD,IAOC;AAPY,kEAA2B;AAgBxC;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CACpC,yBAAgG,EAChG,YAAmC,EACnC,2BAAsC,EACtC,QAAgB,EAChB,cAAsB;IAJtB,0CAAA,EAAA,4DAAgG;IAChG,6BAAA,EAAA,iBAAmC;IAEnC,yBAAA,EAAA,gBAAgB;IAChB,+BAAA,EAAA,sBAAsB;IAEtB;QACE,iCAAkB,CAAC,OAAO,CAAC,cAAM,OAAA,yBAAyB,EAAzB,CAAyB,CAAC;QAC3D,sBAAe,CAAC,OAAO,CAAC;YACtB,MAAM,EAAE;gBACN,OAAO,EAAE,sBAAe;gBACxB,QAAQ,EAAE;oBACR,cAAc,EAAE,UAAC,IAAY,IAAK,OAAA,IAAA,SAAE,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAtB,CAAsB;iBACzD;aACF;YACD,QAAQ,EAAE,2BAA2B;SACtC,CAAC;OACC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAC1E;AACJ,CAAC","sourcesContent":["import {\n ModuleWithProviders,\n NgModule,\n Pipe,\n PipeTransform,\n Provider,\n} from '@angular/core';\nimport {\n TranslateLoader,\n TranslateModule,\n} from '@ngx-translate/core';\nimport {\n LocalizationConfiguration,\n LocalizationModule,\n LocalizationTranslatePipe,\n} from '@o3r/localization';\nimport {\n of,\n} from 'rxjs';\n\nconst defaultLocalizationConfiguration = {\n supportedLocales: ['en'],\n language: 'en',\n endPointUrl: '',\n fallbackLanguage: 'en'\n} as const satisfies Partial<LocalizationConfiguration>;\n\n@Pipe({ name: 'translate' })\nexport class TranslatePipeMock implements PipeTransform {\n public transform(...args: any[]): string | undefined {\n return args && args.map((arg) => JSON.parse(arg)).join(', ');\n }\n}\n\n@Pipe({ name: 'o3rTranslate' })\nexport class O3rTranslatePipeMock implements PipeTransform {\n public transform(...args: any[]): string | undefined {\n return args && args.map((arg) => JSON.parse(arg)).join(', ');\n }\n}\n\n@NgModule({\n declarations: [TranslatePipeMock, O3rTranslatePipeMock],\n exports: [TranslatePipeMock, O3rTranslatePipeMock]\n})\nexport class LocalizationDependencyMocks {\n public static forTest(pipeWithPrefix = false): ModuleWithProviders<LocalizationDependencyMocks> {\n return {\n ngModule: LocalizationDependencyMocks,\n providers: [{ provide: LocalizationTranslatePipe, useClass: pipeWithPrefix ? O3rTranslatePipeMock : TranslatePipeMock }]\n };\n }\n}\n\n/** Mock to provide to the MockTranslation module */\nexport interface MockTranslations {\n [lang: string]: {\n [key: string]: any;\n };\n}\n\n/**\n * Function to get the list of modules required to test component using Localization module\n * @param localizationConfiguration Localization configuration\n * @param translations Translations to use\n * @param translationCompilerProvider Provider for translations compiler\n * @param mockPipe Enable translation pipe mocking\n * @param pipeWithPrefix Enable pipe with prefix\n * @returns List of modules to import in the TestBed\n */\nexport function mockTranslationModules(\n localizationConfiguration: Partial<LocalizationConfiguration> = defaultLocalizationConfiguration,\n translations: MockTranslations = {},\n translationCompilerProvider?: Provider,\n mockPipe = false,\n pipeWithPrefix = false\n): ModuleWithProviders<LocalizationModule>[] {\n return [\n LocalizationModule.forRoot(() => localizationConfiguration),\n TranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useValue: {\n getTranslation: (lang: string) => of(translations[lang])\n }\n },\n compiler: translationCompilerProvider\n }),\n ...(mockPipe ? [LocalizationDependencyMocks.forTest(pipeWithPrefix)] : [])\n ];\n}\n"]}
1
+ {"version":3,"file":"localization-mock.js","sourceRoot":"","sources":["../../src/localization/localization-mock.ts"],"names":[],"mappings":";;;AAsEA,wDAoBC;;AA1FD,sCAMuB;AACvB,4CAG6B;AAC7B,kDAI2B;AAC3B,6BAEc;AAEd,IAAM,gCAAgC,GAAG;IACvC,gBAAgB,EAAE,CAAC,IAAI,CAAC;IACxB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,EAAE;IACf,gBAAg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,EAAC;YACR,YAAY,EAAE,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;YACvD,OAAO,EAAE,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;SACnD,CAAC;OACW,2BAA2B,CAOvC;IAAD,kCAAC;CAAA,AAPD,IAOC;AAPY,kEAA2B;AAgBxC;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CACpC,yBAAgG,EAChG,YAAmC,EACnC,2BAAsC,EACtC,QAAgB,EAChB,cAAsB;IAJtB,0CAAA,EAAA,4DAAgG;IAChG,6BAAA,EAAA,iBAAmC;IAEnC,yBAAA,EAAA,gBAAgB;IAChB,+BAAA,EAAA,sBAAsB;IAEtB;QACE,iCAAkB,CAAC,OAAO,CAAC,cAAM,OAAA,yBAAyB,EAAzB,CAAyB,CAAC;QAC3D,sBAAe,CAAC,OAAO,CAAC;YACtB,MAAM,EAAE;gBACN,OAAO,EAAE,sBAAe;gBACxB,QAAQ,EAAE;oBACR,cAAc,EAAE,UAAC,IAAY,IAAK,OAAA,IAAA,SAAE,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAtB,CAAsB;iBACzD;aACF;YACD,QAAQ,EAAE,2BAA2B;SACtC,CAAC;OACC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAC1E;AACJ,CAAC","sourcesContent":["import {\n ModuleWithProviders,\n NgModule,\n Pipe,\n PipeTransform,\n Provider,\n} from '@angular/core';\nimport {\n TranslateLoader,\n TranslateModule,\n} from '@ngx-translate/core';\nimport {\n LocalizationConfiguration,\n LocalizationModule,\n O3rLocalizationTranslatePipe,\n} from '@o3r/localization';\nimport {\n of,\n} from 'rxjs';\n\nconst defaultLocalizationConfiguration = {\n supportedLocales: ['en'],\n language: 'en',\n endPointUrl: '',\n fallbackLanguage: 'en'\n} as const satisfies Partial<LocalizationConfiguration>;\n\n@Pipe({ name: 'translate' })\nexport class TranslatePipeMock implements PipeTransform {\n public transform(...args: any[]): string | undefined {\n return args && args.map((arg) => JSON.parse(arg)).join(', ');\n }\n}\n\n@Pipe({ name: 'o3rTranslate' })\nexport class O3rTranslatePipeMock implements PipeTransform {\n public transform(...args: any[]): string | undefined {\n return args && args.map((arg) => JSON.parse(arg)).join(', ');\n }\n}\n\n@NgModule({\n declarations: [TranslatePipeMock, O3rTranslatePipeMock],\n exports: [TranslatePipeMock, O3rTranslatePipeMock]\n})\nexport class LocalizationDependencyMocks {\n public static forTest(pipeWithPrefix = false): ModuleWithProviders<LocalizationDependencyMocks> {\n return {\n ngModule: LocalizationDependencyMocks,\n providers: [{ provide: O3rLocalizationTranslatePipe, useClass: pipeWithPrefix ? O3rTranslatePipeMock : TranslatePipeMock }]\n };\n }\n}\n\n/** Mock to provide to the MockTranslation module */\nexport interface MockTranslations {\n [lang: string]: {\n [key: string]: any;\n };\n}\n\n/**\n * Function to get the list of modules required to test component using Localization module\n * @param localizationConfiguration Localization configuration\n * @param translations Translations to use\n * @param translationCompilerProvider Provider for translations compiler\n * @param mockPipe Enable translation pipe mocking\n * @param pipeWithPrefix Enable pipe with prefix\n * @returns List of modules to import in the TestBed\n */\nexport function mockTranslationModules(\n localizationConfiguration: Partial<LocalizationConfiguration> = defaultLocalizationConfiguration,\n translations: MockTranslations = {},\n translationCompilerProvider?: Provider,\n mockPipe = false,\n pipeWithPrefix = false\n): ModuleWithProviders<LocalizationModule>[] {\n return [\n LocalizationModule.forRoot(() => localizationConfiguration),\n TranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useValue: {\n getTranslation: (lang: string) => of(translations[lang])\n }\n },\n compiler: translationCompilerProvider\n }),\n ...(mockPipe ? [LocalizationDependencyMocks.forTest(pipeWithPrefix)] : [])\n ];\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/testing",
3
- "version": "12.0.0-next.2",
3
+ "version": "12.0.0-next.21",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -98,27 +98,28 @@
98
98
  },
99
99
  "peerDependencies": {
100
100
  "@amadeus-it-group/kassette": "^1.7.0",
101
- "@angular-devkit/core": "^18.2.0",
102
- "@angular-devkit/schematics": "^18.2.0",
103
- "@angular/animations": "^18.2.0",
104
- "@angular/cli": "^18.2.0",
105
- "@angular/common": "^18.2.0",
106
- "@angular/core": "^18.2.0",
107
- "@angular/forms": "^18.2.0",
108
- "@angular/platform-browser": "^18.2.0",
101
+ "@angular-devkit/core": "^19.0.0",
102
+ "@angular-devkit/schematics": "^19.0.0",
103
+ "@angular/animations": "^19.0.0",
104
+ "@angular/cli": "^19.0.0",
105
+ "@angular/common": "^19.0.0",
106
+ "@angular/core": "^19.0.0",
107
+ "@angular/forms": "^19.0.0",
108
+ "@angular/platform-browser": "^19.0.0",
109
109
  "@material/slider": "^14.0.0",
110
- "@ngrx/store": "^18.0.0",
111
- "@ngx-translate/core": "^15.0.0",
112
- "@o3r/core": "^12.0.0-next.2",
113
- "@o3r/localization": "^12.0.0-next.2",
114
- "@o3r/schematics": "^12.0.0-next.2",
110
+ "@ngrx/store": "^19.0.0",
111
+ "@ngx-translate/core": "~16.0.4",
112
+ "@o3r/core": "^12.0.0-next.21",
113
+ "@o3r/localization": "^12.0.0-next.21",
114
+ "@o3r/schematics": "^12.0.0-next.21",
115
115
  "@playwright/test": "^1.49.0",
116
- "@schematics/angular": "^18.2.0",
117
- "pixelmatch": "^5.2.1",
116
+ "@schematics/angular": "^19.0.0",
117
+ "pixelmatch": "^6.0.0",
118
118
  "pngjs": "^7.0.0",
119
119
  "protractor": "^7.0.0",
120
120
  "rxjs": "^7.8.1",
121
121
  "temporal-polyfill": "^0.2.0",
122
+ "ts-node": "~10.9.2",
122
123
  "type-fest": "^4.10.2",
123
124
  "typescript": "^5.5.4"
124
125
  },
@@ -179,43 +180,43 @@
179
180
  },
180
181
  "devDependencies": {
181
182
  "@amadeus-it-group/kassette": "^1.7.0",
182
- "@angular-devkit/build-angular": "~18.2.0",
183
- "@angular-devkit/core": "~18.2.0",
184
- "@angular-devkit/schematics": "~18.2.0",
185
- "@angular/cli": "~18.2.0",
186
- "@angular/common": "~18.2.0",
187
- "@angular/compiler": "~18.2.0",
188
- "@angular/compiler-cli": "~18.2.0",
189
- "@angular/core": "~18.2.0",
190
- "@angular/forms": "~18.2.0",
191
- "@angular/platform-browser": "~18.2.0",
192
- "@angular/platform-browser-dynamic": "~18.2.0",
183
+ "@angular-devkit/build-angular": "~19.0.0",
184
+ "@angular-devkit/core": "~19.0.0",
185
+ "@angular-devkit/schematics": "~19.0.0",
186
+ "@angular/cli": "~19.0.0",
187
+ "@angular/common": "~19.0.0",
188
+ "@angular/compiler": "~19.0.0",
189
+ "@angular/compiler-cli": "~19.0.0",
190
+ "@angular/core": "~19.0.0",
191
+ "@angular/forms": "~19.0.0",
192
+ "@angular/platform-browser": "~19.0.0",
193
+ "@angular/platform-browser-dynamic": "~19.0.0",
193
194
  "@babel/core": "~7.26.0",
194
195
  "@babel/preset-typescript": "~7.26.0",
195
196
  "@compodoc/compodoc": "^1.1.19",
196
197
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
197
198
  "@material/slider": "^14.0.0",
198
- "@ngrx/store": "~18.0.0",
199
- "@ngx-translate/core": "~15.0.0",
200
- "@nx/eslint-plugin": "~19.8.0",
201
- "@nx/jest": "~19.8.0",
202
- "@o3r/build-helpers": "^12.0.0-next.2",
203
- "@o3r/core": "^12.0.0-next.2",
204
- "@o3r/eslint-plugin": "^12.0.0-next.2",
205
- "@o3r/localization": "^12.0.0-next.2",
206
- "@o3r/schematics": "^12.0.0-next.2",
207
- "@o3r/test-helpers": "^12.0.0-next.2",
199
+ "@ngrx/store": "~19.0.0",
200
+ "@ngx-translate/core": "~16.0.4",
201
+ "@nx/eslint-plugin": "~20.2.0",
202
+ "@nx/jest": "~20.2.0",
203
+ "@o3r/build-helpers": "^12.0.0-next.21",
204
+ "@o3r/core": "^12.0.0-next.21",
205
+ "@o3r/eslint-plugin": "^12.0.0-next.21",
206
+ "@o3r/localization": "^12.0.0-next.21",
207
+ "@o3r/schematics": "^12.0.0-next.21",
208
+ "@o3r/test-helpers": "^12.0.0-next.21",
208
209
  "@playwright/test": "~1.49.0",
209
- "@schematics/angular": "~18.2.0",
210
- "@stylistic/eslint-plugin": "~2.7.0",
210
+ "@schematics/angular": "~19.0.0",
211
+ "@stylistic/eslint-plugin": "~3.0.0",
211
212
  "@swc/helpers": "~0.5.0",
212
213
  "@types/jest": "~29.5.2",
213
214
  "@types/node": "^20.0.0",
214
215
  "@types/pixelmatch": "^5.2.3",
215
216
  "@types/pngjs": "^6.0.0",
216
- "@typescript-eslint/parser": "~8.18.0",
217
- "angular-eslint": "~18.4.0",
218
- "concurrently": "^8.0.0",
217
+ "@typescript-eslint/parser": "~8.21.0",
218
+ "angular-eslint": "~19.0.0",
219
+ "concurrently": "^9.1.0",
219
220
  "cpy-cli": "^5.0.0",
220
221
  "eslint": "~9.17.0",
221
222
  "eslint-import-resolver-node": "^0.3.9",
@@ -232,22 +233,22 @@
232
233
  "jest": "~29.7.0",
233
234
  "jest-environment-jsdom": "~29.7.0",
234
235
  "jest-junit": "~16.0.0",
235
- "jest-preset-angular": "~14.2.0",
236
+ "jest-preset-angular": "~14.5.0",
236
237
  "jsonc-eslint-parser": "~2.4.0",
237
- "nx": "~19.8.0",
238
+ "nx": "~20.2.0",
238
239
  "pid-from-port": "^1.1.3",
239
- "pixelmatch": "^5.2.1",
240
+ "pixelmatch": "^6.0.0",
240
241
  "pngjs": "^7.0.0",
241
242
  "protractor": "^7.0.0",
242
243
  "rxjs": "^7.8.1",
243
244
  "semver": "^7.5.2",
244
245
  "temporal-polyfill": "^0.2.0",
245
- "ts-jest": "~29.2.0",
246
+ "ts-jest": "~29.2.5",
246
247
  "ts-node": "~10.9.2",
247
- "type-fest": "^4.10.2",
248
- "typescript": "~5.5.4",
249
- "typescript-eslint": "~8.18.0",
250
- "zone.js": "~0.14.2"
248
+ "type-fest": "^4.30.1",
249
+ "typescript": "~5.6.2",
250
+ "typescript-eslint": "~8.21.0",
251
+ "zone.js": "~0.15.0"
251
252
  },
252
253
  "schematics": "./collection.json",
253
254
  "ng-update": {
@@ -1 +1 @@
1
- {"version":3,"file":"path-replacement.d.ts","sourceRoot":"","sources":["../../../src/tools/path-replacement/path-replacement.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAIjB;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,YAAY,GAAG,YAAY,EAAE,sBAAsB,GAAE,gBAAqB,QAgDnH"}
1
+ {"version":3,"file":"path-replacement.d.ts","sourceRoot":"","sources":["../../../src/tools/path-replacement/path-replacement.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAIjB;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,YAAY,GAAG,YAAY,EAAE,sBAAsB,GAAE,gBAAqB,QAiDnH"}
@@ -16,6 +16,7 @@ var module_from_string_1 = require("module-from-string");
16
16
  function adjustPath(frameworkName, customTransformOptions) {
17
17
  if (customTransformOptions === void 0) { customTransformOptions = {}; }
18
18
  var modulesCache = {};
19
+ // eslint-disable-next-line @typescript-eslint/unbound-method -- No need to bind the method, we are using `apply`
19
20
  var originalRequire = node_module_1.Module.prototype.require;
20
21
  var regex = new RegExp("@o3r/testing/core(?!/".concat(frameworkName, ")(.*)"));
21
22
  node_module_1.Module.prototype.require = function (id) {
@@ -1 +1 @@
1
- {"version":3,"file":"path-replacement.js","sourceRoot":"","sources":["../../../src/tools/path-replacement/path-replacement.ts"],"names":[],"mappings":";;AAkBA,gCAgDC;;AAlED,4BAA8B;AAC9B,2CAEqB;AACrB,gCAAkC;AAClC,mCAGiB;AACjB,yDAE4B;AAC5B;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,aAA0C,EAAE,sB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AAE,GAAG,IACZ,sBAAsB,EACzB,CAAC;gBAEH;;;;;;mBAMG;gBACH,IAAI,CAAC;oBACH,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAA,sCAAiB,EAAC,KAAK,CAAC,IAAI,EAAE;wBACrD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;wBAC/B,gBAAgB,EAAE,IAAI;qBACvB,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,EAAE,EAAE,CAAC;oBACZ,mEAAmE;oBACnE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;YAED,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;IACH,CAAmB,CAAC;AACtB,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport {\n Module,\n} from 'node:module';\nimport * as path from 'node:path';\nimport {\n TransformOptions,\n transformSync,\n} from 'esbuild';\nimport {\n requireFromString,\n} from 'module-from-string';\n/**\n * Switch to the needed implementation of core testing, when running e2e tests\n * transforms ESM into CJS when needed\n * @param frameworkName Name of the framework used for e2e testing (playwright|protractor)\n * @param customTransformOptions\n */\nexport function adjustPath(frameworkName: 'playwright' | 'protractor', customTransformOptions: TransformOptions = {}) {\n const modulesCache: Record<string, any> = {};\n const originalRequire = Module.prototype.require;\n const regex = new RegExp(`@o3r/testing/core(?!/${frameworkName})(.*)`);\n Module.prototype.require = function (this: NodeJS.Module, id: string) {\n const newId = id.replace(regex, `@o3r/testing/core/${frameworkName}$1`);\n\n try {\n return Reflect.apply(originalRequire, this, [newId]);\n } catch {\n const paths = ([] as string[])\n .concat(this.paths, this.paths.map((i) => i.replace(/[/\\\\]node_modules$/, '')));\n\n const filePath = require.resolve(newId, { paths });\n if (!modulesCache[filePath]) {\n const fileContent = fs.readFileSync(filePath);\n const cwd = path.resolve(process.cwd(), 'src');\n // we use ESBUILD to transform it into CJS\n const trans = transformSync(fileContent.toString(), {\n loader: 'js',\n format: 'cjs',\n target: 'es2016',\n sourcesContent: true,\n sourceRoot: cwd,\n ...customTransformOptions\n });\n\n /**\n * requireFromString will execute the file apart from just returning a module\n * It can throw an exception which will prevent stop the execution\n *\n * That main blocker includes IVY-compatible libraries which have\n * no compiler facade in a global scope.\n */\n try {\n modulesCache[filePath] = requireFromString(trans.code, {\n dirname: path.dirname(filePath),\n useCurrentGlobal: true\n });\n } catch (ex) {\n // eslint-disable-next-line no-console -- no other logger available\n console.error(ex);\n }\n }\n\n return modulesCache[filePath];\n }\n } as NodeJS.Require;\n}\n"]}
1
+ {"version":3,"file":"path-replacement.js","sourceRoot":"","sources":["../../../src/tools/path-replacement/path-replacement.ts"],"names":[],"mappings":";;AAkBA,gCAiDC;;AAnED,4BAA8B;AAC9B,2CAEqB;AACrB,gCAAkC;AAClC,mCAGiB;AACjB,yDAE4B;AAC5B;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,aAA0C,EAAE,sBAA6C;IAA7C,uCAAA,EAAA,2BAA6C;IAClH,IAAM,YAAY,GAAwB,EAAE,CAAC;IAC7C,iHAAiH;IACjH,IAAM,eAAe,GAAG,oBAAM,CAAC,SAAS,CAAC,OAAO,CAAC;IACjD,IAAM,KAAK,GAAG,IAAI,MAAM,CAAC,+BAAwB,aAAa,UAAO,CAAC,CAAC;IACvE,oBAAM,CAAC,SAAS,CAAC,OAAO,GAAG,UAA+B,EAAU;QAClE,IAAM,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,4BAAqB,aAAa,OAAI,CAAC,CAAC;QAExE,IAAI,CAAC;YACH,OAAO,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC;QAAC,WAAM,CAAC;YACP,IAAM,KAAK,GAAI,EAAe;iBAC3B,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,EAAnC,CAAmC,CAAC,CAAC,CAAC;YAElF,IAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;YACnD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC5B,IAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAC9C,IAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;gBAC/C,0CAA0C;gBAC1C,IAAM,KAAK,GAAG,IAAA,uBAAa,EAAC,WAAW,CAAC,QAAQ,EAAE,qBAChD,MAAM,EAAE,IAAI,EACZ,MAAM,EAAE,KAAK,EACb,MAAM,EAAE,QAAQ,EAChB,cAAc,EAAE,IAAI,EACpB,UAAU,EAAE,GAAG,IACZ,sBAAsB,EACzB,CAAC;gBAEH;;;;;;mBAMG;gBACH,IAAI,CAAC;oBACH,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAA,sCAAiB,EAAC,KAAK,CAAC,IAAI,EAAE;wBACrD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;wBAC/B,gBAAgB,EAAE,IAAI;qBACvB,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,EAAE,EAAE,CAAC;oBACZ,mEAAmE;oBACnE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;YAED,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;IACH,CAAmB,CAAC;AACtB,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport {\n Module,\n} from 'node:module';\nimport * as path from 'node:path';\nimport {\n TransformOptions,\n transformSync,\n} from 'esbuild';\nimport {\n requireFromString,\n} from 'module-from-string';\n/**\n * Switch to the needed implementation of core testing, when running e2e tests\n * transforms ESM into CJS when needed\n * @param frameworkName Name of the framework used for e2e testing (playwright|protractor)\n * @param customTransformOptions\n */\nexport function adjustPath(frameworkName: 'playwright' | 'protractor', customTransformOptions: TransformOptions = {}) {\n const modulesCache: Record<string, any> = {};\n // eslint-disable-next-line @typescript-eslint/unbound-method -- No need to bind the method, we are using `apply`\n const originalRequire = Module.prototype.require;\n const regex = new RegExp(`@o3r/testing/core(?!/${frameworkName})(.*)`);\n Module.prototype.require = function (this: NodeJS.Module, id: string) {\n const newId = id.replace(regex, `@o3r/testing/core/${frameworkName}$1`);\n\n try {\n return Reflect.apply(originalRequire, this, [newId]);\n } catch {\n const paths = ([] as string[])\n .concat(this.paths, this.paths.map((i) => i.replace(/[/\\\\]node_modules$/, '')));\n\n const filePath = require.resolve(newId, { paths });\n if (!modulesCache[filePath]) {\n const fileContent = fs.readFileSync(filePath);\n const cwd = path.resolve(process.cwd(), 'src');\n // we use ESBUILD to transform it into CJS\n const trans = transformSync(fileContent.toString(), {\n loader: 'js',\n format: 'cjs',\n target: 'es2016',\n sourcesContent: true,\n sourceRoot: cwd,\n ...customTransformOptions\n });\n\n /**\n * requireFromString will execute the file apart from just returning a module\n * It can throw an exception which will prevent stop the execution\n *\n * That main blocker includes IVY-compatible libraries which have\n * no compiler facade in a global scope.\n */\n try {\n modulesCache[filePath] = requireFromString(trans.code, {\n dirname: path.dirname(filePath),\n useCurrentGlobal: true\n });\n } catch (ex) {\n // eslint-disable-next-line no-console -- no other logger available\n console.error(ex);\n }\n }\n\n return modulesCache[filePath];\n }\n } as NodeJS.Require;\n}\n"]}