Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write unit tests for a registration page in javascript using jest network. these are the test cases :# TEST CASES TO VERIFY THE REGISTRATION

please write unit tests for a registration page in javascript using jest network.
these are the test cases :# TEST CASES TO VERIFY THE "REGISTRATION" PAGE
To verify if the registration page works properly we need to misuse it to confirm that the page will correctly verify the informations entered by the user.
## Page specific tests:
+ The first test will be trying to register with something that is not an email address. Success if the page shows the please enter a valid email address notification, failure if the registration is successful.
+ The second test will be trying to use a password that does not meet the requirements. Success if the page shows the Password do not meet the requirements or passwords do not match notification, failure if the registration is successful.
+ The third test will be trying to register with two different passwords. Success if the page shows the Password do not meet the requirements or passwords do not match notification, failure if the registration is successful.
+ The fourth test is clicking on the show password button. Success if the password is shown, failure if the password is not shown.
and these is the page code in js, html , css please study the code and wite unit tests using javascript (node js) using jest framework. this is the css code for the registration page :body {
font-family: Arial, sans-serif;
background-image: url('books_wp.jpg');
background-size: cover;
background-repeat: no-repeat;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
position: relative;
background: linear-gradient(to bottom, crimson, #fff);
border-radius: 10px;
box-shadow: 0020px rgba(0,0,0,0.2);
padding: 20px;
width: 500px;
}
h1{
margin-bottom: 20px;
color: #333;
text-align: center;
}
.form-group {
margin-bottom: 15px;
}
input[type="text"],
input[type="password"]{
width: calc(100%-24px);
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #f9f9f9;
color: #333;
}
button[type="submit"]{
background-color: #0070ff;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
position: absolute;
bottom: 20px;
right: 20px;
}
button[type="submit"]:hover {
background-color: #0050cc;
}
.notification {
position: absolute;
top: 20px;
left: 50%;
transform: translateX(-50%);
background-color: #333;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
display: none;
}
.show-password-container {
position: relative;
margin-top: 10px;
text-align: right;
}
this is the html code for the registration page:
BookHub - Register
Password must contain at least one lowercase letter.
Password must contain at least one uppercase letter.
Password must contain at least one special character.
Password must contain at least one number.
Password must be at least 8 characters long.
By creating an account you agree to our Terms & Privacy.Already have an account? Sign in.
Password must contain at least one lowercase letter.
Password must contain at least one uppercase letter.
Password must contain at least one special character.
Password must contain at least one number.
Password must be at least 8 characters long.
By creating an account you agree to our Terms & Privacy.Already have an account? Sign in.
Password must contain at least one lowercase letter.
Password must contain at least one uppercase letter.
Password must contain at least one special character.
Password must contain at least one number.
Password must be at least 8 characters long.
By creating an account you agree to our Terms & Privacy.Already have an account? Sign in.
Password must contain at least one lowercase letter.
Password must contain at least one uppercase letter.
Password must contain at least one special character.
Password must contain at least one number.
Password must be at least 8 characters long.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

What is the coefficient for 2014?

Answered: 1 week ago