@angular/cdk 13.2.4 → 13.2.5

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 (50) hide show
  1. package/drag-drop/drag-ref.d.ts +3 -1
  2. package/esm2020/drag-drop/drag-ref.mjs +13 -12
  3. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +24 -6
  4. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +31 -10
  5. package/esm2020/testing/protractor/protractor-element.mjs +8 -3
  6. package/esm2020/testing/public-api.mjs +2 -1
  7. package/esm2020/testing/selenium-webdriver/selenium-web-driver-element.mjs +8 -3
  8. package/esm2020/testing/test-element-errors.mjs +15 -0
  9. package/esm2020/testing/test-element.mjs +1 -1
  10. package/esm2020/testing/testbed/fake-events/type-in-element.mjs +12 -3
  11. package/esm2020/testing/testbed/unit-test-element.mjs +19 -5
  12. package/esm2020/version.mjs +1 -1
  13. package/fesm2015/cdk.mjs +1 -1
  14. package/fesm2015/cdk.mjs.map +1 -1
  15. package/fesm2015/drag-drop.mjs +12 -11
  16. package/fesm2015/drag-drop.mjs.map +1 -1
  17. package/fesm2015/overlay.mjs +52 -13
  18. package/fesm2015/overlay.mjs.map +1 -1
  19. package/fesm2015/testing/protractor.mjs +7 -2
  20. package/fesm2015/testing/protractor.mjs.map +1 -1
  21. package/fesm2015/testing/selenium-webdriver.mjs +7 -2
  22. package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
  23. package/fesm2015/testing/testbed.mjs +29 -7
  24. package/fesm2015/testing/testbed.mjs.map +1 -1
  25. package/fesm2015/testing.mjs +16 -1
  26. package/fesm2015/testing.mjs.map +1 -1
  27. package/fesm2020/cdk.mjs +1 -1
  28. package/fesm2020/cdk.mjs.map +1 -1
  29. package/fesm2020/drag-drop.mjs +12 -11
  30. package/fesm2020/drag-drop.mjs.map +1 -1
  31. package/fesm2020/overlay.mjs +52 -13
  32. package/fesm2020/overlay.mjs.map +1 -1
  33. package/fesm2020/testing/protractor.mjs +7 -2
  34. package/fesm2020/testing/protractor.mjs.map +1 -1
  35. package/fesm2020/testing/selenium-webdriver.mjs +7 -2
  36. package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
  37. package/fesm2020/testing/testbed.mjs +29 -7
  38. package/fesm2020/testing/testbed.mjs.map +1 -1
  39. package/fesm2020/testing.mjs +16 -1
  40. package/fesm2020/testing.mjs.map +1 -1
  41. package/overlay/dispatchers/overlay-keyboard-dispatcher.d.ts +7 -2
  42. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +8 -2
  43. package/package.json +1 -1
  44. package/schematics/ng-add/index.js +1 -1
  45. package/schematics/ng-add/index.mjs +1 -1
  46. package/testing/public-api.d.ts +1 -0
  47. package/testing/test-element-errors.d.ts +12 -0
  48. package/testing/test-element.d.ts +4 -2
  49. package/testing/testbed/fake-events/type-in-element.d.ts +2 -2
  50. package/testing/testbed/unit-test-element.d.ts +4 -1
@@ -1,4 +1,4 @@
1
- import { TestKey, _getTextWithExcludedElements, HarnessEnvironment } from '@angular/cdk/testing';
1
+ import { TestKey, getNoKeysSpecifiedError, _getTextWithExcludedElements, HarnessEnvironment } from '@angular/cdk/testing';
2
2
  import { Key, browser, Button, by, element } from 'protractor';
3
3
 
