我遇到一个问题,在柏树中返回一个错误:You must set the CYPRESS_MAILOSAUR_API_KEY environment variable to use the Mailosaur plugin.
我尝试将MAILOSAUR_API_KEY放到cypress.json文件和cypress.env.json中。我认为CYPRESS_MAILOSAUR_API_KEY应该用于系统环境变量,在这种情况下需要吗?还是我在cypress.json和env.json中的变量没有被读取?(我的cypress.env.json文件与cypress.json文件一起位于根级文件夹中)
我正在尝试使用cy.writeFile来根据api编写我的夹具文件。我需要这些夹具文件生成之前,任何Cypress测试运行,因为所有的测试将使用这些夹具文件。我只需要在任何测试运行之前运行一次,而不是在每次测试之前运行。
我尝试过在/cypress/support/index.js文件中添加一个前置函数,但当我运行"cypress run“时,它不会创建夹具文件。
import './commands'
before(function() {
// runs once before all tests in the block
const apiUrl
我已经有工作项目,很少通过柏树测试。现在我正在尝试使用Cypress + contract添加合同测试
在开发人员控制台中,我可以看到该应用程序正在调用/api/v1/document-service,但我得到:
协议验证失败-预期的交互不符合实际情况.
部分原木:
W, [2021-07-20T12:49:37.157389 #34805] WARN -- : Verifying - actual interactions do not match expected interactions.
Missing requests:
POST /api/v1/document-se
问题
我正在为Cypress运行一个集成测试,它在本地工作良好,但在Gitlab中运行时却失败了。我正在接收的错误是在使用cy.visit()命令时收到的,该命令导致以下错误:
CypressError: `cy.visit()` failed trying to load:
http://localhost:3000/ The response we received from your web server
was:
404: Not Found
配置
我使用以下命令启动测试:
tests:
image: cypress/base:10
stage: tests
scrip
我正在使用推荐的插件cypress-file-upload从我的fixtures文件夹中附加和上传图像文件。这个文件上传在用户完成时工作得很好,但当Cypress尝试此过程时,服务器将返回以下错误(即使它模仿用户将采取的相同操作): Error: Unexpected end of multipart data
api_1 | at /app/node_modules/dicer/lib/Dicer.js:62:28
api_1 | at processTicksAndRejections (internal/process/task_queues.j
我试图在我的VueJS应用程序上做一个VueJS测试,该应用程序使用axios进行API调用。在我的vue组件中,在挂载中,我执行一个API调用。我的想法是用cy.intercept和cy.wait来模拟这个调用,但是我无法让它工作。在我的本地环境中,当我启动我的前端和后端服务器时,我的测试会随着API调用的进行而通过。但是,调用并没有被静默,cy.wait('@apiCall')也不起作用。
另外,我的测试在Github操作中不起作用,我有这样的错误:AxiosError: The following error originated from your applicatio
应用程序,我必须自动化,完全在一个iframe内。为了继续,我使用了cypress-iframe插件。
但是,当我试图将cypress-drag-drop或cypress-if的命令链接到cypress-iframe上时,它将返回以下错误:
cy.iframe(...).find(...).should(...).if is not a function
下面是抛出错误的脚本:cy.iframe('#iframeID').find('#checkboxLocator').should('be.visible').if('not.check
我正试着在我工作的地方和詹金斯一起做柏树测试。由于代理问题,我已经在s3中上传了我的本地节点模块,在运行测试之前,我将下载这些模块,然后使用以下命令运行测试。
但是我还不能理解的错误。有人能解释一下这里出了什么问题吗?
CYPRESS_CACHE_FOLDER=./cypress-cache ./node_modules/.bin/cypress run --headless --browser chrome --spec cypress/integration/api/api-test.spec.ts
The cypress npm package is installed, but the
当我在Cypress测试中查看某些路由1/8次时,它失败了。有没有办法让Cypress测试总是通过,而不是在多次尝试后随机失败? 下面是我的代码: it("Check if scroll is working on list", () => {
cy.server()
cy.route('GET', '**/api/scorer/company/news/**', { timeout: 15000 }).as('loadMoreAbstracts');
cy.get('[data-cy=Virtual
我正在验证下面的“登录”Cypress测试中的cookie,但是柏树抛出了以下错误:
TypeError: cy.chain不是一个函数
显然,在'../support/index.js'下导入了以下内容,请有人告诉我为什么会抛出错误
import './commands'
柏树试验:
describe("Login test validate cookie", () => {
it.only('Verify the cookies test for login', function() {
我正在尝试使用云构建来部署我的cypress测试,然而,在云构建中我一直收到以下错误。
Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable
我不确定我做错了什么。
这是我的docker文件
FROM cypress/browsers:node13.8.0-chrome81-ff75
WORKDIR /root
COPY package*.json ./
RUN npm install
我正在尝试为react with cypress中的组件编写“单元测试”。
跟随链接
当我为一个组件编写测试用例并尝试使用"npx cypress open-ct“运行时
然后得到上面的错误(问题标题)...
注意:对于登录,实现了oAuth2!
我的index.spec.js文件是
import * as React from 'react';
import { mount } from '@cypress/react';
import User from './index';
describe('User component
我花了两天时间在码头上运行柏树,这样我就可以在本地测试它。这是Dockerfile
FROM cypress/base:16 as UIbuilder
ENV NODE_ENV development
WORKDIR /opt/app
COPY custom-ui .
RUN npm install
RUN npm run build
RUN npm pack
FROM cypress/base:16 as APPbuilder
ARG REACT_APP_PORTAL_API
ARG REACT_APP_ENVIRONMENT="production"
ENV REACT