在最初的开发人员离开后,我最近为我们的项目选择了cypress配置和测试。我在运行现有的测试时遇到了问题:当从命令行运行时,所有的测试都会抛出这个错误: TypeError: The following error originated from your test code, not from Cypress.
. > fs.existsSync is not a function 当我启动GUI时,它抛出相同的错误,如下所示: ? 除了看到fs.existsSync被弃用之外,我在问题和网络上都没有找到任何东西。 当我检查cypress.io的gitter站点时,他们建议我
我读到了关于柏树的。在最后一部分中,作者在调用Cypress.env时重写了类型记录所要推断的类型。
这是我想要理解的片段。
export { };
declare global {
namespace Cypress {
export interface Cypress {
/**
* Returns all environment variables set with CYPRESS_ prefix or in "env" object in "cypress.json"
*
* @se
我编写了这段代码,它运行得很好,是用TypeScript编写的。当我在Cypress中的测试文件中使用相同的代码时,我会得到错误的TypeError: fs.readdir is not a function
import * as fs from 'fs'
let inputPath: String = "C:\\Users\\rkon";
let replacementString = "/";
let newInputPath = inputPath.split('\\').join(replacementString
我有一个使用Cucumber预处理器支持TypeScript的Cypress项目,它突然开始抛出以下异常:
TypeError: Cannot read properties of undefined (reading 'uid')
有时,当我更改到不同的工作区时,它会工作,但当我打开Cypress运行器本身时,甚至在Jenkins中执行时,这个错误都会再次产生。
Cypress Runner: (v8.4.0)
Jenkins控制台: (v8.7.0)
The function exported by the plugins file threw an error
我有码头文件
FROM cypress/base:12.1.0 as hlg
RUN mkdir /app WORKDIR /app COPY . /app
RUN npm install
RUN $(npm bin)/cypress verify
RUN ["npm", "run", "cy:runhlg"]
FROM cypress/base:12.1.0 as tst
RUN mkdir /app WORKDIR /app COPY . /app
RUN npm install
RUN $(npm bin)/cypres
我对类型记录比较陌生,虽然我认为我理解其中的大部分内容,但我不理解的是为什么我不能在具有Cypress.Chainable类型的值上使用标准的JS方法。
例如:
const chainedString: Cypress.Chainable<string> = cy.wrap(" test ")
const trimmed = chainedString.trim()
引发如下错误:Property 'trim' does not exist on type 'Chainable<string>'
如何处理返回的、可链接的值
我正在使用cypress,并且我想从另一个文件导入一个函数。 由于某些原因,我似乎不能成为安倍来进口东西。 我在vscode上得到错误: Parsing error: 'import' and 'export' may appear only with 'sourceType: module'eslint 当我运行cypress时,我从下面的代码行得到这个错误: import test from '../support/helperFunctions'
helperFunctions_1.default is not a f
我想连接到Mysql在服务器上删除几条记录。我试过使用一些教程和答案。因为他们都是关于旧版本的柏树,我不知道是什么错误。这是密码。我很高兴知道是否有任何简单的方法与较少的代码或简单的配置。谢谢
cypress.config.js
const mysql = require("mysql")
function queryTestDb(query, config) {
// creates a new mysql connection using credentials from cypress.json env's
const connection = mysq
我正在尝试使用Docker运行Cypress测试head(无人)。从我遵循的教程中,我得到了这个命令: docker run -it -v ~/tdd/services/cypress:/cypress -w /cypress --entrypoint=cypress cypress/included:4.9.0 run 这会抛出: Can't run because no spec files were found.
We searched for any files inside of this folder:
/cypress/cypress/integration 我将C
当我尝试使用cypress open或cypress run时,会得到以下错误:
✖ Verifying Cypress can run /*/*/.cache/Cypress/3.1.5/Cypress
→ Cypress Version: 3.1.5
Cypress failed to start.
This is usually caused by a missing library or dependency.
The error below should indicate which dependency is missing.
https://on.cypress.
我正在尝试使适应我自己的环境,这个环境非常类似于这个代码库,但是我得到了一个:
cypress | Cypress could not verify that this server is running:
cypress |
cypress | > http://client
cypress |
cypress | We are verifying this server because it has been configured as your baseUrl.
cypress |
cypress |
我在Cypress方面取得了很好的进展,但是在尝试调用单个Spec的时候有点松懈。
package.json中的行如下所示:
"cypress:runST": "cypress run --spec'/cypress/integration/02_DBM_H1_ST_spec.js'",
我从npm run cypress:runST...errors开始!
即使我尝试将其运行为:
`npm run cypress run --spec '/cypress/integration/02_DBM_H1_ST_spec.js'
我