Skip to content

filiphric/online-cypress-workshop

Repository files navigation

Online Cypress automation workshop

About author

I’m Filip. I’m a QA lead at Slido and Cypress.io ambassador

What’s in here

In this repo, you can find an application we are testing throughout the workshop. Each chapter starts with start.js file, so you can follow along and code with me. The final state of the code can be found in final.js file. Some of the chapters contain challenge.js file too. As the name suggest, you can find additional examples and challenges to improve your Cypress skills.

TodoMVC app

Simple todoMVC app build with Vue.js, originally forked from testing-workshop-cypress. I expanded the application and added a couple of features.

How to install and run app

  1. npm install
  2. npm start
  3. open app on http://localhost:3000

Backend

Backend is a json-server on a static json file located in todomvc/data.json.

API

Just a short API documentation for our todo app.


GET /todos

Returns an array of all todo items.


POST /todos

Creates a todo item.

Example of a an item payload:

{
  "title": "buy milk",
  "completed": false,
  "id": 1
}

PATCH /todos/{id}

Edits todo item, usually to change completed state. {id} stands for todo id.

Example payload:

{
  "completed": true
}

DELETE /todos/{id}

Deletes todo item with given id.


DELETE /todos

Deletes all todos.


POST /todos/seed

Seed an array of todos. Payload needs to be an array of objects, containing todos. This request rewrites all todos.


POST /signup

Creates a new account. Example payload:

{
  "email": "email@example.com",
  "password": "abc123"
}

Example error statuses:

409 (Conflict) - Account already exists

401 (Unauthorized) - Email or password was not provided

Request headers:

sendwelcomeemail: true - Sends welcome email to signed up user

Response headers:

Set-Cookie: "auth=true;"


POST /login

Logs into a new account.

Example payload:

{
  "email": "email@example.com",
  "password": "abc123"
}

Response headers:

Set-Cookie: "auth=true;"

Example error statuses:

401 (Unauthorized) - Wrong email or password


POST /reset

Deletes all todos and all accounts.


DELETE /accounts

Deletes all accounts.


POST /accounts/seed

Seed an array of accounts. Payload needs to be an array of objects, containing accounts. This request rewrites all accounts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published