Skip to content
On this page

Cypress Visual Testing

Title
Cypress Visual Testing
Category
Test
Tags
Aliases
Cypress Visual Testing
Created
last year
Updated
last year
js
// /cypress/integration/Login.spec.js

/// <reference types="cypress" />

describe('Login Form', () => {
	it('Should contain valid login information', () => {
		cy.visit('/iframe.html?id=components-login-form--example');
		cy.get('#login-form').within(() => {
			cy.log('**enter the email**');
			cy.get('#email').should('have.value', 'email@provider.com');
			cy.log('**enter password**');
			cy.get('#password').should('have.value', 'a-random-password');
		});
	});
});
// /cypress/integration/Login.spec.js

/// <reference types="cypress" />

describe('Login Form', () => {
	it('Should contain valid login information', () => {
		cy.visit('/iframe.html?id=components-login-form--example');
		cy.get('#login-form').within(() => {
			cy.log('**enter the email**');
			cy.get('#email').should('have.value', 'email@provider.com');
			cy.log('**enter password**');
			cy.get('#password').should('have.value', 'a-random-password');
		});
	});
});

References

Released under the MIT License.