From 53284d96a792fff6d31cb3d47bf8c88e6d07647d Mon Sep 17 00:00:00 2001 From: Keng Ye Date: Tue, 3 Aug 2021 12:20:44 +0800 Subject: [PATCH] test: escape cy.get() selector in getByTestID Using jquery escapeSelector() because cypress is running jquery under the hood --- cypress/support/commands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 57afeacbbf..cac72a7196 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -64,7 +64,7 @@ declare global { } Cypress.Commands.add('getByTestID', (selector, ...args) => { - return cy.get(`[data-testid=${selector}]`, ...args) + return cy.get(`[data-testid=${Cypress.$.escapeSelector(selector)}]`, ...args) }) Cypress.Commands.add('createEmptyWallet', (isRandom: boolean = false) => {