4
4
  /**
@@ -107,7 +107,7 @@ class ProtractorElement {
107
107
  const first = modifiersAndKeys[0];
108
108
  let modifiers;
109
109
  let rest;
110
- if (typeof first !== 'string' && typeof first !== 'number') {
110
+ if (first !== undefined && typeof first !== 'string' && typeof first !== 'number') {
111
111
  modifiers = first;
112
112
  rest = modifiersAndKeys.slice(1);
113
113
  }
@@ -122,6 +122,11 @@ class ProtractorElement {
122
122
  // Key.chord doesn't work well with geckodriver (mozilla/geckodriver#1502),
123
123
  // so avoid it if no modifier keys are required.
124
124
  .map(k => (modifierKeys.length > 0 ? Key.chord(...modifierKeys, k) : k));
125
+ // Throw an error if no keys have been specified. Calling this function with no
126
+ // keys should not result in a focus event being dispatched unexpectedly.
127
+ if (keys.length === 0) {
128
+ throw getNoKeysSpecifiedError();
129
+ }
125
130
  return this.element.sendKeys(...keys);
126
131
  }
127
132
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"protractor.mjs","sources":["../../../../../../../src/cdk/testing/protractor/protractor-element.ts","../../../../../../../src/cdk/testing/protractor/protractor-harness-environment.ts","../../../../../../../src/cdk/testing/protractor/public-api.ts","../../../../../../../src/cdk/testing/protractor/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n _getTextWithExcludedElements,\n ElementDimensions,\n ModifierKeys,\n TestElement,\n TestKey,\n TextOptions,\n EventData,\n} from '@angular/cdk/testing';\nimport {browser, Button, by, ElementFinder, Key} from 'protractor';\n\n/** Maps the `TestKey` constants to Protractor's `Key` constants. */\nconst keyMap = {\n [TestKey.BACKSPACE]: Key.BACK_SPACE,\n [TestKey.TAB]: Key.TAB,\n [TestKey.ENTER]: Key.ENTER,\n [TestKey.SHIFT]: Key.SHIFT,\n [TestKey.CONTROL]: Key.CONTROL,\n [TestKey.ALT]: Key.ALT,\n [TestKey.ESCAPE]: Key.ESCAPE,\n [TestKey.PAGE_UP]: Key.PAGE_UP,\n [TestKey.PAGE_DOWN]: Key.PAGE_DOWN,\n [TestKey.END]: Key.END,\n [TestKey.HOME]: Key.HOME,\n [TestKey.LEFT_ARROW]: Key.ARROW_LEFT,\n [TestKey.UP_ARROW]: Key.ARROW_UP,\n [TestKey.RIGHT_ARROW]: Key.ARROW_RIGHT,\n [TestKey.DOWN_ARROW]: Key.ARROW_DOWN,\n [TestKey.INSERT]: Key.INSERT,\n [TestKey.DELETE]: Key.DELETE,\n [TestKey.F1]: Key.F1,\n [TestKey.F2]: Key.F2,\n [TestKey.F3]: Key.F3,\n [TestKey.F4]: Key.F4,\n [TestKey.F5]: Key.F5,\n [TestKey.F6]: Key.F6,\n [TestKey.F7]: Key.F7,\n [TestKey.F8]: Key.F8,\n [TestKey.F9]: Key.F9,\n [TestKey.F10]: Key.F10,\n [TestKey.F11]: Key.F11,\n [TestKey.F12]: Key.F12,\n [TestKey.META]: Key.META,\n};\n\n/** Converts a `ModifierKeys` object to a list of Protractor `Key`s. */\nfunction toProtractorModifierKeys(modifiers: ModifierKeys): string[] {\n const result: string[] = [];\n if (modifiers.control) {\n result.push(Key.CONTROL);\n }\n if (modifiers.alt) {\n result.push(Key.ALT);\n }\n if (modifiers.shift) {\n result.push(Key.SHIFT);\n }\n if (modifiers.meta) {\n result.push(Key.META);\n }\n return result;\n}\n\n/**\n * A `TestElement` implementation for Protractor.\n * @deprecated\n * @breaking-change 13.0.0\n */\nexport class ProtractorElement implements TestElement {\n constructor(readonly element: ElementFinder) {}\n\n /** Blur the element. */\n async blur(): Promise<void> {\n return browser.executeScript('arguments[0].blur()', this.element);\n }\n\n /** Clear the element's input (for input and textarea elements only). */\n async clear(): Promise<void> {\n return this.element.clear();\n }\n\n /**\n * Click the element at the default location for the current environment. If you need to guarantee\n * the element is clicked at a specific location, consider using `click('center')` or\n * `click(x, y)` instead.\n */\n click(modifiers?: ModifierKeys): Promise<void>;\n /** Click the element at the element's center. */\n click(location: 'center', modifiers?: ModifierKeys): Promise<void>;\n /**\n * Click the element at the specified coordinates relative to the top-left of the element.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n * @param modifiers Modifier keys held while clicking\n */\n click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n async click(\n ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]\n ): Promise<void> {\n await this._dispatchClickEventSequence(args, Button.LEFT);\n }\n\n /**\n * Right clicks on the element at the specified coordinates relative to the top-left of it.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n * @param modifiers Modifier keys held while clicking\n */\n rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n async rightClick(\n ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]\n ): Promise<void> {\n await this._dispatchClickEventSequence(args, Button.RIGHT);\n }\n\n /** Focus the element. */\n async focus(): Promise<void> {\n return browser.executeScript('arguments[0].focus()', this.element);\n }\n\n /** Get the computed value of the given CSS property for the element. */\n async getCssValue(property: string): Promise<string> {\n return this.element.getCssValue(property);\n }\n\n /** Hovers the mouse over the element. */\n async hover(): Promise<void> {\n return browser\n .actions()\n .mouseMove(await this.element.getWebElement())\n .perform();\n }\n\n /** Moves the mouse away from the element. */\n async mouseAway(): Promise<void> {\n return browser\n .actions()\n .mouseMove(await this.element.getWebElement(), {x: -1, y: -1})\n .perform();\n }\n\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n async sendKeys(...keys: (string | TestKey)[]): Promise<void>;\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n async sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;\n async sendKeys(...modifiersAndKeys: any[]): Promise<void> {\n const first = modifiersAndKeys[0];\n let modifiers: ModifierKeys;\n let rest: (string | TestKey)[];\n if (typeof first !== 'string' && typeof first !== 'number') {\n modifiers = first;\n rest = modifiersAndKeys.slice(1);\n } else {\n modifiers = {};\n rest = modifiersAndKeys;\n }\n\n const modifierKeys = toProtractorModifierKeys(modifiers);\n const keys = rest\n .map(k => (typeof k === 'string' ? k.split('') : [keyMap[k]]))\n .reduce((arr, k) => arr.concat(k), [])\n // Key.chord doesn't work well with geckodriver (mozilla/geckodriver#1502),\n // so avoid it if no modifier keys are required.\n .map(k => (modifierKeys.length > 0 ? Key.chord(...modifierKeys, k) : k));\n\n return this.element.sendKeys(...keys);\n }\n\n /**\n * Gets the text from the element.\n * @param options Options that affect what text is included.\n */\n async text(options?: TextOptions): Promise<string> {\n if (options?.exclude) {\n return browser.executeScript(_getTextWithExcludedElements, this.element, options.exclude);\n }\n // We don't go through Protractor's `getText`, because it excludes text from hidden elements.\n return browser.executeScript(`return (arguments[0].textContent || '').trim()`, this.element);\n }\n\n /** Gets the value for the given attribute from the element. */\n async getAttribute(name: string): Promise<string | null> {\n return browser.executeScript(\n `return arguments[0].getAttribute(arguments[1])`,\n this.element,\n name,\n );\n }\n\n /** Checks whether the element has the given class. */\n async hasClass(name: string): Promise<boolean> {\n const classes = (await this.getAttribute('class')) || '';\n return new Set(classes.split(/\\s+/).filter(c => c)).has(name);\n }\n\n /** Gets the dimensions of the element. */\n async getDimensions(): Promise<ElementDimensions> {\n const {width, height} = await this.element.getSize();\n const {x: left, y: top} = await this.element.getLocation();\n return {width, height, left, top};\n }\n\n /** Gets the value of a property of an element. */\n async getProperty<T = any>(name: string): Promise<T> {\n return browser.executeScript(`return arguments[0][arguments[1]]`, this.element, name);\n }\n\n /** Sets the value of a property of an input. */\n async setInputValue(value: string): Promise<void> {\n return browser.executeScript(`arguments[0].value = arguments[1]`, this.element, value);\n }\n\n /** Selects the options at the specified indexes inside of a native `select` element. */\n async selectOptions(...optionIndexes: number[]): Promise<void> {\n const options = await this.element.all(by.css('option'));\n const indexes = new Set(optionIndexes); // Convert to a set to remove duplicates.\n\n if (options.length && indexes.size) {\n // Reset the value so all the selected states are cleared. We can\n // reuse the input-specific method since the logic is the same.\n await this.setInputValue('');\n\n for (let i = 0; i < options.length; i++) {\n if (indexes.has(i)) {\n // We have to hold the control key while clicking on options so that multiple can be\n // selected in multi-selection mode. The key doesn't do anything for single selection.\n await browser.actions().keyDown(Key.CONTROL).perform();\n await options[i].click();\n await browser.actions().keyUp(Key.CONTROL).perform();\n }\n }\n }\n }\n\n /** Checks whether this element matches the given selector. */\n async matchesSelector(selector: string): Promise<boolean> {\n return browser.executeScript(\n `\n return (Element.prototype.matches ||\n Element.prototype.msMatchesSelector).call(arguments[0], arguments[1])\n `,\n this.element,\n selector,\n );\n }\n\n /** Checks whether the element is focused. */\n async isFocused(): Promise<boolean> {\n return this.element.equals(browser.driver.switchTo().activeElement());\n }\n\n /**\n * Dispatches an event with a particular name.\n * @param name Name of the event to be dispatched.\n */\n async dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void> {\n return browser.executeScript(_dispatchEvent, name, this.element, data);\n }\n\n /** Dispatches all the events that are part of a click event sequence. */\n private async _dispatchClickEventSequence(\n args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?],\n button: string,\n ) {\n let modifiers: ModifierKeys = {};\n if (args.length && typeof args[args.length - 1] === 'object') {\n modifiers = args.pop() as ModifierKeys;\n }\n const modifierKeys = toProtractorModifierKeys(modifiers);\n\n // Omitting the offset argument to mouseMove results in clicking the center.\n // This is the default behavior we want, so we use an empty array of offsetArgs if\n // no args remain after popping the modifiers from the args passed to this function.\n const offsetArgs = (args.length === 2 ? [{x: args[0], y: args[1]}] : []) as [\n {x: number; y: number},\n ];\n\n let actions = browser.actions().mouseMove(await this.element.getWebElement(), ...offsetArgs);\n\n for (const modifierKey of modifierKeys) {\n actions = actions.keyDown(modifierKey);\n }\n actions = actions.click(button);\n for (const modifierKey of modifierKeys) {\n actions = actions.keyUp(modifierKey);\n }\n\n await actions.perform();\n }\n}\n\n/**\n * Dispatches an event with a particular name and data to an element.\n * Note that this needs to be a pure function, because it gets stringified by\n * Protractor and is executed inside the browser.\n */\nfunction _dispatchEvent(name: string, element: ElementFinder, data?: Record<string, EventData>) {\n const event = document.createEvent('Event');\n event.initEvent(name);\n\n if (data) {\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the original object.\n Object.assign(event, data);\n }\n\n // This type has a string index signature, so we cannot access it using a dotted property access.\n element['dispatchEvent'](event);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessEnvironment, HarnessLoader, TestElement} from '@angular/cdk/testing';\nimport {by, element as protractorElement, ElementArrayFinder, ElementFinder} from 'protractor';\nimport {ProtractorElement} from './protractor-element';\n\n/**\n * Options to configure the environment.\n * @deprecated\n * @breaking-change 13.0.0\n */\nexport interface ProtractorHarnessEnvironmentOptions {\n /** The query function used to find DOM elements. */\n queryFn: (selector: string, root: ElementFinder) => ElementArrayFinder;\n}\n\n/** The default environment options. */\nconst defaultEnvironmentOptions: ProtractorHarnessEnvironmentOptions = {\n queryFn: (selector: string, root: ElementFinder) => root.all(by.css(selector)),\n};\n\n/**\n * A `HarnessEnvironment` implementation for Protractor.\n * @deprecated As of v13.0.0, this environment no longer works, as it is not\n * compatible with the new [Angular Package Format](https://angular.io/guide/angular-package-format).\n * @breaking-change 13.0.0\n */\nexport class ProtractorHarnessEnvironment extends HarnessEnvironment<ElementFinder> {\n /** The options for this environment. */\n private _options: ProtractorHarnessEnvironmentOptions;\n\n protected constructor(\n rawRootElement: ElementFinder,\n options?: ProtractorHarnessEnvironmentOptions,\n ) {\n super(rawRootElement);\n this._options = {...defaultEnvironmentOptions, ...options};\n }\n\n /** Creates a `HarnessLoader` rooted at the document root. */\n static loader(options?: ProtractorHarnessEnvironmentOptions): HarnessLoader {\n return new ProtractorHarnessEnvironment(protractorElement(by.css('body')), options);\n }\n\n /** Gets the ElementFinder corresponding to the given TestElement. */\n static getNativeElement(el: TestElement): ElementFinder {\n if (el instanceof ProtractorElement) {\n return el.element;\n }\n throw Error('This TestElement was not created by the ProtractorHarnessEnvironment');\n }\n\n /**\n * Flushes change detection and async tasks captured in the Angular zone.\n * In most cases it should not be necessary to call this manually. However, there may be some edge\n * cases where it is needed to fully flush animation events.\n */\n async forceStabilize(): Promise<void> {}\n\n /** @docs-private */\n async waitForTasksOutsideAngular(): Promise<void> {\n // TODO: figure out how we can do this for the protractor environment.\n // https://github.com/angular/components/issues/17412\n }\n\n /** Gets the root element for the document. */\n protected getDocumentRoot(): ElementFinder {\n return protractorElement(by.css('body'));\n }\n\n /** Creates a `TestElement` from a raw element. */\n protected createTestElement(element: ElementFinder): TestElement {\n return new ProtractorElement(element);\n }\n\n /** Creates a `HarnessLoader` rooted at the given raw element. */\n protected createEnvironment(element: ElementFinder): HarnessEnvironment<ElementFinder> {\n return new ProtractorHarnessEnvironment(element, this._options);\n }\n\n /**\n * Gets a list of all elements matching the given selector under this environment's root element.\n */\n protected async getAllRawElements(selector: string): Promise<ElementFinder[]> {\n const elementArrayFinder = this._options.queryFn(selector, this.rawRootElement);\n const length = await elementArrayFinder.count();\n const elements: ElementFinder[] = [];\n for (let i = 0; i < length; i++) {\n elements.push(elementArrayFinder.get(i));\n }\n return elements;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './protractor-element';\nexport * from './protractor-harness-environment';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":["protractorElement"],"mappings":";;;AAAA;;;;;;;AAmBA;AACA,MAAM,MAAM,GAAG;IACb,CAAC,OAAO,CAAC,SAAS,GAAG,GAAG,CAAC,UAAU;IACnC,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG;IACtB,CAAC,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK;IAC1B,CAAC,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK;IAC1B,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO;IAC9B,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG;IACtB,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM;IAC5B,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO;IAC9B,CAAC,OAAO,CAAC,SAAS,GAAG,GAAG,CAAC,S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AAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAChF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAoB,EAAE,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1C;QACD,OAAO,QAAQ,CAAC;KACjB;;;ACjGH;;;;;;;;ACAA;;;;;;;;;;"}
1
+ {"version":3,"file":"protractor.mjs","sources":["../../../../../../../src/cdk/testing/protractor/protractor-element.ts","../../../../../../../src/cdk/testing/protractor/protractor-harness-environment.ts","../../../../../../../src/cdk/testing/protractor/public-api.ts","../../../../../../../src/cdk/testing/protractor/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n _getTextWithExcludedElements,\n ElementDimensions,\n getNoKeysSpecifiedError,\n ModifierKeys,\n TestElement,\n TestKey,\n TextOptions,\n EventData,\n} from '@angular/cdk/testing';\nimport {browser, Button, by, ElementFinder, Key} from 'protractor';\n\n/** Maps the `TestKey` constants to Protractor's `Key` constants. */\nconst keyMap = {\n [TestKey.BACKSPACE]: Key.BACK_SPACE,\n [TestKey.TAB]: Key.TAB,\n [TestKey.ENTER]: Key.ENTER,\n [TestKey.SHIFT]: Key.SHIFT,\n [TestKey.CONTROL]: Key.CONTROL,\n [TestKey.ALT]: Key.ALT,\n [TestKey.ESCAPE]: Key.ESCAPE,\n [TestKey.PAGE_UP]: Key.PAGE_UP,\n [TestKey.PAGE_DOWN]: Key.PAGE_DOWN,\n [TestKey.END]: Key.END,\n [TestKey.HOME]: Key.HOME,\n [TestKey.LEFT_ARROW]: Key.ARROW_LEFT,\n [TestKey.UP_ARROW]: Key.ARROW_UP,\n [TestKey.RIGHT_ARROW]: Key.ARROW_RIGHT,\n [TestKey.DOWN_ARROW]: Key.ARROW_DOWN,\n [TestKey.INSERT]: Key.INSERT,\n [TestKey.DELETE]: Key.DELETE,\n [TestKey.F1]: Key.F1,\n [TestKey.F2]: Key.F2,\n [TestKey.F3]: Key.F3,\n [TestKey.F4]: Key.F4,\n [TestKey.F5]: Key.F5,\n [TestKey.F6]: Key.F6,\n [TestKey.F7]: Key.F7,\n [TestKey.F8]: Key.F8,\n [TestKey.F9]: Key.F9,\n [TestKey.F10]: Key.F10,\n [TestKey.F11]: Key.F11,\n [TestKey.F12]: Key.F12,\n [TestKey.META]: Key.META,\n};\n\n/** Converts a `ModifierKeys` object to a list of Protractor `Key`s. */\nfunction toProtractorModifierKeys(modifiers: ModifierKeys): string[] {\n const result: string[] = [];\n if (modifiers.control) {\n result.push(Key.CONTROL);\n }\n if (modifiers.alt) {\n result.push(Key.ALT);\n }\n if (modifiers.shift) {\n result.push(Key.SHIFT);\n }\n if (modifiers.meta) {\n result.push(Key.META);\n }\n return result;\n}\n\n/**\n * A `TestElement` implementation for Protractor.\n * @deprecated\n * @breaking-change 13.0.0\n */\nexport class ProtractorElement implements TestElement {\n constructor(readonly element: ElementFinder) {}\n\n /** Blur the element. */\n async blur(): Promise<void> {\n return browser.executeScript('arguments[0].blur()', this.element);\n }\n\n /** Clear the element's input (for input and textarea elements only). */\n async clear(): Promise<void> {\n return this.element.clear();\n }\n\n /**\n * Click the element at the default location for the current environment. If you need to guarantee\n * the element is clicked at a specific location, consider using `click('center')` or\n * `click(x, y)` instead.\n */\n click(modifiers?: ModifierKeys): Promise<void>;\n /** Click the element at the element's center. */\n click(location: 'center', modifiers?: ModifierKeys): Promise<void>;\n /**\n * Click the element at the specified coordinates relative to the top-left of the element.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n * @param modifiers Modifier keys held while clicking\n */\n click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n async click(\n ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]\n ): Promise<void> {\n await this._dispatchClickEventSequence(args, Button.LEFT);\n }\n\n /**\n * Right clicks on the element at the specified coordinates relative to the top-left of it.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n * @param modifiers Modifier keys held while clicking\n */\n rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n async rightClick(\n ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]\n ): Promise<void> {\n await this._dispatchClickEventSequence(args, Button.RIGHT);\n }\n\n /** Focus the element. */\n async focus(): Promise<void> {\n return browser.executeScript('arguments[0].focus()', this.element);\n }\n\n /** Get the computed value of the given CSS property for the element. */\n async getCssValue(property: string): Promise<string> {\n return this.element.getCssValue(property);\n }\n\n /** Hovers the mouse over the element. */\n async hover(): Promise<void> {\n return browser\n .actions()\n .mouseMove(await this.element.getWebElement())\n .perform();\n }\n\n /** Moves the mouse away from the element. */\n async mouseAway(): Promise<void> {\n return browser\n .actions()\n .mouseMove(await this.element.getWebElement(), {x: -1, y: -1})\n .perform();\n }\n\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n async sendKeys(...keys: (string | TestKey)[]): Promise<void>;\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n async sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;\n async sendKeys(...modifiersAndKeys: any[]): Promise<void> {\n const first = modifiersAndKeys[0];\n let modifiers: ModifierKeys;\n let rest: (string | TestKey)[];\n if (first !== undefined && typeof first !== 'string' && typeof first !== 'number') {\n modifiers = first;\n rest = modifiersAndKeys.slice(1);\n } else {\n modifiers = {};\n rest = modifiersAndKeys;\n }\n\n const modifierKeys = toProtractorModifierKeys(modifiers);\n const keys = rest\n .map(k => (typeof k === 'string' ? k.split('') : [keyMap[k]]))\n .reduce((arr, k) => arr.concat(k), [])\n // Key.chord doesn't work well with geckodriver (mozilla/geckodriver#1502),\n // so avoid it if no modifier keys are required.\n .map(k => (modifierKeys.length > 0 ? Key.chord(...modifierKeys, k) : k));\n\n // Throw an error if no keys have been specified. Calling this function with no\n // keys should not result in a focus event being dispatched unexpectedly.\n if (keys.length === 0) {\n throw getNoKeysSpecifiedError();\n }\n\n return this.element.sendKeys(...keys);\n }\n\n /**\n * Gets the text from the element.\n * @param options Options that affect what text is included.\n */\n async text(options?: TextOptions): Promise<string> {\n if (options?.exclude) {\n return browser.executeScript(_getTextWithExcludedElements, this.element, options.exclude);\n }\n // We don't go through Protractor's `getText`, because it excludes text from hidden elements.\n return browser.executeScript(`return (arguments[0].textContent || '').trim()`, this.element);\n }\n\n /** Gets the value for the given attribute from the element. */\n async getAttribute(name: string): Promise<string | null> {\n return browser.executeScript(\n `return arguments[0].getAttribute(arguments[1])`,\n this.element,\n name,\n );\n }\n\n /** Checks whether the element has the given class. */\n async hasClass(name: string): Promise<boolean> {\n const classes = (await this.getAttribute('class')) || '';\n return new Set(classes.split(/\\s+/).filter(c => c)).has(name);\n }\n\n /** Gets the dimensions of the element. */\n async getDimensions(): Promise<ElementDimensions> {\n const {width, height} = await this.element.getSize();\n const {x: left, y: top} = await this.element.getLocation();\n return {width, height, left, top};\n }\n\n /** Gets the value of a property of an element. */\n async getProperty<T = any>(name: string): Promise<T> {\n return browser.executeScript(`return arguments[0][arguments[1]]`, this.element, name);\n }\n\n /** Sets the value of a property of an input. */\n async setInputValue(value: string): Promise<void> {\n return browser.executeScript(`arguments[0].value = arguments[1]`, this.element, value);\n }\n\n /** Selects the options at the specified indexes inside of a native `select` element. */\n async selectOptions(...optionIndexes: number[]): Promise<void> {\n const options = await this.element.all(by.css('option'));\n const indexes = new Set(optionIndexes); // Convert to a set to remove duplicates.\n\n if (options.length && indexes.size) {\n // Reset the value so all the selected states are cleared. We can\n // reuse the input-specific method since the logic is the same.\n await this.setInputValue('');\n\n for (let i = 0; i < options.length; i++) {\n if (indexes.has(i)) {\n // We have to hold the control key while clicking on options so that multiple can be\n // selected in multi-selection mode. The key doesn't do anything for single selection.\n await browser.actions().keyDown(Key.CONTROL).perform();\n await options[i].click();\n await browser.actions().keyUp(Key.CONTROL).perform();\n }\n }\n }\n }\n\n /** Checks whether this element matches the given selector. */\n async matchesSelector(selector: string): Promise<boolean> {\n return browser.executeScript(\n `\n return (Element.prototype.matches ||\n Element.prototype.msMatchesSelector).call(arguments[0], arguments[1])\n `,\n this.element,\n selector,\n );\n }\n\n /** Checks whether the element is focused. */\n async isFocused(): Promise<boolean> {\n return this.element.equals(browser.driver.switchTo().activeElement());\n }\n\n /**\n * Dispatches an event with a particular name.\n * @param name Name of the event to be dispatched.\n */\n async dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void> {\n return browser.executeScript(_dispatchEvent, name, this.element, data);\n }\n\n /** Dispatches all the events that are part of a click event sequence. */\n private async _dispatchClickEventSequence(\n args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?],\n button: string,\n ) {\n let modifiers: ModifierKeys = {};\n if (args.length && typeof args[args.length - 1] === 'object') {\n modifiers = args.pop() as ModifierKeys;\n }\n const modifierKeys = toProtractorModifierKeys(modifiers);\n\n // Omitting the offset argument to mouseMove results in clicking the center.\n // This is the default behavior we want, so we use an empty array of offsetArgs if\n // no args remain after popping the modifiers from the args passed to this function.\n const offsetArgs = (args.length === 2 ? [{x: args[0], y: args[1]}] : []) as [\n {x: number; y: number},\n ];\n\n let actions = browser.actions().mouseMove(await this.element.getWebElement(), ...offsetArgs);\n\n for (const modifierKey of modifierKeys) {\n actions = actions.keyDown(modifierKey);\n }\n actions = actions.click(button);\n for (const modifierKey of modifierKeys) {\n actions = actions.keyUp(modifierKey);\n }\n\n await actions.perform();\n }\n}\n\n/**\n * Dispatches an event with a particular name and data to an element.\n * Note that this needs to be a pure function, because it gets stringified by\n * Protractor and is executed inside the browser.\n */\nfunction _dispatchEvent(name: string, element: ElementFinder, data?: Record<string, EventData>) {\n const event = document.createEvent('Event');\n event.initEvent(name);\n\n if (data) {\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the original object.\n Object.assign(event, data);\n }\n\n // This type has a string index signature, so we cannot access it using a dotted property access.\n element['dispatchEvent'](event);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessEnvironment, HarnessLoader, TestElement} from '@angular/cdk/testing';\nimport {by, element as protractorElement, ElementArrayFinder, ElementFinder} from 'protractor';\nimport {ProtractorElement} from './protractor-element';\n\n/**\n * Options to configure the environment.\n * @deprecated\n * @breaking-change 13.0.0\n */\nexport interface ProtractorHarnessEnvironmentOptions {\n /** The query function used to find DOM elements. */\n queryFn: (selector: string, root: ElementFinder) => ElementArrayFinder;\n}\n\n/** The default environment options. */\nconst defaultEnvironmentOptions: ProtractorHarnessEnvironmentOptions = {\n queryFn: (selector: string, root: ElementFinder) => root.all(by.css(selector)),\n};\n\n/**\n * A `HarnessEnvironment` implementation for Protractor.\n * @deprecated As of v13.0.0, this environment no longer works, as it is not\n * compatible with the new [Angular Package Format](https://angular.io/guide/angular-package-format).\n * @breaking-change 13.0.0\n */\nexport class ProtractorHarnessEnvironment extends HarnessEnvironment<ElementFinder> {\n /** The options for this environment. */\n private _options: ProtractorHarnessEnvironmentOptions;\n\n protected constructor(\n rawRootElement: ElementFinder,\n options?: ProtractorHarnessEnvironmentOptions,\n ) {\n super(rawRootElement);\n this._options = {...defaultEnvironmentOptions, ...options};\n }\n\n /** Creates a `HarnessLoader` rooted at the document root. */\n static loader(options?: ProtractorHarnessEnvironmentOptions): HarnessLoader {\n return new ProtractorHarnessEnvironment(protractorElement(by.css('body')), options);\n }\n\n /** Gets the ElementFinder corresponding to the given TestElement. */\n static getNativeElement(el: TestElement): ElementFinder {\n if (el instanceof ProtractorElement) {\n return el.element;\n }\n throw Error('This TestElement was not created by the ProtractorHarnessEnvironment');\n }\n\n /**\n * Flushes change detection and async tasks captured in the Angular zone.\n * In most cases it should not be necessary to call this manually. However, there may be some edge\n * cases where it is needed to fully flush animation events.\n */\n async forceStabilize(): Promise<void> {}\n\n /** @docs-private */\n async waitForTasksOutsideAngular(): Promise<void> {\n // TODO: figure out how we can do this for the protractor environment.\n // https://github.com/angular/components/issues/17412\n }\n\n /** Gets the root element for the document. */\n protected getDocumentRoot(): ElementFinder {\n return protractorElement(by.css('body'));\n }\n\n /** Creates a `TestElement` from a raw element. */\n protected createTestElement(element: ElementFinder): TestElement {\n return new ProtractorElement(element);\n }\n\n /** Creates a `HarnessLoader` rooted at the given raw element. */\n protected createEnvironment(element: ElementFinder): HarnessEnvironment<ElementFinder> {\n return new ProtractorHarnessEnvironment(element, this._options);\n }\n\n /**\n * Gets a list of all elements matching the given selector under this environment's root element.\n */\n protected async getAllRawElements(selector: string): Promise<ElementFinder[]> {\n const elementArrayFinder = this._options.queryFn(selector, this.rawRootElement);\n const length = await elementArrayFinder.count();\n const elements: ElementFinder[] = [];\n for (let i = 0; i < length; i++) {\n elements.push(elementArrayFinder.get(i));\n }\n return elements;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './protractor-element';\nexport * from './protractor-harness-environment';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":["protractorElement"],"mappings":";;;AAAA;;;;;;;AAoBA;AACA,MAAM,MAAM,GAAG;IACb,CAAC,OAAO,CAAC,SAAS,GAAG,GAAG,CAAC,U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EAAe;QACrC,IAAI,EAAE,YAAY,iBAAiB,EAAE;YACnC,OAAO,EAAE,CAAC,OAAO,CAAC;SACnB;QACD,MAAM,KAAK,CAAC,sEAAsE,CAAC,CAAC;KACrF;;;;;;IAOD,MAAM,cAAc,MAAoB;;IAGxC,MAAM,0BAA0B;;;KAG/B;;IAGS,eAAe;QACvB,OAAOA,OAAiB,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;KAC1C;;IAGS,iBAAiB,CAAC,OAAsB;QAChD,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;KACvC;;IAGS,iBAAiB,CAAC,OAAsB;QAChD,OAAO,IAAI,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACjE;;;;IAKS,MAAM,iBAAiB,CAAC,QAAgB;QAChD,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAChF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAoB,EAAE,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1C;QACD,OAAO,QAAQ,CAAC;KACjB;;;ACjGH;;;;;;;;ACAA;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { TestKey, _getTextWithExcludedElements, HarnessEnvironment } from '@angular/cdk/testing';
1
+ import { TestKey, getNoKeysSpecifiedError, _getTextWithExcludedElements, HarnessEnvironment } from '@angular/cdk/testing';
2
2
  import * as webdriver from 'selenium-webdriver';
3
3
 
4
4
  /**
@@ -117,7 +117,7 @@ class SeleniumWebDriverElement {
117
117
  const first = modifiersAndKeys[0];
118
118
  let modifiers;
119
119
  let rest;
120
- if (typeof first !== 'string' && typeof first !== 'number') {
120
+ if (first !== undefined && typeof first !== 'string' && typeof first !== 'number') {
121
121
  modifiers = first;
122
122
  rest = modifiersAndKeys.slice(1);
123
123
  }
@@ -132,6 +132,11 @@ class SeleniumWebDriverElement {
132
132
  // webdriver.Key.chord doesn't work well with geckodriver (mozilla/geckodriver#1502),
133
133
  // so avoid it if no modifier keys are required.
134
134
  .map(k => (modifierKeys.length > 0 ? webdriver.Key.chord(...modifierKeys, k) : k));
135
+ // Throw an error if no keys have been specified. Calling this function with no
136
+ // keys should not result in a focus event being dispatched unexpectedly.
137
+ if (keys.length === 0) {
138
+ throw getNoKeysSpecifiedError();
139
+ }
135
140
  await this.element().sendKeys(...keys);
136
141
  await this._stabilize();
137
142
  }
@@ -1 +1 @@
1
- {"version":3,"file":"selenium-webdriver.mjs","sources":["../../../../../../../src/cdk/testing/selenium-webdriver/selenium-webdriver-keys.ts","../../../../../../../src/cdk/testing/selenium-webdriver/selenium-web-driver-element.ts","../../../../../../../src/cdk/testing/selenium-webdriver/selenium-web-driver-harness-environment.ts","../../../../../../../src/cdk/testing/selenium-webdriver/public-api.ts","../../../../../../../src/cdk/testing/selenium-webdriver/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ModifierKeys, TestKey} from '@angular/cdk/testing';\nimport * as webdriver from 'selenium-webdriver';\n\n/**\n * Maps the `TestKey` constants to WebDriver's `webdriver.Key` constants.\n * See https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/webdriver/key.js#L29\n */\nexport const seleniumWebDriverKeyMap = {\n [TestKey.BACKSPACE]: webdriver.Key.BACK_SPACE,\n [TestKey.TAB]: webdriver.Key.TAB,\n [TestKey.ENTER]: webdriver.Key.ENTER,\n [TestKey.SHIFT]: webdriver.Key.SHIFT,\n [TestKey.CONTROL]: webdriver.Key.CONTROL,\n [TestKey.ALT]: webdriver.Key.ALT,\n [TestKey.ESCAPE]: webdriver.Key.ESCAPE,\n [TestKey.PAGE_UP]: webdriver.Key.PAGE_UP,\n [TestKey.PAGE_DOWN]: webdriver.Key.PAGE_DOWN,\n [TestKey.END]: webdriver.Key.END,\n [TestKey.HOME]: webdriver.Key.HOME,\n [TestKey.LEFT_ARROW]: webdriver.Key.ARROW_LEFT,\n [TestKey.UP_ARROW]: webdriver.Key.ARROW_UP,\n [TestKey.RIGHT_ARROW]: webdriver.Key.ARROW_RIGHT,\n [TestKey.DOWN_ARROW]: webdriver.Key.ARROW_DOWN,\n [TestKey.INSERT]: webdriver.Key.INSERT,\n [TestKey.DELETE]: webdriver.Key.DELETE,\n [TestKey.F1]: webdriver.Key.F1,\n [TestKey.F2]: webdriver.Key.F2,\n [TestKey.F3]: webdriver.Key.F3,\n [TestKey.F4]: webdriver.Key.F4,\n [TestKey.F5]: webdriver.Key.F5,\n [TestKey.F6]: webdriver.Key.F6,\n [TestKey.F7]: webdriver.Key.F7,\n [TestKey.F8]: webdriver.Key.F8,\n [TestKey.F9]: webdriver.Key.F9,\n [TestKey.F10]: webdriver.Key.F10,\n [TestKey.F11]: webdriver.Key.F11,\n [TestKey.F12]: webdriver.Key.F12,\n [TestKey.META]: webdriver.Key.META,\n};\n\n/** Gets a list of WebDriver `Key`s for the given `ModifierKeys`. */\nexport function getSeleniumWebDriverModifierKeys(modifiers: ModifierKeys): string[] {\n const result: string[] = [];\n if (modifiers.control) {\n result.push(webdriver.Key.CONTROL);\n }\n if (modifiers.alt) {\n result.push(webdriver.Key.ALT);\n }\n if (modifiers.shift) {\n result.push(webdriver.Key.SHIFT);\n }\n if (modifiers.meta) {\n result.push(webdriver.Key.META);\n }\n return result;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n _getTextWithExcludedElements,\n ElementDimensions,\n EventData,\n ModifierKeys,\n TestElement,\n TestKey,\n TextOptions,\n} from '@angular/cdk/testing';\nimport * as webdriver from 'selenium-webdriver';\nimport {getSeleniumWebDriverModifierKeys, seleniumWebDriverKeyMap} from './selenium-webdriver-keys';\n\n/** A `TestElement` implementation for WebDriver. */\nexport class SeleniumWebDriverElement implements TestElement {\n constructor(\n readonly element: () => webdriver.WebElement,\n private _stabilize: () => Promise<void>,\n ) {}\n\n /** Blur the element. */\n async blur(): Promise<void> {\n await this._executeScript((element: HTMLElement) => element.blur(), this.element());\n await this._stabilize();\n }\n\n /** Clear the element's input (for input and textarea elements only). */\n async clear(): Promise<void> {\n await this.element().clear();\n await this._stabilize();\n }\n\n /**\n * Click the element at the default location for the current environment. If you need to guarantee\n * the element is clicked at a specific location, consider using `click('center')` or\n * `click(x, y)` instead.\n */\n click(modifiers?: ModifierKeys): Promise<void>;\n /** Click the element at the element's center. */\n click(location: 'center', modifiers?: ModifierKeys): Promise<void>;\n /**\n * Click the element at the specified coordinates relative to the top-left of the element.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n * @param modifiers Modifier keys held while clicking\n */\n click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n async click(\n ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]\n ): Promise<void> {\n await this._dispatchClickEventSequence(args, webdriver.Button.LEFT);\n await this._stabilize();\n }\n\n /**\n * Right clicks on the element at the specified coordinates relative to the top-left of it.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n * @param modifiers Modifier keys held while clicking\n */\n rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n async rightClick(\n ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]\n ): Promise<void> {\n await this._dispatchClickEventSequence(args, webdriver.Button.RIGHT);\n await this._stabilize();\n }\n\n /** Focus the element. */\n async focus(): Promise<void> {\n await this._executeScript((element: HTMLElement) => element.focus(), this.element());\n await this._stabilize();\n }\n\n /** Get the computed value of the given CSS property for the element. */\n async getCssValue(property: string): Promise<string> {\n await this._stabilize();\n return this.element().getCssValue(property);\n }\n\n /** Hovers the mouse over the element. */\n async hover(): Promise<void> {\n await this._actions().mouseMove(this.element()).perform();\n await this._stabilize();\n }\n\n /** Moves the mouse away from the element. */\n async mouseAway(): Promise<void> {\n await this._actions().mouseMove(this.element(), {x: -1, y: -1}).perform();\n await this._stabilize();\n }\n\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n async sendKeys(...keys: (string | TestKey)[]): Promise<void>;\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n async sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;\n async sendKeys(...modifiersAndKeys: any[]): Promise<void> {\n const first = modifiersAndKeys[0];\n let modifiers: ModifierKeys;\n let rest: (string | TestKey)[];\n if (typeof first !== 'string' && typeof first !== 'number') {\n modifiers = first;\n rest = modifiersAndKeys.slice(1);\n } else {\n modifiers = {};\n rest = modifiersAndKeys;\n }\n\n const modifierKeys = getSeleniumWebDriverModifierKeys(modifiers);\n const keys = rest\n .map(k => (typeof k === 'string' ? k.split('') : [seleniumWebDriverKeyMap[k]]))\n .reduce((arr, k) => arr.concat(k), [])\n // webdriver.Key.chord doesn't work well with geckodriver (mozilla/geckodriver#1502),\n // so avoid it if no modifier keys are required.\n .map(k => (modifierKeys.length > 0 ? webdriver.Key.chord(...modifierKeys, k) : k));\n\n await this.element().sendKeys(...keys);\n await this._stabilize();\n }\n\n /**\n * Gets the text from the element.\n * @param options Options that affect what text is included.\n */\n async text(options?: TextOptions): Promise<string> {\n await this._stabilize();\n if (options?.exclude) {\n return this._executeScript(_getTextWithExcludedElements, this.element(), options.exclude);\n }\n // We don't go through the WebDriver `getText`, because it excludes text from hidden elements.\n return this._executeScript(\n (element: Element) => (element.textContent || '').trim(),\n this.element(),\n );\n }\n\n /** Gets the value for the given attribute from the element. */\n async getAttribute(name: string): Promise<string | null> {\n await this._stabilize();\n return this._executeScript(\n (element: Element, attribute: string) => element.getAttribute(attribute),\n this.element(),\n name,\n );\n }\n\n /** Checks whether the element has the given class. */\n async hasClass(name: string): Promise<boolean> {\n await this._stabilize();\n const classes = (await this.getAttribute('class')) || '';\n return new Set(classes.split(/\\s+/).filter(c => c)).has(name);\n }\n\n /** Gets the dimensions of the element. */\n async getDimensions(): Promise<ElementDimensions> {\n await this._stabilize();\n const {width, height} = await this.element().getSize();\n const {x: left, y: top} = await this.element().getLocation();\n return {width, height, left, top};\n }\n\n /** Gets the value of a property of an element. */\n async getProperty<T = any>(name: string): Promise<T> {\n await this._stabilize();\n return this._executeScript(\n (element: Element, property: keyof Element) => element[property],\n this.element(),\n name,\n );\n }\n\n /** Sets the value of a property of an input. */\n async setInputValue(newValue: string): Promise<void> {\n await this._executeScript(\n (element: HTMLInputElement, value: string) => (element.value = value),\n this.element(),\n newValue,\n );\n await this._stabilize();\n }\n\n /** Selects the options at the specified indexes inside of a native `select` element. */\n async selectOptions(...optionIndexes: number[]): Promise<void> {\n await this._stabilize();\n const options = await this.element().findElements(webdriver.By.css('option'));\n const indexes = new Set(optionIndexes); // Convert to a set to remove duplicates.\n\n if (options.length && indexes.size) {\n // Reset the value so all the selected states are cleared. We can\n // reuse the input-specific method since the logic is the same.\n await this.setInputValue('');\n\n for (let i = 0; i < options.length; i++) {\n if (indexes.has(i)) {\n // We have to hold the control key while clicking on options so that multiple can be\n // selected in multi-selection mode. The key doesn't do anything for single selection.\n await this._actions().keyDown(webdriver.Key.CONTROL).perform();\n await options[i].click();\n await this._actions().keyUp(webdriver.Key.CONTROL).perform();\n }\n }\n\n await this._stabilize();\n }\n }\n\n /** Checks whether this element matches the given selector. */\n async matchesSelector(selector: string): Promise<boolean> {\n await this._stabilize();\n return this._executeScript(\n (element: Element, s: string) =>\n (Element.prototype.matches || (Element.prototype as any).msMatchesSelector).call(\n element,\n s,\n ),\n this.element(),\n selector,\n );\n }\n\n /** Checks whether the element is focused. */\n async isFocused(): Promise<boolean> {\n await this._stabilize();\n return webdriver.WebElement.equals(\n this.element(),\n this.element().getDriver().switchTo().activeElement(),\n );\n }\n\n /**\n * Dispatches an event with a particular name.\n * @param name Name of the event to be dispatched.\n */\n async dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void> {\n await this._executeScript(dispatchEvent, name, this.element(), data);\n await this._stabilize();\n }\n\n /** Gets the webdriver action sequence. */\n private _actions() {\n return this.element().getDriver().actions();\n }\n\n /** Executes a function in the browser. */\n private async _executeScript<T>(script: Function, ...var_args: any[]): Promise<T> {\n return this.element()\n .getDriver()\n .executeScript(script, ...var_args);\n }\n\n /** Dispatches all the events that are part of a click event sequence. */\n private async _dispatchClickEventSequence(\n args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?],\n button: string,\n ) {\n let modifiers: ModifierKeys = {};\n if (args.length && typeof args[args.length - 1] === 'object') {\n modifiers = args.pop() as ModifierKeys;\n }\n const modifierKeys = getSeleniumWebDriverModifierKeys(modifiers);\n\n // Omitting the offset argument to mouseMove results in clicking the center.\n // This is the default behavior we want, so we use an empty array of offsetArgs if\n // no args remain after popping the modifiers from the args passed to this function.\n const offsetArgs = (args.length === 2 ? [{x: args[0], y: args[1]}] : []) as [\n {x: number; y: number},\n ];\n\n let actions = this._actions().mouseMove(this.element(), ...offsetArgs);\n\n for (const modifierKey of modifierKeys) {\n actions = actions.keyDown(modifierKey);\n }\n actions = actions.click(button);\n for (const modifierKey of modifierKeys) {\n actions = actions.keyUp(modifierKey);\n }\n\n await actions.perform();\n }\n}\n\n/**\n * Dispatches an event with a particular name and data to an element. Note that this needs to be a\n * pure function, because it gets stringified by WebDriver and is executed inside the browser.\n */\nfunction dispatchEvent(name: string, element: Element, data?: Record<string, EventData>) {\n const event = document.createEvent('Event');\n event.initEvent(name);\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the original object.\n Object.assign(event, data || {});\n element.dispatchEvent(event);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessEnvironment, HarnessLoader, TestElement} from '@angular/cdk/testing';\nimport * as webdriver from 'selenium-webdriver';\nimport {SeleniumWebDriverElement} from './selenium-web-driver-element';\n\n/**\n * An Angular framework stabilizer function that takes a callback and calls it when the application\n * is stable, passing a boolean indicating if any work was done.\n */\ndeclare interface FrameworkStabilizer {\n (callback: (didWork: boolean) => void): void;\n}\n\ndeclare global {\n interface Window {\n /**\n * These hooks are exposed by Angular to register a callback for when the application is stable\n * (no more pending tasks).\n *\n * For the implementation, see: https://github.com/\n * angular/angular/blob/master/packages/platform-browser/src/browser/testability.ts#L30-L49\n */\n frameworkStabilizers: FrameworkStabilizer[];\n }\n}\n\n/** Options to configure the environment. */\nexport interface WebDriverHarnessEnvironmentOptions {\n /** The query function used to find DOM elements. */\n queryFn: (selector: string, root: () => webdriver.WebElement) => Promise<webdriver.WebElement[]>;\n}\n\n/** The default environment options. */\nconst defaultEnvironmentOptions: WebDriverHarnessEnvironmentOptions = {\n queryFn: async (selector: string, root: () => webdriver.WebElement) =>\n root().findElements(webdriver.By.css(selector)),\n};\n\n/**\n * This function is meant to be executed in the browser. It taps into the hooks exposed by Angular\n * and invokes the specified `callback` when the application is stable (no more pending tasks).\n */\nfunction whenStable(callback: (didWork: boolean[]) => void): void {\n Promise.all(window.frameworkStabilizers.map(stabilizer => new Promise(stabilizer))).then(\n callback,\n );\n}\n\n/**\n * This function is meant to be executed in the browser. It checks whether the Angular framework has\n * bootstrapped yet.\n */\nfunction isBootstrapped() {\n return !!window.frameworkStabilizers;\n}\n\n/** Waits for angular to be ready after the page load. */\nexport async function waitForAngularReady(wd: webdriver.WebDriver) {\n await wd.wait(() => wd.executeScript(isBootstrapped));\n await wd.executeAsyncScript(whenStable);\n}\n\n/** A `HarnessEnvironment` implementation for WebDriver. */\nexport class SeleniumWebDriverHarnessEnvironment extends HarnessEnvironment<\n () => webdriver.WebElement\n> {\n /** The options for this environment. */\n private _options: WebDriverHarnessEnvironmentOptions;\n\n /** Environment stabilization callback passed to the created test elements. */\n private _stabilizeCallback: () => Promise<void>;\n\n protected constructor(\n rawRootElement: () => webdriver.WebElement,\n options?: WebDriverHarnessEnvironmentOptions,\n ) {\n super(rawRootElement);\n this._options = {...defaultEnvironmentOptions, ...options};\n this._stabilizeCallback = () => this.forceStabilize();\n }\n\n /** Gets the ElementFinder corresponding to the given TestElement. */\n static getNativeElement(el: TestElement): webdriver.WebElement {\n if (el instanceof SeleniumWebDriverElement) {\n return el.element();\n }\n throw Error('This TestElement was not created by the WebDriverHarnessEnvironment');\n }\n\n /** Creates a `HarnessLoader` rooted at the document root. */\n static loader(\n driver: webdriver.WebDriver,\n options?: WebDriverHarnessEnvironmentOptions,\n ): HarnessLoader {\n return new SeleniumWebDriverHarnessEnvironment(\n () => driver.findElement(webdriver.By.css('body')),\n options,\n );\n }\n\n /**\n * Flushes change detection and async tasks captured in the Angular zone.\n * In most cases it should not be necessary to call this manually. However, there may be some edge\n * cases where it is needed to fully flush animation events.\n */\n async forceStabilize(): Promise<void> {\n await this.rawRootElement().getDriver().executeAsyncScript(whenStable);\n }\n\n /** @docs-private */\n async waitForTasksOutsideAngular(): Promise<void> {\n // TODO: figure out how we can do this for the webdriver environment.\n // https://github.com/angular/components/issues/17412\n }\n\n /** Gets the root element for the document. */\n protected getDocumentRoot(): () => webdriver.WebElement {\n return () => this.rawRootElement().getDriver().findElement(webdriver.By.css('body'));\n }\n\n /** Creates a `TestElement` from a raw element. */\n protected createTestElement(element: () => webdriver.WebElement): TestElement {\n return new SeleniumWebDriverElement(element, this._stabilizeCallback);\n }\n\n /** Creates a `HarnessLoader` rooted at the given raw element. */\n protected createEnvironment(\n element: () => webdriver.WebElement,\n ): HarnessEnvironment<() => webdriver.WebElement> {\n return new SeleniumWebDriverHarnessEnvironment(element, this._options);\n }\n\n // Note: This seems to be working, though we may need to re-evaluate if we encounter issues with\n // stale element references. `() => Promise<webdriver.WebElement[]>` seems like a more correct\n // return type, though supporting it would require changes to the public harness API.\n /**\n * Gets a list of all elements matching the given selector under this environment's root element.\n */\n protected async getAllRawElements(selector: string): Promise<(() => webdriver.WebElement)[]> {\n const els = await this._options.queryFn(selector, this.rawRootElement);\n return els.map((x: webdriver.WebElement) => () => x);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './selenium-web-driver-element';\nexport * from './selenium-web-driver-harness-environment';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;;AAWA;;;;AAIO,MAAM,uBAAuB,GAAG;IACrC,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU;IAC7C,CAAC,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG;IAChC,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK;IACpC,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK;IACpC,CAAC,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO;IACxC,CAAC,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG;IAChC,CAAC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM;IACtC,CAAC,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO;IACxC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S,eAAe;QACvB,OAAO,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;KACtF;;IAGS,iBAAiB,CAAC,OAAmC;QAC7D,OAAO,IAAI,wBAAwB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KACvE;;IAGS,iBAAiB,CACzB,OAAmC;QAEnC,OAAO,IAAI,mCAAmC,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACxE;;;;;;;IAQS,MAAM,iBAAiB,CAAC,QAAgB;QAChD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACvE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAuB,KAAK,MAAM,CAAC,CAAC,CAAC;KACtD;;;ACpJH;;;;;;;;ACAA;;;;;;;;;;"}
1
+ {"version":3,"file":"selenium-webdriver.mjs","sources":["../../../../../../../src/cdk/testing/selenium-webdriver/selenium-webdriver-keys.ts","../../../../../../../src/cdk/testing/selenium-webdriver/selenium-web-driver-element.ts","../../../../../../../src/cdk/testing/selenium-webdriver/selenium-web-driver-harness-environment.ts","../../../../../../../src/cdk/testing/selenium-webdriver/public-api.ts","../../../../../../../src/cdk/testing/selenium-webdriver/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ModifierKeys, TestKey} from '@angular/cdk/testing';\nimport * as webdriver from 'selenium-webdriver';\n\n/**\n * Maps the `TestKey` constants to WebDriver's `webdriver.Key` constants.\n * See https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/webdriver/key.js#L29\n */\nexport const seleniumWebDriverKeyMap = {\n [TestKey.BACKSPACE]: webdriver.Key.BACK_SPACE,\n [TestKey.TAB]: webdriver.Key.TAB,\n [TestKey.ENTER]: webdriver.Key.ENTER,\n [TestKey.SHIFT]: webdriver.Key.SHIFT,\n [TestKey.CONTROL]: webdriver.Key.CONTROL,\n [TestKey.ALT]: webdriver.Key.ALT,\n [TestKey.ESCAPE]: webdriver.Key.ESCAPE,\n [TestKey.PAGE_UP]: webdriver.Key.PAGE_UP,\n [TestKey.PAGE_DOWN]: webdriver.Key.PAGE_DOWN,\n [TestKey.END]: webdriver.Key.END,\n [TestKey.HOME]: webdriver.Key.HOME,\n [TestKey.LEFT_ARROW]: webdriver.Key.ARROW_LEFT,\n [TestKey.UP_ARROW]: webdriver.Key.ARROW_UP,\n [TestKey.RIGHT_ARROW]: webdriver.Key.ARROW_RIGHT,\n [TestKey.DOWN_ARROW]: webdriver.Key.ARROW_DOWN,\n [TestKey.INSERT]: webdriver.Key.INSERT,\n [TestKey.DELETE]: webdriver.Key.DELETE,\n [TestKey.F1]: webdriver.Key.F1,\n [TestKey.F2]: webdriver.Key.F2,\n [TestKey.F3]: webdriver.Key.F3,\n [TestKey.F4]: webdriver.Key.F4,\n [TestKey.F5]: webdriver.Key.F5,\n [TestKey.F6]: webdriver.Key.F6,\n [TestKey.F7]: webdriver.Key.F7,\n [TestKey.F8]: webdriver.Key.F8,\n [TestKey.F9]: webdriver.Key.F9,\n [TestKey.F10]: webdriver.Key.F10,\n [TestKey.F11]: webdriver.Key.F11,\n [TestKey.F12]: webdriver.Key.F12,\n [TestKey.META]: webdriver.Key.META,\n};\n\n/** Gets a list of WebDriver `Key`s for the given `ModifierKeys`. */\nexport function getSeleniumWebDriverModifierKeys(modifiers: ModifierKeys): string[] {\n const result: string[] = [];\n if (modifiers.control) {\n result.push(webdriver.Key.CONTROL);\n }\n if (modifiers.alt) {\n result.push(webdriver.Key.ALT);\n }\n if (modifiers.shift) {\n result.push(webdriver.Key.SHIFT);\n }\n if (modifiers.meta) {\n result.push(webdriver.Key.META);\n }\n return result;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n _getTextWithExcludedElements,\n ElementDimensions,\n EventData,\n getNoKeysSpecifiedError,\n ModifierKeys,\n TestElement,\n TestKey,\n TextOptions,\n} from '@angular/cdk/testing';\nimport * as webdriver from 'selenium-webdriver';\nimport {getSeleniumWebDriverModifierKeys, seleniumWebDriverKeyMap} from './selenium-webdriver-keys';\n\n/** A `TestElement` implementation for WebDriver. */\nexport class SeleniumWebDriverElement implements TestElement {\n constructor(\n readonly element: () => webdriver.WebElement,\n private _stabilize: () => Promise<void>,\n ) {}\n\n /** Blur the element. */\n async blur(): Promise<void> {\n await this._executeScript((element: HTMLElement) => element.blur(), this.element());\n await this._stabilize();\n }\n\n /** Clear the element's input (for input and textarea elements only). */\n async clear(): Promise<void> {\n await this.element().clear();\n await this._stabilize();\n }\n\n /**\n * Click the element at the default location for the current environment. If you need to guarantee\n * the element is clicked at a specific location, consider using `click('center')` or\n * `click(x, y)` instead.\n */\n click(modifiers?: ModifierKeys): Promise<void>;\n /** Click the element at the element's center. */\n click(location: 'center', modifiers?: ModifierKeys): Promise<void>;\n /**\n * Click the element at the specified coordinates relative to the top-left of the element.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n * @param modifiers Modifier keys held while clicking\n */\n click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n async click(\n ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]\n ): Promise<void> {\n await this._dispatchClickEventSequence(args, webdriver.Button.LEFT);\n await this._stabilize();\n }\n\n /**\n * Right clicks on the element at the specified coordinates relative to the top-left of it.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n * @param modifiers Modifier keys held while clicking\n */\n rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n async rightClick(\n ...args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?]\n ): Promise<void> {\n await this._dispatchClickEventSequence(args, webdriver.Button.RIGHT);\n await this._stabilize();\n }\n\n /** Focus the element. */\n async focus(): Promise<void> {\n await this._executeScript((element: HTMLElement) => element.focus(), this.element());\n await this._stabilize();\n }\n\n /** Get the computed value of the given CSS property for the element. */\n async getCssValue(property: string): Promise<string> {\n await this._stabilize();\n return this.element().getCssValue(property);\n }\n\n /** Hovers the mouse over the element. */\n async hover(): Promise<void> {\n await this._actions().mouseMove(this.element()).perform();\n await this._stabilize();\n }\n\n /** Moves the mouse away from the element. */\n async mouseAway(): Promise<void> {\n await this._actions().mouseMove(this.element(), {x: -1, y: -1}).perform();\n await this._stabilize();\n }\n\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n async sendKeys(...keys: (string | TestKey)[]): Promise<void>;\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n async sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;\n async sendKeys(...modifiersAndKeys: any[]): Promise<void> {\n const first = modifiersAndKeys[0];\n let modifiers: ModifierKeys;\n let rest: (string | TestKey)[];\n if (first !== undefined && typeof first !== 'string' && typeof first !== 'number') {\n modifiers = first;\n rest = modifiersAndKeys.slice(1);\n } else {\n modifiers = {};\n rest = modifiersAndKeys;\n }\n\n const modifierKeys = getSeleniumWebDriverModifierKeys(modifiers);\n const keys = rest\n .map(k => (typeof k === 'string' ? k.split('') : [seleniumWebDriverKeyMap[k]]))\n .reduce((arr, k) => arr.concat(k), [])\n // webdriver.Key.chord doesn't work well with geckodriver (mozilla/geckodriver#1502),\n // so avoid it if no modifier keys are required.\n .map(k => (modifierKeys.length > 0 ? webdriver.Key.chord(...modifierKeys, k) : k));\n\n // Throw an error if no keys have been specified. Calling this function with no\n // keys should not result in a focus event being dispatched unexpectedly.\n if (keys.length === 0) {\n throw getNoKeysSpecifiedError();\n }\n\n await this.element().sendKeys(...keys);\n await this._stabilize();\n }\n\n /**\n * Gets the text from the element.\n * @param options Options that affect what text is included.\n */\n async text(options?: TextOptions): Promise<string> {\n await this._stabilize();\n if (options?.exclude) {\n return this._executeScript(_getTextWithExcludedElements, this.element(), options.exclude);\n }\n // We don't go through the WebDriver `getText`, because it excludes text from hidden elements.\n return this._executeScript(\n (element: Element) => (element.textContent || '').trim(),\n this.element(),\n );\n }\n\n /** Gets the value for the given attribute from the element. */\n async getAttribute(name: string): Promise<string | null> {\n await this._stabilize();\n return this._executeScript(\n (element: Element, attribute: string) => element.getAttribute(attribute),\n this.element(),\n name,\n );\n }\n\n /** Checks whether the element has the given class. */\n async hasClass(name: string): Promise<boolean> {\n await this._stabilize();\n const classes = (await this.getAttribute('class')) || '';\n return new Set(classes.split(/\\s+/).filter(c => c)).has(name);\n }\n\n /** Gets the dimensions of the element. */\n async getDimensions(): Promise<ElementDimensions> {\n await this._stabilize();\n const {width, height} = await this.element().getSize();\n const {x: left, y: top} = await this.element().getLocation();\n return {width, height, left, top};\n }\n\n /** Gets the value of a property of an element. */\n async getProperty<T = any>(name: string): Promise<T> {\n await this._stabilize();\n return this._executeScript(\n (element: Element, property: keyof Element) => element[property],\n this.element(),\n name,\n );\n }\n\n /** Sets the value of a property of an input. */\n async setInputValue(newValue: string): Promise<void> {\n await this._executeScript(\n (element: HTMLInputElement, value: string) => (element.value = value),\n this.element(),\n newValue,\n );\n await this._stabilize();\n }\n\n /** Selects the options at the specified indexes inside of a native `select` element. */\n async selectOptions(...optionIndexes: number[]): Promise<void> {\n await this._stabilize();\n const options = await this.element().findElements(webdriver.By.css('option'));\n const indexes = new Set(optionIndexes); // Convert to a set to remove duplicates.\n\n if (options.length && indexes.size) {\n // Reset the value so all the selected states are cleared. We can\n // reuse the input-specific method since the logic is the same.\n await this.setInputValue('');\n\n for (let i = 0; i < options.length; i++) {\n if (indexes.has(i)) {\n // We have to hold the control key while clicking on options so that multiple can be\n // selected in multi-selection mode. The key doesn't do anything for single selection.\n await this._actions().keyDown(webdriver.Key.CONTROL).perform();\n await options[i].click();\n await this._actions().keyUp(webdriver.Key.CONTROL).perform();\n }\n }\n\n await this._stabilize();\n }\n }\n\n /** Checks whether this element matches the given selector. */\n async matchesSelector(selector: string): Promise<boolean> {\n await this._stabilize();\n return this._executeScript(\n (element: Element, s: string) =>\n (Element.prototype.matches || (Element.prototype as any).msMatchesSelector).call(\n element,\n s,\n ),\n this.element(),\n selector,\n );\n }\n\n /** Checks whether the element is focused. */\n async isFocused(): Promise<boolean> {\n await this._stabilize();\n return webdriver.WebElement.equals(\n this.element(),\n this.element().getDriver().switchTo().activeElement(),\n );\n }\n\n /**\n * Dispatches an event with a particular name.\n * @param name Name of the event to be dispatched.\n */\n async dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void> {\n await this._executeScript(dispatchEvent, name, this.element(), data);\n await this._stabilize();\n }\n\n /** Gets the webdriver action sequence. */\n private _actions() {\n return this.element().getDriver().actions();\n }\n\n /** Executes a function in the browser. */\n private async _executeScript<T>(script: Function, ...var_args: any[]): Promise<T> {\n return this.element()\n .getDriver()\n .executeScript(script, ...var_args);\n }\n\n /** Dispatches all the events that are part of a click event sequence. */\n private async _dispatchClickEventSequence(\n args: [ModifierKeys?] | ['center', ModifierKeys?] | [number, number, ModifierKeys?],\n button: string,\n ) {\n let modifiers: ModifierKeys = {};\n if (args.length && typeof args[args.length - 1] === 'object') {\n modifiers = args.pop() as ModifierKeys;\n }\n const modifierKeys = getSeleniumWebDriverModifierKeys(modifiers);\n\n // Omitting the offset argument to mouseMove results in clicking the center.\n // This is the default behavior we want, so we use an empty array of offsetArgs if\n // no args remain after popping the modifiers from the args passed to this function.\n const offsetArgs = (args.length === 2 ? [{x: args[0], y: args[1]}] : []) as [\n {x: number; y: number},\n ];\n\n let actions = this._actions().mouseMove(this.element(), ...offsetArgs);\n\n for (const modifierKey of modifierKeys) {\n actions = actions.keyDown(modifierKey);\n }\n actions = actions.click(button);\n for (const modifierKey of modifierKeys) {\n actions = actions.keyUp(modifierKey);\n }\n\n await actions.perform();\n }\n}\n\n/**\n * Dispatches an event with a particular name and data to an element. Note that this needs to be a\n * pure function, because it gets stringified by WebDriver and is executed inside the browser.\n */\nfunction dispatchEvent(name: string, element: Element, data?: Record<string, EventData>) {\n const event = document.createEvent('Event');\n event.initEvent(name);\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the original object.\n Object.assign(event, data || {});\n element.dispatchEvent(event);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessEnvironment, HarnessLoader, TestElement} from '@angular/cdk/testing';\nimport * as webdriver from 'selenium-webdriver';\nimport {SeleniumWebDriverElement} from './selenium-web-driver-element';\n\n/**\n * An Angular framework stabilizer function that takes a callback and calls it when the application\n * is stable, passing a boolean indicating if any work was done.\n */\ndeclare interface FrameworkStabilizer {\n (callback: (didWork: boolean) => void): void;\n}\n\ndeclare global {\n interface Window {\n /**\n * These hooks are exposed by Angular to register a callback for when the application is stable\n * (no more pending tasks).\n *\n * For the implementation, see: https://github.com/\n * angular/angular/blob/master/packages/platform-browser/src/browser/testability.ts#L30-L49\n */\n frameworkStabilizers: FrameworkStabilizer[];\n }\n}\n\n/** Options to configure the environment. */\nexport interface WebDriverHarnessEnvironmentOptions {\n /** The query function used to find DOM elements. */\n queryFn: (selector: string, root: () => webdriver.WebElement) => Promise<webdriver.WebElement[]>;\n}\n\n/** The default environment options. */\nconst defaultEnvironmentOptions: WebDriverHarnessEnvironmentOptions = {\n queryFn: async (selector: string, root: () => webdriver.WebElement) =>\n root().findElements(webdriver.By.css(selector)),\n};\n\n/**\n * This function is meant to be executed in the browser. It taps into the hooks exposed by Angular\n * and invokes the specified `callback` when the application is stable (no more pending tasks).\n */\nfunction whenStable(callback: (didWork: boolean[]) => void): void {\n Promise.all(window.frameworkStabilizers.map(stabilizer => new Promise(stabilizer))).then(\n callback,\n );\n}\n\n/**\n * This function is meant to be executed in the browser. It checks whether the Angular framework has\n * bootstrapped yet.\n */\nfunction isBootstrapped() {\n return !!window.frameworkStabilizers;\n}\n\n/** Waits for angular to be ready after the page load. */\nexport async function waitForAngularReady(wd: webdriver.WebDriver) {\n await wd.wait(() => wd.executeScript(isBootstrapped));\n await wd.executeAsyncScript(whenStable);\n}\n\n/** A `HarnessEnvironment` implementation for WebDriver. */\nexport class SeleniumWebDriverHarnessEnvironment extends HarnessEnvironment<\n () => webdriver.WebElement\n> {\n /** The options for this environment. */\n private _options: WebDriverHarnessEnvironmentOptions;\n\n /** Environment stabilization callback passed to the created test elements. */\n private _stabilizeCallback: () => Promise<void>;\n\n protected constructor(\n rawRootElement: () => webdriver.WebElement,\n options?: WebDriverHarnessEnvironmentOptions,\n ) {\n super(rawRootElement);\n this._options = {...defaultEnvironmentOptions, ...options};\n this._stabilizeCallback = () => this.forceStabilize();\n }\n\n /** Gets the ElementFinder corresponding to the given TestElement. */\n static getNativeElement(el: TestElement): webdriver.WebElement {\n if (el instanceof SeleniumWebDriverElement) {\n return el.element();\n }\n throw Error('This TestElement was not created by the WebDriverHarnessEnvironment');\n }\n\n /** Creates a `HarnessLoader` rooted at the document root. */\n static loader(\n driver: webdriver.WebDriver,\n options?: WebDriverHarnessEnvironmentOptions,\n ): HarnessLoader {\n return new SeleniumWebDriverHarnessEnvironment(\n () => driver.findElement(webdriver.By.css('body')),\n options,\n );\n }\n\n /**\n * Flushes change detection and async tasks captured in the Angular zone.\n * In most cases it should not be necessary to call this manually. However, there may be some edge\n * cases where it is needed to fully flush animation events.\n */\n async forceStabilize(): Promise<void> {\n await this.rawRootElement().getDriver().executeAsyncScript(whenStable);\n }\n\n /** @docs-private */\n async waitForTasksOutsideAngular(): Promise<void> {\n // TODO: figure out how we can do this for the webdriver environment.\n // https://github.com/angular/components/issues/17412\n }\n\n /** Gets the root element for the document. */\n protected getDocumentRoot(): () => webdriver.WebElement {\n return () => this.rawRootElement().getDriver().findElement(webdriver.By.css('body'));\n }\n\n /** Creates a `TestElement` from a raw element. */\n protected createTestElement(element: () => webdriver.WebElement): TestElement {\n return new SeleniumWebDriverElement(element, this._stabilizeCallback);\n }\n\n /** Creates a `HarnessLoader` rooted at the given raw element. */\n protected createEnvironment(\n element: () => webdriver.WebElement,\n ): HarnessEnvironment<() => webdriver.WebElement> {\n return new SeleniumWebDriverHarnessEnvironment(element, this._options);\n }\n\n // Note: This seems to be working, though we may need to re-evaluate if we encounter issues with\n // stale element references. `() => Promise<webdriver.WebElement[]>` seems like a more correct\n // return type, though supporting it would require changes to the public harness API.\n /**\n * Gets a list of all elements matching the given selector under this environment's root element.\n */\n protected async getAllRawElements(selector: string): Promise<(() => webdriver.WebElement)[]> {\n const els = await this._options.queryFn(selector, this.rawRootElement);\n return els.map((x: webdriver.WebElement) => () => x);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './selenium-web-driver-element';\nexport * from './selenium-web-driver-harness-environment';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;;AAWA;;;;AAIO,MAAM,uBAAuB,GAAG;IACrC,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU;IAC7C,CAAC,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG;IAChC,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK;IACpC,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK;IACpC,CA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qE,CAAC,CAAC;KACpF;;IAGD,OAAO,MAAM,CACX,MAA2B,EAC3B,OAA4C;QAE5C,OAAO,IAAI,mCAAmC,CAC5C,MAAM,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAClD,OAAO,CACR,CAAC;KACH;;;;;;IAOD,MAAM,cAAc;QAClB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;KACxE;;IAGD,MAAM,0BAA0B;;;KAG/B;;IAGS,eAAe;QACvB,OAAO,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;KACtF;;IAGS,iBAAiB,CAAC,OAAmC;QAC7D,OAAO,IAAI,wBAAwB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KACvE;;IAGS,iBAAiB,CACzB,OAAmC;QAEnC,OAAO,IAAI,mCAAmC,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACxE;;;;;;;IAQS,MAAM,iBAAiB,CAAC,QAAgB;QAChD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACvE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAuB,KAAK,MAAM,CAAC,CAAC,CAAC;KACtD;;;ACpJH;;;;;;;;ACAA;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { TestKey, _getTextWithExcludedElements, handleAutoChangeDetectionStatus, stopHandlingAutoChangeDetectionStatus, HarnessEnvironment } from '@angular/cdk/testing';
1
+ import { getNoKeysSpecifiedError, TestKey, _getTextWithExcludedElements, handleAutoChangeDetectionStatus, stopHandlingAutoChangeDetectionStatus, HarnessEnvironment } from '@angular/cdk/testing';
2
2
  import { flush } from '@angular/core/testing';
3
3
  import { takeWhile } from 'rxjs/operators';
4
4
  import { BehaviorSubject } from 'rxjs';
@@ -321,7 +321,10 @@ function typeInElement(element, ...modifiersAndKeys) {
321
321
  const first = modifiersAndKeys[0];
322
322
  let modifiers;
323
323
  let rest;
324
- if (typeof first !== 'string' && first.keyCode === undefined && first.key === undefined) {
324
+ if (first !== undefined &&
325
+ typeof first !== 'string' &&
326
+ first.keyCode === undefined &&
327
+ first.key === undefined) {
325
328
  modifiers = first;
326
329
  rest = modifiersAndKeys.slice(1);
327
330
  }
@@ -336,12 +339,17 @@ function typeInElement(element, ...modifiersAndKeys) {
336
339
  ? k.split('').map(c => ({ keyCode: c.toUpperCase().charCodeAt(0), key: c }))
337
340
  : [k])
338
341
  .reduce((arr, k) => arr.concat(k), []);
342
+ // Throw an error if no keys have been specified. Calling this function with no
343
+ // keys should not result in a focus event being dispatched unexpectedly.
344
+ if (keys.length === 0) {
345
+ throw getNoKeysSpecifiedError();
346
+ }
339
347
  // We simulate the user typing in a value by incrementally assigning the value below. The problem
340
348
  // is that for some input types, the browser won't allow for an invalid value to be set via the
341
349
  // `value` property which will always be the case when going character-by-character. If we detect
342
350
  // such an input, we have to set the value all at once or listeners to the `input` event (e.g.
343
351
  // the `ReactiveFormsModule` uses such an approach) won't receive the correct value.
344
- const enterValueIncrementally = inputType === 'number' && keys.length > 0
352
+ const enterValueIncrementally = inputType === 'number'
345
353
  ? // The value can be set character by character in number inputs if it doesn't have any decimals.
346
354
  keys.every(key => key.key !== '.' && key.keyCode !== PERIOD)
347
355
  : incrementalInputTypes.has(inputType);
@@ -445,7 +453,14 @@ class UnitTestElement {
445
453
  await this._stabilize();
446
454
  }
447
455
  async click(...args) {
448
- await this._dispatchMouseEventSequence('click', args, 0);
456
+ const isDisabled = this.element.disabled === true;
457
+ // If the element is `disabled` and has a `disabled` property, we emit the mouse event
458
+ // sequence but not dispatch the `click` event. This is necessary to keep the behavior
459
+ // consistent with an actual user interaction. The click event is not necessarily
460
+ // automatically prevented by the browser. There is mismatch between Firefox and Chromium:
461
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=329509.
462
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1115661.
463
+ await this._dispatchMouseEventSequence(isDisabled ? null : 'click', args, 0);
449
464
  await this._stabilize();
450
465
  }
451
466
  async rightClick(...args) {
@@ -577,8 +592,11 @@ class UnitTestElement {
577
592
  dispatchPointerEvent(this.element, name, clientX, clientY, { isPrimary: true, button });
578
593
  }
579
594
  }
580
- /** Dispatches all the events that are part of a mouse event sequence. */
581
- async _dispatchMouseEventSequence(name, args, button) {
595
+ /**
596
+ * Dispatches all the events that are part of a mouse event sequence
597
+ * and then emits a given primary event at the end, if speciifed.
598
+ */
599
+ async _dispatchMouseEventSequence(primaryEventName, args, button) {
582
600
  let clientX = undefined;
583
601
  let clientY = undefined;
584
602
  let modifiers = {};
@@ -598,10 +616,14 @@ class UnitTestElement {
598
616
  dispatchMouseEvent(this.element, 'mousedown', clientX, clientY, button, modifiers);
599
617
  this._dispatchPointerEventIfSupported('pointerup', clientX, clientY, button);
600
618
  dispatchMouseEvent(this.element, 'mouseup', clientX, clientY, button, modifiers);
601
- dispatchMouseEvent(this.element, name, clientX, clientY, button, modifiers);
619
+ // If a primary event name is specified, emit it after the mouse event sequence.
620
+ if (primaryEventName !== null) {
621
+ dispatchMouseEvent(this.element, primaryEventName, clientX, clientY, button, modifiers);
622
+ }
602
623
  // This call to _stabilize should not be needed since the callers will already do that them-
603
624
  // selves. Nevertheless it breaks some tests in g3 without it. It needs to be investigated
604
625
  // why removing breaks those tests.
626
+ // See: https://github.com/angular/components/pull/20758/files#r520886256.
605
627
  await this._stabilize();
606
628
  }
607
629
  }