@o3r/testing 12.0.0-next.9 → 12.0.0-rc.0

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,MAA8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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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/testing",
3
- "version": "12.0.0-next.9",
3
+ "version": "12.0.0-rc.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -108,10 +108,10 @@
108
108
  "@angular/platform-browser": "^19.0.0",
109
109
  "@material/slider": "^14.0.0",
110
110
  "@ngrx/store": "^19.0.0",
111
- "@ngx-translate/core": "^15.0.0",
112
- "@o3r/core": "^12.0.0-next.9",
113
- "@o3r/localization": "^12.0.0-next.9",
114
- "@o3r/schematics": "^12.0.0-next.9",
111
+ "@ngx-translate/core": "~16.0.4",
112
+ "@o3r/core": "^12.0.0-rc.0",
113
+ "@o3r/localization": "^12.0.0-rc.0",
114
+ "@o3r/schematics": "^12.0.0-rc.0",
115
115
  "@playwright/test": "^1.49.0",
116
116
  "@schematics/angular": "^19.0.0",
117
117
  "pixelmatch": "^6.0.0",
@@ -197,24 +197,24 @@
197
197
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
198
198
  "@material/slider": "^14.0.0",
199
199
  "@ngrx/store": "~19.0.0",
200
- "@ngx-translate/core": "~15.0.0",
201
- "@nx/eslint-plugin": "~19.8.0",
202
- "@nx/jest": "~19.8.0",
203
- "@o3r/build-helpers": "^12.0.0-next.9",
204
- "@o3r/core": "^12.0.0-next.9",
205
- "@o3r/eslint-plugin": "^12.0.0-next.9",
206
- "@o3r/localization": "^12.0.0-next.9",
207
- "@o3r/schematics": "^12.0.0-next.9",
208
- "@o3r/test-helpers": "^12.0.0-next.9",
209
- "@playwright/test": "~1.49.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-rc.0",
204
+ "@o3r/core": "^12.0.0-rc.0",
205
+ "@o3r/eslint-plugin": "^12.0.0-rc.0",
206
+ "@o3r/localization": "^12.0.0-rc.0",
207
+ "@o3r/schematics": "^12.0.0-rc.0",
208
+ "@o3r/test-helpers": "^12.0.0-rc.0",
209
+ "@playwright/test": "~1.50.0",
210
210
  "@schematics/angular": "~19.0.0",
211
- "@stylistic/eslint-plugin": "~2.7.0",
211
+ "@stylistic/eslint-plugin": "~3.0.0",
212
212
  "@swc/helpers": "~0.5.0",
213
213
  "@types/jest": "~29.5.2",
214
214
  "@types/node": "^20.0.0",
215
215
  "@types/pixelmatch": "^5.2.3",
216
216
  "@types/pngjs": "^6.0.0",
217
- "@typescript-eslint/parser": "~8.19.0",
217
+ "@typescript-eslint/parser": "~8.21.0",
218
218
  "angular-eslint": "~19.0.0",
219
219
  "concurrently": "^9.1.0",
220
220
  "cpy-cli": "^5.0.0",
@@ -233,9 +233,9 @@
233
233
  "jest": "~29.7.0",
234
234
  "jest-environment-jsdom": "~29.7.0",
235
235
  "jest-junit": "~16.0.0",
236
- "jest-preset-angular": "~14.4.0",
236
+ "jest-preset-angular": "~14.5.0",
237
237
  "jsonc-eslint-parser": "~2.4.0",
238
- "nx": "~19.8.0",
238
+ "nx": "~20.2.0",
239
239
  "pid-from-port": "^1.1.3",
240
240
  "pixelmatch": "^6.0.0",
241
241
  "pngjs": "^7.0.0",
@@ -247,9 +247,12 @@
247
247
  "ts-node": "~10.9.2",
248
248
  "type-fest": "^4.30.1",
249
249
  "typescript": "~5.6.2",
250
- "typescript-eslint": "~8.19.0",
250
+ "typescript-eslint": "~8.21.0",
251
251
  "zone.js": "~0.15.0"
252
252
  },
253
+ "generatorDependencies": {
254
+ "@angular-builders/jest": "~19.0.0"
255
+ },
253
256
  "schematics": "./collection.json",
254
257
  "ng-update": {
255
258
  "migrations": "./migration.json"
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAsBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAgJxC;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAsBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAmJxC;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
@@ -16,6 +16,8 @@ const devDependenciesToInstall = [
16
16
  'jest-environment-jsdom',
17
17
  'jest-preset-angular',
18
18
  'ts-jest',
19
+ '@angular-builders/jest',
20
+ '@angular-devkit/build-angular',
19
21
  '@types/jest'
20
22
  ];
21
23
  /**
@@ -117,7 +119,8 @@ function ngAddFn(options) {
117
119
  ]), schematics_1.MergeStrategy.Overwrite);
118
120
  const jestConfigFilesForWorkspace = () => (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./templates/workspace'), [
119
121
  (0, schematics_1.template)({
120
- ...options
122
+ ...options,
123
+ tsconfigPath: `./${['tsconfig.base.json', 'tsconfig.json'].find((tsconfigBase) => tree.exists(`./${tsconfigBase}`))}`
121
124
  }),
122
125
  (0, schematics_1.move)(tree.root.path),
123
126
  (0,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GAGG;AACU,QAAA,KAAK,GAAG,IAAA,kDAAqC,EAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "<%= tsconfigPath %>",
3
+ "compilerOptions": {
4
+ "strictPropertyInitialization": false,
5
+ "strictNullChecks": false,
6
+ "types": ["node", "jest"],
7
+ "composite": true,
8
+ "esModuleInterop": true
9
+ },
10
+ "include": []
11
+ }
@@ -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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AAM,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 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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port * 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"]}