Skip to content

Commit

Permalink
cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
ionlizarazu committed Dec 20, 2022
1 parent 112e668 commit bd25297
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 18 deletions.
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: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:3000',
},
})
17 changes: 0 additions & 17 deletions cypress.json

This file was deleted.

30 changes: 30 additions & 0 deletions cypress/e2e/block-basics.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { setupBeforeEach, tearDownAfterEach } from '../support/e2e';

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

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

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

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

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

// Add block
cy.get('.ui.basic.icon.button.block-add-button').first().click();
cy.get('.blocks-chooser .title').contains('Media').click();
cy.get('.content.active.media .button.image').contains('Irudia').click();

// Save
cy.get('#toolbar-save').click();
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');

// then the page view should contain our changes
cy.contains('My Add-on Page');
cy.get('.block.image');
});
});
2 changes: 1 addition & 1 deletion cypress/integration/block-basics.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setupBeforeEach, tearDownAfterEach } from '../support';
import { setupBeforeEach, tearDownAfterEach } from '../support/e2e';

describe('Blocks Tests', () => {
beforeEach(setupBeforeEach);
Expand Down
File renamed without changes.

0 comments on commit bd25297

Please sign in to comment.