@theia/playwright 1.58.1 → 1.58.3
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/package.json +2 -2
- package/src/theia-app-loader.ts +8 -12
- package/src/theia-workspace.ts +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/playwright",
|
|
3
|
-
"version": "1.58.
|
|
3
|
+
"version": "1.58.3",
|
|
4
4
|
"description": "System tests for Theia",
|
|
5
5
|
"license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"main": "lib/index",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ca70c15332f91e0f61b12cd147b5ff8326e2e6d2"
|
|
51
51
|
}
|
package/src/theia-app-loader.ts
CHANGED
|
@@ -15,11 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { Page, PlaywrightWorkerArgs, _electron as electron } from '@playwright/test';
|
|
18
|
-
import * as path from 'path';
|
|
19
|
-
import * as fs from 'fs';
|
|
20
18
|
import { TheiaApp } from './theia-app';
|
|
21
19
|
import { TheiaWorkspace } from './theia-workspace';
|
|
22
|
-
import { OSUtil } from './util';
|
|
23
20
|
|
|
24
21
|
export interface TheiaAppFactory<T extends TheiaApp> {
|
|
25
22
|
new(page: Page, initialWorkspace: TheiaWorkspace, isElectron?: boolean): T;
|
|
@@ -104,7 +101,7 @@ namespace TheiaElectronAppLoader {
|
|
|
104
101
|
const appPath = electronConfig.electronAppPath!;
|
|
105
102
|
const pluginsPath = electronConfig.pluginsPath;
|
|
106
103
|
const launchOptions = electronConfig.launchOptions ?? {
|
|
107
|
-
additionalArgs: ['--no-cluster'],
|
|
104
|
+
additionalArgs: ['--no-sandbox', '--no-cluster'],
|
|
108
105
|
electronAppPath: appPath,
|
|
109
106
|
pluginsPath: pluginsPath
|
|
110
107
|
};
|
|
@@ -122,14 +119,10 @@ namespace TheiaElectronAppLoader {
|
|
|
122
119
|
export function toPlaywrightOptions(
|
|
123
120
|
electronLaunchOptions: { additionalArgs: string[], electronAppPath: string, pluginsPath?: string } | object,
|
|
124
121
|
workspace?: TheiaWorkspace
|
|
125
|
-
): {
|
|
122
|
+
): {
|
|
123
|
+
args: string[]
|
|
124
|
+
} | object {
|
|
126
125
|
if ('additionalArgs' in electronLaunchOptions && 'electronAppPath' in electronLaunchOptions) {
|
|
127
|
-
const executablePath = path.normalize(path.join(electronLaunchOptions.electronAppPath, 'node_modules/.bin/electron')) + (OSUtil.isWindows ? '.cmd' : '');
|
|
128
|
-
if (!fs.existsSync(executablePath)) {
|
|
129
|
-
const errorMsg = `executablePath: ${executablePath} does not exist`;
|
|
130
|
-
console.log(errorMsg);
|
|
131
|
-
throw new Error(errorMsg);
|
|
132
|
-
}
|
|
133
126
|
const args = [
|
|
134
127
|
electronLaunchOptions.electronAppPath,
|
|
135
128
|
...electronLaunchOptions.additionalArgs,
|
|
@@ -142,7 +135,9 @@ namespace TheiaElectronAppLoader {
|
|
|
142
135
|
args.push(workspace.path);
|
|
143
136
|
}
|
|
144
137
|
|
|
145
|
-
return {
|
|
138
|
+
return {
|
|
139
|
+
args: args
|
|
140
|
+
};
|
|
146
141
|
}
|
|
147
142
|
return electronLaunchOptions;
|
|
148
143
|
}
|
|
@@ -159,6 +154,7 @@ export namespace TheiaAppLoader {
|
|
|
159
154
|
// disable native elements and early window to avoid issues with the electron app
|
|
160
155
|
process.env.THEIA_ELECTRON_DISABLE_NATIVE_ELEMENTS = '1';
|
|
161
156
|
process.env.THEIA_ELECTRON_NO_EARLY_WINDOW = '1';
|
|
157
|
+
process.env.THEIA_NO_SPLASH = 'true';
|
|
162
158
|
return TheiaElectronAppLoader.load(args, initialWorkspace, factory);
|
|
163
159
|
}
|
|
164
160
|
const page = await args.browser.newPage();
|
package/src/theia-workspace.ts
CHANGED
|
@@ -47,12 +47,14 @@ export class TheiaWorkspace {
|
|
|
47
47
|
|
|
48
48
|
get path(): string {
|
|
49
49
|
let workspacePath = this.workspacePath;
|
|
50
|
-
|
|
51
|
-
workspacePath = `${OSUtil.fileSeparator}${workspacePath}`;
|
|
52
|
-
}
|
|
50
|
+
|
|
53
51
|
if (OSUtil.isWindows) {
|
|
54
52
|
// Drive letters in windows paths have to be lower case
|
|
55
53
|
workspacePath = workspacePath.replace(/.:/, matchedChar => matchedChar.toLowerCase());
|
|
54
|
+
} else {
|
|
55
|
+
if (!OSUtil.osStartsWithFileSeparator(this.workspacePath)) {
|
|
56
|
+
workspacePath = `${OSUtil.fileSeparator}${workspacePath}`;
|
|
57
|
+
}
|
|
56
58
|
}
|
|
57
59
|
return workspacePath;
|
|
58
60
|
}
|