From a5ec233559e180ac94d2ad728b9eca2502ca938a Mon Sep 17 00:00:00 2001 From: Dmitriy Kovalenko Date: Fri, 16 Feb 2024 16:06:16 +0100 Subject: [PATCH] chore: Trying to resolve issue with 404 on chrome driver installation (#633) --- .circleci/config.yml | 2 +- cypress/e2e/press.cy.ts | 28 +++++-------- cypress/fixtures/focus-order.html | 66 +++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 20 deletions(-) create mode 100644 cypress/fixtures/focus-order.html diff --git a/.circleci/config.yml b/.circleci/config.yml index 4cd2258..152ed48 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2.1 orbs: - cypress: cypress-io/cypress@3.1.4 + cypress: cypress-io/cypress@3.3.0 jobs: install: executor: cypress/default diff --git a/cypress/e2e/press.cy.ts b/cypress/e2e/press.cy.ts index cfff5c9..4fdb40e 100644 --- a/cypress/e2e/press.cy.ts +++ b/cypress/e2e/press.cy.ts @@ -1,12 +1,7 @@ describe("cy.realPress", { retries: 10 }, () => { it("Can type into an input", () => { - cy.intercept("http://presstest.com/", (req) => { - const html = document.implementation.createHTMLDocument(); - html.body.innerHTML = ``; - req.reply(html.documentElement.innerHTML); - }); - cy.visit("http://presstest.com/"); - cy.get("input").focus(); + cy.visit("https://w3c.github.io/uievents/tools/key-event-viewer"); + cy.get("#input").focus(); cy.realPress("c"); cy.realPress("y"); @@ -20,18 +15,13 @@ describe("cy.realPress", { retries: 10 }, () => { }); it("Can fire native Tab focus switch", () => { - cy.intercept("http://presstest.com/", (req) => { - const html = document.implementation.createHTMLDocument(); - html.body.innerHTML = [ - ``, - ``, - ].join(""); - req.reply(html.documentElement.innerHTML); - }); - cy.visit("http://presstest.com/"); - cy.get("input").click(); - cy.realPress("Tab"); - cy.get("button").should("be.focused"); + cy.visit("./cypress/fixtures/focus-order.html"); + cy.window().focus(); + cy.get("#tab1").realPress("Tab"); // focus switches to tab2 + cy.get("#tab2").should("have.class", "active"); + + cy.get("#tab2").realPress("Tab"); // focus switches to tab3 + cy.get("#tab3").should("have.class", "active"); }); context("Keyboard a11y testing", () => { diff --git a/cypress/fixtures/focus-order.html b/cypress/fixtures/focus-order.html new file mode 100644 index 0000000..471e5c3 --- /dev/null +++ b/cypress/fixtures/focus-order.html @@ -0,0 +1,66 @@ + + + + + + + + + +
+
Tab 1
+
Tab 2
+
Tab 3
+
+
Content 1
+
Content 2
+
Content 3
+ + + + +