我试图运行剧作家E2E测试的github-行动,但到目前为止一直没有成功。
- name: Run build and start
run: |
yarn build:e2e
yarn start:e2e &
- name: Run e2e
run: |
yarn e2e我不认为当playwright运行时服务器正在运行,因为所有的e2e测试都失败了。
运行生成并启动
Done in 192.91s.
yarn run v1.22.19
$ env-cmd -f environments/.env.e2e next start
ready - started server on 0.0.0.0:3000, url: ***Run e2e
Test timeout of 270000ms exceeded while running "beforeEach" hook.我非常肯定剧作家不能从上一步连接到http://localhost:3000,这就是为什么所有的测试超时。
发布于 2022-09-29 02:53:45
我有一个类似的问题,我通过将它添加到playwright.config.ts中来解决它。
const config: PlaywrightTestConfig = {
// the rest of the options
webServer: {
command: 'yarn start',
url: 'http://localhost:3000/',
timeout: 120000,
},
use: {
baseURL: 'http://localhost:3000/',
},
// the rest of the options
};
export default config;另外,我不需要在GitHub动作工作流中启动纱线,只是纱线的构建就足够了。
https://stackoverflow.com/questions/73535575
复制相似问题