@theia/playwright 1.37.0-next.8 → 1.37.0-next.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/lib/index.d.ts +4 -0
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +4 -0
  4. package/lib/index.js.map +1 -1
  5. package/lib/tests/theia-explorer-view.test.js +24 -5
  6. package/lib/tests/theia-explorer-view.test.js.map +1 -1
  7. package/lib/tests/theia-output-view.test.d.ts +2 -0
  8. package/lib/tests/theia-output-view.test.d.ts.map +1 -0
  9. package/lib/tests/theia-output-view.test.js +77 -0
  10. package/lib/tests/theia-output-view.test.js.map +1 -0
  11. package/lib/tests/theia-quick-command.test.js +14 -0
  12. package/lib/tests/theia-quick-command.test.js.map +1 -1
  13. package/lib/tests/theia-sample-app.test.js +3 -30
  14. package/lib/tests/theia-sample-app.test.js.map +1 -1
  15. package/lib/tests/theia-toolbar.test.d.ts +2 -0
  16. package/lib/tests/theia-toolbar.test.d.ts.map +1 -0
  17. package/lib/tests/theia-toolbar.test.js +60 -0
  18. package/lib/tests/theia-toolbar.test.js.map +1 -0
  19. package/lib/tests/theia-workspace.test.js +5 -3
  20. package/lib/tests/theia-workspace.test.js.map +1 -1
  21. package/lib/theia-explorer-view.d.ts +6 -4
  22. package/lib/theia-explorer-view.d.ts.map +1 -1
  23. package/lib/theia-explorer-view.js +38 -6
  24. package/lib/theia-explorer-view.js.map +1 -1
  25. package/lib/theia-monaco-editor.d.ts +16 -0
  26. package/lib/theia-monaco-editor.d.ts.map +1 -0
  27. package/lib/theia-monaco-editor.js +76 -0
  28. package/lib/theia-monaco-editor.js.map +1 -0
  29. package/lib/theia-output-channel.d.ts +25 -0
  30. package/lib/theia-output-channel.d.ts.map +1 -0
  31. package/lib/theia-output-channel.js +72 -0
  32. package/lib/theia-output-channel.js.map +1 -0
  33. package/lib/theia-output-view.d.ts +10 -0
  34. package/lib/theia-output-view.d.ts.map +1 -0
  35. package/lib/theia-output-view.js +82 -0
  36. package/lib/theia-output-view.js.map +1 -0
  37. package/lib/theia-quick-command-palette.d.ts +2 -1
  38. package/lib/theia-quick-command-palette.d.ts.map +1 -1
  39. package/lib/theia-quick-command-palette.js +9 -2
  40. package/lib/theia-quick-command-palette.js.map +1 -1
  41. package/lib/theia-text-editor.d.ts +2 -3
  42. package/lib/theia-text-editor.d.ts.map +1 -1
  43. package/lib/theia-text-editor.js +11 -40
  44. package/lib/theia-text-editor.js.map +1 -1
  45. package/lib/theia-toolbar-item.d.ts +11 -0
  46. package/lib/theia-toolbar-item.d.ts.map +1 -0
  47. package/lib/theia-toolbar-item.js +40 -0
  48. package/lib/theia-toolbar-item.js.map +1 -0
  49. package/lib/theia-toolbar.d.ts +20 -0
  50. package/lib/theia-toolbar.d.ts.map +1 -0
  51. package/lib/theia-toolbar.js +91 -0
  52. package/lib/theia-toolbar.js.map +1 -0
  53. package/lib/theia-tree-node.d.ts +1 -0
  54. package/lib/theia-tree-node.d.ts.map +1 -1
  55. package/lib/theia-tree-node.js +8 -0
  56. package/lib/theia-tree-node.js.map +1 -1
  57. package/package.json +13 -10
  58. package/src/index.ts +4 -0
  59. package/src/tests/resources/sample-files1/sampleFolderCompact/nestedFolder1/nestedFolder2/sampleFile1-1.txt +0 -0
  60. package/src/tests/theia-explorer-view.test.ts +25 -6
  61. package/src/tests/theia-output-view.test.ts +85 -0
  62. package/src/tests/theia-quick-command.test.ts +15 -0
  63. package/src/tests/theia-sample-app.test.ts +3 -34
  64. package/src/tests/theia-toolbar.test.ts +65 -0
  65. package/src/tests/theia-workspace.test.ts +5 -3
  66. package/src/theia-explorer-view.ts +42 -7
  67. package/src/theia-monaco-editor.ts +83 -0
  68. package/src/theia-output-channel.ts +88 -0
  69. package/src/theia-output-view.ts +87 -0
  70. package/src/theia-quick-command-palette.ts +10 -2
  71. package/src/theia-text-editor.ts +13 -44
  72. package/src/theia-toolbar-item.ts +41 -0
  73. package/src/theia-toolbar.ts +99 -0
  74. package/src/theia-tree-node.ts +10 -1
