describe("评卷页面-裁切图", () => { it("裁切图显示", () => { cy.visit("/"); cy.get(".mark-body-container .single-image-container").should("exist"); }); it("键盘选择鼠标分数成功", () => { cy.visit("/"); cy.wait(1000) .get(".mark-body-container") .get("body") .type("1") .trigger("click", { clientX: 200, clientY: 350, }) .get(".cursor-border") .should("contain", "1"); }); it("键盘选择鼠标分数失败", () => { cy.visit("/"); cy.wait(1000) .get(".mark-body-container") .get("body") .type("1.47") .trigger("click", { clientX: 200, clientY: 350, }) .get(".cursor-border") .should("contain", "1.4"); }); it("裁切图点击-分数增加", () => { cy.visit("/"); // 任务开始渲染了 cy.get(".single-image-container"); // 等待遮罩层消除 cy.get('[data-test="status-spin"]').should("not.exist"); cy.get(".total-score span span").invoke("html").as("oldTotal"); const addScore = "2"; cy.get("body .mark-body-container") .scrollTo(0, 0) .get("body") .type(addScore) .click(200, 200) // 要给点时间页面计算动画 .wait(500) .get(".total-score span span") .then(function ($div) { expect($div.html()).eq(+this.oldTotal + +addScore + ""); }); }); });