如何使cypress与github行动以及本地的aurelia一起使用?

异特罗卡地

好的,所以我在配置过程中将cypress添加到了aurelia,并且工作正常。当我只是在一条命令上在github上设置cypress时,我无法将其识别为木偶浏览器。因此,我改为使用赛普拉斯的官方github动作,并且有效

      - name: test
        uses: cypress-io/github-action@v1
        with:
          start: yarn start
          browser: ${{matrix.browser}}
          record: true
        env:
          # pass the Dashboard record key as an environment variable
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

但是我必须设置cypress.json如下

{
  "baseUrl": "http://localhost:8080",
  "fixturesFolder": "test/e2e/fixtures",
  "integrationFolder": "test/e2e/integration",
  "pluginsFile": "test/e2e/plugins/index.js",
  "screenshotsFolder": "test/e2e/screenshots",
  "supportFile": "test/e2e/support/index.js",
  "videosFolder": "test/e2e/videos",
  "projectId": "..."
}

现在yarn e2e无法运行,因为没有服务器站起来,因为它不再通过cypress.config.js

const CLIOptions =  require( 'aurelia-cli').CLIOptions;
const aureliaConfig = require('./aurelia_project/aurelia.json');
const PORT = CLIOptions.getFlagValue('port') || aureliaConfig.platform.port;
const HOST = CLIOptions.getFlagValue('host') || aureliaConfig.platform.host;

module.exports = {
  config: {
    baseUrl: `http://${HOST}:${PORT}`,
    fixturesFolder: 'test/e2e/fixtures',
    integrationFolder: 'test/e2e/integration',
    pluginsFile: 'test/e2e/plugins/index.js',
    screenshotsFolder: 'test/e2e/screenshots',
    supportFile: 'test/e2e/support/index.js',
    videosFolder: 'test/e2e/videos'
  }
};

我如何才能使其yarn e2e像以前一样工作并在github上运行?(我不在乎等式的哪一边改变了)

这里yarn e2e不确定澳大利亚在幕后做什么。

    "e2e": "au cypress",
异特罗卡地

实现此目的的最简单方法是创建一个 test/e2e/cypress-config.json

{
  "baseUrl": "http://localhost:8080",
  "fixturesFolder": "test/e2e/fixtures",
  "integrationFolder": "test/e2e/integration",
  "pluginsFile": "test/e2e/plugins/index.js",
  "screenshotsFolder": "test/e2e/screenshots",
  "supportFile": "test/e2e/support/index.js",
  "videosFolder": "test/e2e/videos",
  "projectId": "1234"
}

,然后像这样设置github动作。

      - name: test
        uses: cypress-io/github-action@v1
        with:
          config-file: tests/e2e/cypress-config.json
          start: yarn start
          browser: ${{matrix.browser}}
          record: true
        env:
          # pass the Dashboard record key as an environment variable
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

路径并不重要,只需配置相同的路径即可。只要确保它不会与aurelia想要的重叠即可。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用 aurelia 让 webpack 与电子一起工作?

如何使用等级/加入以及一起使用

什么是模拟以及它如何与PrincipalContext一起使用

什么是curl以及如何与nodejs一起使用?

Selenium 和 Cypress 一起使用?

如何使InstanceOf与本地存储中的对象一起使用

使Aurelia-Materialize-Bridge与Aurelia 1.0一起使用

如何配置GitHub Desktop / Windows与代理一起使用?

如何将Docker与GitHub Actions一起使用?

如何使GitHub的Jekyll与index.html一起使用?

与分页一起使用的本地存储

Tensorflow的TripletSemiHardLoss和TripletHardLoss如何使用,以及如何与暹罗网络一起使用?

如何实现已与REGISTER路线一起使用的express-validator与护照本地LOGIN一起使用?

如何使自定義 cypress 命令與打字稿一起使用

如何使本地eslint插件与本地安装的eslint一起使用

如何设置TeamCity以与Cypress一起使用,而无需为每次测试执行安装节点,xvfb,cypress

如何在Aurelia-CLI中添加系绳以与Bootstrap 4一起使用

如何理解R,以及它如何与Google的探戈项目一起使用

我如何使用联接以及在哪里一起使用-Laravel?

将Wrapbootstrap主题与Aurelia一起使用

任何人与graphql一起使用Aurelia

将jQuery MiniColors与Aurelia绑定一起使用

在Django中获取相关对象以及如何将Prefetch与相关模型一起使用

List Comprehensions 以及如何将其与 Pandas 一起使用

如何将Spring ClassPathResource:与classpath:或classpath *:一起使用,以及是否以/开头?

将redux-saga与setInterval一起使用-如何以及何时产生

代码拆分如何与导入/导出以及babel和webpack一起使用?

在网络上解释Ethercalc以及如何与Node js一起使用

反应 嵌套组件的render方法的顺序以及它如何与Redux一起使用