@@ -0,0 +1,11 @@
1
+ import { ElementHandle } from '@playwright/test';
2
+ import { TheiaApp } from './theia-app';
3
+ import { TheiaPageObject } from './theia-page-object';
4
+ export declare class TheiaToolbarItem extends TheiaPageObject {
5
+ protected element: ElementHandle<SVGElement | HTMLElement>;
6
+ constructor(app: TheiaApp, element: ElementHandle<SVGElement | HTMLElement>);
7
+ commandId(): Promise<string | null>;
8
+ isEnabled(): Promise<boolean>;
9
+ trigger(): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=theia-toolbar-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-toolbar-item.d.ts","sourceRoot":"","sources":["../src/theia-toolbar-item.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,qBAAa,gBAAiB,SAAQ,eAAe;IACtB,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC;gBAAzE,GAAG,EAAE,QAAQ,EAAY,OAAO,EAAE,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC;IAI/E,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAInC,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ7B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAGjC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 EclipseSource and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TheiaToolbarItem = void 0;
19
+ const theia_page_object_1 = require("./theia-page-object");
20
+ class TheiaToolbarItem extends theia_page_object_1.TheiaPageObject {
21
+ constructor(app, element) {
22
+ super(app);
23
+ this.element = element;
24
+ }
25
+ async commandId() {
26
+ return this.element.getAttribute('id');
27
+ }
28
+ async isEnabled() {
29
+ const classAttribute = await this.element.getAttribute('class');
30
+ if (classAttribute === undefined || classAttribute === null) {
31
+ return false;
32
+ }
33
+ return classAttribute.includes('enabled');
34
+ }
35
+ async trigger() {
36
+ await this.element.click();
37
+ }
38
+ }
39
+ exports.TheiaToolbarItem = TheiaToolbarItem;
40
+ //# sourceMappingURL=theia-toolbar-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-toolbar-item.js","sourceRoot":"","sources":["../src/theia-toolbar-item.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;;;AAIhF,2DAAsD;AAEtD,MAAa,gBAAiB,SAAQ,mCAAe;IACjD,YAAY,GAAa,EAAY,OAAgD;QACjF,KAAK,CAAC,GAAG,CAAC,CAAC;QADsB,YAAO,GAAP,OAAO,CAAyC;IAErF,CAAC;IAED,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,SAAS;QACX,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAChE,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,IAAI,EAAE;YACzD,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,OAAO;QACT,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CACJ;AApBD,4CAoBC"}
@@ -0,0 +1,20 @@
1
+ import { ElementHandle } from '@playwright/test';
2
+ import { TheiaPageObject } from './theia-page-object';
3
+ import { TheiaToolbarItem } from './theia-toolbar-item';
4
+ export declare class TheiaToolbar extends TheiaPageObject {
5
+ selector: string;
6
+ protected toolbarElementHandle(): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
7
+ waitForVisible(): Promise<void>;
8
+ isShown(): Promise<boolean>;
9
+ show(): Promise<void>;
10
+ hide(): Promise<void>;
11
+ toggle(): Promise<void>;
12
+ waitUntilHidden(): Promise<void>;
13
+ waitUntilShown(): Promise<void>;
14
+ toolbarItems(): Promise<TheiaToolbarItem[]>;
15
+ toolbarItemIds(): Promise<string[]>;
16
+ toolBarItem(commandId: string): Promise<TheiaToolbarItem | undefined>;
17
+ protected toolBarItemSelector(toolbarItemId?: string): string;
18
+ protected toCommandIdArray(items: TheiaToolbarItem[]): Promise<string[]>;
19
+ }
20
+ //# sourceMappingURL=theia-toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-toolbar.d.ts","sourceRoot":"","sources":["../src/theia-toolbar.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBAAa,YAAa,SAAQ,eAAe;IAC7C,QAAQ,SAAuC;cAE/B,oBAAoB,IAAI,OAAO,CAAC,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,IAAI,CAAC;IAIzF,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAK3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAOvB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,YAAY,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAS3C,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKnC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAY3E,SAAS,CAAC,mBAAmB,CAAC,aAAa,SAAK,GAAG,MAAM;cAIzC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAKjF"}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 EclipseSource and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TheiaToolbar = void 0;
19
+ const theia_page_object_1 = require("./theia-page-object");
20
+ const theia_toolbar_item_1 = require("./theia-toolbar-item");
21
+ class TheiaToolbar extends theia_page_object_1.TheiaPageObject {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.selector = 'div#main-toolbar.p-TabBar-toolbar';
25
+ }
26
+ async toolbarElementHandle() {
27
+ return this.page.$(this.selector);
28
+ }
29
+ async waitForVisible() {
30
+ await this.page.waitForSelector(this.selector, { state: 'visible' });
31
+ }
32
+ async isShown() {
33
+ const statusBar = await this.toolbarElementHandle();
34
+ return !!statusBar && statusBar.isVisible();
35
+ }
36
+ async show() {
37
+ if (!await this.isShown()) {
38
+ await this.toggle();
39
+ }
40
+ }
41
+ async hide() {
42
+ if (await this.isShown()) {
43
+ await this.toggle();
44
+ }
45
+ }
46
+ async toggle() {
47
+ const isShown = await this.isShown();
48
+ const viewMenu = await this.app.menuBar.openMenu('View');
49
+ await viewMenu.clickMenuItem('Toggle Toolbar');
50
+ isShown ? await this.waitUntilHidden() : await this.waitUntilShown();
51
+ }
52
+ async waitUntilHidden() {
53
+ await this.page.waitForSelector(this.selector, { state: 'hidden' });
54
+ }
55
+ async waitUntilShown() {
56
+ await this.page.waitForSelector(this.selector, { state: 'visible' });
57
+ }
58
+ async toolbarItems() {
59
+ const toolbarHandle = await this.toolbarElementHandle();
60
+ if (!toolbarHandle) {
61
+ return [];
62
+ }
63
+ const items = await toolbarHandle.$$(this.toolBarItemSelector());
64
+ return items.map(element => new theia_toolbar_item_1.TheiaToolbarItem(this.app, element));
65
+ }
66
+ async toolbarItemIds() {
67
+ const items = await this.toolbarItems();
68
+ return this.toCommandIdArray(items);
69
+ }
70
+ async toolBarItem(commandId) {
71
+ const toolbarHandle = await this.toolbarElementHandle();
72
+ if (!toolbarHandle) {
73
+ return undefined;
74
+ }
75
+ const item = await toolbarHandle.$(this.toolBarItemSelector(commandId));
76
+ if (item) {
77
+ return new theia_toolbar_item_1.TheiaToolbarItem(this.app, item);
78
+ }
79
+ return undefined;
80
+ }
81
+ toolBarItemSelector(toolbarItemId = '') {
82
+ return `div.toolbar-item${toolbarItemId ? `[id="${toolbarItemId}"]` : ''}`;
83
+ }
84
+ async toCommandIdArray(items) {
85
+ const contents = items.map(item => item.commandId());
86
+ const resolvedContents = await Promise.all(contents);
87
+ return resolvedContents.filter(id => id !== undefined);
88
+ }
89
+ }
90
+ exports.TheiaToolbar = TheiaToolbar;
91
+ //# sourceMappingURL=theia-toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-toolbar.js","sourceRoot":"","sources":["../src/theia-toolbar.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;AACtD,6DAAwD;AAExD,MAAa,YAAa,SAAQ,mCAAe;IAAjD;;QACI,aAAQ,GAAG,mCAAmC,CAAC;IA6EnD,CAAC;IA3Ea,KAAK,CAAC,oBAAoB;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,cAAc;QAChB,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,OAAO;QACT,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACpD,OAAO,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,IAAI;QACN,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,E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AC;IAED,KAAK,CAAC,cAAc;QAChB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,SAAiB;QAC/B,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACxD,IAAI,CAAC,aAAa,EAAE;YAChB,OAAO,SAAS,CAAC;SACpB;QACD,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;QACxE,IAAI,IAAI,EAAE;YACN,OAAO,IAAI,qCAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SAC/C;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,mBAAmB,CAAC,aAAa,GAAG,EAAE;QAC5C,OAAO,mBAAmB,aAAa,CAAC,CAAC,CAAC,QAAQ,aAAa,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC/E,CAAC;IAES,KAAK,CAAC,gBAAgB,CAAC,KAAyB;QACtD,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACrD,OAAO,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,SAAS,CAAa,CAAC;IACvE,CAAC;CACJ;AA9ED,oCA8EC"}
@@ -12,6 +12,7 @@ export declare class TheiaTreeNode {
12
12
  isCollapsed(): Promise<boolean>;
13
13
  isExpandable(): Promise<boolean>;
14
14
  expand(): Promise<void>;
15
+ collapse(): Promise<void>;
15
16
  openContextMenu(): Promise<TheiaMenu>;
16
17
  }
