@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
package/README.md CHANGED
@@ -17,7 +17,8 @@ The module provides testing (e2e, unit test) utilities to help you build your ow
17
17
  ng add @o3r/testing
18
18
  ```
19
19
 
20
- > **Warning**: this module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
20
+ > [!WARNING]
21
+ > This module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
21
22
 
22
23
  ## Description
23
24
 
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/angular/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAEA,sCAAwC;AAIxC;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAwC;eAClD,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,uCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;4BACzD,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,sBAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAE,CAAC,EAAC;;;;KAC5J;IACH,sBAAC;AAAD,CAAC,AAVD,CAAqC,oBAAU,GAU9C;AAVY,0CAAe","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { MatAutocompleteProfile } from '../../angular-materials';\nimport { O3rElement } from '../element';\n\nexport { SelectElementProfile } from '../../elements';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: DebugElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.setValue(value);\n return this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {} });\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/angular/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAEA,sCAAwC;AAIxC;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAwC;QAClD,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,uCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;4BACzD,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,sBAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAE,CAAC,EAAC;;;;KAC5J;IACH,sBAAC;AAAD,CAAC,AAVD,CAAqC,oBAAU,GAU9C;AAVY,0CAAe","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { MatAutocompleteProfile } from '../../angular-materials';\nimport { O3rElement } from '../element';\n\nexport { SelectElementProfile } from '../../elements';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: DebugElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.setValue(value);\n return this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {} });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../../src/core/angular/angular-materials/select-material.ts"],"names":[],"mappings":";;;;AACA,8DAA+C;AAE/C,sCAAwC;AAIxC;;GAEG;AACH;IAA+B,qCAAU;IACvC,mBAAY,aAAwC;eAClD,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,iCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,qBAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;wBAClE,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;4BACZ,MAAM,GAAG,IAAI,oBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;4BAC9C,sBAAO,MAAM,CAAC,KAAK,EAAE,EAAC;yBACvB;6BAAM;4BACL,sBAAO,OAAO,CAAC,MAAM,CAAC,4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C,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;KAClF;IAED,kBAAkB;IACX,4BAAQ,GAAf;QACE,OAAO,CAAC,IAAI,CAAC,mGAAmG,CAAC,CAAC;QAClH,OAAO,iBAAM,QAAQ,WAAE,CAAC;IAC1B,CAAC;IACH,gBAAC;AAAD,CAAC,AApDD,CAA+B,oBAAU,GAoDxC;AApDY,8BAAS","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { By } from '@angular/platform-browser';\nimport { MatSelectProfile } from '../../angular-materials';\nimport { O3rElement } from '../element';\n\nexport { SelectElementProfile } from '../../elements';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\n constructor(sourceElement: DebugElement | 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.queryAll(By.css('mat-option'));\n if (options[index]) {\n const option = new O3rElement(options[index]);\n return option.click();\n } else {\n return Promise.reject(`Option with index ${index} not found in select element.`);\n }\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.queryAll(By.css('mat-option'));\n\n for (const opt of options) {\n const option = new O3rElement(opt);\n if (await option.getAttribute('ng-reflect-value') === value) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with value ${value} not found in select element.`);\n }\n\n /** @inheritdoc */\n public async selectByLabel(label: string, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.queryAll(By.css('mat-option'));\n\n for (const opt of options) {\n const option = new O3rElement(opt);\n if (await option.getText() === label) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with label ${label} not found in select element.`);\n }\n\n /** @inheritDoc */\n public getValue() {\n console.warn('Usage of \"getValue\" is not recommended on Material Select elements. Use \"getPlainText()\" instead.');\n return super.getValue();\n }\n}\n"]}
1
+ {"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../../src/core/angular/angular-materials/select-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AA;;4BAOzB,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;KAClF;IAED,kBAAkB;IACL,iCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,qBAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;8BAEzC,EAAP,mBAAO;;;6BAAP,CAAA,qBAAO,CAAA;wBAAd,GAAG;wBACN,MAAM,GAAG,IAAI,oBAAU,CAAC,GAAG,CAAC,CAAC;wBAC/B,qBAAM,MAAM,CAAC,OAAO,EAAE,EAAA;;wBAA1B,IAAI,CAAA,SAAsB,MAAK,KAAK,EAAE,CAAC;4BACrC,sBAAO,MAAM,CAAC,KAAK,EAAE,EAAC;wBACxB,CAAC;;;wBAJe,IAAO,CAAA;;4BAOzB,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;KAClF;IAED,kBAAkB;IACX,4BAAQ,GAAf;QACE,OAAO,CAAC,IAAI,CAAC,mGAAmG,CAAC,CAAC;QAClH,OAAO,gBAAK,CAAC,QAAQ,WAAE,CAAC;IAC1B,CAAC;IACH,gBAAC;AAAD,CAAC,AApDD,CAA+B,oBAAU,GAoDxC;AApDY,8BAAS","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { By } from '@angular/platform-browser';\nimport { MatSelectProfile } from '../../angular-materials';\nimport { O3rElement } from '../element';\n\nexport { SelectElementProfile } from '../../elements';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\n constructor(sourceElement: DebugElement | 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.queryAll(By.css('mat-option'));\n if (options[index]) {\n const option = new O3rElement(options[index]);\n return option.click();\n } else {\n return Promise.reject(`Option with index ${index} not found in select element.`);\n }\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.queryAll(By.css('mat-option'));\n\n for (const opt of options) {\n const option = new O3rElement(opt);\n if (await option.getAttribute('ng-reflect-value') === value) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with value ${value} not found in select element.`);\n }\n\n /** @inheritdoc */\n public async selectByLabel(label: string, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.queryAll(By.css('mat-option'));\n\n for (const opt of options) {\n const option = new O3rElement(opt);\n if (await option.getText() === label) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with label ${label} not found in select element.`);\n }\n\n /** @inheritDoc */\n public getValue() {\n console.warn('Usage of \"getValue\" is not recommended on Material Select elements. Use \"getPlainText()\" instead.');\n return super.getValue();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/angular/component-fixture.ts"],"names":[],"mappings":";;;;AAAA,4BAA4B;AAC5B,8DAA6C;AAC7C,4CAAqD;AAErD,sCAAuC;AACvC,qCAA4D;AAK5D;;GAEG;AACH;IAME;;;OAGG;IACH,6BAAY,OAAU;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACO,qDAAuB,GAAjC,UAAwD,OAAW,EAAE,QAAiB;QACpF,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAClE;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACa,8CAAgB,GAAhC,UAAuD,OAA+B,EAAE,OAAgB;;;;gBACtG,sBAAO,IAAA,qBAAW,EAAC,O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ED,kBAAkB;IACX,wCAAU,GAAjB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,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;IACX,6CAAe,GAAtB,UAAuB,QAAgB,EAAE,QAAiB;QACxD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,qBAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IACH,0BAAC;AAAD,CAAC,AAjND,IAiNC;AAjNY,kDAAmB","sourcesContent":["/* eslint-disable new-cap */\nimport {By} from '@angular/platform-browser';\nimport {FixtureUsageError} from '../../errors/index';\nimport type {ComponentFixtureProfile} from '../component-fixture';\nimport {withTimeout} from '../helpers';\nimport {O3rElement, O3rElementConstructor} from './element';\nimport {O3rGroup, O3rGroupConstructor} from './group';\n\nexport type {ComponentFixtureProfile, Constructable, FixtureWithCustom} from '../component-fixture';\n\n/**\n * Implementation of the fixture dedicated to angular, hence using angular testing framework.\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n /**\n * DOM element linked to the fixture.\n */\n protected element: V;\n\n /**\n * Root element of this fixture. It will be used as the context for further queries.\n * @param element\n */\n constructor(element: V) {\n this.element = element;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param element ElementProfile to test\n * @param _timeout specific timeout that will throw when reach\n */\n protected throwOnUndefinedElement<T extends O3rElement>(element?: T, _timeout?: number): Promise<T> {\n if (!element) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return Promise.resolve(element);\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefined<T extends O3rElement>(element: Promise<T | undefined>, timeout?: number): Promise<T> {\n return withTimeout(element, 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: undefined,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n }\n ): Promise<O3rElement | undefined>;\n protected async queryWithOptions<T extends O3rElement>(\n selector: string,\n elementConstructor: O3rElementConstructor<T>,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n }\n ): Promise<T | undefined>;\n protected async queryWithOptions<T extends O3rElement>(\n selector: string,\n elementConstructor: O3rElementConstructor<T> | undefined,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}\n ): Promise<T | O3rElement | undefined> {\n let element: T | O3rElement | undefined;\n if (options.index !== undefined) {\n element = await this.queryNth(selector, options.index, elementConstructor as any);\n } else {\n element = await this.query(selector, elementConstructor as any);\n }\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(element, options.timeout);\n }\n return element;\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 element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n if (!element || !await element.isVisible()) {\n return;\n }\n return await element.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 element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n return !!element && await element.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 element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n if (!!element && await element.isVisible()) {\n await element.click();\n }\n }\n\n /** @inheritdoc */\n public query(selector: string, returnType?: undefined): Promise<O3rElement | undefined>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const queriedElement = this.element.sourceElement.query(By.css(selector));\n return Promise.resolve(queriedElement ? (returnType ? new returnType(queriedElement) : new O3rElement(queriedElement)) : undefined);\n }\n\n /** @inheritdoc */\n public queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement | undefined>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const queriedElement = this.element.sourceElement.queryAll(By.css(selector))[index];\n return Promise.resolve(queriedElement ? (returnType ? new returnType(queriedElement) : new O3rElement(queriedElement)) : undefined);\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 queriedElement = this.element.sourceElement.queryAll(By.css(selector));\n\n const elements = queriedElement.map((el) => (returnType ? new returnType(el) : new O3rElement(el)));\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 Promise.resolve(elements);\n }\n\n /** @inheritdoc */\n public getElement() {\n return this.element;\n }\n\n /** @inheritdoc */\n public getSubComponents(): Promise<{ [componentName: string]: ComponentFixtureProfile[] }> {\n return Promise.resolve({block: [this]});\n }\n\n /** @inheritDoc */\n public queryNotPresent(selector: string, _timeout?: number): Promise<boolean> {\n return Promise.resolve(!this.element.sourceElement.query(By.css(selector)));\n }\n}\n"]}
1
+ {"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/angular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AQ,CAAC,CAAC,CAAC;wBAEvE,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,UAAC,EAAE,IAAK,OAAA,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,oBAAU,CAAC,EAAE,CAAC,CAAC,EAAtD,CAAsD,CAAC,CAAC;6BAChG,SAAS,EAAT,wBAAS;wBACL,KAAK,GAAG,IAAI,SAAS,CAAC,QAAe,CAAC,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,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAC;;;;KAClC;IAED,kBAAkB;IACX,wCAAU,GAAjB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,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;IACX,6CAAe,GAAtB,UAAuB,QAAgB,EAAE,QAAiB;QACxD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,qBAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IACH,0BAAC;AAAD,CAAC,AAjND,IAiNC;AAjNY,kDAAmB","sourcesContent":["/* eslint-disable new-cap */\nimport {By} from '@angular/platform-browser';\nimport {FixtureUsageError} from '../../errors/index';\nimport type {ComponentFixtureProfile} from '../component-fixture';\nimport {withTimeout} from '../helpers';\nimport {O3rElement, O3rElementConstructor} from './element';\nimport {O3rGroup, O3rGroupConstructor} from './group';\n\nexport type {ComponentFixtureProfile, Constructable, FixtureWithCustom} from '../component-fixture';\n\n/**\n * Implementation of the fixture dedicated to angular, hence using angular testing framework.\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n /**\n * DOM element linked to the fixture.\n */\n protected element: V;\n\n /**\n * Root element of this fixture. It will be used as the context for further queries.\n * @param element\n */\n constructor(element: V) {\n this.element = element;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param element ElementProfile to test\n * @param _timeout specific timeout that will throw when reach\n */\n protected throwOnUndefinedElement<T extends O3rElement>(element?: T, _timeout?: number): Promise<T> {\n if (!element) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return Promise.resolve(element);\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefined<T extends O3rElement>(element: Promise<T | undefined>, timeout?: number): Promise<T> {\n return withTimeout(element, 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: undefined,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n }\n ): Promise<O3rElement | undefined>;\n protected async queryWithOptions<T extends O3rElement>(\n selector: string,\n elementConstructor: O3rElementConstructor<T>,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n }\n ): Promise<T | undefined>;\n protected async queryWithOptions<T extends O3rElement>(\n selector: string,\n elementConstructor: O3rElementConstructor<T> | undefined,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}\n ): Promise<T | O3rElement | undefined> {\n let element: T | O3rElement | undefined;\n if (options.index !== undefined) {\n element = await this.queryNth(selector, options.index, elementConstructor as any);\n } else {\n element = await this.query(selector, elementConstructor as any);\n }\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(element, options.timeout);\n }\n return element;\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 element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n if (!element || !await element.isVisible()) {\n return;\n }\n return await element.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 element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n return !!element && await element.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 element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n if (!!element && await element.isVisible()) {\n await element.click();\n }\n }\n\n /** @inheritdoc */\n public query(selector: string, returnType?: undefined): Promise<O3rElement | undefined>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const queriedElement = this.element.sourceElement.query(By.css(selector));\n return Promise.resolve(queriedElement ? (returnType ? new returnType(queriedElement) : new O3rElement(queriedElement)) : undefined);\n }\n\n /** @inheritdoc */\n public queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement | undefined>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const queriedElement = this.element.sourceElement.queryAll(By.css(selector))[index];\n return Promise.resolve(queriedElement ? (returnType ? new returnType(queriedElement) : new O3rElement(queriedElement)) : undefined);\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 queriedElement = this.element.sourceElement.queryAll(By.css(selector));\n\n const elements = queriedElement.map((el) => (returnType ? new returnType(el) : new O3rElement(el)));\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 Promise.resolve(elements);\n }\n\n /** @inheritdoc */\n public getElement() {\n return this.element;\n }\n\n /** @inheritdoc */\n public getSubComponents(): Promise<{ [componentName: string]: ComponentFixtureProfile[] }> {\n return Promise.resolve({block: [this]});\n }\n\n /** @inheritDoc */\n public queryNotPresent(selector: string, _timeout?: number): Promise<boolean> {\n return Promise.resolve(!this.element.sourceElement.query(By.css(selector)));\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/angular/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AAEA,sCAAwC;AAExC;;GAEG;AACH;IAAwC,8CAAU;IAChD,4BAAY,aAA2B;eACrC,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACX,kCAAK,GAAZ,UAAa,KAAY,EAAE,gBAA6B;QAA3C,sBAAA,EAAA,YAAY;QACvB,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;YACpC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;SAClD;QAED,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAC,CAAC,CAAC;QAClJ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,oCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,sCAAS,GAAhB;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACvG,CAAC;IACH,yBAAC;AAAD,CAAC,AAxBD,CAAwC,oBAAU,GAwBjD;AAxBY,gDAAkB","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { CheckboxElementProfile } from '../../elements';\nimport { O3rElement } from '../element';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(sourceElement: DebugElement) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public check(value = true, _associatedLabel?: O3rElement) {\n if (this.sourceElement.nativeElement) {\n this.sourceElement.nativeElement.checked = value;\n }\n\n this.sourceElement.triggerEventHandler('change', {target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {}});\n return Promise.resolve();\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n return Promise.resolve(this.sourceElement.nativeElement && this.sourceElement.nativeElement.checked);\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/angular/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AAEA,sCAAwC;AAExC;;GAEG;AACH;IAAwC,8CAAU;IAChD,4BAAY,aAA2B;QACrC,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACX,kCAAK,GAAZ,UAAa,KAAY,EAAE,gBAA6B;QAA3C,sBAAA,EAAA,YAAY;QACvB,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;YACrC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;QACnD,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAC,CAAC,CAAC;QAClJ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,oCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,sCAAS,GAAhB;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACvG,CAAC;IACH,yBAAC;AAAD,CAAC,AAxBD,CAAwC,oBAAU,GAwBjD;AAxBY,gDAAkB","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { CheckboxElementProfile } from '../../elements';\nimport { O3rElement } from '../element';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(sourceElement: DebugElement) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public check(value = true, _associatedLabel?: O3rElement) {\n if (this.sourceElement.nativeElement) {\n this.sourceElement.nativeElement.checked = value;\n }\n\n this.sourceElement.triggerEventHandler('change', {target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {}});\n return Promise.resolve();\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n return Promise.resolve(this.sourceElement.nativeElement && this.sourceElement.nativeElement.checked);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/angular/elements/radio-element.ts"],"names":[],"mappings":";;;;AAEA,sCAAwC;AAExC;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAA2B;eACrC,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACX,+BAAK,GAAZ,UAAa,KAAY;QAAZ,sBAAA,EAAA,YAAY;QACvB,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;YACpC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;SAClD;QAED,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAE,CAAC,CAAC;QACpJ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,iCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,mCAAS,GAAhB;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACvG,CAAC;IACH,sBAAC;AAAD,CAAC,AAxBD,CAAqC,oBAAU,GAwB9C;AAxBY,0CAAe","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { RadioElementProfile } from '../../elements';\nimport { O3rElement } from '../element';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: DebugElement) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public check(value = true) {\n if (this.sourceElement.nativeElement) {\n this.sourceElement.nativeElement.checked = value;\n }\n\n this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {} });\n return Promise.resolve();\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n return Promise.resolve(this.sourceElement.nativeElement && this.sourceElement.nativeElement.checked);\n }\n}\n"]}
1
+ {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/angular/elements/radio-element.ts"],"names":[],"mappings":";;;;AAEA,sCAAwC;AAExC;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAA2B;QACrC,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACX,+BAAK,GAAZ,UAAa,KAAY;QAAZ,sBAAA,EAAA,YAAY;QACvB,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;YACrC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;QACnD,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAE,CAAC,CAAC;QACpJ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,iCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,mCAAS,GAAhB;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACvG,CAAC;IACH,sBAAC;AAAD,CAAC,AAxBD,CAAqC,oBAAU,GAwB9C;AAxBY,0CAAe","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { RadioElementProfile } from '../../elements';\nimport { O3rElement } from '../element';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: DebugElement) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public check(value = true) {\n if (this.sourceElement.nativeElement) {\n this.sourceElement.nativeElement.checked = value;\n }\n\n this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {} });\n return Promise.resolve();\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n return Promise.resolve(this.sourceElement.nativeElement && this.sourceElement.nativeElement.checked);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/angular/elements/select-element.ts"],"names":[],"mappings":";;;;AACA,8DAA+C;AAE/C,sCAAwC;AAIxC;;GAEG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,aAAwC;eAClD,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;;wBACnD,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,qBAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;6BAC1D,OAAO,CAAC,KAAK,CAAC,EAAd,wBAAc;wBACV,MAAM,GAAG,IAAI,oBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;wBAChC,qBAAM,MAAM,CAAC,QAAQ,EAAE,EAAA;;wBAA/B,KAAK,GAAG,SAAuB;wBAErC,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAE,CAAC,CAAC;;4BAEpJ,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;;KAEpF;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;;wBACnD,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,qBAAE,CAAC,GAAG,CAAC,wBAAiB,KAAK,OAAI,CAAC,CAAC,CAAC;6BACxE,MAAM,EAAN,wBAAM;wBACR,qBAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAA;;wBAA/C,SAA+C,CAAC;wBAChD,sBAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAE,CAAC,EAAC;4BAE3J,sBAAO,OAAO,CAAC,MAAM,CAAC,6BAAsB,KAAK,mCAAgC,CAAC,EAAC;;;;KAEtF;IACH,uBAAC;AAAD,CAAC,AA7BD,CAAsC,oBAAU,GA6B/C;AA7BY,4CAAgB","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { By } from '@angular/platform-browser';\nimport { SelectElementProfile } from '../../elements';\nimport { O3rElement } from '../element';\n\nexport { SelectElementProfile } from '../../elements';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(sourceElement: DebugElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, _timeout?: number) {\n const options = this.sourceElement.queryAll(By.css('option'));\n if (options[index]) {\n const option = new O3rElement(options[index]);\n const value = await option.getValue();\n\n await this.setValue(value);\n this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {} });\n } else {\n return Promise.reject(`Option with index ${index} not found in select element.`);\n }\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n const option = this.sourceElement.query(By.css(`option[value='${value}']`));\n if (option) {\n await this.setValue(option.nativeElement.value);\n return this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {} });\n } else {\n return Promise.reject(`Option with value '${value}' not found in select element.`);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/angular/elements/select-element.ts"],"names":[],"mappings":";;;;AACA,8DAA+C;AAE/C,sCAAwC;AAIxC;;GAEG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,aAAwC;QAClD,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;;wBACnD,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,qBAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;6BAC1D,OAAO,CAAC,KAAK,CAAC,EAAd,wBAAc;wBACV,MAAM,GAAG,IAAI,oBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;wBAChC,qBAAM,MAAM,CAAC,QAAQ,EAAE,EAAA;;wBAA/B,KAAK,GAAG,SAAuB;wBAErC,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAE,CAAC,CAAC;;4BAEpJ,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;;KAEpF;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;;wBACnD,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,qBAAE,CAAC,GAAG,CAAC,wBAAiB,KAAK,OAAI,CAAC,CAAC,CAAC;6BACxE,MAAM,EAAN,wBAAM;wBACR,qBAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAA;;wBAA/C,SAA+C,CAAC;wBAChD,sBAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,EAAE,cAAO,CAAC,EAAE,eAAe,EAAE,cAAO,CAAC,EAAE,CAAC,EAAC;4BAE3J,sBAAO,OAAO,CAAC,MAAM,CAAC,6BAAsB,KAAK,mCAAgC,CAAC,EAAC;;;;KAEtF;IACH,uBAAC;AAAD,CAAC,AA7BD,CAAsC,oBAAU,GA6B/C;AA7BY,4CAAgB","sourcesContent":["import { DebugElement } from '@angular/core';\nimport { By } from '@angular/platform-browser';\nimport { SelectElementProfile } from '../../elements';\nimport { O3rElement } from '../element';\n\nexport { SelectElementProfile } from '../../elements';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(sourceElement: DebugElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, _timeout?: number) {\n const options = this.sourceElement.queryAll(By.css('option'));\n if (options[index]) {\n const option = new O3rElement(options[index]);\n const value = await option.getValue();\n\n await this.setValue(value);\n this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {} });\n } else {\n return Promise.reject(`Option with index ${index} not found in select element.`);\n }\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n const option = this.sourceElement.query(By.css(`option[value='${value}']`));\n if (option) {\n await this.setValue(option.nativeElement.value);\n return this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {} });\n } else {\n return Promise.reject(`Option with value '${value}' not found in select element.`);\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/core/angular/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,sBAAO,KAAK,EAAC;yBACd;wBAED,IAAI,GAAG,QAAQ,CAAC;;;wBANC,IAAU,CAAA;;4BAS7B,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,AAnCD,CAAmC,gBAAQ,GAmC1C;AAnCY,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 return false;\n }\n\n name = itemName;\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/angular/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,sBAAO,KAAK,EAAC;wBACf,CAAC;wBAED,IAAI,GAAG,QAAQ,CAAC;;;wBANC,IAAU,CAAA;;4BAS7B,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,AAnCD,CAAmC,gBAAQ,GAmC1C;AAnCY,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 return false;\n }\n\n name = itemName;\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/angular/page-fixture.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,yDAA0D;AAK1D;;;GAGG;AACH;IAAuE,0CAAsB;IAC3F,wBAAY,OAAU;eACpB,kBAAM,OAAO,CAAC;IAChB,CAAC;IAED,kBAAkB;IACX,iCAAQ,GAAf;QACE,MAAM,IAAI,qCAA6B,CAAC,sDAAsD,CAAC,CAAC;IAClG,CAAC;IACH,qBAAC;AAAD,CAAC,AATD,CAAuE,uCAAmB,GASzF;AATY,wCAAc","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\nimport { PageFixtureProfile } from '../page-fixture';\nimport { O3rComponentFixture } from './component-fixture';\nimport { O3rElement } from './element';\n\nexport { PageFixtureProfile } from '../page-fixture';\n\n/**\n * Implementation of the page fixture dedicated to Angular.\n * Pages are not supposed to be used in a Angular environment!\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\n constructor(element: V) {\n super(element);\n }\n\n /** @inheritdoc */\n public getTitle(): Promise<string> {\n throw new TranspilationPurposeOnlyError('getTitle() operation has no sense in Angular context');\n }\n}\n"]}
1
+ {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../../src/core/angular/page-fixture.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,yDAA0D;AAK1D;;;GAGG;AACH;IAAuE,0CAAsB;IAC3F,wBAAY,OAAU;QACpB,OAAA,MAAK,YAAC,OAAO,CAAC,SAAC;IACjB,CAAC;IAED,kBAAkB;IACX,iCAAQ,GAAf;QACE,MAAM,IAAI,qCAA6B,CAAC,sDAAsD,CAAC,CAAC;IAClG,CAAC;IACH,qBAAC;AAAD,CAAC,AATD,CAAuE,uCAAmB,GASzF;AATY,wCAAc","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\nimport { PageFixtureProfile } from '../page-fixture';\nimport { O3rComponentFixture } from './component-fixture';\nimport { O3rElement } from './element';\n\nexport { PageFixtureProfile } from '../page-fixture';\n\n/**\n * Implementation of the page fixture dedicated to Angular.\n * Pages are not supposed to be used in a Angular environment!\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\n constructor(element: V) {\n super(element);\n }\n\n /** @inheritdoc */\n public getTitle(): Promise<string> {\n throw new TranspilationPurposeOnlyError('getTitle() operation has no sense in Angular context');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../src/core/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AAexD;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,uCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,sBAAC;AAAD,CAAC,AAbD,CAAqC,oBAAU,GAa9C;AAbY,0CAAe","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the material autocomplete elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface MatAutocompleteProfile extends ElementProfile {\n\n /**\n * Select an element in a dropdown by value.\n */\n selectByValue(value: string): Promise<void>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /**\n * Select an element in a dropdown by value.\n * @param _value\n * @param _timeout\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../src/core/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AAexD;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,cAAmB;QAC7B,OAAA,MAAK,YAAC,cAAc,CAAC,SAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,uCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,sBAAC;AAAD,CAAC,AAbD,CAAqC,oBAAU,GAa9C;AAbY,0CAAe","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the material autocomplete elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface MatAutocompleteProfile extends ElementProfile {\n\n /**\n * Select an element in a dropdown by value.\n */\n selectByValue(value: string): Promise<void>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /**\n * Select an element in a dropdown by value.\n * @param _value\n * @param _timeout\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../src/core/angular-materials/select-material.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AACnE,sCAAwC;AAUxC;;;GAGG;AACH;IAA+B,qCAAU;IACvC,mBAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;;OAKG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,gBAAC;AAAD,CAAC,AAhCD,CAA+B,oBAAU,GAgCxC;AAhCY,8BAAS","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\nimport { O3rElement } from '../element';\nimport { SelectElementProfile } from '../elements';\n\n/**\n * Interface to describe the material select elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface MatSelectProfile extends SelectElementProfile {}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /**\n * Select an element in a dropdown by index.\n * @param _index\n * @param _timeout\n */\n public selectByIndex(_index: number, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by value.\n * @param _value\n * @param _timeout\n * @deprecated selectByValue relies on ng-reflect-value, which doesn't work when app is in production mode\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by label.\n * @param _label\n * @param _timeout\n */\n public selectByLabel(_label: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../src/core/angular-materials/select-material.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AACnE,sCAAwC;AAUxC;;;GAGG;AACH;IAA+B,qCAAU;IACvC,mBAAY,cAAmB;QAC7B,OAAA,MAAK,YAAC,cAAc,CAAC,SAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;;OAKG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,gBAAC;AAAD,CAAC,AAhCD,CAA+B,oBAAU,GAgCxC;AAhCY,8BAAS","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\nimport { O3rElement } from '../element';\nimport { SelectElementProfile } from '../elements';\n\n/**\n * Interface to describe the material select elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface MatSelectProfile extends SelectElementProfile {}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /**\n * Select an element in a dropdown by index.\n * @param _index\n * @param _timeout\n */\n public selectByIndex(_index: number, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by value.\n * @param _value\n * @param _timeout\n * @deprecated selectByValue relies on ng-reflect-value, which doesn't work when app is in production mode\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by label.\n * @param _label\n * @param _timeout\n */\n public selectByLabel(_label: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../src/core/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AA0BxD;;;GAGG;AACH;IAAwC,8CAAU;IAChD,4BAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,kCAAK,GAAZ,UAAa,MAAa,EAAE,gBAA6B;QAA5C,uBAAA,EAAA,aAAa;QACxB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,oCAAO,GAAd;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,sCAAS,GAAhB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,yBAAC;AAAD,CAAC,AAnBD,CAAwC,oBAAU,GAmBjD;AAnBY,gDAAkB","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the Checkbox elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface CheckboxElementProfile extends ElementProfile {\n /**\n * Check the checkbox element\n * @param value If specified, determine the value of the checkbox button\n * @param associatedLabel If specified, specify the label associated to the checkbox\n */\n check(value?: boolean, associatedLabel?: O3rElement): Promise<void>;\n\n /**\n * Uncheck the checkbox element\n */\n uncheck(): Promise<void>;\n\n /**\n * Return true if the checkbox button is checked\n */\n isChecked(): Promise<boolean>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /** @inheritDoc */\n public check(_value = true, _associatedLabel?: O3rElement): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../src/core/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AA0BxD;;;GAGG;AACH;IAAwC,8CAAU;IAChD,4BAAY,cAAmB;QAC7B,OAAA,MAAK,YAAC,cAAc,CAAC,SAAC;IACxB,CAAC;IAED,kBAAkB;IACX,kCAAK,GAAZ,UAAa,MAAa,EAAE,gBAA6B;QAA5C,uBAAA,EAAA,aAAa;QACxB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,oCAAO,GAAd;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,sCAAS,GAAhB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,yBAAC;AAAD,CAAC,AAnBD,CAAwC,oBAAU,GAmBjD;AAnBY,gDAAkB","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the Checkbox elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface CheckboxElementProfile extends ElementProfile {\n /**\n * Check the checkbox element\n * @param value If specified, determine the value of the checkbox button\n * @param associatedLabel If specified, specify the label associated to the checkbox\n */\n check(value?: boolean, associatedLabel?: O3rElement): Promise<void>;\n\n /**\n * Uncheck the checkbox element\n */\n uncheck(): Promise<void>;\n\n /**\n * Return true if the checkbox button is checked\n */\n isChecked(): Promise<boolean>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /** @inheritDoc */\n public check(_value = true, _associatedLabel?: O3rElement): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../src/core/elements/radio-element.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AAyBxD;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,+BAAK,GAAZ,UAAa,MAAa;QAAb,uBAAA,EAAA,aAAa;QACxB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,iCAAO,GAAd;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,mCAAS,GAAhB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,sBAAC;AAAD,CAAC,AAnBD,CAAqC,oBAAU,GAmB9C;AAnBY,0CAAe","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the Radio elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface RadioElementProfile extends ElementProfile {\n /**\n * Check the radio element\n * @param value If specified, determine the value of the radio button\n */\n check(value?: boolean): Promise<void>;\n\n /**\n * Uncheck the radio element\n */\n uncheck(): Promise<void>;\n\n /**\n * Return true if the radio button is checked\n */\n isChecked(): Promise<boolean>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /** @inheritDoc */\n public check(_value = true): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../src/core/elements/radio-element.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AAyBxD;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,cAAmB;QAC7B,OAAA,MAAK,YAAC,cAAc,CAAC,SAAC;IACxB,CAAC;IAED,kBAAkB;IACX,+BAAK,GAAZ,UAAa,MAAa;QAAb,uBAAA,EAAA,aAAa;QACxB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,iCAAO,GAAd;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,mCAAS,GAAhB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,sBAAC;AAAD,CAAC,AAnBD,CAAqC,oBAAU,GAmB9C;AAnBY,0CAAe","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the Radio elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface RadioElementProfile extends ElementProfile {\n /**\n * Check the radio element\n * @param value If specified, determine the value of the radio button\n */\n check(value?: boolean): Promise<void>;\n\n /**\n * Uncheck the radio element\n */\n uncheck(): Promise<void>;\n\n /**\n * Return true if the radio button is checked\n */\n isChecked(): Promise<boolean>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /** @inheritDoc */\n public check(_value = true): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../src/core/elements/select-element.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AAmBxD;;;GAGG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,wCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACI,wCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,uBAAC;AAAD,CAAC,AAtBD,CAAsC,oBAAU,GAsB/C;AAtBY,4CAAgB","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the Select elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface SelectElementProfile extends ElementProfile {\n /**\n * Select an element in a dropdown by index.\n */\n selectByIndex(index: number, _timeout?: number): Promise<void>;\n\n /**\n * Select an element in a dropdown by value.\n */\n selectByValue(value: string, _timeout?: number): Promise<void>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /**\n * Select an element in a dropdown by index.\n * @param _index\n * @param _timeout\n */\n public selectByIndex(_index: number, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by value.\n * @param _value\n * @param _timeout\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../src/core/elements/select-element.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AAmBxD;;;GAGG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,cAAmB;QAC7B,OAAA,MAAK,YAAC,cAAc,CAAC,SAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,wCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACI,wCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,uBAAC;AAAD,CAAC,AAtBD,CAAsC,oBAAU,GAsB/C;AAtBY,4CAAgB","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the Select elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface SelectElementProfile extends ElementProfile {\n /**\n * Select an element in a dropdown by index.\n */\n selectByIndex(index: number, _timeout?: number): Promise<void>;\n\n /**\n * Select an element in a dropdown by value.\n */\n selectByValue(value: string, _timeout?: number): Promise<void>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /**\n * Select an element in a dropdown by index.\n * @param _index\n * @param _timeout\n */\n public selectByIndex(_index: number, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by value.\n * @param _value\n * @param _timeout\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../src/core/groups/radio-group.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,kCAAkD;AAYlD;;;GAGG;AACH;IAAmC,yCAAyB;IAC1D,uBAAY,aAAgC;eAC1C,kBAAM,aAAa,CAAC;IACtB,CAAC;IAEM,uCAAe,GAAtB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,oBAAC;AAAD,CAAC,AARD,CAAmC,gBAAQ,GAQ1C;AARY,sCAAa","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\nimport { O3rRadioElement, RadioElementProfile } from '../elements/radio-element';\nimport { GroupProfile, O3rGroup } from '../group';\n\n/**\n * Interface to describe the Radio Group that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface RadioGroupProfile extends GroupProfile<RadioElementProfile> {\n /** Get of selected items */\n getSelectedItem(): Promise<RadioElementProfile | undefined>;\n}\n\n/**\n * Mock for RadioGroupProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rRadioGroup extends O3rGroup<O3rRadioElement> implements RadioGroupProfile {\n constructor(sourceElement: O3rRadioElement[]) {\n super(sourceElement);\n }\n\n public getSelectedItem(): Promise<O3rRadioElement | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../src/core/groups/radio-group.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,kCAAkD;AAYlD;;;GAGG;AACH;IAAmC,yCAAyB;IAC1D,uBAAY,aAAgC;QAC1C,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAEM,uCAAe,GAAtB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,oBAAC;AAAD,CAAC,AARD,CAAmC,gBAAQ,GAQ1C;AARY,sCAAa","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\nimport { O3rRadioElement, RadioElementProfile } from '../elements/radio-element';\nimport { GroupProfile, O3rGroup } from '../group';\n\n/**\n * Interface to describe the Radio Group that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface RadioGroupProfile extends GroupProfile<RadioElementProfile> {\n /** Get of selected items */\n getSelectedItem(): Promise<RadioElementProfile | undefined>;\n}\n\n/**\n * Mock for RadioGroupProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rRadioGroup extends O3rGroup<O3rRadioElement> implements RadioGroupProfile {\n constructor(sourceElement: O3rRadioElement[]) {\n super(sourceElement);\n }\n\n public getSelectedItem(): Promise<O3rRadioElement | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/core/helpers.ts"],"names":[],"mappings":";;;;AACA;;;GAGG;AACI,IAAM,SAAS,GAAG,UAAI,IAAoB,IAAyB,OAAA,CAAC,CAAC,IAAI,IAAI,OAAQ,IAAmB,CAAC,IAAI,KAAK,UAAU,EAAzD,CAAyD,CAAC;AAAvH,QAAA,SAAS,aAA8G;AAEpI;;GAEG;AACH;IAAkC,wCAAK;IACrC,sBAAY,OAA4B;eACtC,kBAAM,OAAO,IAAI,wBAAwB,CAAC;IAC5C,CAAC;IACH,mBAAC;AAAD,CAAC,AAJD,CAAkC,KAAK,GAItC;AAJY,oCAAY;AAMzB;;;;GAIG;AACI,IAAM,WAAW,GAAG,UAAU,OAAmB,EAAE,OAAgB;;QACxE,IAAI,CAAC,OAAO,EAAE;YACZ,sBAAO,OAAO,EAAC;SAChB;QACD,sBAAO,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,OAAO,CAAI,UAAC,CAAC,EAAE,MAAM,IAAK,OAAA,UAAU,CAAC,cAAM,OAAA,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC,EAA1B,CAA0B,EAAE,OAAO,CAAC,EAArD,CAAqD,CAAC,CAAC,CAAC,EAAC;;KACtH,CAAC;AALW,QAAA,WAAW,eAKtB","sourcesContent":["\n/**\n * Determine if the given item is a promise\n * @param item Item to check\n */\nexport const isPromise = <T>(item: T | Promise<T>): item is Promise<T> => !!item && typeof (item as Promise<T>).then === 'function';\n\n/**\n * Error raised when promise timeout\n */\nexport class TimeoutError extends Error {\n constructor(message?: string | undefined) {\n super(message || 'Timeout of the promise');\n }\n}\n\n/**\n * Apply timeout to a given promise\n * @param promise Promise to timeout\n * @param timeout timeout of the given promise (in ms)\n */\nexport const withTimeout = async <T>(promise: Promise<T>, timeout?: number): Promise<T> => {\n if (!timeout) {\n return promise;\n }\n return Promise.race([promise, new Promise<T>((_, reject) => setTimeout(() => reject(new TimeoutError()), timeout))]);\n};\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/core/helpers.ts"],"names":[],"mappings":";;;;AACA;;;GAGG;AACI,IAAM,SAAS,GAAG,UAAI,IAAoB,IAAyB,OAAA,CAAC,CAAC,IAAI,IAAI,OAAQ,IAAmB,CAAC,IAAI,KAAK,UAAU,EAAzD,CAAyD,CAAC;AAAvH,QAAA,SAAS,aAA8G;AAEpI;;GAEG;AACH;IAAkC,wCAAK;IACrC,sBAAY,OAA4B;QACtC,OAAA,MAAK,YAAC,OAAO,IAAI,wBAAwB,CAAC,SAAC;IAC7C,CAAC;IACH,mBAAC;AAAD,CAAC,AAJD,CAAkC,KAAK,GAItC;AAJY,oCAAY;AAMzB;;;;GAIG;AACI,IAAM,WAAW,GAAG,UAAU,OAAmB,EAAE,OAAgB;;QACxE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,sBAAO,OAAO,EAAC;QACjB,CAAC;QACD,sBAAO,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,OAAO,CAAI,UAAC,CAAC,EAAE,MAAM,IAAK,OAAA,UAAU,CAAC,cAAM,OAAA,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC,EAA1B,CAA0B,EAAE,OAAO,CAAC,EAArD,CAAqD,CAAC,CAAC,CAAC,EAAC;;KACtH,CAAC;AALW,QAAA,WAAW,eAKtB","sourcesContent":["\n/**\n * Determine if the given item is a promise\n * @param item Item to check\n */\nexport const isPromise = <T>(item: T | Promise<T>): item is Promise<T> => !!item && typeof (item as Promise<T>).then === 'function';\n\n/**\n * Error raised when promise timeout\n */\nexport class TimeoutError extends Error {\n constructor(message?: string | undefined) {\n super(message || 'Timeout of the promise');\n }\n}\n\n/**\n * Apply timeout to a given promise\n * @param promise Promise to timeout\n * @param timeout timeout of the given promise (in ms)\n */\nexport const withTimeout = async <T>(promise: Promise<T>, timeout?: number): Promise<T> => {\n if (!timeout) {\n return promise;\n }\n return Promise.race([promise, new Promise<T>((_, reject) => setTimeout(() => reject(new TimeoutError()), timeout))]);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../src/core/page-fixture.ts"],"names":[],"mappings":";;;;AAAA,yCAAgE;AAChE,yDAAmF;AAanF;;;GAGG;AACH;IAAuE,0CAAsB;IAC3F;;;;OAIG;IACH,wBAAY,YAAgB;eAC1B,iBAAO;IACT,CAAC;IAEM,iCAAQ,GAAf;QACE,MAAM,IAAI,qCAA6B,CAAC,yCAAyC,CAAC,CAAC;IACrF,CAAC;IACH,qBAAC;AAAD,CAAC,AAbD,CAAuE,uCAAmB,GAazF;AAbY,wCAAc","sourcesContent":["import { TranspilationPurposeOnlyError } from '../errors/index';\nimport { ComponentFixtureProfile, O3rComponentFixture } from './component-fixture';\nimport { ElementProfile, O3rElement } from './element';\n\n/**\n * Interface to describe a page fixture.\n */\nexport interface PageFixtureProfile<V extends ElementProfile> extends ComponentFixtureProfile<V> {\n /**\n * Returns the title of the page\n */\n getTitle(): Promise<string>;\n}\n\n/**\n * Mock for page fixture class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\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 super();\n }\n\n public getTitle(): Promise<string> {\n throw new TranspilationPurposeOnlyError('Should target Protractor implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../src/core/page-fixture.ts"],"names":[],"mappings":";;;;AAAA,yCAAgE;AAChE,yDAAmF;AAanF;;;GAGG;AACH;IAAuE,0CAAsB;IAC3F;;;;OAIG;IACH,wBAAY,YAAgB;QAC1B,OAAA,MAAK,WAAE,SAAC;IACV,CAAC;IAEM,iCAAQ,GAAf;QACE,MAAM,IAAI,qCAA6B,CAAC,yCAAyC,CAAC,CAAC;IACrF,CAAC;IACH,qBAAC;AAAD,CAAC,AAbD,CAAuE,uCAAmB,GAazF;AAbY,wCAAc","sourcesContent":["import { TranspilationPurposeOnlyError } from '../errors/index';\nimport { ComponentFixtureProfile, O3rComponentFixture } from './component-fixture';\nimport { ElementProfile, O3rElement } from './element';\n\n/**\n * Interface to describe a page fixture.\n */\nexport interface PageFixtureProfile<V extends ElementProfile> extends ComponentFixtureProfile<V> {\n /**\n * Returns the title of the page\n */\n getTitle(): Promise<string>;\n}\n\n/**\n * Mock for page fixture class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\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 super();\n }\n\n public getTitle(): Promise<string> {\n throw new TranspilationPurposeOnlyError('Should target Protractor implementation');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/playwright/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AACA,sCAA6E;AAI7E;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAmD;eAC7D,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,uCAAa,GAA1B,UAA2B,KAAa,EAAE,OAAc;QAAd,wBAAA,EAAA,cAAc;;;;;4BACtD,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;wBAClC,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;wBAC9D,qBAAM,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,SAAA,EAAC,CAAC,EAAA;;wBAA9D,SAA8D,CAAC;wBACvC,qBAAM,UAAU,CAAC,KAAK,EAAE,EAAA;;wBAA1C,eAAe,GAAG,SAAwB;wBAC1C,OAAO,GAA2B,EAAE,CAAC;6BACvC,CAAA,eAAe,GAAG,CAAC,CAAA,EAAnB,wBAAmB;wBACZ,CAAC,GAAG,CAAC;;;6BAAE,CAAA,CAAC,GAAG,eAAe,CAAA;wBACjC,KAAA,CAAA,KAAA,OAAO,CAAA,CAAC,IAAI,CAAA;wBAAC,KAAA,sBAAY,CAAA;wBAAC,qBAAM,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,EAAA;;wBAA7D,cAAa,kBAAa,SAAmC,EAAC,EAAC,CAAC;;;wBAD7B,CAAC,EAAE,CAAA;;4BAGxC,MAAM,IAAI,KAAK,CAAC,qGAA8F,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;;6BAElI,CAAA,eAAe,KAAK,CAAC,CAAA,EAArB,yBAAqB;wBACjB,cAAc,GAA4B,EAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAC,CAAC;wBAC5G,qBAAM,IAAI,oBAAU,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,EAAA;;wBAA5C,SAA4C,CAAC;wBAC7C,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAC;6BAGjD,sBAAO,OAAO,CAAC,MAAM,CAAC,0DAA0D,CAAC,EAAC;;;;KACnF;IACH,sBAAC;AAAD,CAAC,AA5BD,CAAqC,oBAAU,GA4B9C;AA5BY,0CAAe","sourcesContent":["import {MatAutocompleteProfile} from '../../angular-materials';\nimport {getPlainText, O3rElement, PlaywrightSourceElement} from '../element';\n\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, timeout = 5000) {\n await this.setValue(value);\n await this.click();\n const element = this.sourceElement.page;\n const matOptions = element.locator('.mat-option, mat-option');\n await matOptions.first().waitFor({state: 'attached', timeout});\n const matOptionsCount = await matOptions.count();\n const options: (string | undefined)[] = [];\n if (matOptionsCount > 1) {\n for (let i = 0; i < matOptionsCount; i++) {\n options.push(getPlainText(await matOptions.nth(i).innerText()));\n }\n throw new Error(`MatAutocomplete selectByValue works only for filtered autocomplete. Found multiple values: ${options.join(', ')}`);\n }\n if (matOptionsCount === 1) {\n const selectedOption: PlaywrightSourceElement = {element: matOptions.nth(0), page: this.sourceElement.page};\n await new O3rElement(selectedOption).click();\n return this.sourceElement.element.press('Tab');\n }\n\n return Promise.reject('Element with selector .mat-option, mat-option not found.');\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/playwright/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AACA,sCAA6E;AAI7E;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAmD;QAC7D,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,uCAAa,GAA1B,UAA2B,KAAa,EAAE,OAAc;QAAd,wBAAA,EAAA,cAAc;;;;;4BACtD,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;wBAClC,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;wBAC9D,qBAAM,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,SAAA,EAAC,CAAC,EAAA;;wBAA9D,SAA8D,CAAC;wBACvC,qBAAM,UAAU,CAAC,KAAK,EAAE,EAAA;;wBAA1C,eAAe,GAAG,SAAwB;wBAC1C,OAAO,GAA2B,EAAE,CAAC;6BACvC,CAAA,eAAe,GAAG,CAAC,CAAA,EAAnB,wBAAmB;wBACZ,CAAC,GAAG,CAAC;;;6BAAE,CAAA,CAAC,GAAG,eAAe,CAAA;wBACjC,KAAA,CAAA,KAAA,OAAO,CAAA,CAAC,IAAI,CAAA;wBAAC,KAAA,sBAAY,CAAA;wBAAC,qBAAM,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,EAAA;;wBAA7D,cAAa,kBAAa,SAAmC,EAAC,EAAC,CAAC;;;wBAD7B,CAAC,EAAE,CAAA;;4BAGxC,MAAM,IAAI,KAAK,CAAC,qGAA8F,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;;6BAElI,CAAA,eAAe,KAAK,CAAC,CAAA,EAArB,yBAAqB;wBACjB,cAAc,GAA4B,EAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAC,CAAC;wBAC5G,qBAAM,IAAI,oBAAU,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,EAAA;;wBAA5C,SAA4C,CAAC;wBAC7C,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAC;6BAGjD,sBAAO,OAAO,CAAC,MAAM,CAAC,0DAA0D,CAAC,EAAC;;;;KACnF;IACH,sBAAC;AAAD,CAAC,AA5BD,CAAqC,oBAAU,GA4B9C;AA5BY,0CAAe","sourcesContent":["import {MatAutocompleteProfile} from '../../angular-materials';\nimport {getPlainText, O3rElement, PlaywrightSourceElement} from '../element';\n\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, timeout = 5000) {\n await this.setValue(value);\n await this.click();\n const element = this.sourceElement.page;\n const matOptions = element.locator('.mat-option, mat-option');\n await matOptions.first().waitFor({state: 'attached', timeout});\n const matOptionsCount = await matOptions.count();\n const options: (string | undefined)[] = [];\n if (matOptionsCount > 1) {\n for (let i = 0; i < matOptionsCount; i++) {\n options.push(getPlainText(await matOptions.nth(i).innerText()));\n }\n throw new Error(`MatAutocomplete selectByValue works only for filtered autocomplete. Found multiple values: ${options.join(', ')}`);\n }\n if (matOptionsCount === 1) {\n const selectedOption: PlaywrightSourceElement = {element: matOptions.nth(0), page: this.sourceElement.page};\n await new O3rElement(selectedOption).click();\n return this.sourceElement.element.press('Tab');\n }\n\n return Promise.reject('Element with selector .mat-option, mat-option not found.');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../../src/core/playwright/angular-materials/select-material.ts"],"names":[],"mappings":";;;;AACA,sCAA+D;AAG/D;;GAEG;AACH;IAA+B,qCAAU;IACvC,mBAAY,aAAmD;eAC7D,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,iCAAa,GAA1B,UAA2B,KAAa,EAAE,OAAc;QAAd,wBAAA,EAAA,cAAc;;;;;4BACtD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;wBAC9D,qBAAM,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,SAAA,EAAC,CAAC,EAAA;;wBAA3D,SAA2D,CAAC;wBACvD,qBAAM,OAAO,CAAC,KAAK,EAAE,EAAA;;wBAA1B,IAAI,CAAC,SAAqB,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE;4BAClC,cAAc,GAA4B,EAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,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GAA1B,UAA2B,KAAa,EAAE,OAAc;QAAd,wBAAA,EAAA,cAAc;;;;;4BACtD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;wBAC9D,qBAAM,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,SAAA,EAAC,CAAC,EAAA;;wBAA3D,SAA2D,CAAC;wBACvC,qBAAM,OAAO,CAAC,KAAK,EAAE,EAAA;;wBAApC,YAAY,GAAG,SAAqB;wBACjC,CAAC,GAAG,CAAC;;;6BAAE,CAAA,CAAC,GAAG,YAAY,CAAA;wBACxB,cAAc,GAA4B,EAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAC,CAAC;wBACnG,MAAM,GAAG,IAAI,oBAAU,CAAC,cAAc,CAAC,CAAC;wBAC1C,qBAAM,MAAM,CAAC,OAAO,EAAE,EAAA;;wBAA1B,IAAI,CAAA,SAAsB,MAAK,KAAK,EAAE;4BACpC,sBAAO,MAAM,CAAC,KAAK,EAAE,EAAC;yBACvB;;;wBAL+B,CAAC,EAAE,CAAA;;4BAQrC,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;KAClF;IAED,kBAAkB;IACX,4BAAQ,GAAf;QACE,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;IAChH,CAAC;IACH,gBAAC;AAAD,CAAC,AAxDD,CAA+B,oBAAU,GAwDxC;AAxDY,8BAAS","sourcesContent":["import {MatSelectProfile} from '../../angular-materials';\nimport {O3rElement, PlaywrightSourceElement} from '../element';\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, timeout = 5000) {\n await this.click();\n const options = this.sourceElement.page.locator('mat-option');\n await options.first().waitFor({state: 'attached', timeout});\n if ((await options.count()) >= index + 1) {\n const selectedOption: PlaywrightSourceElement = {element: options.nth(index), page: this.sourceElement.page};\n const option = new O3rElement(selectedOption);\n return option.click();\n } else {\n return Promise.reject(`Option with index ${index} not found in select element.`);\n }\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, timeout = 5000) {\n await this.click();\n const options = this.sourceElement.page.locator('mat-option');\n await options.first().waitFor({state: 'attached', timeout});\n const optionsCount = await options.count();\n for (let i = 0; i < optionsCount; i++) {\n const selectedOption: PlaywrightSourceElement = {element: options.nth(i), page: this.sourceElement.page};\n const option = new O3rElement(selectedOption);\n if (await option.getAttribute('ng-reflect-value') === value) {\n return option.click();\n }\n }\n return Promise.reject(`Option with value ${value} not found in select element.`);\n }\n\n /** @inheritdoc */\n public async selectByLabel(label: string, timeout = 5000) {\n await this.click();\n const options = this.sourceElement.page.locator('mat-option');\n await options.first().waitFor({state: 'attached', timeout});\n const optionsCount = await options.count();\n for (let i = 0; i < optionsCount; i++) {\n const selectedOption: PlaywrightSourceElement = {element: options.nth(i), page: this.sourceElement.page};\n const option = new O3rElement(selectedOption);\n if (await option.getText() === label) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with label ${label} not found in select element.`);\n }\n\n /** @inheritDoc */\n public getValue(): Promise<string | undefined> {\n throw new Error('Cannot use \"getValue\" function on a Material Select element. Use \"getPlainText()\" instead.');\n }\n}\n"]}
1
+ {"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../../src/core/playwright/angular-materials/select-material.ts"],"names":[],"mappings":";;;;AACA,sCAA+D;AAG/D;;GAEG;AACH;IAA+B,qCAAU;IACvC,mBAAY,aAAmD;QAC7D,OAAA,MAAK,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,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAC,CAAC;wBACnG,MAAM,GAAG,IAAI,oBAAU,CAAC,cAAc,CAAC,CAAC;wBAC1C,qBAAM,MAAM,CAAC,OAAO,EAAE,EAAA;;wBAA1B,IAAI,CAAA,SAAsB,MAAK,KAAK,EAAE,CAAC;4BACrC,sBAAO,MAAM,CAAC,KAAK,EAAE,EAAC;wBACxB,CAAC;;;wBAL+B,CAAC,EAAE,CAAA;;4BAQrC,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;KAClF;IAED,kBAAkB;IACX,4BAAQ,GAAf;QACE,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;IAChH,CAAC;IACH,gBAAC;AAAD,CAAC,AAxDD,CAA+B,oBAAU,GAwDxC;AAxDY,8BAAS","sourcesContent":["import {MatSelectProfile} from '../../angular-materials';\nimport {O3rElement, PlaywrightSourceElement} from '../element';\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, timeout = 5000) {\n await this.click();\n const options = this.sourceElement.page.locator('mat-option');\n await options.first().waitFor({state: 'attached', timeout});\n if ((await options.count()) >= index + 1) {\n const selectedOption: PlaywrightSourceElement = {element: options.nth(index), page: this.sourceElement.page};\n const option = new O3rElement(selectedOption);\n return option.click();\n } else {\n return Promise.reject(`Option with index ${index} not found in select element.`);\n }\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, timeout = 5000) {\n await this.click();\n const options = this.sourceElement.page.locator('mat-option');\n await options.first().waitFor({state: 'attached', timeout});\n const optionsCount = await options.count();\n for (let i = 0; i < optionsCount; i++) {\n const selectedOption: PlaywrightSourceElement = {element: options.nth(i), page: this.sourceElement.page};\n const option = new O3rElement(selectedOption);\n if (await option.getAttribute('ng-reflect-value') === value) {\n return option.click();\n }\n }\n return Promise.reject(`Option with value ${value} not found in select element.`);\n }\n\n /** @inheritdoc */\n public async selectByLabel(label: string, timeout = 5000) {\n await this.click();\n const options = this.sourceElement.page.locator('mat-option');\n await options.first().waitFor({state: 'attached', timeout});\n const optionsCount = await options.count();\n for (let i = 0; i < optionsCount; i++) {\n const selectedOption: PlaywrightSourceElement = {element: options.nth(i), page: this.sourceElement.page};\n const option = new O3rElement(selectedOption);\n if (await option.getText() === label) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with label ${label} not found in select element.`);\n }\n\n /** @inheritDoc */\n public getValue(): Promise<string | undefined> {\n throw new Error('Cannot use \"getValue\" function on a Material Select element. Use \"getPlainText()\" instead.');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/playwright/component-fixture.ts"],"names":[],"mappings":";;;;AAAA,4BAA4B;AAC5B,4CAAuD;AAEvD,sCAAyC;AACzC,qCAAuF;AAKvF;;GAEG;AACH;IAOE;;;;OAIG;IACH,6BAAY,WAAc;QACxB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACa,qDAAuB,GAAvC,UAA8D,OAAW,EAAE,OAAgB;;;;;wBACzF,IAAI,CAAC,OAAO,EAAE;4BACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;yBAClE;wBACD,qBAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,SAAA,EAAC,CAAC,EAAA;;wBAAjF,SAAiF,CAAC;wBAClF,sBAAO,OAAO,EAAC;;;;KAChB;IAED;;;;;OAKG;IACO,8CAAgB,GAA1B,UAAiD,OAAmB,EAAE,OA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Q,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,oBAAU,CAAC,eAAe,CAAC,CAAC,CAAC;yBAC/F;6BACG,SAAS,EAAT,wBAAS;wBACL,KAAK,GAAG,IAAI,SAAS,CAAC,QAAe,CAAC,CAAC;wBAC7B,qBAAM,KAAK,CAAC,YAAY,EAAE,EAAA;;wBAApC,OAAO,GAAG,SAA0B;wBAE1C,IAAI,CAAC,OAAO,EAAE;4BACZ,MAAM,IAAI,yBAAiB,CAAC,wBAAwB,CAAC,CAAC;yBACvD;wBACD,sBAAO,KAAK,EAAC;4BAGf,sBAAO,QAAQ,EAAC;;;wBAEhB,OAAO,CAAC,IAAI,CAAC,8BAAuB,QAAQ,CAAE,EAAE,KAAG,CAAC,CAAC;wBACrD,sBAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAC;;;;;KAE9B;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;IACX,6CAAe,GAAtB,UAAuB,QAAgB;QACrC,IAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;QACjF,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;IACH,0BAAC;AAAD,CAAC,AAnND,IAmNC;AAnNY,kDAAmB","sourcesContent":["/* eslint-disable new-cap */\nimport { FixtureUsageError } from '../../errors/index';\nimport type { ComponentFixtureProfile } from '../component-fixture';\nimport { withTimeout } from '../helpers';\nimport { O3rElement, O3rElementConstructor, PlaywrightSourceElement } from './element';\nimport { O3rGroup, O3rGroupConstructor } from './group';\n\nexport type { ComponentFixtureProfile, Constructable, FixtureWithCustom } from '../component-fixture';\n\n/**\n * Implementation of the fixture dedicated to Playwright, hence using the webdriver to interact with the dom.\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n\n /**\n * DOM element linked to the fixture.\n */\n protected rootElement: V;\n\n /**\n * Root element of this fixture.\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 element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefinedElement<T extends O3rElement>(element?: T, timeout?: number): Promise<T> {\n if (!element) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n await element.sourceElement.element.first().waitFor({state: 'attached', timeout});\n return element;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected throwOnUndefined<T extends O3rElement>(element: Promise<T>, timeout?: number): Promise<T> {\n return withTimeout(\n (async () => {\n const el = await element;\n await el.sourceElement.element.first().waitFor({state: 'attached'});\n return el;\n })(),\n timeout);\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> {\n let element: O3rElement;\n if (options.index !== undefined) {\n element = await this.queryNth(selector, options.index, elementConstructor as any);\n } else {\n element = await this.query(selector, elementConstructor as any);\n }\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(element, options.timeout);\n }\n return element;\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>;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<string | undefined> {\n const element = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (!await element.isVisible()) {\n return;\n }\n return await element.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 element = await this.queryWithOptions(selector, options.elementConstructor, options);\n return await element.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 element = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (await element.isVisible()) {\n await element.click();\n }\n }\n\n /** @inheritdoc */\n public query(selector: string, returnType?: undefined): Promise<O3rElement>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement> {\n const elements = this.rootElement.sourceElement.element.locator(selector);\n const element = elements.first();\n const selectedElement: PlaywrightSourceElement = {element: element, page: this.rootElement.sourceElement.page};\n return Promise.resolve(new (returnType || O3rElement)(selectedElement));\n }\n\n /** @inheritdoc */\n public queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement> {\n const elements = this.rootElement.sourceElement.element.locator(selector);\n const element = elements.nth(index);\n const selectedElement: PlaywrightSourceElement = {element: element, page: this.rootElement.sourceElement.page};\n return Promise.resolve(new (returnType || O3rElement)(selectedElement));\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 = 5000\n ): Promise<(T | O3rElement)[] | K> {\n try {\n const sourceElement = this.rootElement.sourceElement.element;\n const pElements = sourceElement.locator(selector);\n // Mandatory because count is not reliable if we don't wait for the list to be attached\n await pElements.first().waitFor({state: 'attached', timeout});\n const pElementsCount = await pElements.count();\n const elements = [];\n for (let i = 0; i < pElementsCount; i++) {\n const selectedElement: PlaywrightSourceElement = {element: pElements.nth(i), page: this.rootElement.sourceElement.page};\n elements.push(returnType ? new returnType(selectedElement) : new O3rElement(selectedElement));\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 group;\n }\n\n return elements;\n } catch (err) {\n console.warn(`Failed to query all ${selector}`, err);\n return Promise.resolve([]);\n }\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 queryNotPresent(selector: string): Promise<boolean> {\n const element = this.rootElement.sourceElement.element.locator(selector).first();\n return element.isHidden();\n }\n}\n"]}
1
+ {"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/playwright/component-fixture.ts"],"names":[],"mappings":";;;;AAAA,4BAA4B;AAC5B,4CAAuD;AAEvD,sCAAyC;AACzC,qCAAuF;AAKvF;;GAEG;AACH;IAOE;;;;OAIG;IACH,6BAAY,WAAc;QACxB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACa,qDAAuB,GAAvC,UAA8D,OAAW,EAAE,OAAgB;;;;;wBACzF,IAAI,CAAC,OAAO,EAAE,CAAC;4BACb,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;wBACnE,CAAC;wBACD,qBAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,SAAA,EAAC,CAAC,EAAA;;wBAAjF,SAAiF,CAAC;wBAClF,sBAAO,OAAO,EAAC;;;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FixtureUsageError } from '../../errors/index';\nimport type { ComponentFixtureProfile } from '../component-fixture';\nimport { withTimeout } from '../helpers';\nimport { O3rElement, O3rElementConstructor, PlaywrightSourceElement } from './element';\nimport { O3rGroup, O3rGroupConstructor } from './group';\n\nexport type { ComponentFixtureProfile, Constructable, FixtureWithCustom } from '../component-fixture';\n\n/**\n * Implementation of the fixture dedicated to Playwright, hence using the webdriver to interact with the dom.\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n\n /**\n * DOM element linked to the fixture.\n */\n protected rootElement: V;\n\n /**\n * Root element of this fixture.\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 element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefinedElement<T extends O3rElement>(element?: T, timeout?: number): Promise<T> {\n if (!element) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n await element.sourceElement.element.first().waitFor({state: 'attached', timeout});\n return element;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected throwOnUndefined<T extends O3rElement>(element: Promise<T>, timeout?: number): Promise<T> {\n return withTimeout(\n (async () => {\n const el = await element;\n await el.sourceElement.element.first().waitFor({state: 'attached'});\n return el;\n })(),\n timeout);\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> {\n let element: O3rElement;\n if (options.index !== undefined) {\n element = await this.queryNth(selector, options.index, elementConstructor as any);\n } else {\n element = await this.query(selector, elementConstructor as any);\n }\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(element, options.timeout);\n }\n return element;\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>;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<string | undefined> {\n const element = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (!await element.isVisible()) {\n return;\n }\n return await element.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 element = await this.queryWithOptions(selector, options.elementConstructor, options);\n return await element.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 element = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (await element.isVisible()) {\n await element.click();\n }\n }\n\n /** @inheritdoc */\n public query(selector: string, returnType?: undefined): Promise<O3rElement>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement> {\n const elements = this.rootElement.sourceElement.element.locator(selector);\n const element = elements.first();\n const selectedElement: PlaywrightSourceElement = {element: element, page: this.rootElement.sourceElement.page};\n return Promise.resolve(new (returnType || O3rElement)(selectedElement));\n }\n\n /** @inheritdoc */\n public queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement> {\n const elements = this.rootElement.sourceElement.element.locator(selector);\n const element = elements.nth(index);\n const selectedElement: PlaywrightSourceElement = {element: element, page: this.rootElement.sourceElement.page};\n return Promise.resolve(new (returnType || O3rElement)(selectedElement));\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 = 5000\n ): Promise<(T | O3rElement)[] | K> {\n try {\n const sourceElement = this.rootElement.sourceElement.element;\n const pElements = sourceElement.locator(selector);\n // Mandatory because count is not reliable if we don't wait for the list to be attached\n await pElements.first().waitFor({state: 'attached', timeout});\n const pElementsCount = await pElements.count();\n const elements = [];\n for (let i = 0; i < pElementsCount; i++) {\n const selectedElement: PlaywrightSourceElement = {element: pElements.nth(i), page: this.rootElement.sourceElement.page};\n elements.push(returnType ? new returnType(selectedElement) : new O3rElement(selectedElement));\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 group;\n }\n\n return elements;\n } catch (err) {\n console.warn(`Failed to query all ${selector}`, err);\n return Promise.resolve([]);\n }\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 queryNotPresent(selector: string): Promise<boolean> {\n const element = this.rootElement.sourceElement.element.locator(selector).first();\n return element.isHidden();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/playwright/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AACA,sCAA+D;AAE/D;;GAEG;AACH;IAAwC,8CAAU;IAChD,4BAAY,aAAmD;eAC7D,kBAAM,aAAa,CAAC;IACtB,CAAC;IAEa,4CAAe,GAA7B;;;;;;;wBAEU,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;wBACjF,qBAAM,eAAe,CAAC,KAAK,EAAE,EAAA;;wBAAjC,IAAI,SAA6B,EAAE;4BACjC,sBAAO,eAAe,EAAC;yBACxB;wBACD,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAC;;;wBAElC,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAC;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AAxDD,CAAwC,oBAAU,GAwDjD;AAxDY,gDAAkB","sourcesContent":["import {CheckboxElementProfile} from '../../elements';\nimport {O3rElement, PlaywrightSourceElement} from '../element';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n private async getInputElement() {\n try {\n const subInputElement = this.sourceElement.element.locator('input[type=\"checkbox\"]');\n if (await subInputElement.count()) {\n return subInputElement;\n }\n return this.sourceElement.element;\n } catch {\n return this.sourceElement.element;\n }\n }\n\n private async getLabelElement() {\n try {\n const element = this.sourceElement.element.locator('label');\n if (await element.count()) {\n return element;\n }\n } catch (err) {\n console.warn('Failed to retrieve label of O3rCheckboxElement', err);\n return;\n }\n }\n\n /**\n * @inheritDoc\n * If the element contains a label, the label will be used to (un)check the checkbox.\n */\n public async check(value = true) {\n const labelElement = await this.getLabelElement();\n if (labelElement) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n console.warn(`Checkbox is already ${currentValue ? 'checked' : 'unchecked'}`);\n return Promise.resolve();\n }\n return labelElement.click();\n }\n return (await this.getInputElement()).setChecked(value);\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const inputElement = await this.getInputElement();\n return inputElement.isChecked();\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/playwright/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AACA,sCAA+D;AAE/D;;GAEG;AACH;IAAwC,8CAAU;IAChD,4BAAY,aAAmD;QAC7D,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAEa,4CAAe,GAA7B;;;;;;;wBAEU,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;wBACjF,qBAAM,eA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AK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACL,sCAAS,GAAtB;;;;;4BACuB,qBAAM,IAAI,CAAC,eAAe,EAAE,EAAA;;wBAA3C,YAAY,GAAG,SAA4B;wBACjD,sBAAO,YAAY,CAAC,SAAS,EAAE,EAAC;;;;KACjC;IACH,yBAAC;AAAD,CAAC,AAxDD,CAAwC,oBAAU,GAwDjD;AAxDY,gDAAkB","sourcesContent":["import {CheckboxElementProfile} from '../../elements';\nimport {O3rElement, PlaywrightSourceElement} from '../element';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n private async getInputElement() {\n try {\n const subInputElement = this.sourceElement.element.locator('input[type=\"checkbox\"]');\n if (await subInputElement.count()) {\n return subInputElement;\n }\n return this.sourceElement.element;\n } catch {\n return this.sourceElement.element;\n }\n }\n\n private async getLabelElement() {\n try {\n const element = this.sourceElement.element.locator('label');\n if (await element.count()) {\n return element;\n }\n } catch (err) {\n console.warn('Failed to retrieve label of O3rCheckboxElement', err);\n return;\n }\n }\n\n /**\n * @inheritDoc\n * If the element contains a label, the label will be used to (un)check the checkbox.\n */\n public async check(value = true) {\n const labelElement = await this.getLabelElement();\n if (labelElement) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n console.warn(`Checkbox is already ${currentValue ? 'checked' : 'unchecked'}`);\n return Promise.resolve();\n }\n return labelElement.click();\n }\n return (await this.getInputElement()).setChecked(value);\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const inputElement = await this.getInputElement();\n return inputElement.isChecked();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/playwright/elements/radio-element.ts"],"names":[],"mappings":";;;;AACA,sCAA+D;AAE/D;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAmD;eAC7D,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,+BAAK,GAAlB,UAAmB,KAAY;QAAZ,sBAAA,EAAA,YAAY;;;;4BACxB,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAA3B,IAAI,CAAC,SAAsB,CAAC,KAAK,KAAK,EAAE;4BACtC,OAAO,CAAC,IAAI,CAAC,qCAA8B,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAE,CAAC,CAAC;4BAC9E,sBAAO;yBACR;wBACD,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAC;;;;KACrD;IAED,kBAAkB;IACL,iCAAO,GAApB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAC;;;KAC1B;IAED,kBAAkB;IACX,mCAAS,GAAhB;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;IAChD,CAAC;IACH,sBAAC;AAAD,CAAC,AAvBD,CAAqC,oBAAU,GAuB9C;AAvBY,0CAAe","sourcesContent":["import {RadioElementProfile} from '../../elements';\nimport {O3rElement, PlaywrightSourceElement} from '../element';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true) {\n if ((await this.isChecked()) === value) {\n console.warn(`O3rRadioELement is already ${value ? 'checked' : 'unchecked'}`);\n return;\n }\n return this.sourceElement.element.setChecked(value);\n }\n\n /** @inheritDoc */\n public async uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n return this.sourceElement.element.isChecked();\n }\n}\n"]}
1
+ {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/playwright/elements/radio-element.ts"],"names":[],"mappings":";;;;AACA,sCAA+D;AAE/D;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAmD;QAC7D,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,+BAAK,GAAlB,UAAmB,KAAY;QAAZ,sBAAA,EAAA,YAAY;;;;4BACxB,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAA3B,IAAI,CAAC,SAAsB,CAAC,KAAK,KAAK,EAAE,CAAC;4BACvC,OAAO,CAAC,IAAI,CAAC,qCAA8B,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAE,CAAC,CAAC;4BAC9E,sBAAO;wBACT,CAAC;wBACD,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAC;;;;KACrD;IAED,kBAAkB;IACL,iCAAO,GAApB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAC;;;KAC1B;IAED,kBAAkB;IACX,mCAAS,GAAhB;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;IAChD,CAAC;IACH,sBAAC;AAAD,CAAC,AAvBD,CAAqC,oBAAU,GAuB9C;AAvBY,0CAAe","sourcesContent":["import {RadioElementProfile} from '../../elements';\nimport {O3rElement, PlaywrightSourceElement} from '../element';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true) {\n if ((await this.isChecked()) === value) {\n console.warn(`O3rRadioELement is already ${value ? 'checked' : 'unchecked'}`);\n return;\n }\n return this.sourceElement.element.setChecked(value);\n }\n\n /** @inheritDoc */\n public async uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n return this.sourceElement.element.isChecked();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/playwright/elements/select-element.ts"],"names":[],"mappings":";;;;AAAA,sCAA+D;AAG/D;;GAEG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,aAAmD;eAC7D,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACX,wCAAa,GAApB,UAAqB,KAAa,EAAE,QAAiB;QACnD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;IAC1D,CAAC;IAED,kBAAkB;IACX,wCAAa,GAApB,UAAqB,KAAa,EAAE,QAAiB;QACnD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,kBAAkB;IACL,mCAAQ,GAArB;;;gBACE,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,UAAU,EAAE,EAAC;;;KAC1E;IACH,uBAAC;AAAD,CAAC,AAnBD,CAAsC,oBAAU,GAmB/C;AAnBY,4CAAgB","sourcesContent":["import {O3rElement, PlaywrightSourceElement} from '../element';\n\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rSelectElement extends O3rElement {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public selectByIndex(index: number, _timeout?: number) {\n return this.sourceElement.element.selectOption({index});\n }\n\n /** @inheritdoc */\n public selectByValue(value: string, _timeout?: number) {\n return this.sourceElement.element.selectOption({ value });\n }\n\n /** @inheritDoc */\n public async getValue() {\n return this.sourceElement.element.locator('option:checked').inputValue();\n }\n}\n"]}
1
+ {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/playwright/elements/select-element.ts"],"names":[],"mappings":";;;;AAAA,sCAA+D;AAG/D;;GAEG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,aAAmD;QAC7D,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACX,wCAAa,GAApB,UAAqB,KAAa,EAAE,QAAiB;QACnD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;IAC1D,CAAC;IAED,kBAAkB;IACX,wCAAa,GAApB,UAAqB,KAAa,EAAE,QAAiB;QACnD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,kBAAkB;IACL,mCAAQ,GAArB;;;gBACE,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,UAAU,EAAE,EAAC;;;KAC1E;IACH,uBAAC;AAAD,CAAC,AAnBD,CAAsC,oBAAU,GAmB/C;AAnBY,4CAAgB","sourcesContent":["import {O3rElement, PlaywrightSourceElement} from '../element';\n\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rSelectElement extends O3rElement {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public selectByIndex(index: number, _timeout?: number) {\n return this.sourceElement.element.selectOption({index});\n }\n\n /** @inheritdoc */\n public selectByValue(value: string, _timeout?: number) {\n return this.sourceElement.element.selectOption({ value });\n }\n\n /** @inheritDoc */\n public async getValue() {\n return this.sourceElement.element.locator('option:checked').inputValue();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/core/playwright/groups/radio-group.ts"],"names":[],"mappings":";;;;AAEA,kCAAkC;AAElC;;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,sBAAO,KAAK,EAAC;yBACd;wBACD,IAAI,QAAQ,KAAK,SAAS,EAAE;4BAC1B,IAAI,GAAG,QAAQ,CAAC;yBACjB;;;wBAPgB,IAAU,CAAA;;4BAU7B,sBAAO,IAAI,EAAC;;;;KACb;IAED;;OAEG;IACU,uCAAe,GAA5B;;;;;;8BAC+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,AAnCD,CAAmC,gBAAQ,GAmC1C;AAnCY,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 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 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/playwright/groups/radio-group.ts"],"names":[],"mappings":";;;;AAEA,kCAAkC;AAElC;;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,sBAAO,KAAK,EAAC;wBACf,CAAC;wBACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;4BAC3B,IAAI,GAAG,QAAQ,CAAC;wBAClB,CAAC;;;wBAPgB,IAAU,CAAA;;4BAU7B,sBAAO,IAAI,EAAC;;;;KACb;IAED;;OAEG;IACU,uCAAe,GAA5B;;;;;;8BAC+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,AAnCD,CAAmC,gBAAQ,GAmC1C;AAnCY,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 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 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/playwright/page-fixture.ts"],"names":[],"mappings":";;;;AACA,yDAAwD;AAKxD;;GAEG;AACH;IAAuE,0CAAsB;IAC3F,wBAAY,WAAc;eACxB,kBAAM,WAAW,CAAC;IACpB,CAAC;IAEY,iCAAQ,GAArB;;;;4BACS,qBAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,EAAA;4BAAxD,sBAAO,SAAiD,EAAC;;;;KAC1D;IACH,qBAAC;AAAD,CAAC,AARD,CAAuE,uCAAmB,GAQzF;AARY,wCAAc","sourcesContent":["import {PageFixtureProfile} from '../page-fixture';\nimport {O3rComponentFixture} from './component-fixture';\nimport {O3rElement} from './element';\n\nexport {PageFixtureProfile} from '../page-fixture';\n\n/**\n * Implementation of the page fixture dedicated to Playwright.\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 async getTitle() {\n return await this.rootElement.sourceElement.page.title();\n }\n}\n"]}
1
+ {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../../src/core/playwright/page-fixture.ts"],"names":[],"mappings":";;;;AACA,yDAAwD;AAKxD;;GAEG;AACH;IAAuE,0CAAsB;IAC3F,wBAAY,WAAc;QACxB,OAAA,MAAK,YAAC,WAAW,CAAC,SAAC;IACrB,CAAC;IAEY,iCAAQ,GAArB;;;;4BACS,qBAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,EAAA;4BAAxD,sBAAO,SAAiD,EAAC;;;;KAC1D;IACH,qBAAC;AAAD,CAAC,AARD,CAAuE,uCAAmB,GAQzF;AARY,wCAAc","sourcesContent":["import {PageFixtureProfile} from '../page-fixture';\nimport {O3rComponentFixture} from './component-fixture';\nimport {O3rElement} from './element';\n\nexport {PageFixtureProfile} from '../page-fixture';\n\n/**\n * Implementation of the page fixture dedicated to Playwright.\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 async getTitle() {\n return await this.rootElement.sourceElement.page.title();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/protractor/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAAA,yCAAsD;AAEtD,sCAAsC;AAItC;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAyC;eACnD,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,uCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,SAAS,GAAG,IAAA,oBAAO,EAAC,eAAE,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC;wBAC7D,sBAAO,IAAI,oBAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KAC1C;IACH,sBAAC;AAAD,CAAC,AAZD,CAAqC,oBAAU,GAY9C;AAZY,0CAAe","sourcesContent":["import {By, element, ElementFinder} from 'protractor';\nimport {MatAutocompleteProfile} from '../../angular-materials';\nimport {O3rElement} from '../element';\n\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Protractor.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.setValue(value);\n await this.click();\n const matOption = element(By.css('.mat-option, mat-option'));\n return new O3rElement(matOption).click();\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/protractor/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAAA,yCAAsD;AAEtD,sCAAsC;AAItC;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAyC;QACnD,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,uCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,SAAS,GAAG,IAAA,oBAAO,EAAC,eAAE,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC;wBAC7D,sBAAO,IAAI,oBAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KAC1C;IACH,sBAAC;AAAD,CAAC,AAZD,CAAqC,oBAAU,GAY9C;AAZY,0CAAe","sourcesContent":["import {By, element, ElementFinder} from 'protractor';\nimport {MatAutocompleteProfile} from '../../angular-materials';\nimport {O3rElement} from '../element';\n\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Protractor.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.setValue(value);\n await this.click();\n const matOption = element(By.css('.mat-option, mat-option'));\n return new O3rElement(matOption).click();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../../src/core/protractor/angular-materials/select-material.ts"],"names":[],"mappings":";;;;AAAA,yCAAsD;AAEtD,sCAAsC;AAGtC;;GAEG;AACH;IAA+B,qCAAU;IACvC,mBAAY,aAAyC;eACnD,kBAAM,aAAa,CAAC;IACtB,CAAC;IAED,kBAAkB;IACL,iCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBAEc,qBAAM,oBAAO,CAAC,GAAG,CAAC,eAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,EAAE,EAAA;;wBAAtF,OAAO,GAAoB,SAA2D;wBAC5F,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE;4BACnC,MAAM,GAAG,IAAI,oBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;4BAC9C,sBAAO,MAAM,CAAC,KAAK,EAAE,EAAC;yBACvB;6BAAM;4BACL,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;yBAClF;;;;;KACF;IAED,kBAAkB;IACL,iCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EA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O,CAAC,IAAI,CAAC,mGAAmG,CAAC,CAAC;QAClH,OAAO,iBAAM,QAAQ,WAAE,CAAC;IAC1B,CAAC;IACH,gBAAC;AAAD,CAAC,AAvDD,CAA+B,oBAAU,GAuDxC;AAvDY,8BAAS","sourcesContent":["import {By, element, ElementFinder} from 'protractor';\nimport {MatSelectProfile} from '../../angular-materials';\nimport {O3rElement} from '../element';\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Protractor.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\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 // eslint-disable-next-line no-underscore-dangle\n const options: ElementFinder[] = await element.all(By.css('mat-option')).asElementFinders_();\n if (typeof options[index] !== 'undefined') {\n const option = new O3rElement(options[index]);\n return option.click();\n } else {\n return Promise.reject(`Option with index ${index} not found in select element.`);\n }\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n // eslint-disable-next-line no-underscore-dangle\n const options: ElementFinder[] = await element.all(By.css('mat-option')).asElementFinders_();\n\n for (const opt of options) {\n const option = new O3rElement(opt);\n if (await option.getAttribute('ng-reflect-value') === value) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with value ${value} not found in select element.`);\n }\n\n /** @inheritdoc */\n public async selectByLabel(label: string, _timeout?: number) {\n await this.click();\n // eslint-disable-next-line no-underscore-dangle\n const options: ElementFinder[] = await element.all(By.css('mat-option')).asElementFinders_();\n\n for (const opt of options) {\n const option = new O3rElement(opt);\n if (await option.getText() === label) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with label ${label} not found in select element.`);\n }\n\n /** @inheritDoc */\n public getValue() {\n console.warn('Usage of \"getValue\" is not recommended on Material Select elements. Use \"getPlainText()\" instead.');\n return super.getValue();\n }\n}\n"]}
1
+ {"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../../src/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A6C,MAAK,KAAK,EAAE,CAAC;4BAC5D,sBAAO,MAAM,CAAC,KAAK,EAAE,EAAC;wBACxB,CAAC;;;wBAJe,IAAO,CAAA;;4BAOzB,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;KAClF;IAED,kBAAkB;IACL,iCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBAEc,qBAAM,oBAAO,CAAC,GAAG,CAAC,eAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,EAAE,EAAA;;wBAAtF,OAAO,GAAoB,SAA2D;8BAEnE,EAAP,mBAAO;;;6BAAP,CAAA,qBAAO,CAAA;wBAAd,GAAG;wBACN,MAAM,GAAG,IAAI,oBAAU,CAAC,GAAG,CAAC,CAAC;wBAC/B,qBAAM,MAAM,CAAC,OAAO,EAAE,EAAA;;wBAA1B,IAAI,CAAA,SAAsB,MAAK,KAAK,EAAE,CAAC;4BACrC,sBAAO,MAAM,CAAC,KAAK,EAAE,EAAC;wBACxB,CAAC;;;wBAJe,IAAO,CAAA;;4BAOzB,sBAAO,OAAO,CAAC,MAAM,CAAC,4BAAqB,KAAK,kCAA+B,CAAC,EAAC;;;;KAClF;IAED,kBAAkB;IACX,4BAAQ,GAAf;QACE,OAAO,CAAC,IAAI,CAAC,mGAAmG,CAAC,CAAC;QAClH,OAAO,gBAAK,CAAC,QAAQ,WAAE,CAAC;IAC1B,CAAC;IACH,gBAAC;AAAD,CAAC,AAvDD,CAA+B,oBAAU,GAuDxC;AAvDY,8BAAS","sourcesContent":["import {By, element, ElementFinder} from 'protractor';\nimport {MatSelectProfile} from '../../angular-materials';\nimport {O3rElement} from '../element';\nexport {SelectElementProfile} from '../../elements';\n\n/**\n * Implementation dedicated to Protractor.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\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 // eslint-disable-next-line no-underscore-dangle\n const options: ElementFinder[] = await element.all(By.css('mat-option')).asElementFinders_();\n if (typeof options[index] !== 'undefined') {\n const option = new O3rElement(options[index]);\n return option.click();\n } else {\n return Promise.reject(`Option with index ${index} not found in select element.`);\n }\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n // eslint-disable-next-line no-underscore-dangle\n const options: ElementFinder[] = await element.all(By.css('mat-option')).asElementFinders_();\n\n for (const opt of options) {\n const option = new O3rElement(opt);\n if (await option.getAttribute('ng-reflect-value') === value) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with value ${value} not found in select element.`);\n }\n\n /** @inheritdoc */\n public async selectByLabel(label: string, _timeout?: number) {\n await this.click();\n // eslint-disable-next-line no-underscore-dangle\n const options: ElementFinder[] = await element.all(By.css('mat-option')).asElementFinders_();\n\n for (const opt of options) {\n const option = new O3rElement(opt);\n if (await option.getText() === label) {\n return option.click();\n }\n }\n\n return Promise.reject(`Option with label ${label} not found in select element.`);\n }\n\n /** @inheritDoc */\n public getValue() {\n console.warn('Usage of \"getValue\" is not recommended on Material Select elements. Use \"getPlainText()\" instead.');\n return super.getValue();\n }\n}\n"]}