首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在github-actions中运行针对本地主机的剧作家?

如何在github-actions中运行针对本地主机的剧作家?
EN

Stack Overflow用户
提问于 2022-08-29 23:16:49
回答 1查看 351关注 0票数 2

我试图运行剧作家E2E测试的github-行动,但到目前为止一直没有成功。

代码语言:javascript
复制
    - name: Run build and start
      run: |
        yarn build:e2e
        yarn start:e2e &
    - name: Run e2e
      run: |
        yarn e2e

我不认为当playwright运行时服务器正在运行,因为所有的e2e测试都失败了。

运行生成并启动

代码语言:javascript
复制
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

代码语言:javascript
复制
Test timeout of 270000ms exceeded while running "beforeEach" hook.

我非常肯定剧作家不能从上一步连接到http://localhost:3000,这就是为什么所有的测试超时。

EN

回答 1

Stack Overflow用户

发布于 2022-09-29 02:53:45

我有一个类似的问题,我通过将它添加到playwright.config.ts中来解决它。

代码语言:javascript
复制
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://github.com/microsoft/playwright/issues/14814

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73535575

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档