17
18
  //# sourceMappingURL=theia-tree-node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theia-tree-node.d.ts","sourceRoot":"","sources":["../src/theia-tree-node.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,aAAa;IAMV,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC;IAAE,SAAS,CAAC,GAAG,EAAE,QAAQ;IAJrG,oBAAoB,SAAgC;IACpD,uBAAuB,SAA4B;IACnD,iBAAiB,SAA0B;gBAErB,aAAa,EAAE,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC,EAAY,GAAG,EAAE,QAAQ;IAE/F,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAQ/B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;IAIhC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IASvB,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC;CAI9C"}
1
+ {"version":3,"file":"theia-tree-node.d.ts","sourceRoot":"","sources":["../src/theia-tree-node.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,aAAa;IAMV,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC;IAAE,SAAS,CAAC,GAAG,EAAE,QAAQ;IAJrG,oBAAoB,SAAgC;IACpD,uBAAuB,SAA4B;IACnD,iBAAiB,SAA0B;gBAErB,aAAa,EAAE,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC,EAAY,GAAG,EAAE,QAAQ;IAE/F,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAQ/B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;IAIhC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IASvB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IASzB,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC;CAI9C"}
@@ -46,6 +46,14 @@ class TheiaTreeNode {
46
46
  await expansionToggle.click();
47
47
  await this.elementHandle.waitForSelector(`${this.expansionToggleCssClass}:not(${this.collapsedCssClass})`);
48
48
  }
49
+ async collapse() {
50
+ if (await this.isCollapsed()) {
51
+ return;
52
+ }
53
+ const expansionToggle = await this.elementHandle.waitForSelector(this.expansionToggleCssClass);
54
+ await expansionToggle.click();
55
+ await this.elementHandle.waitForSelector(`${this.expansionToggleCssClass}${this.collapsedCssClass}`);
56
+ }
49
57
  async openContextMenu() {
50
58
  return theia_context_menu_1.TheiaContextMenu.open(this.app, () => this.elementHandle.waitForSelector(this.labelElementCssClass));
51
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"theia-tree-node.js","sourceRoot":"","sources":["../src/theia-tree-node.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;;;AAKhF,6DAAwD;AAGxD,MAAa,aAAa;IAMtB,YAAsB,aAAsD,EAAY,GAAa;QAA/E,kBAAa,GAAb,aAAa,CAAyC;QAAY,QAAG,GAAH,GAAG,CAAU;QAJrG,yBAAoB,GAAG,4BAA4B,CAAC;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CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC/F,MAAM,eAAe,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,uBAAuB,QAAQ,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;IAC/G,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,IAAI,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE;YAC1B,OAAO;SACV;QACD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC/F,MAAM,eAAe,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACzG,CAAC;IAED,KAAK,CAAC,eAAe;QACjB,OAAO,qCAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAChH,CAAC;CAEJ;AA9CD,sCA8CC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/playwright",
3
- "version": "1.37.0-next.8+8a58417ba",
3
+ "version": "1.37.0-next.9+2b81f4973",
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": {
@@ -12,14 +12,15 @@
12
12
  },
13
13
  "homepage": "https://github.com/eclipse-theia/theia",
14
14
  "scripts": {
15
- "clean": "rimraf lib *.tsbuildinfo",
16
- "build": "tsc --incremental && npx playwright install chromium",
15
+ "clean": "rimraf lib *.tsbuildinfo .eslintcache",
16
+ "build": "yarn && yarn clean && tsc --incremental && yarn lint && yarn playwright:install",
17
+ "watch": "tsc -w --incremental",
17
18
  "theia:start": "rimraf .tmp.cfg && THEIA_CONFIG_DIR=$PWD/.tmp.cfg yarn --cwd ../browser start",
18
19
  "lint": "eslint -c ./.eslintrc.js --ext .ts ./src",
19
20
  "lint:fix": "eslint -c ./.eslintrc.js --ext .ts ./src --fix",
20
- "ui-tests": "yarn && playwright test --config=./configs/playwright.config.ts",
21
- "ui-tests-ci": "yarn && playwright test --config=./configs/playwright.ci.config.ts",
22
- "ui-tests-headful": "yarn && playwright test --config=./configs/playwright.headful.config.ts",
21
+ "playwright:install": "playwright install chromium",
22
+ "ui-tests": "yarn build && playwright test",
23
+ "ui-tests-headful": "yarn build && playwright test --headed",
23
24
  "ui-tests-report-generate": "allure generate ./allure-results --clean -o allure-results/allure-report",
24
25
  "ui-tests-report": "yarn ui-tests-report-generate && allure open allure-results/allure-report"
25
26
  },
@@ -28,17 +29,19 @@
28
29
  "src"
29
30
  ],
30
31
  "dependencies": {
31
- "@playwright/test": "^1.30.0",
32
+ "@playwright/test": "^1.32.1",
32
33
  "fs-extra": "^9.0.8"
33
34
  },
34
35
  "devDependencies": {
35
36
  "@types/fs-extra": "^9.0.8",
36
- "allure-commandline": "^2.13.8",
37
- "allure-playwright": "^2.0.0-beta.14"
37
+ "allure-commandline": "^2.21.0",
38
+ "allure-playwright": "^2.1.0",
39
+ "rimraf": "^2.6.1",
40
+ "typescript": "~4.5.5"
38
41
  },
39
42
  "publishConfig": {
40
43
  "access": "public"
41
44
  },
42
45
  "main": "lib/index",
43
- "gitHead": "8a58417ba758ba4d7e78ff26fa2d861772909520"
46
+ "gitHead": "2b81f49736019652febf2c7da464d18813fe1768"
44
47
  }
