@opensumi/playwright 2.22.8 → 2.22.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-search.test.d.ts","sourceRoot":"","sources":["../../src/tests/file-search.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
5
|
+
const test_1 = require("@playwright/test");
|
|
6
|
+
const ide_utils_1 = require("@opensumi/ide-utils");
|
|
7
|
+
const app_1 = require("../app");
|
|
8
|
+
const explorer_view_1 = require("../explorer-view");
|
|
9
|
+
const text_editor_1 = require("../text-editor");
|
|
10
|
+
const workspace_1 = require("../workspace");
|
|
11
|
+
const hooks_1 = tslib_1.__importStar(require("./hooks"));
|
|
12
|
+
let app;
|
|
13
|
+
let explorer;
|
|
14
|
+
let fileTreeView;
|
|
15
|
+
let workspace;
|
|
16
|
+
hooks_1.default.describe('OpenSumi File Search', () => {
|
|
17
|
+
hooks_1.default.beforeAll(async () => {
|
|
18
|
+
workspace = new workspace_1.OpenSumiWorkspace([path_1.default.resolve('./src/tests/workspaces/default')]);
|
|
19
|
+
app = await app_1.OpenSumiApp.load(hooks_1.page, workspace);
|
|
20
|
+
explorer = await app.open(explorer_view_1.OpenSumiExplorerView);
|
|
21
|
+
explorer.initFileTreeView(workspace.workspace.displayName);
|
|
22
|
+
fileTreeView = explorer.fileTreeView;
|
|
23
|
+
});
|
|
24
|
+
hooks_1.default.afterAll(() => {
|
|
25
|
+
app.dispose();
|
|
26
|
+
});
|
|
27
|
+
(0, hooks_1.default)('open editor.js file', async () => {
|
|
28
|
+
await explorer.open();
|
|
29
|
+
(0, test_1.expect)(await explorer.isVisible()).toBeTruthy();
|
|
30
|
+
await fileTreeView.open();
|
|
31
|
+
(0, test_1.expect)(await fileTreeView.isVisible()).toBeTruthy();
|
|
32
|
+
// Open editor3.js first
|
|
33
|
+
const testFilePath = 'editor3.js';
|
|
34
|
+
const editor = await app.openEditor(text_editor_1.OpenSumiTextEditor, explorer, testFilePath);
|
|
35
|
+
let currentTab = await editor.getCurrentTab();
|
|
36
|
+
let dataUri = await (currentTab === null || currentTab === void 0 ? void 0 : currentTab.getAttribute('data-uri'));
|
|
37
|
+
(0, test_1.expect)(dataUri).toBeDefined();
|
|
38
|
+
if (dataUri) {
|
|
39
|
+
(0, test_1.expect)(new ide_utils_1.URI(dataUri).displayName).toBe(testFilePath);
|
|
40
|
+
}
|
|
41
|
+
const openFileName = 'editor.js';
|
|
42
|
+
await app.quickOpenPalette.open();
|
|
43
|
+
await app.quickOpenPalette.type(openFileName);
|
|
44
|
+
// Just enter
|
|
45
|
+
await app.page.keyboard.press('Enter');
|
|
46
|
+
await app.page.waitForTimeout(500);
|
|
47
|
+
currentTab = await editor.getCurrentTab();
|
|
48
|
+
dataUri = await (currentTab === null || currentTab === void 0 ? void 0 : currentTab.getAttribute('data-uri'));
|
|
49
|
+
(0, test_1.expect)(dataUri).toBeDefined();
|
|
50
|
+
if (dataUri) {
|
|
51
|
+
(0, test_1.expect)(new ide_utils_1.URI(dataUri).displayName).toBe(openFileName);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=file-search.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-search.test.js","sourceRoot":"","sources":["../../src/tests/file-search.test.ts"],"names":[],"mappings":";;;AAAA,wDAAwB;AAExB,2CAA0C;AAE1C,mDAA0C;AAE1C,gCAAqC;AACrC,oDAAwD;AAExD,gDAAoD;AACpD,4CAAiD;AAEjD,yDAAqC;AAErC,IAAI,GAAgB,CAAC;AACrB,IAAI,QAA8B,CAAC;AACnC,IAAI,YAAkC,CAAC;AACvC,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AC,UAAU,CAAC,CAAA,CAAC;QACzD,IAAA,aAAM,EAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9B,IAAI,OAAO,EAAE;YACX,IAAA,aAAM,EAAC,IAAI,eAAG,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACzD;QAED,MAAM,YAAY,GAAG,WAAW,CAAC;QACjC,MAAM,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9C,aAAa;QACb,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAEnC,UAAU,GAAG,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC;QAC1C,OAAO,GAAG,MAAM,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,YAAY,CAAC,UAAU,CAAC,CAAA,CAAC;QACrD,IAAA,aAAM,EAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9B,IAAI,OAAO,EAAE;YACX,IAAA,aAAM,EAAC,IAAI,eAAG,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACzD;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/playwright",
|
|
3
|
-
"version": "2.22.
|
|
3
|
+
"version": "2.22.9",
|
|
4
4
|
"description": "E2E test module for OpenSumi",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"@playwright/test": "1.29.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@opensumi/ide-utils": "2.22.
|
|
32
|
+
"@opensumi/ide-utils": "2.22.9",
|
|
33
33
|
"allure-commandline": "^2.13.8",
|
|
34
34
|
"allure-playwright": "^2.0.0-beta.14",
|
|
35
35
|
"typescript": "4.9.3"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "5f9389bcdc39dc8a17e8f8cf4a94ce324c26efb5"
|
|
38
38
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
|
|
5
|
+
import { URI } from '@opensumi/ide-utils';
|
|
6
|
+
|
|
7
|
+
import { OpenSumiApp } from '../app';
|
|
8
|
+
import { OpenSumiExplorerView } from '../explorer-view';
|
|
9
|
+
import { OpenSumiFileTreeView } from '../filetree-view';
|
|
10
|
+
import { OpenSumiTextEditor } from '../text-editor';
|
|
11
|
+
import { OpenSumiWorkspace } from '../workspace';
|
|
12
|
+
|
|
13
|
+
import test, { page } from './hooks';
|
|
14
|
+
|
|
15
|
+
let app: OpenSumiApp;
|
|
16
|
+
let explorer: OpenSumiExplorerView;
|
|
17
|
+
let fileTreeView: OpenSumiFileTreeView;
|
|
18
|
+
let workspace: OpenSumiWorkspace;
|
|
19
|
+
|
|
20
|
+
test.describe('OpenSumi File Search', () => {
|
|
21
|
+
test.beforeAll(async () => {
|
|
22
|
+
workspace = new OpenSumiWorkspace([path.resolve('./src/tests/workspaces/default')]);
|
|
23
|
+
app = await OpenSumiApp.load(page, workspace);
|
|
24
|
+
explorer = await app.open(OpenSumiExplorerView);
|
|
25
|
+
explorer.initFileTreeView(workspace.workspace.displayName);
|
|
26
|
+
fileTreeView = explorer.fileTreeView;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test.afterAll(() => {
|
|
30
|
+
app.dispose();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('open editor.js file', async () => {
|
|
34
|
+
await explorer.open();
|
|
35
|
+
expect(await explorer.isVisible()).toBeTruthy();
|
|
36
|
+
await fileTreeView.open();
|
|
37
|
+
expect(await fileTreeView.isVisible()).toBeTruthy();
|
|
38
|
+
// Open editor3.js first
|
|
39
|
+
const testFilePath = 'editor3.js';
|
|
40
|
+
const editor = await app.openEditor(OpenSumiTextEditor, explorer, testFilePath);
|
|
41
|
+
let currentTab = await editor.getCurrentTab();
|
|
42
|
+
let dataUri = await currentTab?.getAttribute('data-uri');
|
|
43
|
+
expect(dataUri).toBeDefined();
|
|
44
|
+
if (dataUri) {
|
|
45
|
+
expect(new URI(dataUri).displayName).toBe(testFilePath);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const openFileName = 'editor.js';
|
|
49
|
+
await app.quickOpenPalette.open();
|
|
50
|
+
await app.quickOpenPalette.type(openFileName);
|
|
51
|
+
// Just enter
|
|
52
|
+
await app.page.keyboard.press('Enter');
|
|
53
|
+
await app.page.waitForTimeout(500);
|
|
54
|
+
|
|
55
|
+
currentTab = await editor.getCurrentTab();
|
|
56
|
+
dataUri = await currentTab?.getAttribute('data-uri');
|
|
57
|
+
expect(dataUri).toBeDefined();
|
|
58
|
+
if (dataUri) {
|
|
59
|
+
expect(new URI(dataUri).displayName).toBe(openFileName);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|