在使用剧作家方面几乎是新的。探索事物,检查我们可以用这个工具做些什么。
我试图推出我们的基于Theia的电子应用在Ubuntu18.04与以下来源。
const { _electron: electron } = require('playwright');
//const { _electron } = require('playwright');
//import { test, expect, Page } from '@playwright/test';
(async () => {
// Launch Electron app.
const electronApp = await electron.launch('./my_executable_file_path');
//this executable is an artifact/packgae
})();
test.describe('New Todo', () => {
test('should allow me to add todo items', async ({ page }) => {
//let's not do anything before the app launch.
});});
在我的package.json文件中,我已经有了这个
"devDependencies": {
"@playwright/test": "^1.20.2",我可以成功地运行基于浏览器的测试用例,但无法启动电子应用程序。
electron.launch: Cannot find module 'electron/index.js'我们在jenkins生成的工件中没有这个index.js。
发布于 2022-07-06 15:33:14
这就是我如何成功发射电子的方法。
const electronApp = await _electron.launch({
args: ['theia-electron-main.js'],
cwd: 'cube-electron/apps/studio/electron/scripts'
});https://stackoverflow.com/questions/71781429
复制相似问题