@ngneers/controls-playwright 0.0.1-pre1
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/README.md +20 -0
- package/awesome-publish.config.ts +6 -0
- package/dist/components/accordion.d.ts +21 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +42 -0
- package/dist/components/avatar.d.ts +9 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +16 -0
- package/dist/components/breadcrumb.d.ts +20 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +15 -0
- package/dist/components/button-group.d.ts +10 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +16 -0
- package/dist/components/button.d.ts +6 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +6 -0
- package/dist/components/calendar.d.ts +101 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +56 -0
- package/dist/components/chip.d.ts +15 -0
- package/dist/components/chip.d.ts.map +1 -0
- package/dist/components/chip.js +38 -0
- package/dist/components/edit-inplace.d.ts +18 -0
- package/dist/components/edit-inplace.d.ts.map +1 -0
- package/dist/components/edit-inplace.js +29 -0
- package/dist/components/filter.d.ts +186 -0
- package/dist/components/filter.d.ts.map +1 -0
- package/dist/components/filter.js +55 -0
- package/dist/components/hint.d.ts +10 -0
- package/dist/components/hint.d.ts.map +1 -0
- package/dist/components/hint.js +22 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +37 -0
- package/dist/components/inplace.d.ts +12 -0
- package/dist/components/inplace.d.ts.map +1 -0
- package/dist/components/inplace.js +29 -0
- package/dist/components/input-field.d.ts +12 -0
- package/dist/components/input-field.d.ts.map +1 -0
- package/dist/components/input-field.js +11 -0
- package/dist/components/input.d.ts +12 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +25 -0
- package/dist/components/item-view.d.ts +18 -0
- package/dist/components/item-view.d.ts.map +1 -0
- package/dist/components/item-view.js +39 -0
- package/dist/components/list-box.d.ts +20 -0
- package/dist/components/list-box.d.ts.map +1 -0
- package/dist/components/list-box.js +24 -0
- package/dist/components/mask-input.d.ts +62 -0
- package/dist/components/mask-input.d.ts.map +1 -0
- package/dist/components/mask-input.js +109 -0
- package/dist/components/menu.d.ts +16 -0
- package/dist/components/menu.d.ts.map +1 -0
- package/dist/components/menu.js +26 -0
- package/dist/components/message.d.ts +10 -0
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +22 -0
- package/dist/components/popover.d.ts +12 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +33 -0
- package/dist/components/progress.d.ts +17 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +46 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/radio.js +35 -0
- package/dist/components/scroller.d.ts +20 -0
- package/dist/components/scroller.d.ts.map +1 -0
- package/dist/components/scroller.js +58 -0
- package/dist/components/select-button.d.ts +30 -0
- package/dist/components/select-button.d.ts.map +1 -0
- package/dist/components/select-button.js +46 -0
- package/dist/components/select.d.ts +46 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +74 -0
- package/dist/components/slider.d.ts +26 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +73 -0
- package/dist/components/snackbar.d.ts +27 -0
- package/dist/components/snackbar.d.ts.map +1 -0
- package/dist/components/snackbar.js +70 -0
- package/dist/components/spinner.d.ts +11 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +22 -0
- package/dist/components/state.d.ts +31 -0
- package/dist/components/state.d.ts.map +1 -0
- package/dist/components/state.js +31 -0
- package/dist/components/switch.d.ts +12 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +39 -0
- package/dist/components/tabs.d.ts +22 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +42 -0
- package/dist/components/tag.d.ts +10 -0
- package/dist/components/tag.d.ts.map +1 -0
- package/dist/components/tag.js +22 -0
- package/dist/components/toast.d.ts +27 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +68 -0
- package/dist/components/toggle-button.d.ts +10 -0
- package/dist/components/toggle-button.d.ts.map +1 -0
- package/dist/components/toggle-button.js +29 -0
- package/dist/components/tooltip.d.ts +12 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +32 -0
- package/dist/components/tree.d.ts +47 -0
- package/dist/components/tree.d.ts.map +1 -0
- package/dist/components/tree.js +85 -0
- package/dist/components/upload.d.ts +27 -0
- package/dist/components/upload.d.ts.map +1 -0
- package/dist/components/upload.js +47 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/classes.d.ts +119 -0
- package/dist/utils/classes.d.ts.map +1 -0
- package/dist/utils/classes.js +31 -0
- package/dist/utils/theme.d.ts +3 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +41 -0
- package/package.json +38 -0
- package/src/components/accordion.ts +50 -0
- package/src/components/avatar.ts +17 -0
- package/src/components/breadcrumb.ts +17 -0
- package/src/components/button-group.ts +18 -0
- package/src/components/button.ts +5 -0
- package/src/components/calendar.ts +67 -0
- package/src/components/chip.ts +43 -0
- package/src/components/edit-inplace.ts +34 -0
- package/src/components/filter.ts +70 -0
- package/src/components/hint.ts +25 -0
- package/src/components/index.ts +37 -0
- package/src/components/inplace.ts +33 -0
- package/src/components/input-field.ts +16 -0
- package/src/components/input.ts +32 -0
- package/src/components/item-view.ts +48 -0
- package/src/components/list-box.ts +25 -0
- package/src/components/mask-input.ts +119 -0
- package/src/components/menu.ts +29 -0
- package/src/components/message.ts +25 -0
- package/src/components/popover.ts +39 -0
- package/src/components/progress.ts +53 -0
- package/src/components/radio.ts +42 -0
- package/src/components/scroller.ts +68 -0
- package/src/components/select-button.ts +57 -0
- package/src/components/select.ts +81 -0
- package/src/components/slider.ts +84 -0
- package/src/components/snackbar.ts +84 -0
- package/src/components/spinner.ts +27 -0
- package/src/components/state.ts +37 -0
- package/src/components/switch.ts +43 -0
- package/src/components/tabs.ts +50 -0
- package/src/components/tag.ts +25 -0
- package/src/components/toast.ts +82 -0
- package/src/components/toggle-button.ts +33 -0
- package/src/components/tooltip.ts +38 -0
- package/src/components/tree.ts +98 -0
- package/src/components/upload.ts +63 -0
- package/src/index.ts +1 -0
- package/src/utils/classes.ts +32 -0
- package/src/utils/theme.ts +44 -0
- package/tsconfig.lib.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @ngneers/controls-playwright
|
|
2
|
+
|
|
3
|
+
Playwright testing harness for **[@ngneers/controls](https://ngneers.dev)**.
|
|
4
|
+
|
|
5
|
+
Provides page-object–style `Ngn*Harness` helpers that wrap the components' DOM and ARIA
|
|
6
|
+
surface, so you can write readable end-to-end assertions against `@ngneers/controls`
|
|
7
|
+
without hand-rolling locators for every control.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { NgnSelectHarness } from '@ngneers/controls-playwright';
|
|
11
|
+
|
|
12
|
+
const select = new NgnSelectHarness(page.locator('ngn-select'));
|
|
13
|
+
await select.open();
|
|
14
|
+
await select.selectOption('Option 2');
|
|
15
|
+
await select.expectValue('Option 2');
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## License
|
|
19
|
+
|
|
20
|
+
MIT © NGneers
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { defineConfig } from 'awesome-publish';
|
|
2
|
+
import root from '../../awesome-publish.config.ts';
|
|
3
|
+
|
|
4
|
+
// Source package.json is already the publish manifest (main: ./dist/index.js);
|
|
5
|
+
// ship the compiled dist/ folder.
|
|
6
|
+
export default defineConfig({ ...root, publishFiles: ['dist'] });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Locator } from '@playwright/test';
|
|
2
|
+
export declare class NgnAccordionHarness {
|
|
3
|
+
locator: Locator;
|
|
4
|
+
readonly classes: import("@ngneers/controls-themes").ThemeClasses<import("@ngneers/controls-themes").ControlTemplate<"accordion-panel", ["root", "header", "header-disabled", "header-text", "content-expander", "content-expander-collapsed", "content"], readonly []>>;
|
|
5
|
+
readonly panels: Locator;
|
|
6
|
+
constructor(locator: Locator);
|
|
7
|
+
getPanelByIndex(index: number): NgnAccordionPanelHarness;
|
|
8
|
+
expectPanelCount(count: number): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare class NgnAccordionPanelHarness {
|
|
11
|
+
locator: Locator;
|
|
12
|
+
readonly classes: import("@ngneers/controls-themes").ThemeClasses<import("@ngneers/controls-themes").ControlTemplate<"accordion-panel", ["root", "header", "header-disabled", "header-text", "content-expander", "content-expander-collapsed", "content"], readonly []>>;
|
|
13
|
+
readonly header: Locator;
|
|
14
|
+
readonly content: Locator;
|
|
15
|
+
constructor(locator: Locator);
|
|
16
|
+
expectHeaderText(expected: string): Promise<void>;
|
|
17
|
+
expectExpanded(expanded?: boolean): Promise<void>;
|
|
18
|
+
expectDisabled(disabled?: boolean): Promise<void>;
|
|
19
|
+
toggle(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,kBAAkB,CAAC;AAKxD,qBAAa,mBAAmB;IAKX,OAAO,EAAE,OAAO;IAJnC,SAAgB,OAAO,yPAA+C;IAEtE,SAAgB,MAAM,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,OAAO;IAI5B,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,wBAAwB;IAIxD,gBAAgB,CAAC,KAAK,EAAE,MAAM;CAGtC;AAED,qBAAa,wBAAwB;IAMhB,OAAO,EAAE,OAAO;IALnC,SAAgB,OAAO,yPAA+C;IAEtE,SAAgB,MAAM,EAAE,OAAO,CAAC;IAChC,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAEd,OAAO,EAAE,OAAO;IAK5B,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAIjC,cAAc,CAAC,QAAQ,UAAO;IAI9B,cAAc,CAAC,QAAQ,UAAO;IAIxB,MAAM;CAGpB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
import { themeClasses } from '../utils/theme';
|
|
3
|
+
import { accordionControlTemplate } from '@ngneers/controls-themes/templates/accordion';
|
|
4
|
+
import { accordionPanelControlTemplate } from '@ngneers/controls-themes/templates/accordion-panel';
|
|
5
|
+
export class NgnAccordionHarness {
|
|
6
|
+
locator;
|
|
7
|
+
classes = themeClasses(accordionPanelControlTemplate);
|
|
8
|
+
panels;
|
|
9
|
+
constructor(locator) {
|
|
10
|
+
this.locator = locator;
|
|
11
|
+
this.panels = this.locator.locator(this.classes['root']);
|
|
12
|
+
}
|
|
13
|
+
getPanelByIndex(index) {
|
|
14
|
+
return new NgnAccordionPanelHarness(this.panels.nth(index));
|
|
15
|
+
}
|
|
16
|
+
expectPanelCount(count) {
|
|
17
|
+
return expect(this.panels).toHaveCount(count);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class NgnAccordionPanelHarness {
|
|
21
|
+
locator;
|
|
22
|
+
classes = themeClasses(accordionPanelControlTemplate);
|
|
23
|
+
header;
|
|
24
|
+
content;
|
|
25
|
+
constructor(locator) {
|
|
26
|
+
this.locator = locator;
|
|
27
|
+
this.header = this.locator.locator(this.classes['header']);
|
|
28
|
+
this.content = this.locator.locator(this.classes['content']);
|
|
29
|
+
}
|
|
30
|
+
expectHeaderText(expected) {
|
|
31
|
+
return expect(this.header).toHaveText(expected);
|
|
32
|
+
}
|
|
33
|
+
expectExpanded(expanded = true) {
|
|
34
|
+
return expect(this.header).toHaveAttribute('aria-expanded', String(expanded));
|
|
35
|
+
}
|
|
36
|
+
expectDisabled(disabled = true) {
|
|
37
|
+
return expect(this.header).toBeDisabled();
|
|
38
|
+
}
|
|
39
|
+
async toggle() {
|
|
40
|
+
await this.header.click();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Locator } from '@playwright/test';
|
|
2
|
+
export declare class NgnAvatarHarness {
|
|
3
|
+
locator: Locator;
|
|
4
|
+
readonly classes: import("@ngneers/controls-themes").ThemeClasses<import("@ngneers/controls-themes").ControlTemplate<"avatar", ["root", "image", "initials", `kind-${string}`], readonly []>>;
|
|
5
|
+
constructor(locator: Locator);
|
|
6
|
+
expectInitials(expected: string): Promise<void>;
|
|
7
|
+
expectImageSrc(expected: string): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/components/avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,kBAAkB,CAAC;AAIxD,qBAAa,gBAAgB;IAGR,OAAO,EAAE,OAAO;IAFnC,SAAgB,OAAO,8KAAuC;gBAE3C,OAAO,EAAE,OAAO;IAE5B,cAAc,CAAC,QAAQ,EAAE,MAAM;IAI/B,cAAc,CAAC,QAAQ,EAAE,MAAM;CAGvC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
import { themeClasses } from '../utils/theme';
|
|
3
|
+
import { avatarControlTemplate } from '@ngneers/controls-themes/templates/avatar';
|
|
4
|
+
export class NgnAvatarHarness {
|
|
5
|
+
locator;
|
|
6
|
+
classes = themeClasses(avatarControlTemplate);
|
|
7
|
+
constructor(locator) {
|
|
8
|
+
this.locator = locator;
|
|
9
|
+
}
|
|
10
|
+
expectInitials(expected) {
|
|
11
|
+
return expect(this.locator.locator(this.classes.initials)).toHaveText(expected);
|
|
12
|
+
}
|
|
13
|
+
expectImageSrc(expected) {
|
|
14
|
+
return expect(this.locator.locator(this.classes.image)).toHaveAttribute('src', expected);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import { NgnItemViewHarness } from './item-view';
|
|
3
|
+
import { NgnMenuHarness } from './menu';
|
|
4
|
+
export declare class NgnBreadcrumbHarness {
|
|
5
|
+
locator: Locator;
|
|
6
|
+
readonly classes: import("@ngneers/controls-themes").ThemeClasses<import("@ngneers/controls-themes").ControlTemplate<"breadcrumb", ["root", "item", "item-clickable", "separator", "overflow"], readonly [{
|
|
7
|
+
readonly class: "item-view";
|
|
8
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"item-view", ["root", "item", "item-overflowing", "more-items", "more-items-hidden", "more-items-default", "hidden-separator"], readonly []>;
|
|
9
|
+
}, {
|
|
10
|
+
readonly class: "menu";
|
|
11
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"menu", ["root", "submenu", "item", "item-opened", "icon-children", "separator"], readonly [{
|
|
12
|
+
readonly class: "popover";
|
|
13
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"popover", ["root", "content", "content-closing"], readonly []>;
|
|
14
|
+
}]>;
|
|
15
|
+
}]>>;
|
|
16
|
+
readonly itemView: NgnItemViewHarness;
|
|
17
|
+
readonly overflowMenu: NgnMenuHarness;
|
|
18
|
+
constructor(locator: Locator);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/components/breadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,qBAAa,oBAAoB;IAMZ,OAAO,EAAE,OAAO;IALnC,SAAgB,OAAO;;;;;;;;;SAA2C;IAElE,SAAgB,QAAQ,EAAE,kBAAkB,CAAC;IAC7C,SAAgB,YAAY,EAAE,cAAc,CAAC;gBAE1B,OAAO,EAAE,OAAO;CAIpC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { themeClasses } from '../utils/theme';
|
|
2
|
+
import { breadcrumbControlTemplate } from '@ngneers/controls-themes/templates/breadcrumb';
|
|
3
|
+
import { NgnItemViewHarness } from './item-view';
|
|
4
|
+
import { NgnMenuHarness } from './menu';
|
|
5
|
+
export class NgnBreadcrumbHarness {
|
|
6
|
+
locator;
|
|
7
|
+
classes = themeClasses(breadcrumbControlTemplate);
|
|
8
|
+
itemView;
|
|
9
|
+
overflowMenu;
|
|
10
|
+
constructor(locator) {
|
|
11
|
+
this.locator = locator;
|
|
12
|
+
this.itemView = new NgnItemViewHarness(this.locator.locator(this.classes['item-view']['root']));
|
|
13
|
+
this.overflowMenu = new NgnMenuHarness(this.locator.locator(this.classes['menu']['root']));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Locator } from '@playwright/test';
|
|
2
|
+
import { NgnButtonHarness } from './button';
|
|
3
|
+
export declare class NgnButtonGroupHarness {
|
|
4
|
+
locator: Locator;
|
|
5
|
+
readonly buttons: Locator;
|
|
6
|
+
constructor(locator: Locator);
|
|
7
|
+
expectItemCount(count: number): Promise<void>;
|
|
8
|
+
getButtonAt(index: number): NgnButtonHarness;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=button-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../src/components/button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,qBAAa,qBAAqB;IAGb,OAAO,EAAE,OAAO;IAFnC,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAEd,OAAO,EAAE,OAAO;IAItB,eAAe,CAAC,KAAK,EAAE,MAAM;IAInC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB;CAGpD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
import { NgnButtonHarness } from './button';
|
|
3
|
+
export class NgnButtonGroupHarness {
|
|
4
|
+
locator;
|
|
5
|
+
buttons;
|
|
6
|
+
constructor(locator) {
|
|
7
|
+
this.locator = locator;
|
|
8
|
+
this.buttons = locator.locator('button[ngnButton]');
|
|
9
|
+
}
|
|
10
|
+
async expectItemCount(count) {
|
|
11
|
+
await expect(this.buttons).toHaveCount(count);
|
|
12
|
+
}
|
|
13
|
+
getButtonAt(index) {
|
|
14
|
+
return new NgnButtonHarness(this.buttons.nth(index));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,qBAAa,gBAAgB;IACR,OAAO,EAAE,OAAO;gBAAhB,OAAO,EAAE,OAAO;CACpC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type Locator } from '@playwright/test';
|
|
2
|
+
import { NgnSelectHarness } from './select';
|
|
3
|
+
import type { WeekDay } from '@ngneers/controls/calendar';
|
|
4
|
+
export declare class NgnCalendarHarness {
|
|
5
|
+
locator: Locator;
|
|
6
|
+
readonly classes: import("@ngneers/controls-themes").ThemeClasses<import("@ngneers/controls-themes").ControlTemplate<"calendar", ["root", "inline", "invalid", "details", "header", "navigation", "days", "week-day", "day", "day-selected", "day-today", "day-other-month", "months", "month", "time", "input-field"], readonly [{
|
|
7
|
+
readonly class: "input";
|
|
8
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"mask-input", ["root", "section", "section-active", "section-placeholder", "separator", "proxy", "sr-only"], readonly []>;
|
|
9
|
+
}, {
|
|
10
|
+
readonly class: "trigger-icon";
|
|
11
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"icon", ["root", "default"], readonly []>;
|
|
12
|
+
}, {
|
|
13
|
+
readonly class: "popover";
|
|
14
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"popover", ["root", "content", "content-closing"], readonly []>;
|
|
15
|
+
}, {
|
|
16
|
+
readonly class: "previous";
|
|
17
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"button", ["root", "inline", "loading", `kind-${string}`, `color-${string}`], readonly []>;
|
|
18
|
+
}, {
|
|
19
|
+
readonly class: "next";
|
|
20
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"button", ["root", "inline", "loading", `kind-${string}`, `color-${string}`], readonly []>;
|
|
21
|
+
}, {
|
|
22
|
+
readonly class: "current-month";
|
|
23
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"select", ["root", "combobox", "input", "icon", "input-editable", "popover-content", "filter-icon", "list-box-empty"], readonly [{
|
|
24
|
+
readonly class: "popover";
|
|
25
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"popover", ["root", "content", "content-closing"], readonly []>;
|
|
26
|
+
}, {
|
|
27
|
+
readonly class: "list-box";
|
|
28
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"list-box", ["root", "empty", "invalid", "item", "group", "default-item", "default-group", "item-selected", "item-highlighted", "item-disabled"], readonly [{
|
|
29
|
+
readonly class: "checkbox";
|
|
30
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"checkbox", ["root", "input", "box", "box-checked", "box-indeterminate", "box-icon", "box-icon-visible", "invalid"], readonly []>;
|
|
31
|
+
}, {
|
|
32
|
+
readonly class: "scroller";
|
|
33
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"scroller", ["root", "virtual", "item", "item-sticky"], readonly []>;
|
|
34
|
+
}]>;
|
|
35
|
+
}, {
|
|
36
|
+
readonly class: "filter";
|
|
37
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"input-field", ["root", "host", "disabled", "readonly", "invalid", "label", "clear-button", `labelKind-${string}`], readonly [{
|
|
38
|
+
readonly class: "input";
|
|
39
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"input", ["root", "invalid", "empty"], readonly []>;
|
|
40
|
+
readonly projected: true;
|
|
41
|
+
}]>;
|
|
42
|
+
}]>;
|
|
43
|
+
}, {
|
|
44
|
+
readonly class: "current-year";
|
|
45
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"select", ["root", "combobox", "input", "icon", "input-editable", "popover-content", "filter-icon", "list-box-empty"], readonly [{
|
|
46
|
+
readonly class: "popover";
|
|
47
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"popover", ["root", "content", "content-closing"], readonly []>;
|
|
48
|
+
}, {
|
|
49
|
+
readonly class: "list-box";
|
|
50
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"list-box", ["root", "empty", "invalid", "item", "group", "default-item", "default-group", "item-selected", "item-highlighted", "item-disabled"], readonly [{
|
|
51
|
+
readonly class: "checkbox";
|
|
52
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"checkbox", ["root", "input", "box", "box-checked", "box-indeterminate", "box-icon", "box-icon-visible", "invalid"], readonly []>;
|
|
53
|
+
}, {
|
|
54
|
+
readonly class: "scroller";
|
|
55
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"scroller", ["root", "virtual", "item", "item-sticky"], readonly []>;
|
|
56
|
+
}]>;
|
|
57
|
+
}, {
|
|
58
|
+
readonly class: "filter";
|
|
59
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"input-field", ["root", "host", "disabled", "readonly", "invalid", "label", "clear-button", `labelKind-${string}`], readonly [{
|
|
60
|
+
readonly class: "input";
|
|
61
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"input", ["root", "invalid", "empty"], readonly []>;
|
|
62
|
+
readonly projected: true;
|
|
63
|
+
}]>;
|
|
64
|
+
}]>;
|
|
65
|
+
}, {
|
|
66
|
+
readonly class: "current-month-field";
|
|
67
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"input-field", ["root", "host", "disabled", "readonly", "invalid", "label", "clear-button", `labelKind-${string}`], readonly [{
|
|
68
|
+
readonly class: "input";
|
|
69
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"input", ["root", "invalid", "empty"], readonly []>;
|
|
70
|
+
readonly projected: true;
|
|
71
|
+
}]>;
|
|
72
|
+
}, {
|
|
73
|
+
readonly class: "current-year-field";
|
|
74
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"input-field", ["root", "host", "disabled", "readonly", "invalid", "label", "clear-button", `labelKind-${string}`], readonly [{
|
|
75
|
+
readonly class: "input";
|
|
76
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"input", ["root", "invalid", "empty"], readonly []>;
|
|
77
|
+
readonly projected: true;
|
|
78
|
+
}]>;
|
|
79
|
+
}]>>;
|
|
80
|
+
readonly backButton: Locator;
|
|
81
|
+
readonly nextButton: Locator;
|
|
82
|
+
readonly currentMonth: NgnSelectHarness;
|
|
83
|
+
readonly currentYear: NgnSelectHarness;
|
|
84
|
+
readonly days: Locator;
|
|
85
|
+
readonly day: Locator;
|
|
86
|
+
readonly daySameMonth: Locator;
|
|
87
|
+
readonly dayOtherMonth: Locator;
|
|
88
|
+
readonly daySelected: Locator;
|
|
89
|
+
readonly weekDay: Locator;
|
|
90
|
+
constructor(locator: Locator);
|
|
91
|
+
expectDate(year: string, month: string, day: string): Promise<[void, void, void]>;
|
|
92
|
+
expectFirstWeekday(weekday: WeekDay): Promise<void>;
|
|
93
|
+
selectDay(day: number): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Select a month in the calendar while in months view
|
|
96
|
+
* @param month the month to select (1-12)
|
|
97
|
+
*/
|
|
98
|
+
selectMonth(month: number): Promise<void>;
|
|
99
|
+
selectDayFromOtherMonth(day: number): Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/components/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAG1D,qBAAa,kBAAkB;IAcV,OAAO,EAAE,OAAO;IAbnC,SAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAyC;IAEhE,SAAgB,UAAU,EAAE,OAAO,CAAC;IACpC,SAAgB,UAAU,EAAE,OAAO,CAAC;IACpC,SAAgB,YAAY,EAAE,gBAAgB,CAAC;IAC/C,SAAgB,WAAW,EAAE,gBAAgB,CAAC;IAC9C,SAAgB,IAAI,EAAE,OAAO,CAAC;IAC9B,SAAgB,GAAG,EAAE,OAAO,CAAC;IAC7B,SAAgB,YAAY,EAAE,OAAO,CAAC;IACtC,SAAgB,aAAa,EAAE,OAAO,CAAC;IACvC,SAAgB,WAAW,EAAE,OAAO,CAAC;IACrC,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAEd,OAAO,EAAE,OAAO;IAiB5B,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAQnD,kBAAkB,CAAC,OAAO,EAAE,OAAO;IAInC,SAAS,CAAC,GAAG,EAAE,MAAM;IAI5B;;;OAGG;IACU,WAAW,CAAC,KAAK,EAAE,MAAM;IAKzB,uBAAuB,CAAC,GAAG,EAAE,MAAM;CAGjD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
import { calendarControlTemplate } from '@ngneers/controls-themes/templates/calendar';
|
|
3
|
+
import { themeClasses } from '../utils/theme';
|
|
4
|
+
import { NgnSelectHarness } from './select';
|
|
5
|
+
import { en } from '@ngneers/controls/i18n/translations/en';
|
|
6
|
+
export class NgnCalendarHarness {
|
|
7
|
+
locator;
|
|
8
|
+
classes = themeClasses(calendarControlTemplate);
|
|
9
|
+
backButton;
|
|
10
|
+
nextButton;
|
|
11
|
+
currentMonth;
|
|
12
|
+
currentYear;
|
|
13
|
+
days;
|
|
14
|
+
day;
|
|
15
|
+
daySameMonth;
|
|
16
|
+
dayOtherMonth;
|
|
17
|
+
daySelected;
|
|
18
|
+
weekDay;
|
|
19
|
+
constructor(locator) {
|
|
20
|
+
this.locator = locator;
|
|
21
|
+
this.backButton = locator.locator(this.classes.previous['root']);
|
|
22
|
+
this.nextButton = locator.locator(this.classes.next['root']);
|
|
23
|
+
this.currentMonth = new NgnSelectHarness(locator.locator(this.classes['current-month']['root']));
|
|
24
|
+
this.currentYear = new NgnSelectHarness(locator.locator(this.classes['current-year']['root']));
|
|
25
|
+
this.days = locator.locator(this.classes.days);
|
|
26
|
+
this.day = locator.locator(this.classes.day);
|
|
27
|
+
this.daySameMonth = locator.locator(`${this.classes.day}:not(${this.classes['day-other-month']})`);
|
|
28
|
+
this.dayOtherMonth = locator.locator(`${this.classes.day}${this.classes['day-other-month']}`);
|
|
29
|
+
this.daySelected = locator.locator(this.classes['day-selected']);
|
|
30
|
+
this.weekDay = locator.locator(this.classes['week-day']);
|
|
31
|
+
}
|
|
32
|
+
expectDate(year, month, day) {
|
|
33
|
+
return Promise.all([
|
|
34
|
+
this.currentYear.inputEditable.expectValue(year),
|
|
35
|
+
this.currentMonth.expectSelectedItemText(month),
|
|
36
|
+
expect(this.daySelected).toHaveText(day),
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
expectFirstWeekday(weekday) {
|
|
40
|
+
return expect(this.weekDay.first()).toHaveText(en.calendar.weekdaysShort[weekday]);
|
|
41
|
+
}
|
|
42
|
+
selectDay(day) {
|
|
43
|
+
return this.daySameMonth.nth(day - 1).click();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Select a month in the calendar while in months view
|
|
47
|
+
* @param month the month to select (1-12)
|
|
48
|
+
*/
|
|
49
|
+
async selectMonth(month) {
|
|
50
|
+
await this.currentMonth.open();
|
|
51
|
+
await this.currentMonth.clickItemByIndex(month - 1);
|
|
52
|
+
}
|
|
53
|
+
async selectDayFromOtherMonth(day) {
|
|
54
|
+
return this.dayOtherMonth.filter({ hasText: new RegExp(`^\\s*${day}\\s*$`) }).click();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Locator } from '@playwright/test';
|
|
2
|
+
export declare class NgnChipHarness {
|
|
3
|
+
readonly classes: import("@ngneers/controls-themes").ThemeClasses<import("@ngneers/controls-themes").ControlTemplate<"chip", ["root", "closable", "actionable", "content", "close-button", "close-icon", `color-${string}`], readonly []>>;
|
|
4
|
+
readonly locator: Locator;
|
|
5
|
+
readonly content: Locator;
|
|
6
|
+
readonly closeButton: Locator;
|
|
7
|
+
constructor(locator: Locator);
|
|
8
|
+
click(): Promise<void>;
|
|
9
|
+
close(): Promise<void>;
|
|
10
|
+
expectState(state: {
|
|
11
|
+
actionable?: boolean;
|
|
12
|
+
closable?: boolean;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../src/components/chip.ts"],"names":[],"mappings":"AAEA,OAAa,EAAU,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE9D,qBAAa,cAAc;IACzB,SAAgB,OAAO,2NAAqC;IAE5D,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,WAAW,EAAE,OAAO,CAAC;gBAEzB,OAAO,EAAE,OAAO;IAMf,KAAK;IAIL,KAAK;IAIL,WAAW,CAAC,KAAK,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE;CAiB7E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { chipControlTemplate } from '@ngneers/controls-themes/templates/chip';
|
|
2
|
+
import { themeClasses } from '../utils/theme';
|
|
3
|
+
import test, { expect } from '@playwright/test';
|
|
4
|
+
export class NgnChipHarness {
|
|
5
|
+
classes = themeClasses(chipControlTemplate);
|
|
6
|
+
locator;
|
|
7
|
+
content;
|
|
8
|
+
closeButton;
|
|
9
|
+
constructor(locator) {
|
|
10
|
+
this.locator = locator;
|
|
11
|
+
this.content = locator.locator(this.classes.content);
|
|
12
|
+
this.closeButton = locator.locator(this.classes['close-button']);
|
|
13
|
+
}
|
|
14
|
+
async click() {
|
|
15
|
+
await this.content.click();
|
|
16
|
+
}
|
|
17
|
+
async close() {
|
|
18
|
+
await this.closeButton.click();
|
|
19
|
+
}
|
|
20
|
+
async expectState(state) {
|
|
21
|
+
if (state.actionable !== undefined) {
|
|
22
|
+
if (state.actionable) {
|
|
23
|
+
await expect(this.locator).toHaveClass(this.classes.actionable);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
await expect(this.locator).not.toHaveClass(this.classes.actionable);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (state.closable !== undefined) {
|
|
30
|
+
if (state.closable) {
|
|
31
|
+
await expect(this.locator).toHaveClass(this.classes.closable);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
await expect(this.locator).not.toHaveClass(this.classes.closable);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Locator } from '@playwright/test';
|
|
2
|
+
import { NgnInplaceHarness } from './inplace';
|
|
3
|
+
export declare class NgnEditInplaceHarness {
|
|
4
|
+
locator: Locator;
|
|
5
|
+
readonly classes: import("@ngneers/controls-themes").ThemeClasses<import("@ngneers/controls-themes").ControlTemplate<"edit-inplace", ["root", "disabled", "readonly", "invalid", "default-display", "default-fallback-display", "default-edit", "default-edit-input", "default-edit-close-button", "sr-only"], readonly [{
|
|
6
|
+
readonly class: "inplace";
|
|
7
|
+
readonly template: import("@ngneers/controls-themes").ControlTemplate<"inplace", ["root", "content", "display", "disabled"], readonly []>;
|
|
8
|
+
}]>>;
|
|
9
|
+
readonly inplace: NgnInplaceHarness;
|
|
10
|
+
readonly input: Locator;
|
|
11
|
+
readonly closeButton: Locator;
|
|
12
|
+
constructor(locator: Locator);
|
|
13
|
+
fillInput(value: string): Promise<void>;
|
|
14
|
+
expectInputValue(value: string): Promise<void>;
|
|
15
|
+
clickCloseButton(): Promise<void>;
|
|
16
|
+
pressEnter(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=edit-inplace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-inplace.d.ts","sourceRoot":"","sources":["../../src/components/edit-inplace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,qBAAa,qBAAqB;IAOb,OAAO,EAAE,OAAO;IANnC,SAAgB,OAAO;;;SAA4C;IAEnE,SAAgB,OAAO,EAAE,iBAAiB,CAAC;IAC3C,SAAgB,KAAK,EAAE,OAAO,CAAC;IAC/B,SAAgB,WAAW,EAAE,OAAO,CAAC;gBAElB,OAAO,EAAE,OAAO;IAMtB,SAAS,CAAC,KAAK,EAAE,MAAM;IAIvB,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAI9B,gBAAgB;IAIhB,UAAU;CAGxB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
import { themeClasses } from '../utils/theme';
|
|
3
|
+
import { editInplaceControlTemplate } from '@ngneers/controls-themes/templates/edit-inplace';
|
|
4
|
+
import { NgnInplaceHarness } from './inplace';
|
|
5
|
+
export class NgnEditInplaceHarness {
|
|
6
|
+
locator;
|
|
7
|
+
classes = themeClasses(editInplaceControlTemplate);
|
|
8
|
+
inplace;
|
|
9
|
+
input;
|
|
10
|
+
closeButton;
|
|
11
|
+
constructor(locator) {
|
|
12
|
+
this.locator = locator;
|
|
13
|
+
this.inplace = new NgnInplaceHarness(this.locator.locator(this.classes['inplace']['root']));
|
|
14
|
+
this.input = this.locator.locator(this.classes['default-edit-input']);
|
|
15
|
+
this.closeButton = this.locator.locator(this.classes['default-edit-close-button']);
|
|
16
|
+
}
|
|
17
|
+
async fillInput(value) {
|
|
18
|
+
await this.input.fill(value);
|
|
19
|
+
}
|
|
20
|
+
async expectInputValue(value) {
|
|
21
|
+
await expect(this.input).toHaveValue(value);
|
|
22
|
+
}
|
|
23
|
+
async clickCloseButton() {
|
|
24
|
+
await this.closeButton.click();
|
|
25
|
+
}
|
|
26
|
+
async pressEnter() {
|
|
27
|
+
await this.input.press('Enter');
|
|
28
|
+
}
|
|
29
|
+
}
|