【发布时间】:2020-05-26 08:18:11
【问题描述】:
好的,所以我在配置过程中将 cypress 添加到 aurelia,它运行良好。当我在 github 上将 cypress 设置为一个命令时,我无法让它将 puppeteer 识别为浏览器。因此,我转而使用 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 不确定 au 在后台做什么。
"e2e": "au cypress",
【问题讨论】:
-
与“au”命令相关的操作默认定义在 aurelia_project/tasks 文件夹中。接下来,我们运行以下命令启动所有:
yarn cypress run -
结束我的评论:由于我们使用 typescript,我们将 webpack-preprocessor 作为插件添加到 cypress,如 here 所述
标签: github continuous-integration aurelia cypress github-actions