@theia/playwright 1.26.0-next.22 → 1.26.0-next.25
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/lib/theia-notification-indicator.d.ts +1 -2
- package/lib/theia-notification-indicator.d.ts.map +1 -1
- package/lib/theia-notification-indicator.js +11 -11
- package/lib/theia-notification-indicator.js.map +1 -1
- package/lib/theia-problem-indicator.d.ts +1 -1
- package/lib/theia-problem-indicator.d.ts.map +1 -1
- package/lib/theia-problem-indicator.js +4 -5
- package/lib/theia-problem-indicator.js.map +1 -1
- package/lib/theia-status-indicator.d.ts +7 -11
- package/lib/theia-status-indicator.d.ts.map +1 -1
- package/lib/theia-status-indicator.js +13 -41
- package/lib/theia-status-indicator.js.map +1 -1
- package/lib/theia-toggle-bottom-indicator.d.ts +1 -1
- package/lib/theia-toggle-bottom-indicator.d.ts.map +1 -1
- package/lib/theia-toggle-bottom-indicator.js +3 -3
- package/lib/theia-toggle-bottom-indicator.js.map +1 -1
- package/package.json +2 -2
- package/src/theia-notification-indicator.ts +9 -14
- package/src/theia-problem-indicator.ts +2 -9
- package/src/theia-status-indicator.ts +15 -44
- package/src/theia-toggle-bottom-indicator.ts +1 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TheiaStatusIndicator } from './theia-status-indicator';
|
|
2
2
|
export declare class TheiaNotificationIndicator extends TheiaStatusIndicator {
|
|
3
|
-
|
|
4
|
-
isVisible(): Promise<boolean>;
|
|
3
|
+
id: string;
|
|
5
4
|
hasNotifications(): Promise<boolean>;
|
|
6
5
|
waitForVisible(expectNotifications?: boolean): Promise<void>;
|
|
7
6
|
toggleOverlay(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-notification-indicator.d.ts","sourceRoot":"","sources":["../src/theia-notification-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"theia-notification-indicator.d.ts","sourceRoot":"","sources":["../src/theia-notification-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIhE,qBAAa,0BAA2B,SAAQ,oBAAoB;IAChE,EAAE,SAA+B;IAE3B,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAM3B,cAAc,CAAC,mBAAmB,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAOnE,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAOvC"}
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.TheiaNotificationIndicator = void 0;
|
|
19
19
|
const theia_status_indicator_1 = require("./theia-status-indicator");
|
|
20
|
-
const NOTIFICATION_ICON = 'codicon-bell';
|
|
21
20
|
const NOTIFICATION_DOT_ICON = 'codicon-bell-dot';
|
|
22
|
-
const NOTIFICATION_ICONS = [NOTIFICATION_ICON, NOTIFICATION_DOT_ICON];
|
|
23
21
|
class TheiaNotificationIndicator extends theia_status_indicator_1.TheiaStatusIndicator {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
async isVisible() {
|
|
28
|
-
return super.isVisible(NOTIFICATION_ICONS, this.title);
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.id = 'theia-notification-center';
|
|
29
25
|
}
|
|
30
26
|
async hasNotifications() {
|
|
31
|
-
|
|
27
|
+
const container = await this.getElementHandle();
|
|
28
|
+
const bellWithDot = await container.$(`.${NOTIFICATION_DOT_ICON}`);
|
|
29
|
+
return Boolean(bellWithDot === null || bellWithDot === void 0 ? void 0 : bellWithDot.isVisible());
|
|
32
30
|
}
|
|
33
31
|
async waitForVisible(expectNotifications = false) {
|
|
34
|
-
await super.
|
|
32
|
+
await super.waitForVisible();
|
|
33
|
+
if (expectNotifications && !(await this.hasNotifications())) {
|
|
34
|
+
throw new Error('No notifications when notifications expected.');
|
|
35
|
+
}
|
|
35
36
|
}
|
|
36
37
|
async toggleOverlay() {
|
|
37
|
-
const
|
|
38
|
-
const element = await this.getElementHandleByIcon(hasNotifications ? NOTIFICATION_DOT_ICON : NOTIFICATION_ICON, this.title);
|
|
38
|
+
const element = await this.getElementHandle();
|
|
39
39
|
if (element) {
|
|
40
40
|
await element.click();
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-notification-indicator.js","sourceRoot":"","sources":["../src/theia-notification-indicator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,qEAAgE;AAEhE,MAAM,
|
|
1
|
+
{"version":3,"file":"theia-notification-indicator.js","sourceRoot":"","sources":["../src/theia-notification-indicator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,qEAAgE;AAEhE,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEjD,MAAa,0BAA2B,SAAQ,6CAAoB;IAApE;;QACI,OAAE,GAAG,2BAA2B,CAAC;IAsBrC,CAAC;IApBG,KAAK,CAAC,gBAAgB;QAClB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAChD,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,IAAI,qBAAqB,EAAE,CAAC,CAAC;QACnE,OAAO,OAAO,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC;IAEQ,KAAK,CAAC,cAAc,CAAC,mBAAmB,GAAG,KAAK;QACrD,MAAM,KAAK,CAAC,cAAc,EAAE,CAAC;QAC7B,IAAI,mBAAmB,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;SACpE;IACL,CAAC;IAED,KAAK,CAAC,aAAa;QACf,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9C,IAAI,OAAO,EAAE;YACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;SACzB;IACL,CAAC;CAEJ;AAvBD,gEAuBC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementHandle } from '@playwright/test';
|
|
2
2
|
import { TheiaStatusIndicator } from './theia-status-indicator';
|
|
3
3
|
export declare class TheiaProblemIndicator extends TheiaStatusIndicator {
|
|
4
|
-
|
|
4
|
+
id: string;
|
|
5
5
|
numberOfProblems(): Promise<number>;
|
|
6
6
|
numberOfWarnings(): Promise<number>;
|
|
7
7
|
protected getSpans(): Promise<ElementHandle[] | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-problem-indicator.d.ts","sourceRoot":"","sources":["../src/theia-problem-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"theia-problem-indicator.d.ts","sourceRoot":"","sources":["../src/theia-problem-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,qBAAa,qBAAsB,SAAQ,oBAAoB;IAC3D,EAAE,SAA2B;IAEvB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;IAKnC,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;cAKzB,QAAQ,IAAI,OAAO,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC;CAInE"}
|
|
@@ -17,11 +17,10 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.TheiaProblemIndicator = void 0;
|
|
19
19
|
const theia_status_indicator_1 = require("./theia-status-indicator");
|
|
20
|
-
const PROBLEM_ICON = 'codicon-error';
|
|
21
20
|
class TheiaProblemIndicator extends theia_status_indicator_1.TheiaStatusIndicator {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.id = 'problem-marker-status';
|
|
25
24
|
}
|
|
26
25
|
async numberOfProblems() {
|
|
27
26
|
const spans = await this.getSpans();
|
|
@@ -32,7 +31,7 @@ class TheiaProblemIndicator extends theia_status_indicator_1.TheiaStatusIndicato
|
|
|
32
31
|
return spans ? +await spans[3].innerText() : -1;
|
|
33
32
|
}
|
|
34
33
|
async getSpans() {
|
|
35
|
-
const handle = await
|
|
34
|
+
const handle = await this.getElementHandle();
|
|
36
35
|
return handle === null || handle === void 0 ? void 0 : handle.$$('span');
|
|
37
36
|
}
|
|
38
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-problem-indicator.js","sourceRoot":"","sources":["../src/theia-problem-indicator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAGhF,qEAAgE;AAEhE,
|
|
1
|
+
{"version":3,"file":"theia-problem-indicator.js","sourceRoot":"","sources":["../src/theia-problem-indicator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAGhF,qEAAgE;AAEhE,MAAa,qBAAsB,SAAQ,6CAAoB;IAA/D;;QACI,OAAE,GAAG,uBAAuB,CAAC;IAgBjC,CAAC;IAdG,KAAK,CAAC,gBAAgB;QAClB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,gBAAgB;QAClB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IAES,KAAK,CAAC,QAAQ;QACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC7C,OAAO,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACJ;AAjBD,sDAiBC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { ElementHandle } from '@playwright/test';
|
|
2
2
|
import { TheiaPageObject } from './theia-page-object';
|
|
3
|
-
export declare class TheiaStatusIndicator extends TheiaPageObject {
|
|
4
|
-
protected
|
|
5
|
-
protected
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getElementHandleByIcon(iconClass: string | string[], titleContain?: string): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
|
|
11
|
-
waitForVisibleByTitle(title: string, waitForDetached?: boolean): Promise<void>;
|
|
12
|
-
waitForVisibleByIcon(icon: string, waitForDetached?: boolean): Promise<void>;
|
|
13
|
-
isVisible(icon: string | string[], titleContain?: string): Promise<boolean>;
|
|
3
|
+
export declare abstract class TheiaStatusIndicator extends TheiaPageObject {
|
|
4
|
+
protected abstract id: string;
|
|
5
|
+
protected statusBarElementSelector: string;
|
|
6
|
+
protected getSelectorForId(id: string): string;
|
|
7
|
+
waitForVisible(waitForDetached?: boolean): Promise<void>;
|
|
8
|
+
getElementHandle(): Promise<ElementHandle<SVGElement | HTMLElement>>;
|
|
9
|
+
isVisible(): Promise<boolean>;
|
|
14
10
|
}
|
|
15
11
|
//# sourceMappingURL=theia-status-indicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-status-indicator.d.ts","sourceRoot":"","sources":["../src/theia-status-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,
|
|
1
|
+
{"version":3,"file":"theia-status-indicator.d.ts","sourceRoot":"","sources":["../src/theia-status-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,8BAAsB,oBAAqB,SAAQ,eAAe;IAC9D,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAE9B,SAAS,CAAC,wBAAwB,SAAkC;IAEpE,SAAS,CAAC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAIxC,cAAc,CAAC,eAAe,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC;IAQpE,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;CAStC"}
|
|
@@ -20,53 +20,25 @@ const theia_page_object_1 = require("./theia-page-object");
|
|
|
20
20
|
class TheiaStatusIndicator extends theia_page_object_1.TheiaPageObject {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
|
-
this.
|
|
23
|
+
this.statusBarElementSelector = '#theia-statusBar div.element';
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
return this.
|
|
27
|
-
}
|
|
28
|
-
async waitForVisible() {
|
|
29
|
-
await this.page.waitForSelector(this.elementSpanSelector);
|
|
30
|
-
}
|
|
31
|
-
getSelectorByTitle(title) {
|
|
32
|
-
return `.element[title="${title}"]`;
|
|
33
|
-
}
|
|
34
|
-
async getElementHandleByTitle(title) {
|
|
35
|
-
// Fetch element via title in case status elements exist without a dedicated Codicon icon
|
|
36
|
-
return this.page.$(this.getSelectorByTitle(title));
|
|
25
|
+
getSelectorForId(id) {
|
|
26
|
+
return `${this.statusBarElementSelector}#status-bar-${id}`;
|
|
37
27
|
}
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
async waitForVisible(waitForDetached = false) {
|
|
29
|
+
await this.page.waitForSelector(this.getSelectorForId(this.id), waitForDetached ? { state: 'detached' } : {});
|
|
40
30
|
}
|
|
41
|
-
async
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (span) {
|
|
46
|
-
const parent = await span.$('..');
|
|
47
|
-
if (titleContain === '') {
|
|
48
|
-
return parent;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
const parentTitle = await (parent === null || parent === void 0 ? void 0 : parent.getAttribute('title'));
|
|
52
|
-
if (parentTitle === null || parentTitle === void 0 ? void 0 : parentTitle.includes(titleContain)) {
|
|
53
|
-
return parent;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
31
|
+
async getElementHandle() {
|
|
32
|
+
const element = await this.page.$(this.getSelectorForId(this.id));
|
|
33
|
+
if (element) {
|
|
34
|
+
return element;
|
|
57
35
|
}
|
|
58
|
-
throw new Error('
|
|
59
|
-
}
|
|
60
|
-
async waitForVisibleByTitle(title, waitForDetached = false) {
|
|
61
|
-
await this.page.waitForSelector(this.getSelectorByTitle(title), waitForDetached ? { state: 'detached' } : {});
|
|
62
|
-
}
|
|
63
|
-
async waitForVisibleByIcon(icon, waitForDetached = false) {
|
|
64
|
-
await this.page.waitForSelector(this.getSelectorByIcon(icon), waitForDetached ? { state: 'detached' } : {});
|
|
36
|
+
throw new Error('Could not find status bar element with ID ' + this.id);
|
|
65
37
|
}
|
|
66
|
-
async isVisible(
|
|
38
|
+
async isVisible() {
|
|
67
39
|
try {
|
|
68
|
-
const element = await this.
|
|
69
|
-
return
|
|
40
|
+
const element = await this.getElementHandle();
|
|
41
|
+
return element.isVisible();
|
|
70
42
|
}
|
|
71
43
|
catch (err) {
|
|
72
44
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-status-indicator.js","sourceRoot":"","sources":["../src/theia-status-indicator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAGhF,2DAAsD;AAEtD,
|
|
1
|
+
{"version":3,"file":"theia-status-indicator.js","sourceRoot":"","sources":["../src/theia-status-indicator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAGhF,2DAAsD;AAEtD,MAAsB,oBAAqB,SAAQ,mCAAe;IAAlE;;QAGc,6BAAwB,GAAG,8BAA8B,CAAC;IA2BxE,CAAC;IAzBa,gBAAgB,CAAC,EAAU;QACjC,OAAO,GAAG,IAAI,CAAC,wBAAwB,eAAe,EAAE,EAAE,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,eAAe,GAAG,KAAK;QACxC,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClH,CAAC;IAED,KAAK,CAAC,gBAAgB;QAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAClE,IAAI,OAAO,EAAE;YACT,OAAO,OAAO,CAAC;SAClB;QACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,SAAS;QACX,IAAI;YACA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC9C,OAAO,OAAO,CAAC,SAAS,EAAE,CAAC;SAC9B;QAAC,OAAO,GAAG,EAAE;YACV,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;CAEJ;AA9BD,oDA8BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-toggle-bottom-indicator.d.ts","sourceRoot":"","sources":["../src/theia-toggle-bottom-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"theia-toggle-bottom-indicator.d.ts","sourceRoot":"","sources":["../src/theia-toggle-bottom-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,qBAAa,0BAA2B,SAAQ,oBAAoB;IAChE,EAAE,SAAyB;CAC9B"}
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.TheiaToggleBottomIndicator = void 0;
|
|
19
19
|
const theia_status_indicator_1 = require("./theia-status-indicator");
|
|
20
|
-
const TOGGLE_BOTTOM_ICON = 'codicon-window';
|
|
21
20
|
class TheiaToggleBottomIndicator extends theia_status_indicator_1.TheiaStatusIndicator {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.id = 'bottom-panel-toggle';
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
exports.TheiaToggleBottomIndicator = TheiaToggleBottomIndicator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-toggle-bottom-indicator.js","sourceRoot":"","sources":["../src/theia-toggle-bottom-indicator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,qEAAgE;AAEhE,
|
|
1
|
+
{"version":3,"file":"theia-toggle-bottom-indicator.js","sourceRoot":"","sources":["../src/theia-toggle-bottom-indicator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,qEAAgE;AAEhE,MAAa,0BAA2B,SAAQ,6CAAoB;IAApE;;QACI,OAAE,GAAG,qBAAqB,CAAC;IAC/B,CAAC;CAAA;AAFD,gEAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/playwright",
|
|
3
|
-
"version": "1.26.0-next.
|
|
3
|
+
"version": "1.26.0-next.25+70466bb4b72",
|
|
4
4
|
"description": "System tests for Theia",
|
|
5
5
|
"license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"main": "lib/index",
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "70466bb4b7283187b019defec095f8dea42d47c6"
|
|
45
45
|
}
|
|
@@ -16,31 +16,26 @@
|
|
|
16
16
|
|
|
17
17
|
import { TheiaStatusIndicator } from './theia-status-indicator';
|
|
18
18
|
|
|
19
|
-
const NOTIFICATION_ICON = 'codicon-bell';
|
|
20
19
|
const NOTIFICATION_DOT_ICON = 'codicon-bell-dot';
|
|
21
|
-
const NOTIFICATION_ICONS = [NOTIFICATION_ICON, NOTIFICATION_DOT_ICON];
|
|
22
20
|
|
|
23
21
|
export class TheiaNotificationIndicator extends TheiaStatusIndicator {
|
|
24
|
-
|
|
25
|
-
protected get title(): string {
|
|
26
|
-
return 'Notification';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
override async isVisible(): Promise<boolean> {
|
|
30
|
-
return super.isVisible(NOTIFICATION_ICONS, this.title);
|
|
31
|
-
}
|
|
22
|
+
id = 'theia-notification-center';
|
|
32
23
|
|
|
33
24
|
async hasNotifications(): Promise<boolean> {
|
|
34
|
-
|
|
25
|
+
const container = await this.getElementHandle();
|
|
26
|
+
const bellWithDot = await container.$(`.${NOTIFICATION_DOT_ICON}`);
|
|
27
|
+
return Boolean(bellWithDot?.isVisible());
|
|
35
28
|
}
|
|
36
29
|
|
|
37
30
|
override async waitForVisible(expectNotifications = false): Promise<void> {
|
|
38
|
-
await super.
|
|
31
|
+
await super.waitForVisible();
|
|
32
|
+
if (expectNotifications && !(await this.hasNotifications())) {
|
|
33
|
+
throw new Error('No notifications when notifications expected.');
|
|
34
|
+
}
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
async toggleOverlay(): Promise<void> {
|
|
42
|
-
const
|
|
43
|
-
const element = await this.getElementHandleByIcon(hasNotifications ? NOTIFICATION_DOT_ICON : NOTIFICATION_ICON, this.title);
|
|
38
|
+
const element = await this.getElementHandle();
|
|
44
39
|
if (element) {
|
|
45
40
|
await element.click();
|
|
46
41
|
}
|
|
@@ -17,14 +17,8 @@
|
|
|
17
17
|
import { ElementHandle } from '@playwright/test';
|
|
18
18
|
import { TheiaStatusIndicator } from './theia-status-indicator';
|
|
19
19
|
|
|
20
|
-
const PROBLEM_ICON = 'codicon-error';
|
|
21
|
-
|
|
22
20
|
export class TheiaProblemIndicator extends TheiaStatusIndicator {
|
|
23
|
-
|
|
24
|
-
override async isVisible(): Promise<boolean> {
|
|
25
|
-
const handle = await super.getElementHandleByIcon(PROBLEM_ICON);
|
|
26
|
-
return !!handle && handle.isVisible();
|
|
27
|
-
}
|
|
21
|
+
id = 'problem-marker-status';
|
|
28
22
|
|
|
29
23
|
async numberOfProblems(): Promise<number> {
|
|
30
24
|
const spans = await this.getSpans();
|
|
@@ -37,8 +31,7 @@ export class TheiaProblemIndicator extends TheiaStatusIndicator {
|
|
|
37
31
|
}
|
|
38
32
|
|
|
39
33
|
protected async getSpans(): Promise<ElementHandle[] | undefined> {
|
|
40
|
-
const handle = await
|
|
34
|
+
const handle = await this.getElementHandle();
|
|
41
35
|
return handle?.$$('span');
|
|
42
36
|
}
|
|
43
|
-
|
|
44
37
|
}
|
|
@@ -17,60 +17,31 @@
|
|
|
17
17
|
import { ElementHandle } from '@playwright/test';
|
|
18
18
|
import { TheiaPageObject } from './theia-page-object';
|
|
19
19
|
|
|
20
|
-
export class TheiaStatusIndicator extends TheiaPageObject {
|
|
20
|
+
export abstract class TheiaStatusIndicator extends TheiaPageObject {
|
|
21
|
+
protected abstract id: string;
|
|
21
22
|
|
|
22
|
-
protected
|
|
23
|
+
protected statusBarElementSelector = '#theia-statusBar div.element';
|
|
23
24
|
|
|
24
|
-
protected
|
|
25
|
-
return this.
|
|
25
|
+
protected getSelectorForId(id: string): string {
|
|
26
|
+
return `${this.statusBarElementSelector}#status-bar-${id}`;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
async waitForVisible(): Promise<void> {
|
|
29
|
-
await this.page.waitForSelector(this.
|
|
29
|
+
async waitForVisible(waitForDetached = false): Promise<void> {
|
|
30
|
+
await this.page.waitForSelector(this.getSelectorForId(this.id), waitForDetached ? { state: 'detached' } : {});
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
async getElementHandleByTitle(title: string): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
|
|
37
|
-
// Fetch element via title in case status elements exist without a dedicated Codicon icon
|
|
38
|
-
return this.page.$(this.getSelectorByTitle(title));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
protected getSelectorByIcon(icon: string): string {
|
|
42
|
-
return `${this.elementSpanSelector}.codicon.${icon}`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async getElementHandleByIcon(iconClass: string | string[], titleContain = ''): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
|
|
46
|
-
const icons = Array.isArray(iconClass) ? iconClass : [iconClass];
|
|
47
|
-
for (const icon of icons) {
|
|
48
|
-
const span = await this.page.$(this.getSelectorByIcon(icon));
|
|
49
|
-
if (span) {
|
|
50
|
-
const parent = await span.$('..');
|
|
51
|
-
if (titleContain === '') {
|
|
52
|
-
return parent;
|
|
53
|
-
} else {
|
|
54
|
-
const parentTitle = await parent?.getAttribute('title');
|
|
55
|
-
if (parentTitle?.includes(titleContain)) { return parent; }
|
|
56
|
-
}
|
|
57
|
-
}
|
|
33
|
+
async getElementHandle(): Promise<ElementHandle<SVGElement | HTMLElement>> {
|
|
34
|
+
const element = await this.page.$(this.getSelectorForId(this.id));
|
|
35
|
+
if (element) {
|
|
36
|
+
return element;
|
|
58
37
|
}
|
|
59
|
-
throw new Error('
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async waitForVisibleByTitle(title: string, waitForDetached = false): Promise<void> {
|
|
63
|
-
await this.page.waitForSelector(this.getSelectorByTitle(title), waitForDetached ? { state: 'detached' } : {});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async waitForVisibleByIcon(icon: string, waitForDetached = false): Promise<void> {
|
|
67
|
-
await this.page.waitForSelector(this.getSelectorByIcon(icon), waitForDetached ? { state: 'detached' } : {});
|
|
38
|
+
throw new Error('Could not find status bar element with ID ' + this.id);
|
|
68
39
|
}
|
|
69
40
|
|
|
70
|
-
async isVisible(
|
|
41
|
+
async isVisible(): Promise<boolean> {
|
|
71
42
|
try {
|
|
72
|
-
const element = await this.
|
|
73
|
-
return
|
|
43
|
+
const element = await this.getElementHandle();
|
|
44
|
+
return element.isVisible();
|
|
74
45
|
} catch (err) {
|
|
75
46
|
return false;
|
|
76
47
|
}
|
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
import { TheiaStatusIndicator } from './theia-status-indicator';
|
|
18
18
|
|
|
19
|
-
const TOGGLE_BOTTOM_ICON = 'codicon-window';
|
|
20
|
-
|
|
21
19
|
export class TheiaToggleBottomIndicator extends TheiaStatusIndicator {
|
|
22
|
-
|
|
23
|
-
return super.isVisible(TOGGLE_BOTTOM_ICON);
|
|
24
|
-
}
|
|
20
|
+
id = 'bottom-panel-toggle';
|
|
25
21
|
}
|