@o3r/testing 10.0.0-prerelease.99 → 10.1.0-prerelease.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.
Files changed (57) hide show
  1. package/README.md +2 -1
  2. package/core/angular/angular-materials/autocomplete-material.js.map +1 -1
  3. package/core/angular/angular-materials/select-material.js.map +1 -1
  4. package/core/angular/component-fixture.js.map +1 -1
  5. package/core/angular/elements/checkbox-element.js.map +1 -1
  6. package/core/angular/elements/radio-element.js.map +1 -1
  7. package/core/angular/elements/select-element.js.map +1 -1
  8. package/core/angular/groups/radio-group.js.map +1 -1
  9. package/core/angular/page-fixture.js.map +1 -1
  10. package/core/angular-materials/autocomplete-material.js.map +1 -1
  11. package/core/angular-materials/select-material.js.map +1 -1
  12. package/core/elements/checkbox-element.js.map +1 -1
  13. package/core/elements/radio-element.js.map +1 -1
  14. package/core/elements/select-element.js.map +1 -1
  15. package/core/groups/radio-group.js.map +1 -1
  16. package/core/helpers.js.map +1 -1
  17. package/core/page-fixture.js.map +1 -1
  18. package/core/playwright/angular-materials/autocomplete-material.js.map +1 -1
  19. package/core/playwright/angular-materials/select-material.js.map +1 -1
  20. package/core/playwright/component-fixture.js.map +1 -1
  21. package/core/playwright/elements/checkbox-element.js.map +1 -1
  22. package/core/playwright/elements/radio-element.js.map +1 -1
  23. package/core/playwright/elements/select-element.js.map +1 -1
  24. package/core/playwright/groups/radio-group.js.map +1 -1
  25. package/core/playwright/page-fixture.js.map +1 -1
  26. package/core/protractor/angular-materials/autocomplete-material.js.map +1 -1
  27. package/core/protractor/angular-materials/select-material.js.map +1 -1
  28. package/core/protractor/component-fixture.js.map +1 -1
  29. package/core/protractor/elements/checkbox-element.js.map +1 -1
  30. package/core/protractor/elements/radio-element.js.map +1 -1
  31. package/core/protractor/elements/select-element.js.map +1 -1
  32. package/core/protractor/groups/radio-group.js.map +1 -1
  33. package/core/protractor/page-fixture.js.map +1 -1
  34. package/errors/fixture-usage-error.js.map +1 -1
  35. package/errors/transpilation-purpose-only.js.map +1 -1
  36. package/kassette/update-dates-in-mocks.js.map +1 -1
  37. package/mocks/mock-component-generator.js.map +1 -1
  38. package/package.json +13 -13
  39. package/schematics/add-functions-to-fixture/helpers.js.map +1 -1
  40. package/schematics/add-functions-to-fixture/index.js.map +1 -1
  41. package/schematics/fixture-to-component/index.js.map +1 -1
  42. package/schematics/ng-add/fixture/index.d.ts.map +1 -1
  43. package/schematics/ng-add/fixture/index.js +2 -1
  44. package/schematics/ng-add/fixture/index.js.map +1 -1
  45. package/schematics/ng-add/index.d.ts.map +1 -1
  46. package/schematics/ng-add/index.js +32 -26
  47. package/schematics/ng-add/index.js.map +1 -1
  48. package/schematics/ng-add/playwright/index.d.ts +3 -2
  49. package/schematics/ng-add/playwright/index.d.ts.map +1 -1
  50. package/schematics/ng-add/playwright/index.js +19 -8
  51. package/schematics/ng-add/playwright/index.js.map +1 -1
  52. package/schematics/playwright/sanity/index.js.map +1 -1
  53. package/schematics/playwright/scenario/index.js.map +1 -1
  54. package/store/testable-select.js.map +1 -1
  55. package/tools/path-replacement/path-replacement.js.map +1 -1
  56. package/visual-test/utils.js.map +1 -1
  57. package/visual-test/visual-test.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/protractor/component-fixture.ts"],"names":[],"mappings":";;;;AAAA,4BAA4B;AAC5B,yCAAiE;AACjE,4CAAuD;AAGvD,sCAAyC;AACzC,qCAA8D;AAE9D,iCAAyC;AAIzC;;GAEG;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;YACX,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SACl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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,AAjND,IAiNC;AAjNY,kDAAmB","sourcesContent":["/* eslint-disable new-cap */\nimport { browser, By, element, ElementFinder } from 'protractor';\nimport { FixtureUsageError } from '../../errors/index';\n\nimport type { ComponentFixtureProfile } from '../component-fixture';\nimport { withTimeout } from '../helpers';\nimport { O3rElement, O3rElementConstructor } from './element';\nimport { O3rGroup, O3rGroupConstructor } from './group';\nimport { convertPromise } from './utils';\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 */\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 /**\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 let queryElement: O3rElement | undefined;\n if (options.index !== undefined) {\n queryElement = await this.queryNth(selector, options.index, elementConstructor as any);\n } else {\n queryElement = await this.query(selector, 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 // eslint-disable-next-line @typescript-eslint/no-misused-promises\n const isElPresent = await (sourceElement! || browser).isElementPresent(cssSelector);\n if (!isElPresent) {\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 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,4BAA4B;AAC5B,yCAAiE;AACjE,4CAAuD;AAGvD,sCAAyC;AACzC,qCAA8D;AAE9D,iCAAyC;AAIzC;;GAEG;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,EAAE,OAAgB;;;;gBACrG,sBAAO,IAAA,qBAAW,EAAC,MAAM,EAAE,OAAO,CAAC;yBAChC,IAAI,CAAC,UAAC,EAAE;wBACP,IAAI,CAAC,EAAE,EAAE,CAAC;4BACR,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,KAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;wBACnE,CAAC;wBACD,OAAO,EAAE,CAAC;oBACZ,CAAC,CAAC,EAAC;;;KACN;IAGD;;;;;;;;OAQG;IACa,8CAAgB,GAAhC,UACE,QAAgB,EAChB,kBAAsD,EACtD,OAIM;QAJN,wBAAA,EAAA,YAIM;;;;;;6BAGF,CAAA,OAAO,CAAC,KAAK,KAAK,SAAS,CAAA,EAA3B,wBAA2B;wBACd,qBAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,EAAE,kBAAyB,CAAC,EAAA;;wBAAtF,YAAY,GAAG,SAAuE,CAAC;;4BAExE,qBAAM,IAA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CAAC;wBAC7B,qBAAM,KAAK,CAAC,YAAY,EAAE,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,EAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;IAC1C,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,AAjND,IAiNC;AAjNY,kDAAmB","sourcesContent":["/* eslint-disable new-cap */\nimport { browser, By, element, ElementFinder } from 'protractor';\nimport { FixtureUsageError } from '../../errors/index';\n\nimport type { ComponentFixtureProfile } from '../component-fixture';\nimport { withTimeout } from '../helpers';\nimport { O3rElement, O3rElementConstructor } from './element';\nimport { O3rGroup, O3rGroupConstructor } from './group';\nimport { convertPromise } from './utils';\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 */\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 /**\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 let queryElement: O3rElement | undefined;\n if (options.index !== undefined) {\n queryElement = await this.queryNth(selector, options.index, elementConstructor as any);\n } else {\n queryElement = await this.query(selector, 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 // eslint-disable-next-line @typescript-eslint/no-misused-promises\n const isElPresent = await (sourceElement! || browser).isElementPresent(cssSelector);\n if (!isElPresent) {\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 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 +1 @@
1
- {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AAEA,sCAAsC;AAEtC;;GAEG;AACH;IAAwC,8CAAU;IAChD,4BAAY,aAA4B;eACtC,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,kCAAK,GAAlB,UAAmB,KAAY,EAAE,eAA4B;QAA1C,sBAAA,EAAA,YAAY;;;;;4BACR,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAArC,YAAY,GAAG,SAAsB;wBAC3C,IAAI,YAAY,KAAK,KAAK,EAAE;4BAC1B,sBAAO,OAAO,CAAC,OAAO,EAAE,EAAC;yBAC1B;wBAED,sBAAO,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,EAAC;;;;KACjE;IAED,kBAAkB;IACX,oCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACL,sCAAS,GAAtB;;;;;4BACgB,qBAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,EAAA;;wBAA7C,KAAK,GAAG,SAAqC;wBACnD,sBAAO,KAAK,EAAC;;;;KACd;IACH,yBAAC;AAAD,CAAC,AAzBD,CAAwC,oBAAU,GAyBjD;AAzBY,gDAAkB","sourcesContent":["import {ElementFinder} from 'protractor';\nimport {CheckboxElementProfile} from '../../elements';\nimport {O3rElement} from '../element';\n\n/**\n * Implementation dedicated to karma / TestBed.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true, associatedLabel?: O3rElement) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n return Promise.resolve();\n }\n\n return associatedLabel ? associatedLabel.click() : this.click();\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const value = await this.sourceElement.isSelected();\n return value;\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AAEA,sCAAsC;AAEtC;;GAEG;AACH;IAAwC,8CAAU;IAChD,4BAAY,aAA4B;QACtC,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,kCAAK,GAAlB,UAAmB,KAAY,EAAE,eAA4B;QAA1C,sBAAA,EAAA,YAAY;;;;;4BACR,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAArC,YAAY,GAAG,SAAsB;wBAC3C,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;4BAC3B,sBAAO,OAAO,CAAC,OAAO,EAAE,EAAC;wBAC3B,CAAC;wBAED,sBAAO,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,EAAC;;;;KACjE;IAED,kBAAkB;IACX,oCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACL,sCAAS,GAAtB;;;;;4BACgB,qBAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,EAAA;;wBAA7C,KAAK,GAAG,SAAqC;wBACnD,sBAAO,KAAK,EAAC;;;;KACd;IACH,yBAAC;AAAD,CAAC,AAzBD,CAAwC,oBAAU,GAyBjD;AAzBY,gDAAkB","sourcesContent":["import {ElementFinder} from 'protractor';\nimport {CheckboxElementProfile} from '../../elements';\nimport {O3rElement} from '../element';\n\n/**\n * Implementation dedicated to karma / TestBed.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true, associatedLabel?: O3rElement) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n return Promise.resolve();\n }\n\n return associatedLabel ? associatedLabel.click() : this.click();\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const value = await this.sourceElement.isSelected();\n return value;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/radio-element.ts"],"names":[],"mappings":";;;;AAEA,sCAAsC;AAEtC;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAA4B;eACtC,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,+BAAK,GAAlB,UAAmB,KAAY;QAAZ,sBAAA,EAAA,YAAY;;;;;4BACR,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAArC,YAAY,GAAG,SAAsB;wBAC3C,IAAI,YAAY,KAAK,KAAK,EAAE;4BAC1B,OAAO,CAAC,IAAI,CAAC,qCAA8B,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAE,CAAC,CAAC;4BAC9E,sBAAO,OAAO,CAAC,OAAO,EAAE,EAAC;yBAC1B;wBAED,sBAAO,IAAI,CAAC,KAAK,EAAE,EAAC;;;;KACrB;IAED,kBAAkB;IACX,iCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACL,mCAAS,GAAtB;;;;;4BACkB,qBAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAA;;wBAA5C,OAAO,GAAG,SAAkC;wBAClD,sBAAO,OAAO,KAAK,SAAS,EAAC;;;;KAC9B;IACH,sBAAC;AAAD,CAAC,AA1BD,CAAqC,oBAAU,GA0B9C;AA1BY,0CAAe","sourcesContent":["import {ElementFinder} from 'protractor';\nimport {RadioElementProfile} from '../../elements';\nimport {O3rElement} from '../element';\n\n/**\n * Implementation dedicated to karma / TestBed.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n console.warn(`O3rRadioElement is already ${value ? 'checked' : 'unchecked'}`);\n return Promise.resolve();\n }\n\n return this.click();\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const checked = await this.getAttribute('checked');\n return checked !== undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/radio-element.ts"],"names":[],"mappings":";;;;AAEA,sCAAsC;AAEtC;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAA4B;QACtC,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,+BAAK,GAAlB,UAAmB,KAAY;QAAZ,sBAAA,EAAA,YAAY;;;;;4BACR,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAArC,YAAY,GAAG,SAAsB;wBAC3C,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;4BAC3B,OAAO,CAAC,IAAI,CAAC,qCAA8B,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAE,CAAC,CAAC;4BAC9E,sBAAO,OAAO,CAAC,OAAO,EAAE,EAAC;wBAC3B,CAAC;wBAED,sBAAO,IAAI,CAAC,KAAK,EAAE,EAAC;;;;KACrB;IAED,kBAAkB;IACX,iCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACL,mCAAS,GAAtB;;;;;4BACkB,qBAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAA;;wBAA5C,OAAO,GAAG,SAAkC;wBAClD,sBAAO,OAAO,KAAK,SAAS,EAAC;;;;KAC9B;IACH,sBAAC;AAAD,CAAC,AA1BD,CAAqC,oBAAU,GA0B9C;AA1BY,0CAAe","sourcesContent":["import {ElementFinder} from 'protractor';\nimport {RadioElementProfile} from '../../elements';\nimport {O3rElement} from '../element';\n\n/**\n * Implementation dedicated to karma / TestBed.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n console.warn(`O3rRadioElement is already ${value ? 'checked' : 'unchecked'}`);\n return Promise.resolve();\n }\n\n return this.click();\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const checked = await this.getAttribute('checked');\n return checked !== undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/select-element.ts"],"names":[],"mappings":";;;;AAAA,yCAA6C;AAE7C,sCAAsC;AAItC;;GAEG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,aAAyC;eACnD,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,eAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;wBAC7D,sBAAO,IAAI,oBAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KACnD;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,eAAE,CAAC,GAAG,CAAC,wBAAiB,KAAK,OAAI,CAAC,CAAC,CAAC;wBAC9E,sBAAO,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KACvC;IACH,uBAAC;AAAD,CAAC,AAlBD,CAAsC,oBAAU,GAkB/C;AAlBY,4CAAgB","sourcesContent":["import {By, ElementFinder} from 'protractor';\nimport {SelectElementProfile} from '../../elements';\nimport {O3rElement} from '../element';\n\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Protractor.\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.all(By.tagName('option'));\n return new O3rElement(options.get(index)).click();\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n const option = this.sourceElement.element(By.css(`option[value='${value}']`));\n return new O3rElement(option).click();\n }\n}\n"]}
1
+ {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/select-element.ts"],"names":[],"mappings":";;;;AAAA,yCAA6C;AAE7C,sCAAsC;AAItC;;GAEG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,aAAyC;QACnD,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,eAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;wBAC7D,sBAAO,IAAI,oBAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KACnD;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,eAAE,CAAC,GAAG,CAAC,wBAAiB,KAAK,OAAI,CAAC,CAAC,CAAC;wBAC9E,sBAAO,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KACvC;IACH,uBAAC;AAAD,CAAC,AAlBD,CAAsC,oBAAU,GAkB/C;AAlBY,4CAAgB","sourcesContent":["import {By, ElementFinder} from 'protractor';\nimport {SelectElementProfile} from '../../elements';\nimport {O3rElement} from '../element';\n\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Protractor.\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.all(By.tagName('option'));\n return new O3rElement(options.get(index)).click();\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n const option = this.sourceElement.element(By.css(`option[value='${value}']`));\n return new O3rElement(option).click();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/core/protractor/groups/radio-group.ts"],"names":[],"mappings":";;;;AAEA,kCAAoC;AAEpC;;GAEG;AACH;IAAmC,yCAAyB;IAC1D,uBAAY,aAAgC;eAC1C,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,oCAAY,GAAzB;;;;;;wBACM,IAAI,GAAG,EAAE,CAAC;8BAEe,EAAV,KAAA,IAAI,CAAC,KAAK;;;6BAAV,CAAA,cAAU,CAAA;wBAAlB,IAAI;wBACI,qBAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAA;;wBAA1C,QAAQ,GAAG,SAA+B;wBAChD,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,QAAQ,EAAE;4BACpC,OAAO,CAAC,IAAI,CAAC,uFAAgF,IAAI,kBAAQ,QAAQ,IAAI,WAAW,CAAE,CAAC,CAAC;4BACpI,sBAAO,KAAK,EAAC;yBACd;wBACD,IAAI,QAAQ,KAAK,SAAS,EAAE;4BAC1B,IAAI,GAAG,QAAQ,CAAC;yBACjB;;;wBARgB,IAAU,CAAA;;4BAW7B,sBAAO,IAAI,EAAC;;;;KACb;IAED;;OAEG;IACU,uCAAe,GAA5B;;;;;;8BAE+B,EAAV,KAAA,IAAI,CAAC,KAAK;;;6BAAV,CAAA,cAAU,CAAA;wBAAlB,IAAI;wBACM,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAAnC,UAAU,GAAG,SAAsB;wBACzC,IAAI,UAAU,EAAE;4BACd,sBAAO,IAAI,EAAC;yBACb;;;wBAJgB,IAAU,CAAA;;4BAO7B,sBAAO,SAAS,EAAC;;;;KAClB;IACH,oBAAC;AAAD,CAAC,AArCD,CAAmC,gBAAQ,GAqC1C;AArCY,sCAAa","sourcesContent":["import { RadioGroupProfile } from '../../groups/radio-group';\nimport { O3rRadioElement } from '../elements/radio-element';\nimport { O3rGroup } from '../group';\n\n/**\n * Group element to manage a radio group\n */\nexport class O3rRadioGroup extends O3rGroup<O3rRadioElement> implements RadioGroupProfile {\n constructor(sourceElement: O3rRadioElement[]) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async isValidGroup() {\n let name = '';\n\n for (const item of this.items) {\n const itemName = await item.getAttribute('name');\n if (name !== '' && name !== itemName) {\n console.warn(`Items in this radio group are not consistent, incompatible input names found ${name} and ${itemName || 'undefined'}`);\n return false;\n }\n if (itemName !== undefined) {\n name = itemName;\n }\n }\n\n return true;\n }\n\n /**\n * Get the selected radio\n */\n public async getSelectedItem() {\n\n for (const item of this.items) {\n const isSelected = await item.isChecked();\n if (isSelected) {\n return item;\n }\n }\n\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/core/protractor/groups/radio-group.ts"],"names":[],"mappings":";;;;AAEA,kCAAoC;AAEpC;;GAEG;AACH;IAAmC,yCAAyB;IAC1D,uBAAY,aAAgC;QAC1C,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,oCAAY,GAAzB;;;;;;wBACM,IAAI,GAAG,EAAE,CAAC;8BAEe,EAAV,KAAA,IAAI,CAAC,KAAK;;;6BAAV,CAAA,cAAU,CAAA;wBAAlB,IAAI;wBACI,qBAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAA;;wBAA1C,QAAQ,GAAG,SAA+B;wBAChD,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;4BACrC,OAAO,CAAC,IAAI,CAAC,uFAAgF,IAAI,kBAAQ,QAAQ,IAAI,WAAW,CAAE,CAAC,CAAC;4BACpI,sBAAO,KAAK,EAAC;wBACf,CAAC;wBACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;4BAC3B,IAAI,GAAG,QAAQ,CAAC;wBAClB,CAAC;;;wBARgB,IAAU,CAAA;;4BAW7B,sBAAO,IAAI,EAAC;;;;KACb;IAED;;OAEG;IACU,uCAAe,GAA5B;;;;;;8BAE+B,EAAV,KAAA,IAAI,CAAC,KAAK;;;6BAAV,CAAA,cAAU,CAAA;wBAAlB,IAAI;wBACM,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAAnC,UAAU,GAAG,SAAsB;wBACzC,IAAI,UAAU,EAAE,CAAC;4BACf,sBAAO,IAAI,EAAC;wBACd,CAAC;;;wBAJgB,IAAU,CAAA;;4BAO7B,sBAAO,SAAS,EAAC;;;;KAClB;IACH,oBAAC;AAAD,CAAC,AArCD,CAAmC,gBAAQ,GAqC1C;AArCY,sCAAa","sourcesContent":["import { RadioGroupProfile } from '../../groups/radio-group';\nimport { O3rRadioElement } from '../elements/radio-element';\nimport { O3rGroup } from '../group';\n\n/**\n * Group element to manage a radio group\n */\nexport class O3rRadioGroup extends O3rGroup<O3rRadioElement> implements RadioGroupProfile {\n constructor(sourceElement: O3rRadioElement[]) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async isValidGroup() {\n let name = '';\n\n for (const item of this.items) {\n const itemName = await item.getAttribute('name');\n if (name !== '' && name !== itemName) {\n console.warn(`Items in this radio group are not consistent, incompatible input names found ${name} and ${itemName || 'undefined'}`);\n return false;\n }\n if (itemName !== undefined) {\n name = itemName;\n }\n }\n\n return true;\n }\n\n /**\n * Get the selected radio\n */\n public async getSelectedItem() {\n\n for (const item of this.items) {\n const isSelected = await item.isChecked();\n if (isSelected) {\n return item;\n }\n }\n\n return undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../../src/core/protractor/page-fixture.ts"],"names":[],"mappings":";;;;AAAA,yCAAmC;AAEnC,yDAAwD;AAExD,iCAAuC;AAIvC;;GAEG;AACH;IAAuE,0CAAsB;IAC3F,wBAAY,WAAe;eACzB,kBAAM,WAAW,CAAC;IACpB,CAAC;IAEM,iCAAQ,GAAf;QACE,OAAO,IAAA,sBAAc,EAAC,oBAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC5C,CAAC;IACH,qBAAC;AAAD,CAAC,AARD,CAAuE,uCAAmB,GAQzF;AARY,wCAAc","sourcesContent":["import {browser} from 'protractor';\nimport {PageFixtureProfile} from '../page-fixture';\nimport {O3rComponentFixture} from './component-fixture';\nimport {O3rElement} from './element';\nimport {convertPromise} from './utils';\n\nexport {PageFixtureProfile} from '../page-fixture';\n\n/**\n * Implementation of the page fixture dedicated to protractor.\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\n constructor(rootElement?: V) {\n super(rootElement);\n }\n\n public getTitle() {\n return convertPromise(browser.getTitle());\n }\n}\n"]}
1
+ {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../../src/core/protractor/page-fixture.ts"],"names":[],"mappings":";;;;AAAA,yCAAmC;AAEnC,yDAAwD;AAExD,iCAAuC;AAIvC;;GAEG;AACH;IAAuE,0CAAsB;IAC3F,wBAAY,WAAe;QACzB,OAAA,MAAK,YAAC,WAAW,CAAC,SAAC;IACrB,CAAC;IAEM,iCAAQ,GAAf;QACE,OAAO,IAAA,sBAAc,EAAC,oBAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC5C,CAAC;IACH,qBAAC;AAAD,CAAC,AARD,CAAuE,uCAAmB,GAQzF;AARY,wCAAc","sourcesContent":["import {browser} from 'protractor';\nimport {PageFixtureProfile} from '../page-fixture';\nimport {O3rComponentFixture} from './component-fixture';\nimport {O3rElement} from './element';\nimport {convertPromise} from './utils';\n\nexport {PageFixtureProfile} from '../page-fixture';\n\n/**\n * Implementation of the page fixture dedicated to protractor.\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\n constructor(rootElement?: V) {\n super(rootElement);\n }\n\n public getTitle() {\n return convertPromise(browser.getTitle());\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"fixture-usage-error.js","sourceRoot":"","sources":["../../src/errors/fixture-usage-error.ts"],"names":[],"mappings":";;;;AAAA;;GAEG;AACH;IAAuC,6CAAK;IAC1C,2BAAY,OAA+B;QAA/B,wBAAA,EAAA,+BAA+B;QAA3C,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;;IAClC,CAAC;IACH,wBAAC;AAAD,CAAC,AALD,CAAuC,KAAK,GAK3C;AALY,8CAAiB","sourcesContent":["/**\n * Exception to indicate that a fixture is being used with invalid parameters.\n */\nexport class FixtureUsageError extends Error {\n constructor(message = 'Fixture usage error') {\n super(message);\n this.name = 'FixtureUsageError';\n }\n}\n"]}
1
+ {"version":3,"file":"fixture-usage-error.js","sourceRoot":"","sources":["../../src/errors/fixture-usage-error.ts"],"names":[],"mappings":";;;;AAAA;;GAEG;AACH;IAAuC,6CAAK;IAC1C,2BAAY,OAA+B;QAA/B,wBAAA,EAAA,+BAA+B;QACzC,YAAA,MAAK,YAAC,OAAO,CAAC,SAAC;QACf,KAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;;IAClC,CAAC;IACH,wBAAC;AAAD,CAAC,AALD,CAAuC,KAAK,GAK3C;AALY,8CAAiB","sourcesContent":["/**\n * Exception to indicate that a fixture is being used with invalid parameters.\n */\nexport class FixtureUsageError extends Error {\n constructor(message = 'Fixture usage error') {\n super(message);\n this.name = 'FixtureUsageError';\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"transpilation-purpose-only.js","sourceRoot":"","sources":["../../src/errors/transpilation-purpose-only.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH;IAAmD,yDAAK;IACtD,uCAAY,OAAsC;QAAtC,wBAAA,EAAA,sCAAsC;QAAlD,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;;IACzC,CAAC;IACH,oCAAC;AAAD,CAAC,AALD,CAAmD,KAAK,GAKvD;AALY,sEAA6B","sourcesContent":["/**\n * Exception to indicate that the code run is for transpilation purpose only.\n * It should not be used during runtime process\n */\nexport class TranspilationPurposeOnlyError extends Error {\n constructor(message = 'Transpilation purpose only') {\n super(message);\n this.name = 'TranspilationPurposeOnly';\n }\n}\n"]}
1
+ {"version":3,"file":"transpilation-purpose-only.js","sourceRoot":"","sources":["../../src/errors/transpilation-purpose-only.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH;IAAmD,yDAAK;IACtD,uCAAY,OAAsC;QAAtC,wBAAA,EAAA,sCAAsC;QAChD,YAAA,MAAK,YAAC,OAAO,CAAC,SAAC;QACf,KAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;;IACzC,CAAC;IACH,oCAAC;AAAD,CAAC,AALD,CAAmD,KAAK,GAKvD;AALY,sEAA6B","sourcesContent":["/**\n * Exception to indicate that the code run is for transpilation purpose only.\n * It should not be used during runtime process\n */\nexport class TranspilationPurposeOnlyError extends Error {\n constructor(message = 'Transpilation purpose only') {\n super(message);\n this.name = 'TranspilationPurposeOnly';\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"update-dates-in-mocks.js","sourceRoot":"","sources":["../../src/kassette/update-dates-in-mocks.ts"],"names":[],"mappings":";;;;AACA,uDAA2C;AAiC3C;;;;GAIG;AACH,SAAsB,kBAAkB,CAAC,IAAW,EAAE,YAAqD;;IAArD,6BAAA,E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AAC,GAAG,CAAC,WAAI,IAAI,CAAC,IAAI,CAAC,YAAU,CAAC,IAAI,GAAG,CAAC,CAAC,MAAG,CAAC,CAAC,EAAtG,CAAsG,CAAC,CAAC;6BAC7J;yBACF;wBACD,OAAO,MAAM,CAAC;oBAChB,CAAC,CAAC;oBACI,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC;wBACxC,IAAI,EAAE,YAAY,CAAC,IAAI;wBACvB,IAAI,EAAE,oBAAoB,CAAC,CAAA,MAAA,YAAY,CAAC,IAAI,0CAAE,QAAQ,EAAE,KAAI,EAAE,CAAC;qBAChE,CAAC,CAAC;oBACH,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;oBAC7C,qBAAM,IAAI,CAAC,YAAY,EAAE,EAAA;;oBAAzB,SAAyB,CAAC;;;;;;CAIjC;AAtED,gDAsEC","sourcesContent":["import type {IMock} from '@amadeus-it-group/kassette';\nimport {Temporal} from 'temporal-polyfill';\n\n/**\n * Options to be passed to `updateDatesInMocks`\n */\nexport interface UpdateDatesInMocksOptions {\n /**\n * 'any': dates in inputs will be ignored when computing checksum, the dates on the output will be updated to keep the same day offset\n * 'day-offset': dates in inputs will be converted to day offsets, the dates on the output will be updated to keep the same day offset\n * 'same-day-of-week': dates in inputs will be converted to day of week, the dates on the output will be updated to keep the same day of week but increment the week\n */\n mode: 'any' | 'day-offset' | 'same-day-of-week';\n /**\n * RegExp used to extract dates from request and response\n */\n extractor: RegExp;\n /**\n * Functions to be used to convert from Temporal objects to strings, and strings to temporal objects\n */\n converter: {\n /**\n * Converter from Temporal to string\n * @param input\n */\n fromDate: (input: Temporal.ZonedDateTime | Temporal.PlainDate) => string;\n /**\n * Converter from string to Temporal\n * @param input\n */\n toDate: (input: string) => Temporal.ZonedDateTime | Temporal.PlainDate;\n };\n}\n\n/**\n * Update mock checksum and response body to keep using the same mocks every day with updated dates\n * @param mock the mock instance provided by the hook method of Kassette\n * @param inputOptions default options will extract ISO strings and use 'day-offset' mode\n */\nexport async function updateDatesInMocks(mock: IMock, inputOptions: Partial<UpdateDatesInMocksOptions> = {}) {\n const plainDateLength = 'YYYY-MM-DDThh:mm:ss'.length;\n const options: UpdateDatesInMocksOptions = {\n mode: 'day-offset',\n extractor: /\\b(\\d{4}-\\d{2}-\\d{2})[^\"]*/g,\n converter: {\n fromDate: (date) => date.toString().substring(0, plainDateLength),\n toDate: (input) => {\n input = input.replace(/\\.\\d+/, '').replace(/Z/, '+00:00');\n return input.length > plainDateLength ?\n Temporal.ZonedDateTime.from(`${input.replace(/(\\.\\d+)/, '')}[${input.replace(/^.*(\\+\\d{2}:\\d{2}).*$/, '$1') || '+00:00'}]`) :\n Temporal.PlainDate.from(input);\n }\n },\n ...inputOptions\n };\n const todayTime = Temporal.Now.plainDateISO();\n\n // Update request\n const replaceDatesInInput = (input: string): string => {\n switch (options.mode) {\n case 'any': {\n return input.replace(options.extractor, '<any>');\n }\n case 'day-offset': {\n return input.replace(options.extractor, (match) => `<t+${Temporal.PlainDate.from(todayTime).until(options.converter.toDate(match)).toString()}>`);\n }\n case 'same-day-of-week': {\n return input.replace(options.extractor, (match) => `<day ${options.converter.toDate(match).dayOfWeek} next week>`);\n }\n }\n return input;\n };\n const checksum = await mock.checksum({\n headers: false,\n body: {filter: (body) => replaceDatesInInput(body.toString())},\n query: {filter: (params) => Object.fromEntries(Object.entries(params).map(([key, value]) => [key, replaceDatesInInput(value)]))},\n customData: {updateDatesMode: options.mode}\n });\n mock.setLocalPath([mock.localPath, checksum]);\n\n // Update response\n if (/get|post/.test(mock.request.method) && (await mock.hasLocalMock())) {\n const localPayload = (await mock.readLocalPayload())?.payload;\n if (localPayload && localPayload.data.creationDateTime) {\n const referenceTime = Temporal.PlainDate.from(localPayload.data.creationDateTime.toISOString().substring(0, 10));\n const timeOffset = Temporal.PlainDate.from(referenceTime).until(todayTime, {smallestUnit: 'days', largestUnit: 'days'});\n if (timeOffset.days !== 0) {\n mock.setMode('manual');\n const replaceDatesInOutput = (output: string): string => {\n switch (options.mode) {\n case 'any':\n case 'day-offset': {\n return output.replace(options.extractor, (match) => options.converter.fromDate(options.converter.toDate(match).add(timeOffset)));\n }\n case 'same-day-of-week': {\n return output.replace(options.extractor, (match) => options.converter.fromDate(options.converter.toDate(match).add(`P${Math.ceil(timeOffset.days / 7)}W`)));\n }\n }\n return output;\n };\n const wrappedPayload = mock.createPayload({\n data: localPayload.data,\n body: replaceDatesInOutput(localPayload.body?.toString() || '')\n });\n mock.fillResponseFromPayload(wrappedPayload);\n await mock.sendResponse();\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"update-dates-in-mocks.js","sourceRoot":"","sources":["../../src/kassette/update-dates-in-mocks.ts"],"names":[],"mappings":";;;;AACA,uDAA2C;AAiC3C;;;;GAIG;AACH,SAAsB,kBAAkB,CAAC,IAAW,EAAE,YAAqD;;IAArD,6BAAA,EAAA,iBAAqD;;;;;;oBACnG,eAAe,GAAG,qBAAqB,CAAC,MAAM,CAAC;oBAC/C,OAAO,sBACX,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,6BAA6B,EACxC,SAAS,EAAE;4BACT,QAAQ,EAAE,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,eAAe,CAAC,EAA7C,CAA6C;4BACjE,MAAM,EAAE,UAAC,KAAK;gCACZ,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gCAC1D,OAAO,KAAK,CAAC,MAAM,GAAG,eAAe,CAAC,CAAC;oCACrC,4BAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,UAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,cAAI,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,IAAI,CAAC,IAAI,QAAQ,MAAG,CAAC,CAAC,CAAC;oCAC7H,4BAAQ,CAA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Options to be passed to `updateDatesInMocks`\n */\nexport interface UpdateDatesInMocksOptions {\n /**\n * 'any': dates in inputs will be ignored when computing checksum, the dates on the output will be updated to keep the same day offset\n * 'day-offset': dates in inputs will be converted to day offsets, the dates on the output will be updated to keep the same day offset\n * 'same-day-of-week': dates in inputs will be converted to day of week, the dates on the output will be updated to keep the same day of week but increment the week\n */\n mode: 'any' | 'day-offset' | 'same-day-of-week';\n /**\n * RegExp used to extract dates from request and response\n */\n extractor: RegExp;\n /**\n * Functions to be used to convert from Temporal objects to strings, and strings to temporal objects\n */\n converter: {\n /**\n * Converter from Temporal to string\n * @param input\n */\n fromDate: (input: Temporal.ZonedDateTime | Temporal.PlainDate) => string;\n /**\n * Converter from string to Temporal\n * @param input\n */\n toDate: (input: string) => Temporal.ZonedDateTime | Temporal.PlainDate;\n };\n}\n\n/**\n * Update mock checksum and response body to keep using the same mocks every day with updated dates\n * @param mock the mock instance provided by the hook method of Kassette\n * @param inputOptions default options will extract ISO strings and use 'day-offset' mode\n */\nexport async function updateDatesInMocks(mock: IMock, inputOptions: Partial<UpdateDatesInMocksOptions> = {}) {\n const plainDateLength = 'YYYY-MM-DDThh:mm:ss'.length;\n const options: UpdateDatesInMocksOptions = {\n mode: 'day-offset',\n extractor: /\\b(\\d{4}-\\d{2}-\\d{2})[^\"]*/g,\n converter: {\n fromDate: (date) => date.toString().substring(0, plainDateLength),\n toDate: (input) => {\n input = input.replace(/\\.\\d+/, '').replace(/Z/, '+00:00');\n return input.length > plainDateLength ?\n Temporal.ZonedDateTime.from(`${input.replace(/(\\.\\d+)/, '')}[${input.replace(/^.*(\\+\\d{2}:\\d{2}).*$/, '$1') || '+00:00'}]`) :\n Temporal.PlainDate.from(input);\n }\n },\n ...inputOptions\n };\n const todayTime = Temporal.Now.plainDateISO();\n\n // Update request\n const replaceDatesInInput = (input: string): string => {\n switch (options.mode) {\n case 'any': {\n return input.replace(options.extractor, '<any>');\n }\n case 'day-offset': {\n return input.replace(options.extractor, (match) => `<t+${Temporal.PlainDate.from(todayTime).until(options.converter.toDate(match)).toString()}>`);\n }\n case 'same-day-of-week': {\n return input.replace(options.extractor, (match) => `<day ${options.converter.toDate(match).dayOfWeek} next week>`);\n }\n }\n return input;\n };\n const checksum = await mock.checksum({\n headers: false,\n body: {filter: (body) => replaceDatesInInput(body.toString())},\n query: {filter: (params) => Object.fromEntries(Object.entries(params).map(([key, value]) => [key, replaceDatesInInput(value)]))},\n customData: {updateDatesMode: options.mode}\n });\n mock.setLocalPath([mock.localPath, checksum]);\n\n // Update response\n if (/get|post/.test(mock.request.method) && (await mock.hasLocalMock())) {\n const localPayload = (await mock.readLocalPayload())?.payload;\n if (localPayload && localPayload.data.creationDateTime) {\n const referenceTime = Temporal.PlainDate.from(localPayload.data.creationDateTime.toISOString().substring(0, 10));\n const timeOffset = Temporal.PlainDate.from(referenceTime).until(todayTime, {smallestUnit: 'days', largestUnit: 'days'});\n if (timeOffset.days !== 0) {\n mock.setMode('manual');\n const replaceDatesInOutput = (output: string): string => {\n switch (options.mode) {\n case 'any':\n case 'day-offset': {\n return output.replace(options.extractor, (match) => options.converter.fromDate(options.converter.toDate(match).add(timeOffset)));\n }\n case 'same-day-of-week': {\n return output.replace(options.extractor, (match) => options.converter.fromDate(options.converter.toDate(match).add(`P${Math.ceil(timeOffset.days / 7)}W`)));\n }\n }\n return output;\n };\n const wrappedPayload = mock.createPayload({\n data: localPayload.data,\n body: replaceDatesInOutput(localPayload.body?.toString() || '')\n });\n mock.fillResponseFromPayload(wrappedPayload);\n await mock.sendResponse();\n }\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mock-component-generator.js","sourceRoot":"","sources":["../../src/mocks/mock-component-generator.ts"],"names":[],"mappings":";;;;AAAA,sCAA0E;AAC1E,wCAAmD;AAEnD,+BAAiC;AAEjC;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAa,EAAE,MAAqB;IACvD,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,I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AAC,CAAC;gBAClC,IAAI,CAAC,iBAAiB,GAAG,cAAQ,CAAC,CAAC;aACpC;QACH,CAAC;QACH,cAAC;IAAD,CAAC,AAdY,GAcZ,CAAC;IAEF,OAAO,IAAA,gBAAS,qBACd,QAAQ,EAAE,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,EAAE,EACzC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAC3C,MAAM,QAAA,EACN,OAAO,SAAA,IACJ,CAAC,MAAM,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;QAC7C,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,yBAAiB;gBAC1B,WAAW,EAAE,IAAA,iBAAU,EAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;gBACnC,KAAK,EAAE,IAAI;aACZ;SACF;KACF,CAAC,CAAC,CAAC,EAAE,EACN,CAAC,IAAI,CAAY,CAAC;AACtB,CAAC;AAvCD,sDAuCC","sourcesContent":["import { Component, EventEmitter, forwardRef, Type } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport * as ts from 'typescript';\n\n/**\n * Determine if the node in an input field\n * @param node Typescript AST Node\n * @param source Typescript source file\n */\nfunction isInputNode(node: ts.Node, source: ts.SourceFile): node is ts.Decorator {\n return ts.isDecorator(node) && /^@Input/.test(node.getText(source));\n}\n\n/**\n * Determine if the node in an output field\n * @param node Typescript AST Node\n * @param source Typescript source file\n */\nfunction isOutputNode(node: ts.Node, source: ts.SourceFile): node is ts.Decorator {\n return ts.isDecorator(node) && /^@Output/.test(node.getText(source));\n}\n\n/**\n * Get the name of the input / output\n * @param currentNode Typescript AST Node\n * @param decorator Current Input/Output decorator node\n * @param source Typescript source file\n */\nfunction getIOName(currentNode: ts.Node, decorator: ts.Decorator, source: ts.SourceFile): string | undefined {\n const nameInDecorator = decorator.getText(source).match(/@(Input|Ouput) *\\( *(['\"](.*)['\"])? *\\) */i);\n if (nameInDecorator && nameInDecorator[3]) {\n return nameInDecorator[3];\n } else {\n let name: string | undefined;\n currentNode.forEachChild((node) => {\n if (ts.isIdentifier(node)) {\n name = node.getText(source);\n }\n });\n return name;\n }\n}\n\n/**\n * Get the list of Input and Output of a component\n * @param parentNode Typescript AST Node\n * @param source Typescript source file\n */\nfunction parseIO(parentNode: ts.Node, source: ts.SourceFile): { outputs: string[]; inputs: string[] } {\n const outputs: string[] = [];\n const inputs: string[] = [];\n\n parentNode.forEachChild((node) => {\n if (isInputNode(node, source)) {\n const name = getIOName(parentNode, node, source);\n if (name) {\n inputs.push(name);\n }\n } else if (isOutputNode(node, source)) {\n const name = getIOName(parentNode, node, source);\n if (name) {\n outputs.push(name);\n }\n } else {\n const childrenResult = parseIO(node, source);\n inputs.push(...childrenResult.inputs);\n outputs.push(...childrenResult.outputs);\n }\n });\n\n return {\n outputs,\n inputs\n };\n}\n\n/**\n * Get the selector of an angular class\n * @param parentNode Typescript AST Node\n * @param source Typescript source file\n * @param isInDecorator true if the recursive execution is in a decorator\n * @param isInComponentConfig true if the recursive execution is in a component decorator configuration\n */\nfunction getSelector(parentNode: ts.Node, source: ts.SourceFile, isInDecorator = false, isInComponentConfig = false) {\n let foundDecorator = false;\n let foundSelector = false;\n let ret: string | undefined;\n parentNode.forEachChild((node) => {\n if (isInDecorator && isInComponentConfig && ts.isIdentifier(node) && node.getText(source) === 'selector') {\n foundSelector = true;\n } else if (foundSelector && ts.isStringLiteral(node)) {\n ret = node.getText(source).replace(/['\"]/ig, '');\n } else if (isInDecorator && ts.isIdentifier(node) && node.getText(source) === 'Component') {\n foundDecorator = true;\n } else if (isInDecorator && foundDecorator && ts.isObjectLiteralExpression(node)) {\n ret = ret || getSelector(node, source, isInDecorator, true);\n } else {\n ret = ret || getSelector(node, source, isInDecorator || ts.isDecorator(node), isInComponentConfig);\n }\n });\n return ret;\n}\n\n/**\n * Generate a mock class base on a component file\n * @param componentPath Path to the component file to mock\n * @param config Object containing the following configurations:\n * template: should be provided if the template contain `<ng-content></ng-content>`\n * isControlValueAccessor: should be provided if the component extends ControlValueAccessor\n * @param config.template\n * @param config.isControlValueAccessor\n * @example\n * ```typescript\n * // hero.component.ts\n * \\@Component({selector: 'hero'})\n * class HeroComponent {\n * \\@Input() name: string;\n * \\@Output() doSomething: EventEmitter<void>\n * }\n *\n * // mock generation\n * class MockComponent extends generateMockComponent('hero.component.ts') {}\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint\nexport function generateMockComponent<T extends unknown = Record<string, unknown>>(componentPath: string, config?: { template?: string; isControlValueAccessor?: boolean }): Type<T> {\n const program = ts.createProgram([componentPath], {});\n const source = program.getSourceFile(componentPath);\n if (!source) {\n throw new Error('No Source found');\n }\n\n const { outputs, inputs } = parseIO(source, source);\n const mock = class {\n public writeValue: any;\n public registerOnChange: any;\n public registerOnTouched: any;\n\n constructor() {\n Object.keys(outputs)\n .forEach((outputName) => (this as any)[outputName] = new EventEmitter<any>());\n if (config && config.isControlValueAccessor) {\n this.writeValue = () => { };\n this.registerOnChange = () => { };\n this.registerOnTouched = () => { };\n }\n }\n };\n\n return Component({\n template: config && config.template || '',\n selector: getSelector(source, source) || '',\n inputs,\n outputs,\n ...(config && config.isControlValueAccessor) ? {\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => mock),\n multi: true\n }\n ]\n } : {}\n })(mock) as Type<T>;\n}\n"]}
1
+ {"version":3,"file":"mock-component-generator.js","sourceRoot":"","sources":["../../src/mocks/mock-component-generator.ts"],"names":[],"mappings":";;;;AAAA,sCAA0E;AAC1E,wCAAmD;AAEnD,+BAAiC;AAEjC;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAa,EAAE,MAAqB;IACvD,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AACtE,CAA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BAC5C,IAAI,CAAC,UAAU,GAAG,cAAQ,CAAC,CAAC;gBAC5B,IAAI,CAAC,gBAAgB,GAAG,cAAQ,CAAC,CAAC;gBAClC,IAAI,CAAC,iBAAiB,GAAG,cAAQ,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;QACH,cAAC;IAAD,CAAC,AAdY,GAcZ,CAAC;IAEF,OAAO,IAAA,gBAAS,qBACd,QAAQ,EAAE,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,EAAE,EACzC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAC3C,MAAM,QAAA,EACN,OAAO,SAAA,IACJ,CAAC,MAAM,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;QAC7C,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,yBAAiB;gBAC1B,WAAW,EAAE,IAAA,iBAAU,EAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;gBACnC,KAAK,EAAE,IAAI;aACZ;SACF;KACF,CAAC,CAAC,CAAC,EAAE,EACN,CAAC,IAAI,CAAY,CAAC;AACtB,CAAC;AAvCD,sDAuCC","sourcesContent":["import { Component, EventEmitter, forwardRef, Type } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport * as ts from 'typescript';\n\n/**\n * Determine if the node in an input field\n * @param node Typescript AST Node\n * @param source Typescript source file\n */\nfunction isInputNode(node: ts.Node, source: ts.SourceFile): node is ts.Decorator {\n return ts.isDecorator(node) && /^@Input/.test(node.getText(source));\n}\n\n/**\n * Determine if the node in an output field\n * @param node Typescript AST Node\n * @param source Typescript source file\n */\nfunction isOutputNode(node: ts.Node, source: ts.SourceFile): node is ts.Decorator {\n return ts.isDecorator(node) && /^@Output/.test(node.getText(source));\n}\n\n/**\n * Get the name of the input / output\n * @param currentNode Typescript AST Node\n * @param decorator Current Input/Output decorator node\n * @param source Typescript source file\n */\nfunction getIOName(currentNode: ts.Node, decorator: ts.Decorator, source: ts.SourceFile): string | undefined {\n const nameInDecorator = decorator.getText(source).match(/@(Input|Ouput) *\\( *(['\"](.*)['\"])? *\\) */i);\n if (nameInDecorator && nameInDecorator[3]) {\n return nameInDecorator[3];\n } else {\n let name: string | undefined;\n currentNode.forEachChild((node) => {\n if (ts.isIdentifier(node)) {\n name = node.getText(source);\n }\n });\n return name;\n }\n}\n\n/**\n * Get the list of Input and Output of a component\n * @param parentNode Typescript AST Node\n * @param source Typescript source file\n */\nfunction parseIO(parentNode: ts.Node, source: ts.SourceFile): { outputs: string[]; inputs: string[] } {\n const outputs: string[] = [];\n const inputs: string[] = [];\n\n parentNode.forEachChild((node) => {\n if (isInputNode(node, source)) {\n const name = getIOName(parentNode, node, source);\n if (name) {\n inputs.push(name);\n }\n } else if (isOutputNode(node, source)) {\n const name = getIOName(parentNode, node, source);\n if (name) {\n outputs.push(name);\n }\n } else {\n const childrenResult = parseIO(node, source);\n inputs.push(...childrenResult.inputs);\n outputs.push(...childrenResult.outputs);\n }\n });\n\n return {\n outputs,\n inputs\n };\n}\n\n/**\n * Get the selector of an angular class\n * @param parentNode Typescript AST Node\n * @param source Typescript source file\n * @param isInDecorator true if the recursive execution is in a decorator\n * @param isInComponentConfig true if the recursive execution is in a component decorator configuration\n */\nfunction getSelector(parentNode: ts.Node, source: ts.SourceFile, isInDecorator = false, isInComponentConfig = false) {\n let foundDecorator = false;\n let foundSelector = false;\n let ret: string | undefined;\n parentNode.forEachChild((node) => {\n if (isInDecorator && isInComponentConfig && ts.isIdentifier(node) && node.getText(source) === 'selector') {\n foundSelector = true;\n } else if (foundSelector && ts.isStringLiteral(node)) {\n ret = node.getText(source).replace(/['\"]/ig, '');\n } else if (isInDecorator && ts.isIdentifier(node) && node.getText(source) === 'Component') {\n foundDecorator = true;\n } else if (isInDecorator && foundDecorator && ts.isObjectLiteralExpression(node)) {\n ret = ret || getSelector(node, source, isInDecorator, true);\n } else {\n ret = ret || getSelector(node, source, isInDecorator || ts.isDecorator(node), isInComponentConfig);\n }\n });\n return ret;\n}\n\n/**\n * Generate a mock class base on a component file\n * @param componentPath Path to the component file to mock\n * @param config Object containing the following configurations:\n * template: should be provided if the template contain `<ng-content></ng-content>`\n * isControlValueAccessor: should be provided if the component extends ControlValueAccessor\n * @param config.template\n * @param config.isControlValueAccessor\n * @example\n * ```typescript\n * // hero.component.ts\n * \\@Component({selector: 'hero'})\n * class HeroComponent {\n * \\@Input() name: string;\n * \\@Output() doSomething: EventEmitter<void>\n * }\n *\n * // mock generation\n * class MockComponent extends generateMockComponent('hero.component.ts') {}\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint\nexport function generateMockComponent<T extends unknown = Record<string, unknown>>(componentPath: string, config?: { template?: string; isControlValueAccessor?: boolean }): Type<T> {\n const program = ts.createProgram([componentPath], {});\n const source = program.getSourceFile(componentPath);\n if (!source) {\n throw new Error('No Source found');\n }\n\n const { outputs, inputs } = parseIO(source, source);\n const mock = class {\n public writeValue: any;\n public registerOnChange: any;\n public registerOnTouched: any;\n\n constructor() {\n Object.keys(outputs)\n .forEach((outputName) => (this as any)[outputName] = new EventEmitter<any>());\n if (config && config.isControlValueAccessor) {\n this.writeValue = () => { };\n this.registerOnChange = () => { };\n this.registerOnTouched = () => { };\n }\n }\n };\n\n return Component({\n template: config && config.template || '',\n selector: getSelector(source, source) || '',\n inputs,\n outputs,\n ...(config && config.isControlValueAccessor) ? {\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => mock),\n multi: true\n }\n ]\n } : {}\n })(mock) as Type<T>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/testing",
3
- "version": "10.0.0-prerelease.99",
3
+ "version": "10.1.0-prerelease.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -103,9 +103,9 @@
103
103
  "@angular/platform-browser": "~17.2.0",
104
104
  "@ngrx/store": "~17.1.0",
105
105
  "@ngx-translate/core": "~15.0.0",
106
- "@o3r/core": "^10.0.0-prerelease.99",
107
- "@o3r/localization": "^10.0.0-prerelease.99",
108
- "@o3r/schematics": "^10.0.0-prerelease.99",
106
+ "@o3r/core": "^10.1.0-prerelease.0",
107
+ "@o3r/localization": "^10.1.0-prerelease.0",
108
+ "@o3r/schematics": "^10.1.0-prerelease.0",
109
109
  "@playwright/test": "~1.41.0",
110
110
  "@schematics/angular": "~17.2.0",
111
111
  "pixelmatch": "^5.2.1",
@@ -113,7 +113,7 @@
113
113
  "protractor": "^7.0.0",
114
114
  "rxjs": "^7.8.1",
115
115
  "temporal-polyfill": "^0.2.0",
116
- "typescript": "~5.2.2"
116
+ "typescript": "~5.3.3"
117
117
  },
118
118
  "peerDependenciesMeta": {
119
119
  "@amadeus-it-group/kassette": {
@@ -179,12 +179,12 @@
179
179
  "@ngx-translate/core": "~15.0.0",
180
180
  "@nx/eslint-plugin": "~18.0.2",
181
181
  "@nx/jest": "~18.0.2",
182
- "@o3r/build-helpers": "^10.0.0-prerelease.99",
183
- "@o3r/core": "^10.0.0-prerelease.99",
184
- "@o3r/eslint-plugin": "^10.0.0-prerelease.99",
185
- "@o3r/localization": "^10.0.0-prerelease.99",
186
- "@o3r/schematics": "^10.0.0-prerelease.99",
187
- "@o3r/test-helpers": "^10.0.0-prerelease.99",
182
+ "@o3r/build-helpers": "^10.1.0-prerelease.0",
183
+ "@o3r/core": "^10.1.0-prerelease.0",
184
+ "@o3r/eslint-plugin": "^10.1.0-prerelease.0",
185
+ "@o3r/localization": "^10.1.0-prerelease.0",
186
+ "@o3r/schematics": "^10.1.0-prerelease.0",
187
+ "@o3r/test-helpers": "^10.1.0-prerelease.0",
188
188
  "@playwright/test": "~1.41.0",
189
189
  "@schematics/angular": "~17.2.0",
190
190
  "@stylistic/eslint-plugin-ts": "^1.5.4",
@@ -199,7 +199,7 @@
199
199
  "eslint": "^8.42.0",
200
200
  "eslint-import-resolver-node": "^0.3.4",
201
201
  "eslint-plugin-jest": "~27.9.0",
202
- "eslint-plugin-jsdoc": "~48.1.0",
202
+ "eslint-plugin-jsdoc": "~48.2.0",
203
203
  "eslint-plugin-prefer-arrow": "~1.2.3",
204
204
  "eslint-plugin-unicorn": "^51.0.0",
205
205
  "isomorphic-fetch": "~3.0.0",
@@ -219,7 +219,7 @@
219
219
  "ts-jest": "~29.1.1",
220
220
  "ts-node": "~10.9.1",
221
221
  "type-fest": "^4.10.2",
222
- "typescript": "~5.2.2",
222
+ "typescript": "~5.3.3",
223
223
  "zone.js": "~0.14.2"
224
224
  },
225
225
  "schematics": "./collection.json",
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../schematics/add-functions-to-fixture/helpers.ts"],"names":[],"mappings":";;;AAAA,qCAAkD;AAElD,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,MAAkB,EAAE,EAAE;IAC7D,uBAAuB;IACvB,MAAM,qBAAqB,GAAG,QAAQ;SACnC,WAAW,EAAE;SACb,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC;SACtC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;SACvC,OAAO,CACN,IAAI,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,EAC9B,CAAC,GAAW,EAAE,EAAU,EAAE,EAAU,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,CAC/D;SACA,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACrD,QAAQ,MAAM,EAAE;QACd,KAAK,eAAe,CAAC,CAAC;YACpB,OAAO,UAAU,qBAAqB,QAAQ,CAAC;SAChD;QACD,KAAK,SAAS,CAAC,CAAC;YACd,OAAO,MAAM,qBAAqB,MAAM,CAAC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EAAE,CAAC;SAClE;QACD,KAAK,kBAAkB,CAAC,CAAC;YACvB,OAAO,GAAG,UAAU,OAAO,mBAAU,CAAC,UAAU,CAAC,EAAE,CAAC;SACrD;QACD,OAAO,CAAC,CAAC;YACP,OAAO,GAAG,UAAU,IAAI,CAAC;SAC1B;KACF;AACH,CAAC,CAAC;AA/BW,QAAA,YAAY,gBA+BvB;AAEF;;;;;;GAMG;AACI,MAAM,iBAAiB,GAAG,CAC/B,UAAsB,EACtB,iBAAyB,EACzB,EAAE;IACF,QAAQ,UAAU,EAAE;QAClB,KAAK,eAAe,CAAC,CAAC;YACpB,OAAO;mDACsC,iBAAiB;;IAEhE,CAAC;SACA;QACD,KAAK,SAAS,CAAC,CAAC;YACd,OAAO;mDACsC,iBAAiB;;IAEhE,CAAC;SACA;QACD,KAAK,eAAe,CAAC,CAAC;YACpB,OAAO;mDACsC,iBAAiB;;IAEhE,CAAC;SACA;QACD,KAAK,eAAe,CAAC,CAAC;YACpB,OAAO;mDACsC,iBAAiB;;IAEhE,CAAC;SACA;QACD,KAAK,eAAe,CAAC,CAAC;YACpB,OAAO;gDACmC,iBAAiB;;;IAG7D,CAAC;SACA;QACD,KAAK,mBAAmB,CAAC,CAAC;YACxB,OAAO;gDACmC,iBAAiB;;;IAG7D,CAAC;SACA;QACD,KAAK,kBAAkB,CAAC,CAAC;YACvB,OAAO;gDACmC,iBAAiB;;IAE7D,CAAC;SACA;QACD,OAAO,CAAC,CAAC;YACP,OAAO;;IAET,CAAC;SACA;KACF;AACH,CAAC,CAAC;AAvDW,QAAA,iBAAiB,qBAuD5B"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../schematics/add-functions-to-fixture/helpers.ts"],"names":[],"mappings":";;;AAAA,qCAAkD;AAElD,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,MAAkB,EAAE,EAAE;IAC7D,uBAAuB;IACvB,MAAM,qBAAqB,GAAG,QAAQ;SACnC,WAAW,EAAE;SACb,OAAO,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,CAAC;QACD,CAAC;QACD,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,OAAO;mDACsC,iBAAiB;;IAEhE,CAAC;QACD,CAAC;QACD,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,OAAO;mDACsC,iBAAiB;;IAEhE,CAAC;QACD,CAAC;QACD,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,OAAO;mDACsC,iBAAiB;;IAEhE,CAAC;QACD,CAAC;QACD,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,OAAO;gDACmC,iBAAiB;;;IAG7D,CAAC;QACD,CAAC;QACD,KAAK,mBAAmB,CAAC,CAAC,CAAC;YACzB,OAAO;gDACmC,iBAAiB;;;IAG7D,CAAC;QACD,CAAC;QACD,KAAK,kBAAkB,CAAC,CAAC,CAAC;YACxB,OAAO;gDACmC,iBAAiB;;IAE7D,CAAC;QACD,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,OAAO;;IAET,CAAC;QACD,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAvDW,QAAA,iBAAiB,qBAuD5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/add-functions-to-fixture/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqE;AACrE,gDAAqG;AACrG,iCAAiC;AACjC,uCAA4D;AAC5D,qCAAuC;AAGvC;;;GAGG;AACH,SAAS,yBAAyB,CAAC,OAAgD;IACjF,OAAO,IAAA,kBAAK,EAAC;QACX,CAAC,IAAU,EAAE,EAAE;YACb,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;YAC5C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBACtB,MAAM,IAAI,wBAAW,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC;aACvD;YACD,OAAO,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;gBACpC,MAA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C,CAAC,CAAC,IAAA,iBAAI,GAAE,CAAC,CAAC,CAAC,IAAA,2BAAc,GAAE;aAC/C,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,6BAAgB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;gBACzD,MAAM,sBAAsB,GAAG,MAAM,IAAA,8CAAiC,GAAE,CAAC;gBACzE,IAAI,sBAAsB,EAAE,CAAC;oBAC3B,OAAO,IAAA,kBAAK,EAAC;wBACX,IAAA,8BAAiB,EAAC,WAAW,EAAE,mBAAmB,EAAE;4BAClD,IAAI,EAAE,OAAO,CAAC,IAAI;yBACnB,CAAC;wBACF,cAAc,CAAC,OAAO,CAAC;qBACxB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAlGD,wCAkGC;AAED;;;GAGG;AACU,QAAA,YAAY,GAAG,IAAA,kDAAqC,EAAC,cAAc,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/fixture/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAKjF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,EAAE,4BAA4B,EAAE,OAAO,GAAG,IAAI,CA2FnL"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/fixture/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAKjF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,EAAE,4BAA4B,EAAE,OAAO,GAAG,IAAI,CA4FnL"}
@@ -17,7 +17,7 @@ function updateFixtureConfig(options, registerUnitTestFixturePaths) {
17
17
  /**
18
18
  * Update test tsconfig
19
19
  * @param tree
20
- * @param _context
20
+ * @param context
21
21
  */
22
22
  const updateTestTsconfig = (tree, context) => {
23
23
  const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
@@ -79,6 +79,7 @@ function updateFixtureConfig(options, registerUnitTestFixturePaths) {
79
79
  return acc;
80
80
  }, {});
81
81
  if (registerUnitTestFixturePaths) {
82
+ configWithPath.content.compilerOptions.baseUrl ||= '.';
82
83
  configWithPath.content.compilerOptions.paths['@o3r/testing/core'] = ['node_modules/@o3r/testing/core/angular'];
83
84
  configWithPath.content.compilerOptions.paths['@o3r/testing/core/*'] = ['node_modules/@o3r/testing/core/angular/*'];
84
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/ng-add/fixture/index.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,2DAAiF;AACjF,gDAAuE;AAEvE,iCAAiC;AAEjC;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,OAAkG,EAAE,4BAAqC;IAE3K,MAAM,QAAQ,GAAG,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC;IAClE;;;;OAIG;IACH,MAAM,kBAAkB,GAAS,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QACzE,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAA,+BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC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AAC;AACxE,CAAC;AA5FD,kDA4FC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2E,IAAI,EAAyC,MAAM,4BAA4B,CAAC;AAkBlK,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAyI5E;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2E,IAAI,EAAyC,MAAM,4BAA4B,CAAC;AAoBlK,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AA+I5E;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
@@ -9,15 +9,12 @@ const fs = require("node:fs");
9
9
  const path = require("node:path");
10
10
  const fixture_1 = require("./fixture");
11
11
  const playwright_1 = require("./playwright");
12
- function canResolvePlaywright() {
13
- try {
14
- require.resolve('playwright/package.json');
15
- return true;
16
- }
17
- catch {
18
- return false;
19
- }
20
- }
12
+ const devDependenciesToInstall = [
13
+ 'pixelmatch',
14
+ 'pngjs',
15
+ 'jest',
16
+ 'jest-preset-angular'
17
+ ];
21
18
  /**
22
19
  * Add Otter testing to an Angular Project
23
20
  * @param options
@@ -30,8 +27,25 @@ function ngAddFn(options) {
30
27
  const depsInfo = (0, schematics_2.getO3rPeerDeps)(testPackageJsonPath);
31
28
  const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
32
29
  const workingDirectory = workspaceProject?.root || '.';
33
- const dependencyType = (0, schematics_2.getProjectNewDependenciesType)(workspaceProject);
34
30
  const projectType = workspaceProject?.projectType || 'application';
31
+ const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
32
+ acc[dep] = {
33
+ inManifest: [{
34
+ range: `~${depsInfo.packageVersion}`,
35
+ types: (0, schematics_2.getProjectNewDependenciesTypes)(workspaceProject)
36
+ }]
37
+ };
38
+ return acc;
39
+ }, (0, schematics_2.getPackageInstallConfig)(testPackageJsonPath, tree, options.projectName, true));
40
+ Object.entries((0, schematics_2.getExternalDependenciesVersionRange)(devDependenciesToInstall, testPackageJsonPath))
41
+ .forEach(([dep, range]) => {
42
+ dependencies[dep] = {
43
+ inManifest: [{
44
+ range,
45
+ types: [dependencies_1.NodeDependencyType.Dev]
46
+ }]
47
+ };
48
+ });
35
49
  let installJest;
36
50
  const testFramework = options.testingFramework || (0, schematics_2.getTestFramework)((0, schematics_2.getWorkspaceConfig)(tree), context);
37
51
  switch (testFramework) {
@@ -53,27 +67,19 @@ function ngAddFn(options) {
53
67
  break;
54
68
  }
55
69
  }
56
- let installPlaywright;
57
- if (options.enablePlaywright && projectType === 'application') {
58
- installPlaywright = true;
59
- }
60
- else {
61
- installPlaywright = !canResolvePlaywright() ? await (0, prompt_1.askConfirmation)('Do you want to setup Playwright test framework for E2E?', true) : false;
62
- }
70
+ const installPlaywright = options.enablePlaywright !== undefined && projectType === 'application' ?
71
+ options.enablePlaywright :
72
+ await (0, prompt_1.askConfirmation)('Do you want to setup Playwright test framework for E2E?', true);
63
73
  const rules = [
64
74
  (0, fixture_1.updateFixtureConfig)(options, installJest),
65
75
  (0, schematics_2.removePackages)(['@otter/testing']),
66
76
  (0, schematics_2.addVsCodeRecommendations)(['Orta.vscode-jest']),
67
- (0, schematics_2.ngAddPackages)(depsInfo.o3rPeerDeps, {
68
- skipConfirmation: true,
69
- version: depsInfo.packageVersion,
70
- parentPackageInfo: depsInfo.packageName,
77
+ installPlaywright ? (0, playwright_1.updatePlaywright)(options, dependencies) : schematics_1.noop,
78
+ (0, schematics_2.setupDependencies)({
71
79
  projectName: options.projectName,
72
- dependencyType: dependencyType,
73
- workingDirectory
80
+ dependencies,
81
+ ngAddToRun: depsInfo.o3rPeerDeps
74
82
  }),
75
- installPlaywright ? (0, playwright_1.updatePlaywright)(options) : schematics_1.noop,
76
- (0, schematics_2.ngAddPeerDependencyPackages)(['pixelmatch', 'pngjs'], testPackageJsonPath, dependencyType, { ...options, workingDirectory, skipNgAddSchematicRun: true }),
77
83
  (0, schematics_2.registerPackageCollectionSchematics)(packageJson),
78
84
  (0, schematics_2.setupSchematicsDefaultParams)({
79
85
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -114,7 +120,7 @@ function ngAddFn(options) {
114
120
  (0, schematics_1.move)(tree.root.path),
115
121
  (0, schematics_1.renameTemplateFiles)()
116
122
  ]), schematics_1.MergeStrategy.Default);
117
- rules.push((0, schematics_2.ngAddPeerDependencyPackages)(['jest', 'jest-preset-angular'], testPackageJsonPath, dependencies_1.NodeDependencyType.Dev, { ...options, workingDirectory, skipNgAddSchematicRun: true }), jestConfigFilesForProject, jestConfigFilesForWorkspace);
123
+ rules.push(jestConfigFilesForProject, jestConfigFilesForWorkspace);
118
124
  }
119
125
  else {
120
126
  throw new schematics_2.O3rCliError(`Could not find working directory for project ${options.projectName || ''}`);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAAkK;AAClK,gDAWwE;AACxE,8DAAoE;AACpE,2EAA8E;AAC9E,8BAA8B;AAC9B,kCAAkC;AAGlC,uCAAgD;AAChD,6CAAgD;AAEhD,SAAS,oBAAoB;IAC3B,IAAI;QACF,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;KACb;IAAC,MAAM;QACN,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,IAAI;YACF,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IA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NgAddPackageOptions } from '@o3r/schematics';
3
3
  /**
4
4
  * Add Playwright to Otter application
5
5
  * @param options @see RuleFactory.options
6
+ * @param dependencies
6
7
  */
7
- export declare function updatePlaywright(options?: NgAddPackageOptions): Rule;
8
+ export declare function updatePlaywright(options: NgAddPackageOptions, dependencies: Record<string, DependencyToAdd>): Rule;
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/playwright/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAqE,IAAI,EAAyC,MAAM,4BAA4B,CAAC;AAC5J,OAAO,EAAsB,mBAAmB,EAA+B,MAAM,iBAAiB,CAAC;AAKvG;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,mBAAwB,GAAG,IAAI,CA0DxE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/playwright/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA8D,IAAI,EAAyC,MAAM,4BAA4B,CAAC;AACrJ,OAAO,EACL,KAAK,eAAe,EAEpB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAMzB;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,IAAI,CAoElH"}