diff --git a/cypress/integration/analysis.spec.js b/cypress/integration/analysis.spec.js index 3063bc6..a202138 100644 --- a/cypress/integration/analysis.spec.js +++ b/cypress/integration/analysis.spec.js @@ -9,8 +9,8 @@ const { INPUT_SELECTOR } = require('../constants'); const ARROW_SELECTOR = 'img.chessBoardArrow'; -const E2E4_ARROW_SELECTOR = 'chess-board .arrows [data-arrow="e2e4"]'; -const SQUARE_SELECTOR = 'chess-board [class^="highlight square-"][style="background-color: rgb(255, 68, 68); opacity: 0.8;"]'; +const E2E4_ARROW_SELECTOR = 'chess-board .arrows [data-arrow="e2e4"], wc-chess-board [id="arrow-e2e4"]'; +const SQUARE_SELECTOR = 'chess-board [class^="highlight square-"][style="background-color: rgb(255, 68, 68); opacity: 0.8;"], wc-chess-board [class^="highlight square-"][style="background-color: rgb(255, 68, 68); opacity: 0.8;"]'; const BLINDFOLD_SELECTOR = '.ccHelper-blindfold'; const BLINDFOLD_BODY_CLASS = 'ccHelper-docBody--blindfolded'; const BLINDFOLD_HEAD_CLASS = 'ccHelper-docHead--blindfolded'; diff --git a/cypress/integration/games.spec.js b/cypress/integration/games.spec.js index 6cf49db..79f8f41 100644 --- a/cypress/integration/games.spec.js +++ b/cypress/integration/games.spec.js @@ -6,11 +6,6 @@ * (run on analysis board) */ -const { INPUT_SELECTOR } = require('../constants'); - -const ARROW_SELECTOR = 'img.chessBoardArrow'; -const E2E4_ARROW_SELECTOR = 'chess-board .arrows [data-arrow="e2e4"]'; -const SQUARE_SELECTOR = 'chess-board [class^="highlight square-"][style*="background-color: rgb(235, 97, 80)"]'; context('Chess games', () => { beforeEach(() => { diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 57a9848..e700121 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -24,7 +24,7 @@ Cypress.Commands.add('makeMove', (move, options = {}) => { Cypress.Commands.add('fenEquals', (expectedFen) => { return cy - .get('chess-board') + .get('chess-board, wc-chess-board') .then($chessboard => $chessboard[0].game.getPosition().fen) .should('eq', expectedFen) }) @@ -49,7 +49,7 @@ Cypress.Commands.add('flipBoard', () => { Cypress.Commands.add('acceptCookies', () => { return cy.window().then((win) => { try { - const SELECTOR = '.accept-button, .bottom-banner-close'; + const SELECTOR = '.accept-button, .bottom-banner-close, .osano-cm-save'; const buttons = win.document.querySelectorAll(SELECTOR); buttons.forEach(b => b.click()); } catch(e) {} @@ -58,7 +58,7 @@ Cypress.Commands.add('acceptCookies', () => { Cypress.Commands.add('enablePuzzleBoard', () => { return cy.window().then((win) => { - const element = win.document.querySelector('chess-board'); + const element = win.document.querySelector('chess-board, wc-chess-board'); element.game.setOptions({ enabled: true })