小编tra*_*le7的帖子

运行赛普拉斯测试后出现空白页

每当我运行新的 cypress 测试时,应该显示 UI 的页面都是空白的。即使我单击每个测试的每个部分,它仍然是空白的。请参见下图。

图像

1

Cypress 软件包版本:10.4.0
Node v16.16.0

代码:

    describe("home page", () => {
      beforeEach(() => {
    cy.visit("http://localhost:3000")
    })

    context("Hero section", () => {
      it("the h1 contains the correct text", () => {
      cy.getByData("hero-heading").contains(
        "Testing Next.js Applications with Cypress"
      )
    })

    it("the features on the homepage are correct", () => {
      cy.get("dt").eq(0).contains("4 Courses")
      cy.get("dt").eq(1).contains("25+ Lessons")
      cy.get("dt").eq(2).contains("Free and Open Source")
    })
  })

  context("Courses section", () => {
    it("CourseL Testing Your First Next.js Application", () => {
      cy.getByData('course-0')
        .find('a')
        .eq(3) …
Run Code Online (Sandbox Code Playgroud)

cypress

26
推荐指数
3
解决办法
2万
查看次数

标签 统计

cypress ×1