@dugararchit/cdk 0.0.0-dugararchit
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/_index.scss +8 -0
- package/a11y/_index.import.scss +2 -0
- package/a11y/_index.scss +102 -0
- package/a11y/a11y-prebuilt.scss +3 -0
- package/fesm2022/stagefright5-cdk-a11y.mjs +2381 -0
- package/fesm2022/stagefright5-cdk-a11y.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-accordion.mjs +267 -0
- package/fesm2022/stagefright5-cdk-accordion.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-bidi.mjs +185 -0
- package/fesm2022/stagefright5-cdk-bidi.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-clipboard.mjs +250 -0
- package/fesm2022/stagefright5-cdk-clipboard.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-coercion.mjs +128 -0
- package/fesm2022/stagefright5-cdk-coercion.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-collections.mjs +472 -0
- package/fesm2022/stagefright5-cdk-collections.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-drag-drop.mjs +3690 -0
- package/fesm2022/stagefright5-cdk-drag-drop.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-keycodes.mjs +159 -0
- package/fesm2022/stagefright5-cdk-keycodes.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-layout.mjs +246 -0
- package/fesm2022/stagefright5-cdk-layout.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-observers.mjs +203 -0
- package/fesm2022/stagefright5-cdk-observers.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-overlay.mjs +3033 -0
- package/fesm2022/stagefright5-cdk-overlay.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-platform.mjs +375 -0
- package/fesm2022/stagefright5-cdk-platform.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-portal.mjs +672 -0
- package/fesm2022/stagefright5-cdk-portal.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-scrolling.mjs +1399 -0
- package/fesm2022/stagefright5-cdk-scrolling.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-stepper.mjs +624 -0
- package/fesm2022/stagefright5-cdk-stepper.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-table.mjs +2346 -0
- package/fesm2022/stagefright5-cdk-table.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-testing-protractor.mjs +324 -0
- package/fesm2022/stagefright5-cdk-testing-protractor.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs +364 -0
- package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-testing-testbed.mjs +806 -0
- package/fesm2022/stagefright5-cdk-testing-testbed.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-testing.mjs +740 -0
- package/fesm2022/stagefright5-cdk-testing.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-text-field.mjs +453 -0
- package/fesm2022/stagefright5-cdk-text-field.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk-tree.mjs +945 -0
- package/fesm2022/stagefright5-cdk-tree.mjs.map +1 -0
- package/fesm2022/stagefright5-cdk.mjs +26 -0
- package/fesm2022/stagefright5-cdk.mjs.map +1 -0
- package/overlay/_index-deprecated.scss +13 -0
- package/overlay/_index.import.scss +13 -0
- package/overlay/_index.scss +148 -0
- package/overlay/overlay-prebuilt.scss +3 -0
- package/package.json +159 -0
- package/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
- package/schematics/schematics/BUILD.bazel +104 -0
- package/schematics/schematics/README.md +4 -0
- package/schematics/schematics/collection.json +18 -0
- package/schematics/schematics/index.ts +22 -0
- package/schematics/schematics/migration.json +50 -0
- package/schematics/schematics/ng-add/index.spec.ts +50 -0
- package/schematics/schematics/ng-add/index.ts +39 -0
- package/schematics/schematics/ng-add/package-config.ts +62 -0
- package/schematics/schematics/ng-add/schema.json +16 -0
- package/schematics/schematics/ng-add/schema.ts +12 -0
- package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +53 -0
- package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +17 -0
- package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +29 -0
- package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +43 -0
- package/schematics/schematics/ng-generate/drag-drop/index.spec.ts +205 -0
- package/schematics/schematics/ng-generate/drag-drop/index.ts +35 -0
- package/schematics/schematics/ng-generate/drag-drop/schema.json +93 -0
- package/schematics/schematics/ng-generate/drag-drop/schema.ts +11 -0
- package/schematics/schematics/ng-update/data/attribute-selectors.ts +29 -0
- package/schematics/schematics/ng-update/data/class-names.ts +50 -0
- package/schematics/schematics/ng-update/data/constructor-checks.ts +75 -0
- package/schematics/schematics/ng-update/data/css-selectors.ts +33 -0
- package/schematics/schematics/ng-update/data/element-selectors.ts +21 -0
- package/schematics/schematics/ng-update/data/index.ts +18 -0
- package/schematics/schematics/ng-update/data/input-names.ts +118 -0
- package/schematics/schematics/ng-update/data/method-call-checks.ts +63 -0
- package/schematics/schematics/ng-update/data/output-names.ts +42 -0
- package/schematics/schematics/ng-update/data/property-names.ts +151 -0
- package/schematics/schematics/ng-update/data/symbol-removal.ts +22 -0
- package/schematics/schematics/ng-update/devkit-file-system.ts +87 -0
- package/schematics/schematics/ng-update/devkit-migration-rule.ts +185 -0
- package/schematics/schematics/ng-update/devkit-migration.ts +47 -0
- package/schematics/schematics/ng-update/find-stylesheets.ts +43 -0
- package/schematics/schematics/ng-update/html-parsing/angular.ts +49 -0
- package/schematics/schematics/ng-update/html-parsing/elements.ts +66 -0
- package/schematics/schematics/ng-update/index.ts +113 -0
- package/schematics/schematics/ng-update/migrations/attribute-selectors.ts +83 -0
- package/schematics/schematics/ng-update/migrations/class-inheritance.ts +63 -0
- package/schematics/schematics/ng-update/migrations/class-names.ts +107 -0
- package/schematics/schematics/ng-update/migrations/constructor-signature.ts +170 -0
- package/schematics/schematics/ng-update/migrations/css-selectors.ts +83 -0
- package/schematics/schematics/ng-update/migrations/element-selectors.ts +75 -0
- package/schematics/schematics/ng-update/migrations/input-names.ts +83 -0
- package/schematics/schematics/ng-update/migrations/method-call-arguments.ts +70 -0
- package/schematics/schematics/ng-update/migrations/misc-template.ts +36 -0
- package/schematics/schematics/ng-update/migrations/output-names.ts +61 -0
- package/schematics/schematics/ng-update/migrations/property-names.ts +61 -0
- package/schematics/schematics/ng-update/migrations/symbol-removal.ts +51 -0
- package/schematics/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.ts +40 -0
- package/schematics/schematics/ng-update/public-api.ts +18 -0
- package/schematics/schematics/ng-update/test-cases/index.spec.ts +18 -0
- package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution.spec.ts +32 -0
- package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution_input.ts +22 -0
- package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
- package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets.spec.ts +50 -0
- package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets_input.ts +8 -0
- package/schematics/schematics/ng-update/test-cases/misc/method-call-checks.spec.ts +20 -0
- package/schematics/schematics/ng-update/test-cases/misc/method-call-checks_input.ts +18 -0
- package/schematics/schematics/ng-update/test-cases/misc/module-resolution.spec.ts +27 -0
- package/schematics/schematics/ng-update/test-cases/v13/misc/tilde-import-v13.spec.ts +149 -0
- package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_expected_output.ts +36 -0
- package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_input.ts +36 -0
- package/schematics/schematics/ng-update/test-cases/v6/class-names_expected_output.ts +8 -0
- package/schematics/schematics/ng-update/test-cases/v6/class-names_input.ts +8 -0
- package/schematics/schematics/ng-update/test-cases/v6/input-names_expected_output.ts +22 -0
- package/schematics/schematics/ng-update/test-cases/v6/input-names_input.ts +22 -0
- package/schematics/schematics/ng-update/test-cases/v6/property-names_expected_output.ts +64 -0
- package/schematics/schematics/ng-update/test-cases/v6/property-names_input.ts +64 -0
- package/schematics/schematics/ng-update/test-cases/v7/property-names_expected_output.ts +28 -0
- package/schematics/schematics/ng-update/test-cases/v7/property-names_input.ts +28 -0
- package/schematics/schematics/ng-update/typescript/base-types.ts +22 -0
- package/schematics/schematics/ng-update/typescript/imports.ts +54 -0
- package/schematics/schematics/ng-update/typescript/literal.ts +32 -0
- package/schematics/schematics/ng-update/typescript/module-specifiers.ts +39 -0
- package/schematics/schematics/ng-update/update-schematic.md +209 -0
- package/schematics/schematics/ng-update/upgrade-data.ts +79 -0
- package/schematics/schematics/paths.ts +15 -0
- package/schematics/schematics/testing/BUILD.bazel +27 -0
- package/schematics/schematics/testing/file-content.ts +20 -0
- package/schematics/schematics/testing/index.ts +14 -0
- package/schematics/schematics/testing/post-scheduled-tasks.ts +45 -0
- package/schematics/schematics/testing/resolve-bazel-path.ts +46 -0
- package/schematics/schematics/testing/test-app.ts +21 -0
- package/schematics/schematics/testing/test-case-setup.ts +236 -0
- package/schematics/schematics/testing/test-library.ts +21 -0
- package/schematics/schematics/testing/test-project.ts +40 -0
- package/schematics/schematics/testing/tsconfig.json +7 -0
- package/schematics/schematics/tsconfig.json +28 -0
- package/schematics/schematics/update-tool/BUILD.bazel +19 -0
- package/schematics/schematics/update-tool/component-resource-collector.ts +195 -0
- package/schematics/schematics/update-tool/file-system.ts +78 -0
- package/schematics/schematics/update-tool/index.ts +191 -0
- package/schematics/schematics/update-tool/logger.ts +23 -0
- package/schematics/schematics/update-tool/migration.ts +88 -0
- package/schematics/schematics/update-tool/public-api.ts +16 -0
- package/schematics/schematics/update-tool/target-version.ts +31 -0
- package/schematics/schematics/update-tool/tsconfig.json +7 -0
- package/schematics/schematics/update-tool/update-recorder.ts +14 -0
- package/schematics/schematics/update-tool/utils/decorators.ts +54 -0
- package/schematics/schematics/update-tool/utils/functions.ts +18 -0
- package/schematics/schematics/update-tool/utils/imports.ts +128 -0
- package/schematics/schematics/update-tool/utils/line-mappings.ts +84 -0
- package/schematics/schematics/update-tool/utils/parse-tsconfig.ts +25 -0
- package/schematics/schematics/update-tool/utils/property-name.ts +28 -0
- package/schematics/schematics/update-tool/utils/virtual-host.ts +116 -0
- package/schematics/schematics/update-tool/version-changes.ts +49 -0
- package/schematics/schematics/utils/ast/ng-module-imports.spec.ts +43 -0
- package/schematics/schematics/utils/ast/ng-module-imports.ts +102 -0
- package/schematics/schematics/utils/ast.ts +88 -0
- package/schematics/schematics/utils/build-component.ts +252 -0
- package/schematics/schematics/utils/get-project.ts +27 -0
- package/schematics/schematics/utils/html-manipulation.ts +105 -0
- package/schematics/schematics/utils/index.ts +19 -0
- package/schematics/schematics/utils/parse5-element.ts +34 -0
- package/schematics/schematics/utils/project-index-file.ts +21 -0
- package/schematics/schematics/utils/project-main-file.ts +26 -0
- package/schematics/schematics/utils/project-style-file.ts +53 -0
- package/schematics/schematics/utils/project-targets.ts +43 -0
- package/schematics/schematics/utils/project-tsconfig-paths.spec.ts +91 -0
- package/schematics/schematics/utils/project-tsconfig-paths.ts +49 -0
- package/schematics/schematics/utils/schematic-options.ts +65 -0
- package/schematics/schematics/utils/vendored-ast-utils/index.ts +599 -0
- package/scrolling/virtual-scroll-viewport.scss +87 -0
- package/table/table.scss +3 -0
- package/text-field/_index.import.scss +2 -0
- package/text-field/_index.scss +89 -0
- package/text-field/text-field-prebuilt.scss +4 -0
- package/types/stagefright5-cdk-a11y.d.ts +1160 -0
- package/types/stagefright5-cdk-accordion.d.ts +95 -0
- package/types/stagefright5-cdk-bidi.d.ts +95 -0
- package/types/stagefright5-cdk-clipboard.d.ts +116 -0
- package/types/stagefright5-cdk-coercion.d.ts +101 -0
- package/types/stagefright5-cdk-collections.d.ts +405 -0
- package/types/stagefright5-cdk-drag-drop.d.ts +1471 -0
- package/types/stagefright5-cdk-keycodes.d.ts +142 -0
- package/types/stagefright5-cdk-layout.d.ts +96 -0
- package/types/stagefright5-cdk-observers.d.ts +91 -0
- package/types/stagefright5-cdk-overlay.d.ts +1258 -0
- package/types/stagefright5-cdk-platform.d.ts +130 -0
- package/types/stagefright5-cdk-portal.d.ts +327 -0
- package/types/stagefright5-cdk-scrolling.d.ts +631 -0
- package/types/stagefright5-cdk-stepper.d.ts +302 -0
- package/types/stagefright5-cdk-table.d.ts +1128 -0
- package/types/stagefright5-cdk-testing-protractor.d.ts +146 -0
- package/types/stagefright5-cdk-testing-selenium-webdriver.d.ts +161 -0
- package/types/stagefright5-cdk-testing-testbed.d.ts +168 -0
- package/types/stagefright5-cdk-testing.d.ts +735 -0
- package/types/stagefright5-cdk-text-field.d.ts +171 -0
- package/types/stagefright5-cdk-tree.d.ts +522 -0
- package/types/stagefright5-cdk.d.ts +14 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { TestElement, ModifierKeys, TestKey, TextOptions, ElementDimensions, EventData, HarnessEnvironment, HarnessLoader } from '@dugararchit/cdk/testing';
|
|
2
|
+
import { ElementFinder, ElementArrayFinder } 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
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A `TestElement` implementation for Protractor.
|
|
14
|
+
* @deprecated
|
|
15
|
+
* @breaking-change 13.0.0
|
|
16
|
+
*/
|
|
17
|
+
declare class ProtractorElement implements TestElement {
|
|
18
|
+
readonly element: ElementFinder;
|
|
19
|
+
constructor(element: ElementFinder);
|
|
20
|
+
/** Blur the element. */
|
|
21
|
+
blur(): Promise<void>;
|
|
22
|
+
/** Clear the element's input (for input and textarea elements only). */
|
|
23
|
+
clear(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Click the element at the default location for the current environment. If you need to guarantee
|
|
26
|
+
* the element is clicked at a specific location, consider using `click('center')` or
|
|
27
|
+
* `click(x, y)` instead.
|
|
28
|
+
*/
|
|
29
|
+
click(modifiers?: ModifierKeys): Promise<void>;
|
|
30
|
+
/** Click the element at the element's center. */
|
|
31
|
+
click(location: 'center', modifiers?: ModifierKeys): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Click the element at the specified coordinates relative to the top-left of the element.
|
|
34
|
+
* @param relativeX Coordinate within the element, along the X-axis at which to click.
|
|
35
|
+
* @param relativeY Coordinate within the element, along the Y-axis at which to click.
|
|
36
|
+
* @param modifiers Modifier keys held while clicking
|
|
37
|
+
*/
|
|
38
|
+
click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Right clicks on the element at the specified coordinates relative to the top-left of it.
|
|
41
|
+
* @param relativeX Coordinate within the element, along the X-axis at which to click.
|
|
42
|
+
* @param relativeY Coordinate within the element, along the Y-axis at which to click.
|
|
43
|
+
* @param modifiers Modifier keys held while clicking
|
|
44
|
+
*/
|
|
45
|
+
rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
|
|
46
|
+
/** Focus the element. */
|
|
47
|
+
focus(): Promise<void>;
|
|
48
|
+
/** Get the computed value of the given CSS property for the element. */
|
|
49
|
+
getCssValue(property: string): Promise<string>;
|
|
50
|
+
/** Hovers the mouse over the element. */
|
|
51
|
+
hover(): Promise<void>;
|
|
52
|
+
/** Moves the mouse away from the element. */
|
|
53
|
+
mouseAway(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Sends the given string to the input as a series of key presses. Also fires input events
|
|
56
|
+
* and attempts to add the string to the Element's value.
|
|
57
|
+
*/
|
|
58
|
+
sendKeys(...keys: (string | TestKey)[]): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Sends the given string to the input as a series of key presses. Also fires input events
|
|
61
|
+
* and attempts to add the string to the Element's value.
|
|
62
|
+
*/
|
|
63
|
+
sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Gets the text from the element.
|
|
66
|
+
* @param options Options that affect what text is included.
|
|
67
|
+
*/
|
|
68
|
+
text(options?: TextOptions): Promise<string>;
|
|
69
|
+
/** Gets the value for the given attribute from the element. */
|
|
70
|
+
getAttribute(name: string): Promise<string | null>;
|
|
71
|
+
/** Checks whether the element has the given class. */
|
|
72
|
+
hasClass(name: string): Promise<boolean>;
|
|
73
|
+
/** Gets the dimensions of the element. */
|
|
74
|
+
getDimensions(): Promise<ElementDimensions>;
|
|
75
|
+
/** Gets the value of a property of an element. */
|
|
76
|
+
getProperty<T = any>(name: string): Promise<T>;
|
|
77
|
+
/** Sets the value of a property of an input. */
|
|
78
|
+
setInputValue(value: string): Promise<void>;
|
|
79
|
+
/** Selects the options at the specified indexes inside of a native `select` element. */
|
|
80
|
+
selectOptions(...optionIndexes: number[]): Promise<void>;
|
|
81
|
+
/** Checks whether this element matches the given selector. */
|
|
82
|
+
matchesSelector(selector: string): Promise<boolean>;
|
|
83
|
+
/** Checks whether the element is focused. */
|
|
84
|
+
isFocused(): Promise<boolean>;
|
|
85
|
+
/**
|
|
86
|
+
* Dispatches an event with a particular name.
|
|
87
|
+
* @param name Name of the event to be dispatched.
|
|
88
|
+
*/
|
|
89
|
+
dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void>;
|
|
90
|
+
/** Dispatches all the events that are part of a click event sequence. */
|
|
91
|
+
private _dispatchClickEventSequence;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @license
|
|
96
|
+
* Copyright Google LLC All Rights Reserved.
|
|
97
|
+
*
|
|
98
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
99
|
+
* found in the LICENSE file at https://angular.io/license
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Options to configure the environment.
|
|
104
|
+
* @deprecated
|
|
105
|
+
* @breaking-change 13.0.0
|
|
106
|
+
*/
|
|
107
|
+
interface ProtractorHarnessEnvironmentOptions {
|
|
108
|
+
/** The query function used to find DOM elements. */
|
|
109
|
+
queryFn: (selector: string, root: ElementFinder) => ElementArrayFinder;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A `HarnessEnvironment` implementation for Protractor.
|
|
113
|
+
* @deprecated As of v13.0.0, this environment no longer works, as it is not
|
|
114
|
+
* compatible with the new [Angular Package Format](https://angular.io/guide/angular-package-format).
|
|
115
|
+
* @breaking-change 13.0.0
|
|
116
|
+
*/
|
|
117
|
+
declare class ProtractorHarnessEnvironment extends HarnessEnvironment<ElementFinder> {
|
|
118
|
+
/** The options for this environment. */
|
|
119
|
+
private _options;
|
|
120
|
+
protected constructor(rawRootElement: ElementFinder, options?: ProtractorHarnessEnvironmentOptions);
|
|
121
|
+
/** Creates a `HarnessLoader` rooted at the document root. */
|
|
122
|
+
static loader(options?: ProtractorHarnessEnvironmentOptions): HarnessLoader;
|
|
123
|
+
/** Gets the ElementFinder corresponding to the given TestElement. */
|
|
124
|
+
static getNativeElement(el: TestElement): ElementFinder;
|
|
125
|
+
/**
|
|
126
|
+
* Flushes change detection and async tasks captured in the Angular zone.
|
|
127
|
+
* In most cases it should not be necessary to call this manually. However, there may be some edge
|
|
128
|
+
* cases where it is needed to fully flush animation events.
|
|
129
|
+
*/
|
|
130
|
+
forceStabilize(): Promise<void>;
|
|
131
|
+
/** @docs-private */
|
|
132
|
+
waitForTasksOutsideAngular(): Promise<void>;
|
|
133
|
+
/** Gets the root element for the document. */
|
|
134
|
+
protected getDocumentRoot(): ElementFinder;
|
|
135
|
+
/** Creates a `TestElement` from a raw element. */
|
|
136
|
+
protected createTestElement(element: ElementFinder): TestElement;
|
|
137
|
+
/** Creates a `HarnessLoader` rooted at the given raw element. */
|
|
138
|
+
protected createEnvironment(element: ElementFinder): HarnessEnvironment<ElementFinder>;
|
|
139
|
+
/**
|
|
140
|
+
* Gets a list of all elements matching the given selector under this environment's root element.
|
|
141
|
+
*/
|
|
142
|
+
protected getAllRawElements(selector: string): Promise<ElementFinder[]>;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { ProtractorElement, ProtractorHarnessEnvironment };
|
|
146
|
+
export type { ProtractorHarnessEnvironmentOptions };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { TestElement, ModifierKeys, TestKey, TextOptions, ElementDimensions, EventData, HarnessEnvironment, HarnessLoader } from '@dugararchit/cdk/testing';
|
|
2
|
+
import * as webdriver from 'selenium-webdriver';
|
|
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
|
+
|
|
12
|
+
/** A `TestElement` implementation for WebDriver. */
|
|
13
|
+
declare class SeleniumWebDriverElement implements TestElement {
|
|
14
|
+
readonly element: () => webdriver.WebElement;
|
|
15
|
+
private _stabilize;
|
|
16
|
+
constructor(element: () => webdriver.WebElement, _stabilize: () => Promise<void>);
|
|
17
|
+
/** Blur the element. */
|
|
18
|
+
blur(): Promise<void>;
|
|
19
|
+
/** Clear the element's input (for input and textarea elements only). */
|
|
20
|
+
clear(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Click the element at the default location for the current environment. If you need to guarantee
|
|
23
|
+
* the element is clicked at a specific location, consider using `click('center')` or
|
|
24
|
+
* `click(x, y)` instead.
|
|
25
|
+
*/
|
|
26
|
+
click(modifiers?: ModifierKeys): Promise<void>;
|
|
27
|
+
/** Click the element at the element's center. */
|
|
28
|
+
click(location: 'center', modifiers?: ModifierKeys): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Click the element at the specified coordinates relative to the top-left of the element.
|
|
31
|
+
* @param relativeX Coordinate within the element, along the X-axis at which to click.
|
|
32
|
+
* @param relativeY Coordinate within the element, along the Y-axis at which to click.
|
|
33
|
+
* @param modifiers Modifier keys held while clicking
|
|
34
|
+
*/
|
|
35
|
+
click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Right clicks on the element at the specified coordinates relative to the top-left of it.
|
|
38
|
+
* @param relativeX Coordinate within the element, along the X-axis at which to click.
|
|
39
|
+
* @param relativeY Coordinate within the element, along the Y-axis at which to click.
|
|
40
|
+
* @param modifiers Modifier keys held while clicking
|
|
41
|
+
*/
|
|
42
|
+
rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
|
|
43
|
+
/** Focus the element. */
|
|
44
|
+
focus(): Promise<void>;
|
|
45
|
+
/** Get the computed value of the given CSS property for the element. */
|
|
46
|
+
getCssValue(property: string): Promise<string>;
|
|
47
|
+
/** Hovers the mouse over the element. */
|
|
48
|
+
hover(): Promise<void>;
|
|
49
|
+
/** Moves the mouse away from the element. */
|
|
50
|
+
mouseAway(): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Sends the given string to the input as a series of key presses. Also fires input events
|
|
53
|
+
* and attempts to add the string to the Element's value.
|
|
54
|
+
*/
|
|
55
|
+
sendKeys(...keys: (string | TestKey)[]): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Sends the given string to the input as a series of key presses. Also fires input events
|
|
58
|
+
* and attempts to add the string to the Element's value.
|
|
59
|
+
*/
|
|
60
|
+
sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Gets the text from the element.
|
|
63
|
+
* @param options Options that affect what text is included.
|
|
64
|
+
*/
|
|
65
|
+
text(options?: TextOptions): Promise<string>;
|
|
66
|
+
/** Gets the value for the given attribute from the element. */
|
|
67
|
+
getAttribute(name: string): Promise<string | null>;
|
|
68
|
+
/** Checks whether the element has the given class. */
|
|
69
|
+
hasClass(name: string): Promise<boolean>;
|
|
70
|
+
/** Gets the dimensions of the element. */
|
|
71
|
+
getDimensions(): Promise<ElementDimensions>;
|
|
72
|
+
/** Gets the value of a property of an element. */
|
|
73
|
+
getProperty<T = any>(name: string): Promise<T>;
|
|
74
|
+
/** Sets the value of a property of an input. */
|
|
75
|
+
setInputValue(newValue: string): Promise<void>;
|
|
76
|
+
/** Selects the options at the specified indexes inside of a native `select` element. */
|
|
77
|
+
selectOptions(...optionIndexes: number[]): Promise<void>;
|
|
78
|
+
/** Checks whether this element matches the given selector. */
|
|
79
|
+
matchesSelector(selector: string): Promise<boolean>;
|
|
80
|
+
/** Checks whether the element is focused. */
|
|
81
|
+
isFocused(): Promise<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Dispatches an event with a particular name.
|
|
84
|
+
* @param name Name of the event to be dispatched.
|
|
85
|
+
*/
|
|
86
|
+
dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void>;
|
|
87
|
+
/** Gets the webdriver action sequence. */
|
|
88
|
+
private _actions;
|
|
89
|
+
/** Executes a function in the browser. */
|
|
90
|
+
private _executeScript;
|
|
91
|
+
/** Dispatches all the events that are part of a click event sequence. */
|
|
92
|
+
private _dispatchClickEventSequence;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @license
|
|
97
|
+
* Copyright Google LLC All Rights Reserved.
|
|
98
|
+
*
|
|
99
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
100
|
+
* found in the LICENSE file at https://angular.io/license
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* An Angular framework stabilizer function that takes a callback and calls it when the application
|
|
105
|
+
* is stable, passing a boolean indicating if any work was done.
|
|
106
|
+
*/
|
|
107
|
+
declare interface FrameworkStabilizer {
|
|
108
|
+
(callback: (didWork: boolean) => void): void;
|
|
109
|
+
}
|
|
110
|
+
declare global {
|
|
111
|
+
interface Window {
|
|
112
|
+
/**
|
|
113
|
+
* These hooks are exposed by Angular to register a callback for when the application is stable
|
|
114
|
+
* (no more pending tasks).
|
|
115
|
+
*
|
|
116
|
+
* For the implementation, see: https://github.com/
|
|
117
|
+
* angular/angular/blob/main/packages/platform-browser/src/browser/testability.ts#L30-L49
|
|
118
|
+
*/
|
|
119
|
+
frameworkStabilizers: FrameworkStabilizer[];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** Options to configure the environment. */
|
|
123
|
+
interface WebDriverHarnessEnvironmentOptions {
|
|
124
|
+
/** The query function used to find DOM elements. */
|
|
125
|
+
queryFn: (selector: string, root: () => webdriver.WebElement) => Promise<webdriver.WebElement[]>;
|
|
126
|
+
}
|
|
127
|
+
/** Waits for angular to be ready after the page load. */
|
|
128
|
+
declare function waitForAngularReady(wd: webdriver.WebDriver): Promise<void>;
|
|
129
|
+
/** A `HarnessEnvironment` implementation for WebDriver. */
|
|
130
|
+
declare class SeleniumWebDriverHarnessEnvironment extends HarnessEnvironment<() => webdriver.WebElement> {
|
|
131
|
+
/** The options for this environment. */
|
|
132
|
+
private _options;
|
|
133
|
+
/** Environment stabilization callback passed to the created test elements. */
|
|
134
|
+
private _stabilizeCallback;
|
|
135
|
+
protected constructor(rawRootElement: () => webdriver.WebElement, options?: WebDriverHarnessEnvironmentOptions);
|
|
136
|
+
/** Gets the ElementFinder corresponding to the given TestElement. */
|
|
137
|
+
static getNativeElement(el: TestElement): webdriver.WebElement;
|
|
138
|
+
/** Creates a `HarnessLoader` rooted at the document root. */
|
|
139
|
+
static loader(driver: webdriver.WebDriver, options?: WebDriverHarnessEnvironmentOptions): HarnessLoader;
|
|
140
|
+
/**
|
|
141
|
+
* Flushes change detection and async tasks captured in the Angular zone.
|
|
142
|
+
* In most cases it should not be necessary to call this manually. However, there may be some edge
|
|
143
|
+
* cases where it is needed to fully flush animation events.
|
|
144
|
+
*/
|
|
145
|
+
forceStabilize(): Promise<void>;
|
|
146
|
+
/** @docs-private */
|
|
147
|
+
waitForTasksOutsideAngular(): Promise<void>;
|
|
148
|
+
/** Gets the root element for the document. */
|
|
149
|
+
protected getDocumentRoot(): () => webdriver.WebElement;
|
|
150
|
+
/** Creates a `TestElement` from a raw element. */
|
|
151
|
+
protected createTestElement(element: () => webdriver.WebElement): TestElement;
|
|
152
|
+
/** Creates a `HarnessLoader` rooted at the given raw element. */
|
|
153
|
+
protected createEnvironment(element: () => webdriver.WebElement): HarnessEnvironment<() => webdriver.WebElement>;
|
|
154
|
+
/**
|
|
155
|
+
* Gets a list of all elements matching the given selector under this environment's root element.
|
|
156
|
+
*/
|
|
157
|
+
protected getAllRawElements(selector: string): Promise<(() => webdriver.WebElement)[]>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export { SeleniumWebDriverElement, SeleniumWebDriverHarnessEnvironment, waitForAngularReady };
|
|
161
|
+
export type { WebDriverHarnessEnvironmentOptions };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { HarnessEnvironment, HarnessLoader, TestElement, ComponentHarness, ComponentHarnessConstructor, ModifierKeys, TestKey, TextOptions, ElementDimensions, EventData } from '@dugararchit/cdk/testing';
|
|
2
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
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
|
+
|
|
12
|
+
/** Options to configure the environment. */
|
|
13
|
+
interface TestbedHarnessEnvironmentOptions {
|
|
14
|
+
/** The query function used to find DOM elements. */
|
|
15
|
+
queryFn: (selector: string, root: Element) => Iterable<Element> | ArrayLike<Element>;
|
|
16
|
+
}
|
|
17
|
+
/** A `HarnessEnvironment` implementation for Angular's Testbed. */
|
|
18
|
+
declare class TestbedHarnessEnvironment extends HarnessEnvironment<Element> {
|
|
19
|
+
private _fixture;
|
|
20
|
+
/** Whether the environment has been destroyed. */
|
|
21
|
+
private _destroyed;
|
|
22
|
+
/** Observable that emits whenever the test task state changes. */
|
|
23
|
+
private _taskState;
|
|
24
|
+
/** The options for this environment. */
|
|
25
|
+
private _options;
|
|
26
|
+
/** Environment stabilization callback passed to the created test elements. */
|
|
27
|
+
private _stabilizeCallback;
|
|
28
|
+
protected constructor(rawRootElement: Element, _fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions);
|
|
29
|
+
/** Creates a `HarnessLoader` rooted at the given fixture's root element. */
|
|
30
|
+
static loader(fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions): HarnessLoader;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a `HarnessLoader` at the document root. This can be used if harnesses are
|
|
33
|
+
* located outside of a fixture (e.g. overlays appended to the document body).
|
|
34
|
+
*/
|
|
35
|
+
static documentRootLoader(fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions): HarnessLoader;
|
|
36
|
+
/** Gets the native DOM element corresponding to the given TestElement. */
|
|
37
|
+
static getNativeElement(el: TestElement): Element;
|
|
38
|
+
/**
|
|
39
|
+
* Creates an instance of the given harness type, using the fixture's root element as the
|
|
40
|
+
* harness's host element. This method should be used when creating a harness for the root element
|
|
41
|
+
* of a fixture, as components do not have the correct selector when they are created as the root
|
|
42
|
+
* of the fixture.
|
|
43
|
+
*/
|
|
44
|
+
static harnessForFixture<T extends ComponentHarness>(fixture: ComponentFixture<unknown>, harnessType: ComponentHarnessConstructor<T>, options?: TestbedHarnessEnvironmentOptions): Promise<T>;
|
|
45
|
+
/**
|
|
46
|
+
* Flushes change detection and async tasks captured in the Angular zone.
|
|
47
|
+
* In most cases it should not be necessary to call this manually. However, there may be some edge
|
|
48
|
+
* cases where it is needed to fully flush animation events.
|
|
49
|
+
*/
|
|
50
|
+
forceStabilize(): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Waits for all scheduled or running async tasks to complete. This allows harness
|
|
53
|
+
* authors to wait for async tasks outside of the Angular zone.
|
|
54
|
+
*/
|
|
55
|
+
waitForTasksOutsideAngular(): Promise<void>;
|
|
56
|
+
/** Gets the root element for the document. */
|
|
57
|
+
protected getDocumentRoot(): Element;
|
|
58
|
+
/** Creates a `TestElement` from a raw element. */
|
|
59
|
+
protected createTestElement(element: Element): TestElement;
|
|
60
|
+
/** Creates a `HarnessLoader` rooted at the given raw element. */
|
|
61
|
+
protected createEnvironment(element: Element): HarnessEnvironment<Element>;
|
|
62
|
+
/**
|
|
63
|
+
* Gets a list of all elements matching the given selector under this environment's root element.
|
|
64
|
+
*/
|
|
65
|
+
protected getAllRawElements(selector: string): Promise<Element[]>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @license
|
|
70
|
+
* Copyright Google LLC All Rights Reserved.
|
|
71
|
+
*
|
|
72
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
73
|
+
* found in the LICENSE file at https://angular.io/license
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/** A `TestElement` implementation for unit tests. */
|
|
77
|
+
declare class UnitTestElement implements TestElement {
|
|
78
|
+
readonly element: Element;
|
|
79
|
+
private _stabilize;
|
|
80
|
+
constructor(element: Element, _stabilize: () => Promise<void>);
|
|
81
|
+
/** Blur the element. */
|
|
82
|
+
blur(): Promise<void>;
|
|
83
|
+
/** Clear the element's input (for input and textarea elements only). */
|
|
84
|
+
clear(): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Click the element at the default location for the current environment. If you need to guarantee
|
|
87
|
+
* the element is clicked at a specific location, consider using `click('center')` or
|
|
88
|
+
* `click(x, y)` instead.
|
|
89
|
+
*/
|
|
90
|
+
click(modifiers?: ModifierKeys): Promise<void>;
|
|
91
|
+
/** Click the element at the element's center. */
|
|
92
|
+
click(location: 'center', modifiers?: ModifierKeys): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Click the element at the specified coordinates relative to the top-left of the element.
|
|
95
|
+
* @param relativeX Coordinate within the element, along the X-axis at which to click.
|
|
96
|
+
* @param relativeY Coordinate within the element, along the Y-axis at which to click.
|
|
97
|
+
* @param modifiers Modifier keys held while clicking
|
|
98
|
+
*/
|
|
99
|
+
click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Right clicks on the element at the specified coordinates relative to the top-left of it.
|
|
102
|
+
* @param relativeX Coordinate within the element, along the X-axis at which to click.
|
|
103
|
+
* @param relativeY Coordinate within the element, along the Y-axis at which to click.
|
|
104
|
+
* @param modifiers Modifier keys held while clicking
|
|
105
|
+
*/
|
|
106
|
+
rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
|
|
107
|
+
/** Focus the element. */
|
|
108
|
+
focus(): Promise<void>;
|
|
109
|
+
/** Get the computed value of the given CSS property for the element. */
|
|
110
|
+
getCssValue(property: string): Promise<string>;
|
|
111
|
+
/** Hovers the mouse over the element. */
|
|
112
|
+
hover(): Promise<void>;
|
|
113
|
+
/** Moves the mouse away from the element. */
|
|
114
|
+
mouseAway(): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Sends the given string to the input as a series of key presses. Also fires input events
|
|
117
|
+
* and attempts to add the string to the Element's value. Note that this cannot
|
|
118
|
+
* reproduce native browser behavior for keyboard shortcuts such as Tab, Ctrl + A, etc.
|
|
119
|
+
*/
|
|
120
|
+
sendKeys(...keys: (string | TestKey)[]): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Sends the given string to the input as a series of key presses. Also fires input events
|
|
123
|
+
* and attempts to add the string to the Element's value.
|
|
124
|
+
*/
|
|
125
|
+
sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* Gets the text from the element.
|
|
128
|
+
* @param options Options that affect what text is included.
|
|
129
|
+
*/
|
|
130
|
+
text(options?: TextOptions): Promise<string>;
|
|
131
|
+
/** Gets the value for the given attribute from the element. */
|
|
132
|
+
getAttribute(name: string): Promise<string | null>;
|
|
133
|
+
/** Checks whether the element has the given class. */
|
|
134
|
+
hasClass(name: string): Promise<boolean>;
|
|
135
|
+
/** Gets the dimensions of the element. */
|
|
136
|
+
getDimensions(): Promise<ElementDimensions>;
|
|
137
|
+
/** Gets the value of a property of an element. */
|
|
138
|
+
getProperty<T = any>(name: string): Promise<T>;
|
|
139
|
+
/** Sets the value of a property of an input. */
|
|
140
|
+
setInputValue(value: string): Promise<void>;
|
|
141
|
+
/** Selects the options at the specified indexes inside of a native `select` element. */
|
|
142
|
+
selectOptions(...optionIndexes: number[]): Promise<void>;
|
|
143
|
+
/** Checks whether this element matches the given selector. */
|
|
144
|
+
matchesSelector(selector: string): Promise<boolean>;
|
|
145
|
+
/** Checks whether the element is focused. */
|
|
146
|
+
isFocused(): Promise<boolean>;
|
|
147
|
+
/**
|
|
148
|
+
* Dispatches an event with a particular name.
|
|
149
|
+
* @param name Name of the event to be dispatched.
|
|
150
|
+
*/
|
|
151
|
+
dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Dispatches a pointer event on the current element if the browser supports it.
|
|
154
|
+
* @param name Name of the pointer event to be dispatched.
|
|
155
|
+
* @param clientX Coordinate of the user's pointer along the X axis.
|
|
156
|
+
* @param clientY Coordinate of the user's pointer along the Y axis.
|
|
157
|
+
* @param button Mouse button that should be pressed when dispatching the event.
|
|
158
|
+
*/
|
|
159
|
+
private _dispatchPointerEventIfSupported;
|
|
160
|
+
/**
|
|
161
|
+
* Dispatches all the events that are part of a mouse event sequence
|
|
162
|
+
* and then emits a given primary event at the end, if speciifed.
|
|
163
|
+
*/
|
|
164
|
+
private _dispatchMouseEventSequence;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export { TestbedHarnessEnvironment, UnitTestElement };
|
|
168
|
+
export type { TestbedHarnessEnvironmentOptions };
|