34
loading...
This website collects cookies to deliver better user experience
module.exports = {
"user input": {
"successfully types into a text input field": {
"after typing": {
"tagName": "input",
"attributes": {
"value": "kangaroo canyon"
}
}
}
}
}
module.exports = {
"login page": {
"login button": {
"1": "<button type=\"button\" data-cy=\"login\">Login</button>"
}
}
}
describe('workflow builder', () => {
it('PDF section is displayed properly', () => {
...
cy.get('#pdf-section-btn').click()
cy.document().imageSnapshot()
})
})
describe('workflow builder', () => {
it('PDF and its fields are displayed properly', () => {
...
cy.get('#pdf-section-btn').click()
cy.get('#pdf-display').imageSnapshot()
})
it('PDF toolbar is displayed properly', () => {
...
cy.get('#pdf-section-btn').click()
cy.get('#pdf-toolbar').imageSnapshot()
})
it('workflow builder header is displayed properly', () => {
...
cy.get('#pdf-section-btn').click()
cy.get('#workflow-builder-header').imageSnapshot()
})
})
cy.get('#pdf-display').imageSnapshot({
clip: {
x: 0,
y: 0,
width: 800,
height: 300, // crop off the bottom half of the snapshot
},
})
cy.get('#pdf-editor').imageSnapshot()
cy.get('#pdf-editor').imageSnapshot({
threshold: '0.025',
thresholdType: 'percent',
})
cy.scrollTo()
command is crazy useful for adjusting your viewport for the right image snapshot. For example, an affix component may be partially blocking a component you want to snapshot test. We can fix that by scrolling up or down.describe('etch template builder', () => {
it('PDF and its fields are displayed properly', () => {
...
cy.get('#pdf-display').imageSnapshot()
})
})
describe('etch template builder', () => {
it('PDF and its fields are displayed properly', () => {
...
cy.get('#app-container').scrollTo('top')
cy.get('#pdf-display').imageSnapshot()
})
})
snapshot()
command which serializes the selected UI component.toMatchSnapshot()
Cypress command which serializes the element the command is chained off of.toMatchImageSnapshot()
command can take a screenshot of the entire web document or of a specific element.matchImageSnapshot()
Cypress command which can take a screenshot of the entire screen or of the chained element.compareSnapshot()
Cypress command which takes a screenshot of the full screen or of a single HTML element.compareSnapshot()
Cypress command which provides functionality similar to that of the above commands.