mark-header.spec.cy.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. describe("评卷页面", () => {
  2. beforeEach(() => {
  3. cy.intercept("POST", "/mark/getSetting", {
  4. fixture: "settings-1.json",
  5. });
  6. cy.intercept("GET", "/slice/1/374/46208374-1.jpg", {
  7. fixture: "assets/46208374-1.jpg,null",
  8. });
  9. cy.intercept("GET", "/slice/1/374/46208374-2.jpg", {
  10. fixture: "assets/46208374-2.jpg,null",
  11. });
  12. cy.intercept("GET", "/slice/1/374/46208374-3.jpg", {
  13. fixture: "assets/46208374-3.jpg,null",
  14. });
  15. cy.intercept("GET", "/slice/1/374/46208374-4.jpg", {
  16. fixture: "assets/46208374-4.jpg,null",
  17. });
  18. // FIXME: need better way to do it
  19. cy.intercept("GET", "/slice/**", { fixture: "assets/46208374-1.jpg,null" });
  20. });
  21. it("成功加载", () => {
  22. cy.visit("/"); // change URL to match your dev URL
  23. });
  24. it("科目代码和名称显示", () => {
  25. cy.visit("/");
  26. cy.get(".header-container a").should("contain", "431-金融学综合");
  27. });
  28. it("用户姓名显示", () => {
  29. cy.visit("/");
  30. cy.get(".header-container").should("contain", "王小兰");
  31. });
  32. it("小助手显示", () => {
  33. cy.visit("/");
  34. cy.get(".header-container .assistant-text").click();
  35. cy.get(".assistant-table").should("contain", "全卷");
  36. });
  37. });