|
@@ -1,17 +1,16 @@
|
|
|
describe("评卷页面-裁切图", () => {
|
|
|
beforeEach(() => {
|
|
|
cy.networkStub();
|
|
|
+ cy.visit("/");
|
|
|
});
|
|
|
|
|
|
it("裁切图显示", () => {
|
|
|
- cy.visit("/");
|
|
|
cy.wait(4000)
|
|
|
.get(".mark-body-container .single-image-container")
|
|
|
.should("exist");
|
|
|
});
|
|
|
|
|
|
it("键盘选择鼠标分数成功", () => {
|
|
|
- cy.visit("/");
|
|
|
cy.wait(1000)
|
|
|
.get(".mark-body-container")
|
|
|
.get("body")
|
|
@@ -25,7 +24,6 @@ describe("评卷页面-裁切图", () => {
|
|
|
});
|
|
|
|
|
|
it("键盘选择鼠标分数失败", () => {
|
|
|
- cy.visit("/");
|
|
|
cy.wait(1000)
|
|
|
.get(".mark-body-container")
|
|
|
.get("body")
|
|
@@ -39,32 +37,32 @@ describe("评卷页面-裁切图", () => {
|
|
|
});
|
|
|
|
|
|
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")
|
|
|
+ cy.get(".mark-body-container")
|
|
|
.scrollTo(0, 0)
|
|
|
.get("body")
|
|
|
- .type(addScore)
|
|
|
- .click(200, 200)
|
|
|
- // 要给点时间页面计算动画
|
|
|
+ .type("1")
|
|
|
+ .click(200, 300)
|
|
|
+ .wait(1500)
|
|
|
+ .type("2")
|
|
|
+ .click(300, 500)
|
|
|
+ .wait(1500)
|
|
|
+ .get(".single-image-container:nth(2)")
|
|
|
+ .scrollIntoView()
|
|
|
+ .get("body")
|
|
|
+ .type("3")
|
|
|
+ .click(400, 200)
|
|
|
.wait(500);
|
|
|
- cy.get("body .mark-body-container .score-container").should(
|
|
|
- "have.length",
|
|
|
- 1
|
|
|
- );
|
|
|
- cy.get(".total-score span span").then(function ($div) {
|
|
|
- expect($div.html()).eq(+this.oldTotal + +addScore + "");
|
|
|
- });
|
|
|
+ cy.get(".score-container").should("have.length", 3);
|
|
|
+
|
|
|
+ cy.get(".total-score span span").contains("6");
|
|
|
});
|
|
|
|
|
|
it("裁切图点击-分数在有效区域外", () => {
|
|
|
- cy.visit("/");
|
|
|
// 任务开始渲染了
|
|
|
cy.get(".single-image-container");
|
|
|
// 等待遮罩层消除
|
|
@@ -85,7 +83,6 @@ describe("评卷页面-裁切图", () => {
|
|
|
});
|
|
|
|
|
|
it("清除本题分数", () => {
|
|
|
- cy.visit("/");
|
|
|
// 任务开始渲染了
|
|
|
cy.get(".single-image-container");
|
|
|
// 等待遮罩层消除
|