@angular/cdk 13.2.1 → 14.0.0-next.2
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.
- package/esm2020/scrolling/virtual-scroll-viewport.mjs +3 -1
- package/esm2020/testing/component-harness.mjs +7 -1
- package/esm2020/testing/harness-environment.mjs +9 -1
- package/esm2020/version.mjs +1 -1
- package/fesm2015/cdk.mjs +1 -1
- package/fesm2015/cdk.mjs.map +1 -1
- package/fesm2015/scrolling.mjs +2 -0
- package/fesm2015/scrolling.mjs.map +1 -1
- package/fesm2015/testing.mjs +20 -0
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/cdk.mjs +1 -1
- package/fesm2020/cdk.mjs.map +1 -1
- package/fesm2020/scrolling.mjs +2 -0
- package/fesm2020/scrolling.mjs.map +1 -1
- package/fesm2020/testing.mjs +14 -0
- package/fesm2020/testing.mjs.map +1 -1
- package/package.json +1 -9
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/drag-drop/schema.json +1 -1
- package/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/ng-update/devkit-migration.mjs +1 -1
- package/schematics/tsconfig.json +2 -10
- package/testing/component-harness.d.ts +18 -0
- package/testing/harness-environment.d.ts +2 -0
- package/esm2020/testing/protractor/index.mjs +0 -9
- package/esm2020/testing/protractor/protractor-element.mjs +0 -234
- package/esm2020/testing/protractor/protractor-harness-environment.mjs +0 -73
- package/esm2020/testing/protractor/public-api.mjs +0 -10
- package/fesm2015/testing/protractor.mjs +0 -356
- package/fesm2015/testing/protractor.mjs.map +0 -1
- package/fesm2020/testing/protractor.mjs +0 -323
- package/fesm2020/testing/protractor.mjs.map +0 -1
- package/testing/protractor/index.d.ts +0 -8
- package/testing/protractor/package.json +0 -9
- package/testing/protractor/protractor-element.d.ts +0 -90
- package/testing/protractor/protractor-harness-environment.d.ts +0 -51
- package/testing/protractor/public-api.d.ts +0 -9
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import { TestKey, _getTextWithExcludedElements, HarnessEnvironment } from '@angular/cdk/testing';
|
|
2
|
-
import { Key, browser, Button, by, element } from 'protractor';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @license
|
|
6
|
-
* Copyright Google LLC All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
9
|
-
* found in the LICENSE file at https://angular.io/license
|
|
10
|
-
*/
|
|
11
|
-
/** Maps the `TestKey` constants to Protractor's `Key` constants. */
|
|
12
|
-
const keyMap = {
|
|
13
|
-
[TestKey.BACKSPACE]: Key.BACK_SPACE,
|
|
14
|
-
[TestKey.TAB]: Key.TAB,
|
|
15
|
-
[TestKey.ENTER]: Key.ENTER,
|
|
16
|
-
[TestKey.SHIFT]: Key.SHIFT,
|
|
17
|
-
[TestKey.CONTROL]: Key.CONTROL,
|
|
18
|
-
[TestKey.ALT]: Key.ALT,
|
|
19
|
-
[TestKey.ESCAPE]: Key.ESCAPE,
|
|
20
|
-
[TestKey.PAGE_UP]: Key.PAGE_UP,
|
|
21
|
-
[TestKey.PAGE_DOWN]: Key.PAGE_DOWN,
|
|
22
|
-
[TestKey.END]: Key.END,
|
|
23
|
-
[TestKey.HOME]: Key.HOME,
|
|
24
|
-
[TestKey.LEFT_ARROW]: Key.ARROW_LEFT,
|
|
25
|
-
[TestKey.UP_ARROW]: Key.ARROW_UP,
|
|
26
|
-
[TestKey.RIGHT_ARROW]: Key.ARROW_RIGHT,
|
|
27
|
-
[TestKey.DOWN_ARROW]: Key.ARROW_DOWN,
|
|
28
|
-
[TestKey.INSERT]: Key.INSERT,
|
|
29
|
-
[TestKey.DELETE]: Key.DELETE,
|
|
30
|
-
[TestKey.F1]: Key.F1,
|
|
31
|
-
[TestKey.F2]: Key.F2,
|
|
32
|
-
[TestKey.F3]: Key.F3,
|
|
33
|
-
[TestKey.F4]: Key.F4,
|
|
34
|
-
[TestKey.F5]: Key.F5,
|
|
35
|
-
[TestKey.F6]: Key.F6,
|
|
36
|
-
[TestKey.F7]: Key.F7,
|
|
37
|
-
[TestKey.F8]: Key.F8,
|
|
38
|
-
[TestKey.F9]: Key.F9,
|
|
39
|
-
[TestKey.F10]: Key.F10,
|
|
40
|
-
[TestKey.F11]: Key.F11,
|
|
41
|
-
[TestKey.F12]: Key.F12,
|
|
42
|
-
[TestKey.META]: Key.META,
|
|
43
|
-
};
|
|
44
|
-
/** Converts a `ModifierKeys` object to a list of Protractor `Key`s. */
|
|
45
|
-
function toProtractorModifierKeys(modifiers) {
|
|
46
|
-
const result = [];
|
|
47
|
-
if (modifiers.control) {
|
|
48
|
-
result.push(Key.CONTROL);
|
|
49
|
-
}
|
|
50
|
-
if (modifiers.alt) {
|
|
51
|
-
result.push(Key.ALT);
|
|
52
|
-
}
|
|
53
|
-
if (modifiers.shift) {
|
|
54
|
-
result.push(Key.SHIFT);
|
|
55
|
-
}
|
|
56
|
-
if (modifiers.meta) {
|
|
57
|
-
result.push(Key.META);
|
|
58
|
-
}
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* A `TestElement` implementation for Protractor.
|
|
63
|
-
* @deprecated
|
|
64
|
-
* @breaking-change 13.0.0
|
|
65
|
-
*/
|
|
66
|
-
class ProtractorElement {
|
|
67
|
-
constructor(element) {
|
|
68
|
-
this.element = element;
|
|
69
|
-
}
|
|
70
|
-
/** Blur the element. */
|
|
71
|
-
async blur() {
|
|
72
|
-
return browser.executeScript('arguments[0].blur()', this.element);
|
|
73
|
-
}
|
|
74
|
-
/** Clear the element's input (for input and textarea elements only). */
|
|
75
|
-
async clear() {
|
|
76
|
-
return this.element.clear();
|
|
77
|
-
}
|
|
78
|
-
async click(...args) {
|
|
79
|
-
await this._dispatchClickEventSequence(args, Button.LEFT);
|
|
80
|
-
}
|
|
81
|
-
async rightClick(...args) {
|
|
82
|
-
await this._dispatchClickEventSequence(args, Button.RIGHT);
|
|
83
|
-
}
|
|
84
|
-
/** Focus the element. */
|
|
85
|
-
async focus() {
|
|
86
|
-
return browser.executeScript('arguments[0].focus()', this.element);
|
|
87
|
-
}
|
|
88
|
-
/** Get the computed value of the given CSS property for the element. */
|
|
89
|
-
async getCssValue(property) {
|
|
90
|
-
return this.element.getCssValue(property);
|
|
91
|
-
}
|
|
92
|
-
/** Hovers the mouse over the element. */
|
|
93
|
-
async hover() {
|
|
94
|
-
return browser
|
|
95
|
-
.actions()
|
|
96
|
-
.mouseMove(await this.element.getWebElement())
|
|
97
|
-
.perform();
|
|
98
|
-
}
|
|
99
|
-
/** Moves the mouse away from the element. */
|
|
100
|
-
async mouseAway() {
|
|
101
|
-
return browser
|
|
102
|
-
.actions()
|
|
103
|
-
.mouseMove(await this.element.getWebElement(), { x: -1, y: -1 })
|
|
104
|
-
.perform();
|
|
105
|
-
}
|
|
106
|
-
async sendKeys(...modifiersAndKeys) {
|
|
107
|
-
const first = modifiersAndKeys[0];
|
|
108
|
-
let modifiers;
|
|
109
|
-
let rest;
|
|
110
|
-
if (typeof first !== 'string' && typeof first !== 'number') {
|
|
111
|
-
modifiers = first;
|
|
112
|
-
rest = modifiersAndKeys.slice(1);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
modifiers = {};
|
|
116
|
-
rest = modifiersAndKeys;
|
|
117
|
-
}
|
|
118
|
-
const modifierKeys = toProtractorModifierKeys(modifiers);
|
|
119
|
-
const keys = rest
|
|
120
|
-
.map(k => (typeof k === 'string' ? k.split('') : [keyMap[k]]))
|
|
121
|
-
.reduce((arr, k) => arr.concat(k), [])
|
|
122
|
-
// Key.chord doesn't work well with geckodriver (mozilla/geckodriver#1502),
|
|
123
|
-
// so avoid it if no modifier keys are required.
|
|
124
|
-
.map(k => (modifierKeys.length > 0 ? Key.chord(...modifierKeys, k) : k));
|
|
125
|
-
return this.element.sendKeys(...keys);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Gets the text from the element.
|
|
129
|
-
* @param options Options that affect what text is included.
|
|
130
|
-
*/
|
|
131
|
-
async text(options) {
|
|
132
|
-
if (options?.exclude) {
|
|
133
|
-
return browser.executeScript(_getTextWithExcludedElements, this.element, options.exclude);
|
|
134
|
-
}
|
|
135
|
-
// We don't go through Protractor's `getText`, because it excludes text from hidden elements.
|
|
136
|
-
return browser.executeScript(`return (arguments[0].textContent || '').trim()`, this.element);
|
|
137
|
-
}
|
|
138
|
-
/** Gets the value for the given attribute from the element. */
|
|
139
|
-
async getAttribute(name) {
|
|
140
|
-
return browser.executeScript(`return arguments[0].getAttribute(arguments[1])`, this.element, name);
|
|
141
|
-
}
|
|
142
|
-
/** Checks whether the element has the given class. */
|
|
143
|
-
async hasClass(name) {
|
|
144
|
-
const classes = (await this.getAttribute('class')) || '';
|
|
145
|
-
return new Set(classes.split(/\s+/).filter(c => c)).has(name);
|
|
146
|
-
}
|
|
147
|
-
/** Gets the dimensions of the element. */
|
|
148
|
-
async getDimensions() {
|
|
149
|
-
const { width, height } = await this.element.getSize();
|
|
150
|
-
const { x: left, y: top } = await this.element.getLocation();
|
|
151
|
-
return { width, height, left, top };
|
|
152
|
-
}
|
|
153
|
-
/** Gets the value of a property of an element. */
|
|
154
|
-
async getProperty(name) {
|
|
155
|
-
return browser.executeScript(`return arguments[0][arguments[1]]`, this.element, name);
|
|
156
|
-
}
|
|
157
|
-
/** Sets the value of a property of an input. */
|
|
158
|
-
async setInputValue(value) {
|
|
159
|
-
return browser.executeScript(`arguments[0].value = arguments[1]`, this.element, value);
|
|
160
|
-
}
|
|
161
|
-
/** Selects the options at the specified indexes inside of a native `select` element. */
|
|
162
|
-
async selectOptions(...optionIndexes) {
|
|
163
|
-
const options = await this.element.all(by.css('option'));
|
|
164
|
-
const indexes = new Set(optionIndexes); // Convert to a set to remove duplicates.
|
|
165
|
-
if (options.length && indexes.size) {
|
|
166
|
-
// Reset the value so all the selected states are cleared. We can
|
|
167
|
-
// reuse the input-specific method since the logic is the same.
|
|
168
|
-
await this.setInputValue('');
|
|
169
|
-
for (let i = 0; i < options.length; i++) {
|
|
170
|
-
if (indexes.has(i)) {
|
|
171
|
-
// We have to hold the control key while clicking on options so that multiple can be
|
|
172
|
-
// selected in multi-selection mode. The key doesn't do anything for single selection.
|
|
173
|
-
await browser.actions().keyDown(Key.CONTROL).perform();
|
|
174
|
-
await options[i].click();
|
|
175
|
-
await browser.actions().keyUp(Key.CONTROL).perform();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/** Checks whether this element matches the given selector. */
|
|
181
|
-
async matchesSelector(selector) {
|
|
182
|
-
return browser.executeScript(`
|
|
183
|
-
return (Element.prototype.matches ||
|
|
184
|
-
Element.prototype.msMatchesSelector).call(arguments[0], arguments[1])
|
|
185
|
-
`, this.element, selector);
|
|
186
|
-
}
|
|
187
|
-
/** Checks whether the element is focused. */
|
|
188
|
-
async isFocused() {
|
|
189
|
-
return this.element.equals(browser.driver.switchTo().activeElement());
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Dispatches an event with a particular name.
|
|
193
|
-
* @param name Name of the event to be dispatched.
|
|
194
|
-
*/
|
|
195
|
-
async dispatchEvent(name, data) {
|
|
196
|
-
return browser.executeScript(_dispatchEvent, name, this.element, data);
|
|
197
|
-
}
|
|
198
|
-
/** Dispatches all the events that are part of a click event sequence. */
|
|
199
|
-
async _dispatchClickEventSequence(args, button) {
|
|
200
|
-
let modifiers = {};
|
|
201
|
-
if (args.length && typeof args[args.length - 1] === 'object') {
|
|
202
|
-
modifiers = args.pop();
|
|
203
|
-
}
|
|
204
|
-
const modifierKeys = toProtractorModifierKeys(modifiers);
|
|
205
|
-
// Omitting the offset argument to mouseMove results in clicking the center.
|
|
206
|
-
// This is the default behavior we want, so we use an empty array of offsetArgs if
|
|
207
|
-
// no args remain after popping the modifiers from the args passed to this function.
|
|
208
|
-
const offsetArgs = (args.length === 2 ? [{ x: args[0], y: args[1] }] : []);
|
|
209
|
-
let actions = browser.actions().mouseMove(await this.element.getWebElement(), ...offsetArgs);
|
|
210
|
-
for (const modifierKey of modifierKeys) {
|
|
211
|
-
actions = actions.keyDown(modifierKey);
|
|
212
|
-
}
|
|
213
|
-
actions = actions.click(button);
|
|
214
|
-
for (const modifierKey of modifierKeys) {
|
|
215
|
-
actions = actions.keyUp(modifierKey);
|
|
216
|
-
}
|
|
217
|
-
await actions.perform();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Dispatches an event with a particular name and data to an element.
|
|
222
|
-
* Note that this needs to be a pure function, because it gets stringified by
|
|
223
|
-
* Protractor and is executed inside the browser.
|
|
224
|
-
*/
|
|
225
|
-
function _dispatchEvent(name, element, data) {
|
|
226
|
-
const event = document.createEvent('Event');
|
|
227
|
-
event.initEvent(name);
|
|
228
|
-
if (data) {
|
|
229
|
-
// tslint:disable-next-line:ban Have to use `Object.assign` to preserve the original object.
|
|
230
|
-
Object.assign(event, data);
|
|
231
|
-
}
|
|
232
|
-
// This type has a string index signature, so we cannot access it using a dotted property access.
|
|
233
|
-
element['dispatchEvent'](event);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* @license
|
|
238
|
-
* Copyright Google LLC All Rights Reserved.
|
|
239
|
-
*
|
|
240
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
241
|
-
* found in the LICENSE file at https://angular.io/license
|
|
242
|
-
*/
|
|
243
|
-
/** The default environment options. */
|
|
244
|
-
const defaultEnvironmentOptions = {
|
|
245
|
-
queryFn: (selector, root) => root.all(by.css(selector)),
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* A `HarnessEnvironment` implementation for Protractor.
|
|
249
|
-
* @deprecated As of v13.0.0, this environment no longer works, as it is not
|
|
250
|
-
* compatible with the new [Angular Package Format](https://angular.io/guide/angular-package-format).
|
|
251
|
-
* @breaking-change 13.0.0
|
|
252
|
-
*/
|
|
253
|
-
class ProtractorHarnessEnvironment extends HarnessEnvironment {
|
|
254
|
-
constructor(rawRootElement, options) {
|
|
255
|
-
super(rawRootElement);
|
|
256
|
-
this._options = { ...defaultEnvironmentOptions, ...options };
|
|
257
|
-
}
|
|
258
|
-
/** Creates a `HarnessLoader` rooted at the document root. */
|
|
259
|
-
static loader(options) {
|
|
260
|
-
return new ProtractorHarnessEnvironment(element(by.css('body')), options);
|
|
261
|
-
}
|
|
262
|
-
/** Gets the ElementFinder corresponding to the given TestElement. */
|
|
263
|
-
static getNativeElement(el) {
|
|
264
|
-
if (el instanceof ProtractorElement) {
|
|
265
|
-
return el.element;
|
|
266
|
-
}
|
|
267
|
-
throw Error('This TestElement was not created by the ProtractorHarnessEnvironment');
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Flushes change detection and async tasks captured in the Angular zone.
|
|
271
|
-
* In most cases it should not be necessary to call this manually. However, there may be some edge
|
|
272
|
-
* cases where it is needed to fully flush animation events.
|
|
273
|
-
*/
|
|
274
|
-
async forceStabilize() { }
|
|
275
|
-
/** @docs-private */
|
|
276
|
-
async waitForTasksOutsideAngular() {
|
|
277
|
-
// TODO: figure out how we can do this for the protractor environment.
|
|
278
|
-
// https://github.com/angular/components/issues/17412
|
|
279
|
-
}
|
|
280
|
-
/** Gets the root element for the document. */
|
|
281
|
-
getDocumentRoot() {
|
|
282
|
-
return element(by.css('body'));
|
|
283
|
-
}
|
|
284
|
-
/** Creates a `TestElement` from a raw element. */
|
|
285
|
-
createTestElement(element) {
|
|
286
|
-
return new ProtractorElement(element);
|
|
287
|
-
}
|
|
288
|
-
/** Creates a `HarnessLoader` rooted at the given raw element. */
|
|
289
|
-
createEnvironment(element) {
|
|
290
|
-
return new ProtractorHarnessEnvironment(element, this._options);
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Gets a list of all elements matching the given selector under this environment's root element.
|
|
294
|
-
*/
|
|
295
|
-
async getAllRawElements(selector) {
|
|
296
|
-
const elementArrayFinder = this._options.queryFn(selector, this.rawRootElement);
|
|
297
|
-
const length = await elementArrayFinder.count();
|
|
298
|
-
const elements = [];
|
|
299
|
-
for (let i = 0; i < length; i++) {
|
|
300
|
-
elements.push(elementArrayFinder.get(i));
|
|
301
|
-
}
|
|
302
|
-
return elements;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* @license
|
|
308
|
-
* Copyright Google LLC All Rights Reserved.
|
|
309
|
-
*
|
|
310
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
311
|
-
* found in the LICENSE file at https://angular.io/license
|
|
312
|
-
*/
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* @license
|
|
316
|
-
* Copyright Google LLC All Rights Reserved.
|
|
317
|
-
*
|
|
318
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
319
|
-
* found in the LICENSE file at https://angular.io/license
|
|
320
|
-
*/
|
|
321
|
-
|
|
322
|
-
export { ProtractorElement, ProtractorHarnessEnvironment };
|
|
323
|
-
//# sourceMappingURL=protractor.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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/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;;IAGD,OAAO,gBAAgB,CAAC,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,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@angular/cdk/testing/protractor",
|
|
3
|
-
"fesm2020": "../../fesm2020/testing/protractor.mjs",
|
|
4
|
-
"fesm2015": "../../fesm2015/testing/protractor.mjs",
|
|
5
|
-
"esm2020": "../../esm2020/testing/protractor/index.mjs",
|
|
6
|
-
"typings": "./index.d.ts",
|
|
7
|
-
"module": "../../fesm2015/testing/protractor.mjs",
|
|
8
|
-
"es2020": "../../fesm2020/testing/protractor.mjs"
|
|
9
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { ElementDimensions, ModifierKeys, TestElement, TestKey, TextOptions, EventData } from '@angular/cdk/testing';
|
|
9
|
-
import { ElementFinder } from 'protractor';
|
|
10
|
-
/**
|
|
11
|
-
* A `TestElement` implementation for Protractor.
|
|
12
|
-
* @deprecated
|
|
13
|
-
* @breaking-change 13.0.0
|
|
14
|
-
*/
|
|
15
|
-
export declare class ProtractorElement implements TestElement {
|
|
16
|
-
readonly element: ElementFinder;
|
|
17
|
-
constructor(element: ElementFinder);
|
|
18
|
-
/** Blur the element. */
|
|
19
|
-
blur(): Promise<void>;
|
|
20
|
-
/** Clear the element's input (for input and textarea elements only). */
|
|
21
|
-
clear(): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Click the element at the default location for the current environment. If you need to guarantee
|
|
24
|
-
* the element is clicked at a specific location, consider using `click('center')` or
|
|
25
|
-
* `click(x, y)` instead.
|
|
26
|
-
*/
|
|
27
|
-
click(modifiers?: ModifierKeys): Promise<void>;
|
|
28
|
-
/** Click the element at the element's center. */
|
|
29
|
-
click(location: 'center', modifiers?: ModifierKeys): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Click the element at the specified coordinates relative to the top-left of the element.
|
|
32
|
-
* @param relativeX Coordinate within the element, along the X-axis at which to click.
|
|
33
|
-
* @param relativeY Coordinate within the element, along the Y-axis at which to click.
|
|
34
|
-
* @param modifiers Modifier keys held while clicking
|
|
35
|
-
*/
|
|
36
|
-
click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Right clicks on the element at the specified coordinates relative to the top-left of it.
|
|
39
|
-
* @param relativeX Coordinate within the element, along the X-axis at which to click.
|
|
40
|
-
* @param relativeY Coordinate within the element, along the Y-axis at which to click.
|
|
41
|
-
* @param modifiers Modifier keys held while clicking
|
|
42
|
-
*/
|
|
43
|
-
rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
|
|
44
|
-
/** Focus the element. */
|
|
45
|
-
focus(): Promise<void>;
|
|
46
|
-
/** Get the computed value of the given CSS property for the element. */
|
|
47
|
-
getCssValue(property: string): Promise<string>;
|
|
48
|
-
/** Hovers the mouse over the element. */
|
|
49
|
-
hover(): Promise<void>;
|
|
50
|
-
/** Moves the mouse away from the element. */
|
|
51
|
-
mouseAway(): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Sends the given string to the input as a series of key presses. Also fires input events
|
|
54
|
-
* and attempts to add the string to the Element's value.
|
|
55
|
-
*/
|
|
56
|
-
sendKeys(...keys: (string | TestKey)[]): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Sends the given string to the input as a series of key presses. Also fires input events
|
|
59
|
-
* and attempts to add the string to the Element's value.
|
|
60
|
-
*/
|
|
61
|
-
sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Gets the text from the element.
|
|
64
|
-
* @param options Options that affect what text is included.
|
|
65
|
-
*/
|
|
66
|
-
text(options?: TextOptions): Promise<string>;
|
|
67
|
-
/** Gets the value for the given attribute from the element. */
|
|
68
|
-
getAttribute(name: string): Promise<string | null>;
|
|
69
|
-
/** Checks whether the element has the given class. */
|
|
70
|
-
hasClass(name: string): Promise<boolean>;
|
|
71
|
-
/** Gets the dimensions of the element. */
|
|
72
|
-
getDimensions(): Promise<ElementDimensions>;
|
|
73
|
-
/** Gets the value of a property of an element. */
|
|
74
|
-
getProperty<T = any>(name: string): Promise<T>;
|
|
75
|
-
/** Sets the value of a property of an input. */
|
|
76
|
-
setInputValue(value: string): Promise<void>;
|
|
77
|
-
/** Selects the options at the specified indexes inside of a native `select` element. */
|
|
78
|
-
selectOptions(...optionIndexes: number[]): Promise<void>;
|
|
79
|
-
/** Checks whether this element matches the given selector. */
|
|
80
|
-
matchesSelector(selector: string): Promise<boolean>;
|
|
81
|
-
/** Checks whether the element is focused. */
|
|
82
|
-
isFocused(): Promise<boolean>;
|
|
83
|
-
/**
|
|
84
|
-
* Dispatches an event with a particular name.
|
|
85
|
-
* @param name Name of the event to be dispatched.
|
|
86
|
-
*/
|
|
87
|
-
dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void>;
|
|
88
|
-
/** Dispatches all the events that are part of a click event sequence. */
|
|
89
|
-
private _dispatchClickEventSequence;
|
|
90
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { HarnessEnvironment, HarnessLoader, TestElement } from '@angular/cdk/testing';
|
|
9
|
-
import { ElementArrayFinder, ElementFinder } from 'protractor';
|
|
10
|
-
/**
|
|
11
|
-
* Options to configure the environment.
|
|
12
|
-
* @deprecated
|
|
13
|
-
* @breaking-change 13.0.0
|
|
14
|
-
*/
|
|
15
|
-
export interface ProtractorHarnessEnvironmentOptions {
|
|
16
|
-
/** The query function used to find DOM elements. */
|
|
17
|
-
queryFn: (selector: string, root: ElementFinder) => ElementArrayFinder;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* A `HarnessEnvironment` implementation for Protractor.
|
|
21
|
-
* @deprecated As of v13.0.0, this environment no longer works, as it is not
|
|
22
|
-
* compatible with the new [Angular Package Format](https://angular.io/guide/angular-package-format).
|
|
23
|
-
* @breaking-change 13.0.0
|
|
24
|
-
*/
|
|
25
|
-
export declare class ProtractorHarnessEnvironment extends HarnessEnvironment<ElementFinder> {
|
|
26
|
-
/** The options for this environment. */
|
|
27
|
-
private _options;
|
|
28
|
-
protected constructor(rawRootElement: ElementFinder, options?: ProtractorHarnessEnvironmentOptions);
|
|
29
|
-
/** Creates a `HarnessLoader` rooted at the document root. */
|
|
30
|
-
static loader(options?: ProtractorHarnessEnvironmentOptions): HarnessLoader;
|
|
31
|
-
/** Gets the ElementFinder corresponding to the given TestElement. */
|
|
32
|
-
static getNativeElement(el: TestElement): ElementFinder;
|
|
33
|
-
/**
|
|
34
|
-
* Flushes change detection and async tasks captured in the Angular zone.
|
|
35
|
-
* In most cases it should not be necessary to call this manually. However, there may be some edge
|
|
36
|
-
* cases where it is needed to fully flush animation events.
|
|
37
|
-
*/
|
|
38
|
-
forceStabilize(): Promise<void>;
|
|
39
|
-
/** @docs-private */
|
|
40
|
-
waitForTasksOutsideAngular(): Promise<void>;
|
|
41
|
-
/** Gets the root element for the document. */
|
|
42
|
-
protected getDocumentRoot(): ElementFinder;
|
|
43
|
-
/** Creates a `TestElement` from a raw element. */
|
|
44
|
-
protected createTestElement(element: ElementFinder): TestElement;
|
|
45
|
-
/** Creates a `HarnessLoader` rooted at the given raw element. */
|
|
46
|
-
protected createEnvironment(element: ElementFinder): HarnessEnvironment<ElementFinder>;
|
|
47
|
-
/**
|
|
48
|
-
* Gets a list of all elements matching the given selector under this environment's root element.
|
|
49
|
-
*/
|
|
50
|
-
protected getAllRawElements(selector: string): Promise<ElementFinder[]>;
|
|
51
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
export * from './protractor-element';
|
|
9
|
-
export * from './protractor-harness-environment';
|