Skip to content

Testing the UI and server side functionality of new user account creation in an imitation social blogging site (a Medium.com clone called Conduit) using Cypress

Notifications You must be signed in to change notification settings

StephanieJF/account-creation-cypress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated Account Creation Tests Using Cypress

Testing the UI and server side functionality of new user account creation in an imitation social blogging site (a Medium.com clone called Conduit) using Cypress.

Overview

Links:

Components Tested:

  • New user account creation via the HTML sign up form
  • New user account creation via the API

Sign up form conditions:

  • All fields are required in order to submit the form
  • Username and email must be unique (not be associated with any existing accounts)

Test Details

Happy Path: Valid new user account creation

UI Tests: An e2e approach using the HTML sign up form

Pre-testing steps

  1. Generate unique user data and write to fixture file
  2. Navigate to the sign up page

Test Steps

  1. Type the username
  2. Type the email address
  3. Type the password
  4. Click Sign up button

Expected Results

  1. Redirected to home page as the logged in user
API Tests:

Pre-testing steps

  1. Generate new user data and write to fixture file

Test Steps

  1. Send a POST request to the /users endpoint containing username, email, and password in the body

Expected Results

  1. Response containing success status code of 200
    • Note: Discrepancy noted in the documentation showing success status code of 201. Issue filed here
  2. Response body matches data in the request body

Sad Path: Attempt invalid new user account creation

UI Tests: Attempt to submit the form with missing fields and non-unique username and email

Pre-testing steps

  1. Register test username and email if not already registered
  2. Navigate to the sign up page

Test Steps

  1. Type the username of existing account
  2. Type the email address of existing account
  3. Type the password of the existing account
  4. Click Sign up button

Expected Results

  1. Submit button remains disabled until all fields are entered
  2. Attempt to submit leads to error messages
    1. "email has already been taken"
    2. "username has already been taken"
  3. Registration is unsuccessful
API Tests:

Pre-testing steps

  1. Register test username and email if not already registered

Test Steps

  1. Send a POST request to the /users endpoint containing the existing user's username, email, and password in the body

Expected Results

  1. Registration fails
  2. Response containing error status code of 422
  3. Response error messages indicate missing fields or username/password taken

About

Testing the UI and server side functionality of new user account creation in an imitation social blogging site (a Medium.com clone called Conduit) using Cypress

Resources

Stars

Watchers

Forks