Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Ravi Prakash Chaudhary #119

Closed

Conversation

prakashravichaudhary
Copy link

describe('User Registration', () => {
beforeEach(() => {
cy.visit('/signup');
});

it('should register a new user with valid credentials', () => {
cy.get('input[name="email"]').type('[email protected]');
cy.get('input[name="password"]').type('password123');
cy.get('input[name="confirmPassword"]').type('password123');
cy.get('button[type="submit"]').click();

// Assertion to check user is redirected to the login page
cy.url().should('include', '/login');
cy.contains('Registration successful').should('be.visible');

});

it('should show an error for existing email', () => {
cy.get('input[name="email"]').type('[email protected]');
cy.get('input[name="password"]').type('password123');
cy.get('input[name="confirmPassword"]').type('password123');
cy.get('button[type="submit"]').click();

// Assertion to check error message
cy.contains('Email already in use').should('be.visible');

});
});

@rzhao271 rzhao271 closed this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants