From 7ae9bd149391c15a66f7b772e741186c64f7b6e0 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Fri, 22 Mar 2024 19:16:06 +0100 Subject: [PATCH] Adequate import in cypress commands, move to new helpers module --- packages/volto/cypress/support/commands.js | 2 -- packages/volto/cypress/support/helpers.js | 1 + .../tests/core/volto-slate/01-block-slate-title-description.js | 2 +- packages/volto/cypress/tests/core/volto-slate/02-block-slate.js | 2 +- packages/volto/cypress/tests/core/volto-slate/03-block-slate.js | 2 +- packages/volto/cypress/tests/core/volto-slate/04-block-focus.js | 2 +- .../tests/core/volto-slate/05-block-slate-format-basics.js | 2 +- .../tests/core/volto-slate/06-block-slate-format-link.js | 2 +- .../tests/core/volto-slate/07-block-slate-format-ulist.js | 2 +- .../tests/core/volto-slate/08-block-slate-format-olist.js | 2 +- .../cypress/tests/core/volto-slate/09-block-slate-slashmenu.js | 2 +- .../tests/core/volto-slate/24-block-slate-format-boldlists.js | 2 +- .../tests/core/volto-slate/25-block-slate-paste-images.js | 2 +- .../cypress/tests/core/volto-slate/27-block-slate-paste-html.js | 2 +- .../tests/core/volto-slate/28-table-block-slate-paste.js | 2 +- 15 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 packages/volto/cypress/support/helpers.js diff --git a/packages/volto/cypress/support/commands.js b/packages/volto/cypress/support/commands.js index 6c61b1d811..0410029d94 100644 --- a/packages/volto/cypress/support/commands.js +++ b/packages/volto/cypress/support/commands.js @@ -22,8 +22,6 @@ const ploneAuthObj = { pass: ploneAuth[1], }; -export * from './volto-slate'; - // --- isInViewport ---------------------------------------------------------- Cypress.Commands.add('isInViewport', (element) => { cy.get(element).then(($el) => { diff --git a/packages/volto/cypress/support/helpers.js b/packages/volto/cypress/support/helpers.js new file mode 100644 index 0000000000..046ccce0ac --- /dev/null +++ b/packages/volto/cypress/support/helpers.js @@ -0,0 +1 @@ +export * from './volto-slate'; diff --git a/packages/volto/cypress/tests/core/volto-slate/01-block-slate-title-description.js b/packages/volto/cypress/tests/core/volto-slate/01-block-slate-title-description.js index 6589739022..b37c4ff80b 100644 --- a/packages/volto/cypress/tests/core/volto-slate/01-block-slate-title-description.js +++ b/packages/volto/cypress/tests/core/volto-slate/01-block-slate-title-description.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/02-block-slate.js b/packages/volto/cypress/tests/core/volto-slate/02-block-slate.js index 9cedde19c4..fd795beca7 100644 --- a/packages/volto/cypress/tests/core/volto-slate/02-block-slate.js +++ b/packages/volto/cypress/tests/core/volto-slate/02-block-slate.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/03-block-slate.js b/packages/volto/cypress/tests/core/volto-slate/03-block-slate.js index 4f2cc9baa8..3d4906b1f0 100644 --- a/packages/volto/cypress/tests/core/volto-slate/03-block-slate.js +++ b/packages/volto/cypress/tests/core/volto-slate/03-block-slate.js @@ -1,4 +1,4 @@ -import { slateBeforeEach, getSlateBlockValue } from '../../../support/commands'; +import { slateBeforeEach, getSlateBlockValue } from '../../../support/helpers'; describe('Block Tests', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/04-block-focus.js b/packages/volto/cypress/tests/core/volto-slate/04-block-focus.js index b30bbe16c1..edd4e200dd 100644 --- a/packages/volto/cypress/tests/core/volto-slate/04-block-focus.js +++ b/packages/volto/cypress/tests/core/volto-slate/04-block-focus.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/05-block-slate-format-basics.js b/packages/volto/cypress/tests/core/volto-slate/05-block-slate-format-basics.js index 4bcd4c66de..b80620c59a 100644 --- a/packages/volto/cypress/tests/core/volto-slate/05-block-slate-format-basics.js +++ b/packages/volto/cypress/tests/core/volto-slate/05-block-slate-format-basics.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests: Basic text format', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/06-block-slate-format-link.js b/packages/volto/cypress/tests/core/volto-slate/06-block-slate-format-link.js index 84466f323d..08866b263b 100644 --- a/packages/volto/cypress/tests/core/volto-slate/06-block-slate-format-link.js +++ b/packages/volto/cypress/tests/core/volto-slate/06-block-slate-format-link.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests: Links', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/07-block-slate-format-ulist.js b/packages/volto/cypress/tests/core/volto-slate/07-block-slate-format-ulist.js index 10cb24ed6d..02f8b85629 100644 --- a/packages/volto/cypress/tests/core/volto-slate/07-block-slate-format-ulist.js +++ b/packages/volto/cypress/tests/core/volto-slate/07-block-slate-format-ulist.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests: Bulleted lists', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/08-block-slate-format-olist.js b/packages/volto/cypress/tests/core/volto-slate/08-block-slate-format-olist.js index be763871f4..1e62db98f6 100644 --- a/packages/volto/cypress/tests/core/volto-slate/08-block-slate-format-olist.js +++ b/packages/volto/cypress/tests/core/volto-slate/08-block-slate-format-olist.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests: Numbered lists', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/09-block-slate-slashmenu.js b/packages/volto/cypress/tests/core/volto-slate/09-block-slate-slashmenu.js index b421870eba..e5862d441d 100644 --- a/packages/volto/cypress/tests/core/volto-slate/09-block-slate-slashmenu.js +++ b/packages/volto/cypress/tests/core/volto-slate/09-block-slate-slashmenu.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('SlashMenu Test: Shortcuts', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/24-block-slate-format-boldlists.js b/packages/volto/cypress/tests/core/volto-slate/24-block-slate-format-boldlists.js index c6b55806ad..8dc4e9aca8 100644 --- a/packages/volto/cypress/tests/core/volto-slate/24-block-slate-format-boldlists.js +++ b/packages/volto/cypress/tests/core/volto-slate/24-block-slate-format-boldlists.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests: Bold Bulleted lists', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/25-block-slate-paste-images.js b/packages/volto/cypress/tests/core/volto-slate/25-block-slate-paste-images.js index 262c731424..7d4dc9a89c 100644 --- a/packages/volto/cypress/tests/core/volto-slate/25-block-slate-paste-images.js +++ b/packages/volto/cypress/tests/core/volto-slate/25-block-slate-paste-images.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests: paste external images', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/27-block-slate-paste-html.js b/packages/volto/cypress/tests/core/volto-slate/27-block-slate-paste-html.js index e0f69fac04..0f657a5825 100644 --- a/packages/volto/cypress/tests/core/volto-slate/27-block-slate-paste-html.js +++ b/packages/volto/cypress/tests/core/volto-slate/27-block-slate-paste-html.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests: external text containing html contents/tags ', () => { beforeEach(slateBeforeEach); diff --git a/packages/volto/cypress/tests/core/volto-slate/28-table-block-slate-paste.js b/packages/volto/cypress/tests/core/volto-slate/28-table-block-slate-paste.js index a07f9a62b6..72de3f313e 100644 --- a/packages/volto/cypress/tests/core/volto-slate/28-table-block-slate-paste.js +++ b/packages/volto/cypress/tests/core/volto-slate/28-table-block-slate-paste.js @@ -1,4 +1,4 @@ -import { slateBeforeEach } from '../../../support/commands'; +import { slateBeforeEach } from '../../../support/helpers'; describe('Block Tests: pasting content in table block', () => { beforeEach(slateBeforeEach);