From 201f94e133099d596a3a7051e6fe446482c479d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 10 Mar 2026 01:02:33 +0800 Subject: [PATCH] Use String.raw for backslash-escaped CSS selectors in Cypress tests (S7780) Co-Authored-By: Claude Opus 4.6 --- cypress/e2e/discoverConformance.cy.js | 14 +++++++------- cypress/e2e/discoverPerformance.cy.js | 16 ++++++++-------- cypress/e2e/discoverTabs.cy.js | 12 ++++++------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cypress/e2e/discoverConformance.cy.js b/cypress/e2e/discoverConformance.cy.js index 466f248..c61caec 100644 --- a/cypress/e2e/discoverConformance.cy.js +++ b/cypress/e2e/discoverConformance.cy.js @@ -13,21 +13,21 @@ describe("Discover Conformance Page", () => { }); it("page loads and loading overlay disappears", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); }); it("displays Rule Settings sidebar", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Rule Settings").should("be.visible"); }); it("displays Conformance Checking Results heading", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Conformance Checking Results").should("be.visible"); }); it("displays rule type radio options", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Have activity").should("be.visible"); cy.contains("Activity sequence").should("be.visible"); cy.contains("Activity duration").should("be.visible"); @@ -37,18 +37,18 @@ describe("Discover Conformance Page", () => { }); it("displays Clear and Apply buttons", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("button", "Clear").should("be.visible"); cy.contains("button", "Apply").should("exist"); }); it("displays Activity list area", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Activity list").should("be.visible"); }); it("displays default placeholder values in results", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Conformance Rate").should("be.visible"); cy.contains("Cases").should("be.visible"); }); diff --git a/cypress/e2e/discoverPerformance.cy.js b/cypress/e2e/discoverPerformance.cy.js index ea9ea22..548940f 100644 --- a/cypress/e2e/discoverPerformance.cy.js +++ b/cypress/e2e/discoverPerformance.cy.js @@ -14,21 +14,21 @@ describe("Discover Performance Page", () => { it("page loads and loading overlay disappears", () => { // Loading overlay should not be visible after data loads - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); }); it("displays Time Usage sidebar section", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Time Usage").should("be.visible"); }); it("displays Frequency sidebar section", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Frequency").should("be.visible"); }); it("displays sidebar navigation items", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Cycle Time & Efficiency").should("be.visible"); cy.contains("Processing Time").should("be.visible"); cy.contains("Waiting Time").should("be.visible"); @@ -36,7 +36,7 @@ describe("Discover Performance Page", () => { }); it("displays chart titles", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Average Cycle Time").should("be.visible"); cy.contains("Cycle Efficiency").should("be.visible"); cy.contains("Average Processing Time").should("be.visible"); @@ -45,19 +45,19 @@ describe("Discover Performance Page", () => { }); it("displays frequency chart titles", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("New Cases").should("be.visible"); cy.contains("Number of Cases by Activity").should("be.visible"); }); it("renders canvas elements for charts", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); // Chart.js renders into canvas elements cy.get("canvas").should("have.length.at.least", 5); }); it("sidebar navigation scrolls to section", () => { - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); // Click on "Waiting Time" in sidebar cy.contains("li", "Waiting Time").click(); // The Waiting Time section should be in view diff --git a/cypress/e2e/discoverTabs.cy.js b/cypress/e2e/discoverTabs.cy.js index 099d47a..0876a52 100644 --- a/cypress/e2e/discoverTabs.cy.js +++ b/cypress/e2e/discoverTabs.cy.js @@ -28,7 +28,7 @@ describe("Discover Tab Navigation", () => { cy.get(".nav-item").contains("PERFORMANCE").click(); cy.url().should("include", "/performance"); cy.wait("@getPerformance"); - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Time Usage").should("be.visible"); }); @@ -36,7 +36,7 @@ describe("Discover Tab Navigation", () => { cy.get(".nav-item").contains("CONFORMANCE").click(); cy.url().should("include", "/conformance"); cy.wait("@getLogCheckParams"); - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Rule Settings").should("be.visible"); }); @@ -50,7 +50,7 @@ describe("Discover Tab Navigation", () => { beforeEach(() => { cy.visit("/discover/log/297310264/performance"); cy.wait("@getPerformance"); - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); }); it("clicking MAP tab navigates to map page", () => { @@ -64,7 +64,7 @@ describe("Discover Tab Navigation", () => { cy.get(".nav-item").contains("CONFORMANCE").click(); cy.url().should("include", "/conformance"); cy.wait("@getLogCheckParams"); - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Rule Settings").should("be.visible"); }); }); @@ -73,7 +73,7 @@ describe("Discover Tab Navigation", () => { beforeEach(() => { cy.visit("/discover/log/297310264/conformance"); cy.wait("@getLogCheckParams"); - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); }); it("clicking MAP tab navigates to map page", () => { @@ -87,7 +87,7 @@ describe("Discover Tab Navigation", () => { cy.get(".nav-item").contains("PERFORMANCE").click(); cy.url().should("include", "/performance"); cy.wait("@getPerformance"); - cy.get(".z-\\[9999\\]", { timeout: 10000 }).should("not.exist"); + cy.get(String.raw`.z-\[9999\]`, { timeout: 10000 }).should("not.exist"); cy.contains("Time Usage").should("be.visible"); }); });