package/src/index.ts CHANGED
@@ -25,6 +25,8 @@ export * from './theia-menu-item';
25
25
  export * from './theia-menu';
26
26
  export * from './theia-notification-indicator';
27
27
  export * from './theia-notification-overlay';
28
+ export * from './theia-output-channel';
29
+ export * from './theia-output-view';
28
30
  export * from './theia-page-object';
29
31
  export * from './theia-preference-view';
30
32
  export * from './theia-problem-indicator';
@@ -35,6 +37,8 @@ export * from './theia-status-bar';
35
37
  export * from './theia-status-indicator';
36
38
  export * from './theia-text-editor';
37
39
  export * from './theia-toggle-bottom-indicator';
40
+ export * from './theia-toolbar';
41
+ export * from './theia-toolbar-item';
38
42
  export * from './theia-tree-node';
39
43
  export * from './theia-view';
40
44
  export * from './theia-workspace';
@@ -54,24 +54,29 @@ test.describe('Theia Explorer View', () => {
54
54
  expect(await explorer.isActive()).toBe(true);
55
55
  });
56
56
 
57
- test('should show one folder named "sampleFolder" and one file named "sample.txt"', async () => {
57
+ test('should show one folder named "sampleFolder", one named "sampleFolderCompact" and one file named "sample.txt"', async () => {
58
58
  await explorer.selectTreeNode('sampleFolder');
59
59
  expect(await explorer.isTreeNodeSelected('sampleFolder')).toBe(true);
60
60
  const fileStatElements = await explorer.visibleFileStatNodes(DOT_FILES_FILTER);
61
- expect(fileStatElements.length).toBe(2);
61
+ expect(fileStatElements.length).toBe(3);
62
62
 
63
- let file; let folder;
63
+ let file; let folder; let compactFolder;
64
64
  if (await fileStatElements[0].isFolder()) {
65
65
  folder = fileStatElements[0];
66
- file = fileStatElements[1];
66
+ compactFolder = fileStatElements[1];
67
+ file = fileStatElements[2];
67
68
  } else {
68
- folder = fileStatElements[1];
69
+ folder = fileStatElements[2];
70
+ compactFolder = fileStatElements[1];
69
71
  file = fileStatElements[0];
70
72
  }
71
73
 
72
74
  expect(await folder.label()).toBe('sampleFolder');
73
75
  expect(await folder.isFile()).toBe(false);
74
76
  expect(await folder.isFolder()).toBe(true);
77
+ expect(await compactFolder.label()).toBe('sampleFolderCompact');
78
+ expect(await compactFolder.isFile()).toBe(false);
79
+ expect(await compactFolder.isFolder()).toBe(true);
75
80
  expect(await file.label()).toBe('sample.txt');
76
81
  expect(await file.isFolder()).toBe(false);
77
82
  expect(await file.isFile()).toBe(true);
@@ -84,7 +89,7 @@ test.describe('Theia Explorer View', () => {
84
89
  expect(await file.isFile()).toBe(true);
85
90
  });
86
91
 
87
- test('should provide file stat nodes that can define whether they are collapsed or not and that can be expanded', async () => {
92
+ test('should provide file stat nodes that can define whether they are collapsed or not and that can be expanded and collapsed', async () => {
88
93
  const file = await explorer.getFileStatNodeByLabel('sample.txt');
89
94
  expect(await file.isCollapsed()).toBe(false);
90
95
 
@@ -93,6 +98,9 @@ test.describe('Theia Explorer View', () => {
93
98
 
94
99
  await folder.expand();
95
100
  expect(await folder.isCollapsed()).toBe(false);
101
+
102
+ await folder.collapse();
103
+ expect(await folder.isCollapsed()).toBe(true);
96
104
  });
97
105
 
98
106
  test('should provide file stat node by path "sampleFolder/sampleFolder1/sampleFolder1-1/sampleFile1-1-1.txt"', async () => {
@@ -101,6 +109,17 @@ test.describe('Theia Explorer View', () => {
101
109
  expect(await file.label()).toBe('sampleFile1-1-1.txt');
102
110
  });
103
111
 
112
+ test('should be able to check if compact folder "sampleFolderCompact/nestedFolder1/nestedFolder2" exists', async () => {
113
+ // default setting `explorer.compactFolders=true` renders folders in a compact form - single child folders will be compressed in a combined tree element
114
+ expect(await explorer.existsDirectoryNode('sampleFolderCompact/nestedFolder1/nestedFolder2', true /* compact */)).toBe(true);
115
+ });
116
+
117
+ test('should provide file stat node by path of compact folder "sampleFolderCompact/nestedFolder1/nestedFolder2/sampleFile1-1.txt"', async () => {
118
+ const file = await explorer.fileStatNode('sampleFolderCompact/nestedFolder1/nestedFolder2/sampleFile1-1.txt', true /* compact */);
119
+ if (!file) { throw Error('File stat node could not be retrieved by path'); }
120
+ expect(await file.label()).toBe('sampleFile1-1.txt');
121
+ });
122
+
104
123
  test('should open context menu on "sample.txt"', async () => {
105
124
  const file = await explorer.getFileStatNodeByLabel('sample.txt');
106
125
  const menu = await file.openContextMenu();
@@ -0,0 +1,85 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 EclipseSource and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { expect } from '@playwright/test';
18
+ import { TheiaOutputViewChannel } from 'src/theia-output-channel';
19
+ import { TheiaApp } from '../theia-app';
20
+ import { TheiaOutputView } from '../theia-output-view';
21
+ import test, { page } from './fixtures/theia-fixture';
22
+
23
+ let app: TheiaApp;
24
+ let outputView: TheiaOutputView;
25
+ let testChannel: TheiaOutputViewChannel;
26
+
27
+ test.describe('Theia Output View', () => {
28
+
29
+ test.beforeAll(async () => {
30
+ app = await TheiaApp.load(page);
31
+ });
32
+
33
+ test('should open the output view and check if is visible and active', async () => {
34
+ outputView = await app.openView(TheiaOutputView);
35
+ expect(await outputView.isTabVisible()).toBe(true);
36
+ expect(await outputView.isDisplayed()).toBe(true);
37
+ expect(await outputView.isActive()).toBe(true);
38
+ });
39
+ test('should be opened at the bottom and have the title "Output"', async () => {
40
+ expect(await outputView.isInSidePanel()).toBe(false);
41
+ expect(await outputView.side()).toBe('bottom');
42
+ expect(await outputView.title()).toBe('Output');
43
+ });
44
+ test('should be closable', async () => {
45
+ expect(await outputView.isClosable()).toBe(true);
46
+ await outputView.close();
47
+ expect(await outputView.isTabVisible()).toBe(false);
48
+ expect(await outputView.isDisplayed()).toBe(false);
49
+ expect(await outputView.isActive()).toBe(false);
50
+ });
51
+ test('should select a test output channel', async () => {
52
+ outputView = await app.openView(TheiaOutputView);
53
+ expect(await outputView.isTabVisible()).toBe(true);
54
+ expect(await outputView.isDisplayed()).toBe(true);
55
+ expect(await outputView.isActive()).toBe(true);
56
+
57
+ const testChannelName = 'API Sample: my test channel';
58
+ expect(await outputView.selectOutputChannel(testChannelName)).toBe(true);
59
+ });
60
+ test('should check if the output view of the test output channel', async () => {
61
+ const testChannelName = 'API Sample: my test channel';
62
+ expect(await outputView.isOutputChannelSelected(testChannelName));
63
+ const channel = await outputView.getOutputChannel(testChannelName);
64
+ expect(channel).toBeDefined;
65
+ testChannel = channel!;
66
+ expect(await testChannel!.isDisplayed()).toBe(true);
67
+ });
68
+ test('should check if the output view test channel shows the test output', async () => {
69
+ expect(await testChannel.numberOfLines()).toBe(5);
70
+ expect(await testChannel.textContentOfLineByLineNumber(1)).toMatch('hello info1');
71
+ expect(await testChannel.maxSeverityOfLineByLineNumber(1)).toMatch('info');
72
+ expect(await testChannel.textContentOfLineByLineNumber(2)).toMatch('hello info2');
73
+ expect(await testChannel.maxSeverityOfLineByLineNumber(2)).toMatch('info');
74
+ expect(await testChannel.textContentOfLineByLineNumber(3)).toMatch('hello error');
75
+ expect(await testChannel.maxSeverityOfLineByLineNumber(3)).toMatch('error');
76
+ expect(await testChannel.textContentOfLineByLineNumber(4)).toMatch('hello warning');
77
+ expect(await testChannel.maxSeverityOfLineByLineNumber(4)).toMatch('warning');
78
+ expect(await testChannel.textContentOfLineByLineNumber(5)).toMatch(
79
+ 'inlineInfo1 inlineWarning inlineError inlineInfo2'
80
+ );
81
+ expect(await testChannel.maxSeverityOfLineByLineNumber(5)).toMatch('error');
82
+ });
83
+
84
+ });
85
+
@@ -18,6 +18,8 @@ import { expect } from '@playwright/test';
18
18
  import { TheiaAboutDialog } from '../theia-about-dialog';
19
19
  import { TheiaApp } from '../theia-app';
20
20
  import { TheiaExplorerView } from '../theia-explorer-view';
21
+ import { TheiaNotificationIndicator } from '../theia-notification-indicator';
22
+ import { TheiaNotificationOverlay } from '../theia-notification-overlay';
21
23
  import { TheiaQuickCommandPalette } from '../theia-quick-command-palette';
22
24
  import test, { page } from './fixtures/theia-fixture';
23
25
 
@@ -34,6 +36,10 @@ test.describe('Theia Quick Command', () => {
34
36
  test('should show quick command palette', async () => {
35
37
  await quickCommand.open();
36
38
  expect(await quickCommand.isOpen()).toBe(true);
39
+ await quickCommand.hide();
40
+ expect(await quickCommand.isOpen()).toBe(false);
41
+ await quickCommand.open();
42
+ expect(await quickCommand.isOpen()).toBe(true);
37
43
  });
38
44
 
39
45
  test('should trigger \'About\' command after typing', async () => {
@@ -58,4 +64,13 @@ test.describe('Theia Quick Command', () => {
58
64
  expect(await explorerView.isDisplayed()).toBe(true);
59
65
  });
60
66
 
67
+ test('should trigger \'Quick Input: Test Positive Integer\' command by confirming via Enter', async () => {
68
+ await quickCommand.type('Test Positive', true);
69
+ expect(await quickCommand.isOpen()).toBe(true);
70
+ await quickCommand.type('6', true);
71
+ const notificationIndicator = new TheiaNotificationIndicator(app);
72
+ const notification = new TheiaNotificationOverlay(app, notificationIndicator);
73
+ expect(await notification.isEntryVisible('Positive Integer: 6')).toBe(true);
74
+ });
75
+
61
76
  });
@@ -14,44 +14,13 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { TheiaApp } from '../theia-app';
18
-
19
17
  import { expect } from '@playwright/test';
18
+ import { TheiaApp } from '../theia-app';
19
+ import { TheiaToolbar } from '../theia-toolbar';
20
20
  import test, { page } from './fixtures/theia-fixture';
21
- import { TheiaPageObject } from '../theia-page-object';
22
-
23
- class TheiaSampleToolbar extends TheiaPageObject {
24
- protected selector = '#main-toolbar';
25
-
26
- async show(): Promise<void> {
27
- if (!await this.isShown()) {
28
- await this.toggle();
29
- }
30
- }
31
-
32
- async toggle(): Promise<void> {
33
- const isShown = await this.isShown();
34
- const viewMenu = await this.app.menuBar.openMenu('View');
35
- await viewMenu.clickMenuItem('Toggle Toolbar');
36
- isShown ? await this.waitUntilHidden() : await this.waitUntilShown();
37
- }
38
-
39
- async waitUntilHidden(): Promise<void> {
40
- await this.page.waitForSelector(this.selector, { state: 'hidden' });
41
- }
42
-
43
- async waitUntilShown(): Promise<void> {
44
- await this.page.waitForSelector(this.selector, { state: 'visible' });
45
- }
46
-
47
- async isShown(): Promise<boolean> {
48
- const toolbar = await this.page.$(this.selector);
49
- return !!toolbar && toolbar.isVisible();
50
- }
51
- }
52
21
 
53
22
  class TheiaSampleApp extends TheiaApp {
54
- protected toolbar = new TheiaSampleToolbar(this);
23
+ protected toolbar = new TheiaToolbar(this);
55
24
 
56
25
  override async waitForInitialized(): Promise<void> {
57
26
  await this.toolbar.show();
@@ -0,0 +1,65 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 EclipseSource and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { expect } from '@playwright/test';
18
+ import { TheiaApp } from '../theia-app';
19
+ import { TheiaToolbar } from '../theia-toolbar';
20
+ import test, { page } from './fixtures/theia-fixture';
21
+
22
+ let app: TheiaApp;
23
+ let toolbar: TheiaToolbar;
24
+
25
+ test.describe('Theia Toolbar', () => {
26
+
27
+ test.beforeAll(async () => {
28
+ app = await TheiaApp.load(page);
29
+ toolbar = new TheiaToolbar(app);
30
+ });
31
+
32
+ test('should toggle the toolbar and check visibility', async () => {
33
+ // depending on the user settings we have different starting conditions for the toolbar
34
+ const isShownInitially = await toolbar.isShown();
35
+ expect(await toolbar.isShown()).toBe(isShownInitially);
36
+ await toolbar.toggle();
37
+ expect(await toolbar.isShown()).toBe(!isShownInitially);
38
+ await toolbar.hide();
39
+ expect(await toolbar.isShown()).toBe(false);
40
+ await toolbar.show();
41
+ expect(await toolbar.isShown()).toBe(true);
42
+ });
43
+
44
+ test('should show the default toolbar tools of the sample Theia application', async () => {
45
+ expect(await toolbar.toolbarItems()).toHaveLength(5);
46
+ expect(await toolbar.toolbarItemIds()).toStrictEqual([
47
+ 'textEditor.commands.go.back',
48
+ 'textEditor.commands.go.forward',
49
+ 'workbench.action.splitEditorRight',
50
+ 'theia-sample-toolbar-contribution',
51
+ 'workbench.action.showCommands'
52
+ ]);
53
+ });
54
+
55
+ test('should trigger the "Command Palette" toolbar tool as expect the command palette to open', async () => {
56
+ const commandPaletteTool = await toolbar.toolBarItem('workbench.action.showCommands');
57
+ expect(commandPaletteTool).toBeDefined;
58
+ expect(await commandPaletteTool!.isEnabled()).toBe(true);
59
+
60
+ await commandPaletteTool!.trigger();
61
+ expect(await app.quickCommandPalette.isOpen()).toBe(true);
62
+ await app.quickCommandPalette.hide();
63
+ expect(await app.quickCommandPalette.isOpen()).toBe(false);
64
+ });
65
+ });
@@ -14,10 +14,10 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
+ import { expect } from '@playwright/test';
17
18
  import { TheiaApp } from '../theia-app';
18
19
  import { DOT_FILES_FILTER, TheiaExplorerView } from '../theia-explorer-view';
19
20
  import { TheiaWorkspace } from '../theia-workspace';
20
- import { expect } from '@playwright/test';
21
21
  import test, { page } from './fixtures/theia-fixture';
22
22
 
23
23
  test.describe('Theia Workspace', () => {
@@ -33,8 +33,9 @@ test.describe('Theia Workspace', () => {
33
33
  const ws = new TheiaWorkspace(['src/tests/resources/sample-files1']);
34
34
  const app = await TheiaApp.load(page, ws);
35
35
  const explorer = await app.openView(TheiaExplorerView);
36
- // resources/sample-files1 contains one folder and one file
36
+ // resources/sample-files1 contains two folders and one file
37
37
  expect(await explorer.existsDirectoryNode('sampleFolder')).toBe(true);
38
+ expect(await explorer.existsDirectoryNode('sampleFolderCompact')).toBe(true);
38
39
  expect(await explorer.existsFileNode('sample.txt')).toBe(true);
39
40
  });
40
41
 
@@ -42,8 +43,9 @@ test.describe('Theia Workspace', () => {
42
43
  const ws = new TheiaWorkspace(['src/tests/resources/sample-files1', 'src/tests/resources/sample-files2']);
43
44
  const app = await TheiaApp.load(page, ws);
44
45
  const explorer = await app.openView(TheiaExplorerView);
45
- // resources/sample-files1 contains one folder and one file
46
+ // resources/sample-files1 contains two folders and one file
46
47
  expect(await explorer.existsDirectoryNode('sampleFolder')).toBe(true);
48
+ expect(await explorer.existsDirectoryNode('sampleFolderCompact')).toBe(true);
47
49
  expect(await explorer.existsFileNode('sample.txt')).toBe(true);
48
50
  // resources/sample-files2 contains one file
49
51
  expect(await explorer.existsFileNode('another-sample.txt')).toBe(true);