Skip to content

Commit

Permalink
test(cypress): Cypress 10 / Razzle 4
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Oct 28, 2022
1 parent 5247e9c commit 36429b4
Show file tree
Hide file tree
Showing 11 changed files with 393 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .coverage.babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');

function applyDefault(api) {
const voltoBabel = defaultBabel(api);
voltoBabel.plugins.push('@babel/plugin-transform-modules-commonjs', 'transform-class-properties', 'istanbul');
voltoBabel.plugins.push('istanbul');
return voltoBabel;
}

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.vscode/
.history
.eslintrc.js
.nyc_output
project
coverage
logs
*.log
npm-debug.log*
Expand Down
1 change: 1 addition & 0 deletions .i18n.babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@plone/volto/babel');
26 changes: 26 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
viewportWidth: 1280,
defaultCommandTimeout: 8888,
chromeWebSecurity: false,
reporter: 'junit',
video: true,
retries: {
runMode: 8,
openMode: 0,
},
reporterOptions: {
mochaFile: 'cypress/reports/cypress-[hash].xml',
jenkinsMode: true,
toConsole: true,
},
e2e: {
setupNodeEvents(on, config) {
// e2e testing node events setup code
require('@cypress/code-coverage/task')(on, config);
return config;
},
baseUrl: 'http://localhost:3000',
},
});
17 changes: 0 additions & 17 deletions cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { setupBeforeEach, tearDownAfterEach } from '../support';
import { slateBeforeEach, slateAfterEach } from '../support/e2e';

describe('Blocks Tests', () => {
beforeEach(setupBeforeEach);
afterEach(tearDownAfterEach);
beforeEach(slateBeforeEach);
afterEach(slateAfterEach);

it('Add Block: Empty', () => {
// Change page title
cy.get('[contenteditable=true]').first().clear();

cy.get('[contenteditable=true]').first().type('My Add-on Page');
cy.clearSlateTitle();
cy.getSlateTitle().type('My Add-on Page');

cy.get('.documentFirstHeading').contains('My Add-on Page');

cy.get('[contenteditable=true]').first().type('{enter}');
cy.getSlate().click();

// Add block
cy.get('.ui.basic.icon.button.block-add-button').first().click();
Expand Down
26 changes: 0 additions & 26 deletions cypress/plugins/index.js

This file was deleted.

0 comments on commit 36429b4

Please sign in to comment.