generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from eea/develop
Cypress coverage
- Loading branch information
Showing
11 changed files
with
543 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
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'); | ||
return voltoBabel; | ||
} | ||
|
||
module.exports = applyDefault; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { setupBeforeEach, tearDownAfterEach } from '../support'; | ||
|
||
describe('Blocks Tests', () => { | ||
beforeEach(setupBeforeEach); | ||
afterEach(tearDownAfterEach); | ||
|
||
it('Add Block: Empty', () => { | ||
// Change page title | ||
cy.get('.documentFirstHeading > .public-DraftStyleDefault-block') | ||
.clear() | ||
.type('My Add-on Page') | ||
.get('.documentFirstHeading span[data-text]') | ||
.contains('My Add-on Page'); | ||
|
||
cy.get('.documentFirstHeading > .public-DraftStyleDefault-block').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('Image').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'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/// <reference types="cypress" /> | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
/** | ||
* @type {Cypress.PluginConfig} | ||
*/ | ||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
/* coverage-start | ||
require('@cypress/code-coverage/task')(on, config) | ||
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc')) | ||
return config | ||
coverage-end */ | ||
}; |
Oops, something went wrong.