Skip to content

Commit bd25297

Browse files
committed
cypress
1 parent 112e668 commit bd25297

File tree

5 files changed

+57
-18
lines changed

5 files changed

+57
-18
lines changed

cypress.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
viewportWidth: 1280,
5+
defaultCommandTimeout: 8888,
6+
chromeWebSecurity: false,
7+
reporter: 'junit',
8+
video: true,
9+
retries: {
10+
runMode: 8,
11+
openMode: 0,
12+
},
13+
reporterOptions: {
14+
mochaFile: 'cypress/reports/cypress-[hash].xml',
15+
jenkinsMode: true,
16+
toConsole: true,
17+
},
18+
e2e: {
19+
// We've imported your old cypress plugins here.
20+
// You may want to clean this up later by importing these.
21+
setupNodeEvents(on, config) {
22+
return require('./cypress/plugins/index.js')(on, config)
23+
},
24+
baseUrl: 'http://localhost:3000',
25+
},
26+
})

cypress.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

cypress/e2e/block-basics.cy.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { setupBeforeEach, tearDownAfterEach } from '../support/e2e';
2+
3+
describe('Blocks Tests', () => {
4+
beforeEach(setupBeforeEach);
5+
afterEach(tearDownAfterEach);
6+
7+
it('Add Block: Empty', () => {
8+
// Change page title
9+
cy.get('[contenteditable=true]').first().clear();
10+
11+
cy.get('[contenteditable=true]').first().type('My Add-on Page');
12+
13+
cy.get('.documentFirstHeading').contains('My Add-on Page');
14+
15+
cy.get('[contenteditable=true]').first().type('{enter}');
16+
17+
// Add block
18+
cy.get('.ui.basic.icon.button.block-add-button').first().click();
19+
cy.get('.blocks-chooser .title').contains('Media').click();
20+
cy.get('.content.active.media .button.image').contains('Irudia').click();
21+
22+
// Save
23+
cy.get('#toolbar-save').click();
24+
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');
25+
26+
// then the page view should contain our changes
27+
cy.contains('My Add-on Page');
28+
cy.get('.block.image');
29+
});
30+
});

cypress/integration/block-basics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { setupBeforeEach, tearDownAfterEach } from '../support';
1+
import { setupBeforeEach, tearDownAfterEach } from '../support/e2e';
22

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

0 commit comments

Comments
 (0)