gpt4 book ai didi

cypress - GitHub 操作管道中的 yml 文件中的意外值 "with"

转载 作者:行者123 更新时间:2023-12-02 01:24:53 25 4
gpt4 key购买 nike

在运行 Cypress 测试时,在 GitHub 操作管道中出现以下错误:工作流无效。 .github/workflows/main.yml(第 44 行,第 9 列):意外值“with”。有人可以建议我们如何在 with: 级别的 yml 文件中添加 browser : chrome

name: Cypress Automation Tests

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [develop]

env:

CYPRESS_BOOKING_FREE_USER_PASSWORD: ${{ secrets.CYPRESS_BOOKING_FREE_USER_PASSWORD }}


jobs:
install:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
uses: cypress-io/github-action@v2
with:
# just perform install
runTests: false

tests:
runs-on: ubuntu-22.04
needs: install
steps:
- name: Check out code
uses: actions/checkout@v2
# we re-install the dependencies
- name: Install dependencies
uses: cypress-io/github-action@v2
with:
# just perform install
runTests: false

- name: Run Automation tests
run: npm run cy:run -- --env grepTags="@Envtest1",ENV="staging"
with:
browser: chrome
- name: Upload Results
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
path: cypress/videos

最佳答案

with 选项与您在上面给出的运行命令不兼容。

但是可以使用--browser Cypress命令行选项,和本地cy:run命令一样

引用:cypress run --browser

cypress run --browser chrome

管道(为了更清楚而缩写)

jobs:
install:
runs-on: ubuntu-22.04
steps:
...

tests:
runs-on: ubuntu-22.04
needs: install
steps:
...
- name: Run Automation tests
run: npm run cy:run -- --browser chrome --env grepTags="@Envtest1",ENV="staging"

关于cypress - GitHub 操作管道中的 yml 文件中的意外值 "with",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75000798/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com