【发布时间】:2021-04-17 17:13:02
【问题描述】:
我正在尝试为我的电子应用程序创建一个 circleci 自动化测试。
我按照这里的说明进行操作:https://circleci.com/blog/electron-testing/
我的仓库:https://github.com/dhanyn10/electron-example/tree/spectron
我的项目文件夹是这样的
electron-example
|──/.circleci
| |──config.yml
|──/bootbox
|──/project1
|──/project2
因为在我的项目中包含许多应用程序,我需要在文件夹中指定要测试的应用程序。这是我的circleci配置
version: 2.1
jobs:
build:
working_directory: ~/electron-example/bootbox
docker:
- image: circleci/node:11-browsers
steps:
- checkout:
path: ~/electron-example
- run:
name: Update NPM
command: "sudo npm install -g npm"
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install Dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: Run tests
command: npm run test
package.json
...
"devDependencies": {
"electron": "^11.4.3",
"electron-builder": "^22.10.4",
"mocha": "^8.3.2",
"spectron": "^13.0.0"
},
...
它在下面返回错误
#!/bin/sh -eo pipefail
# ERROR IN CONFIG FILE:
# [#/jobs/build] only 1 subschema matches out of 2
# 1. [#/jobs/build/steps/0] 0 subschemas matched instead of one
# | 1. [#/jobs/build/steps/0] extraneous key [path] is not permitted
# | | Permitted keys:
# | | - persist_to_workspace
# | | - save_cache
# | | - run
# | | - checkout
# | | - attach_workspace
# | | - store_test_results
# | | - restore_cache
# | | - store_artifacts
# | | - add_ssh_keys
# | | - deploy
# | | - setup_remote_docker
# | | Passed keys:
# | | []
# | 2. [#/jobs/build/steps/0] Input not a valid enum value
# | | Steps without arguments can be called as strings
# | | enum:
# | | - checkout
# | | - setup_remote_docker
# | | - add_ssh_keys
#
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false
Exited with code exit status 1
CircleCI received exit code 1
如何解决这个错误?
【问题讨论】:
标签: electron circleci spectron