Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Making Test Suites | Using a Test Automation Framework
Introduction to QA Automation Testing
course content

Зміст курсу

Introduction to QA Automation Testing

Introduction to QA Automation Testing

1. Introduction to Automation Testing
2. Using a Test Automation Framework
3. Browser Automation with Selenium
4. Intro to Intermediate Automation Testing

bookMaking Test Suites

We have improved the validation functions validateUsername and validatePassword adding the following rules for the username and password respectively:

  • The username should be between 3 and 20 characters in length and it can only contain alphanumeric characters.
  • The password should be at least 8 characters long and it should contain a combination of lower and uppercase letters along with at least one number or symbol;

Your task is to:

  • Organize the test cases present in validation.js Test Script, into appropriate describe blocks.
  • Write test cases to test case code in auth.js. Make sure to enclose the test cases in proper describe blocks;

Following are the test cases you have to write in the __test__/auth.js file:

Test ID: 1

  1. Title: Hash a valid password;
  2. Precondition: The hashPassword function is available;
  3. Test Steps:
    • Pass the string 'examplePassword123' to the hashPassword function;
  4. Expected Result: The function should return a string that is different from the input password;

Test ID: 2

  1. Title: Hash an empty password;
  2. Precondition: The hashPassword function is available;
  3. Test Steps:
    • Pass an empty string '' to the hashPassword function;
  4. Expected Result: The function should return a non-empty string;

Test ID: 3

  1. Title: Compare a valid password with its correct hash;
  2. Precondition: The comparePassword and hashPassword functions are available;
  3. Test Steps:
    • Hash the string 'examplePassword123' using the hashPassword function;
    • Pass the original password 'examplePassword123' and the generated hash to the comparePassword function;
  4. Expected Result: The function should return true, indicating the password matches the hash;

Test ID: 4

  1. Title: Compare a valid password with an incorrect hash;
  2. Precondition: The comparePassword and hashPassword functions are available;
  3. Test Steps:
    • Hash the string 'examplePassword123' using the hashPassword function;
    • Pass a different password 'wrongPassword456' and the generated hash to the comparePassword function;
  4. Expected Result: The function should return false, indicating the password does not match the hash;

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 8
some-alt