Code Monkey home page Code Monkey logo

assignment-4's Introduction

Assignment 4

E2E / UI Testing


Time for some more testing. We are going to focus on testing the UI this week. We will be using react-testing-library to create ui-integration tests and Playwright to create E2E tests.

Group size: 1 person


The Assignment

Copy the Github repo into your own repository and make it private.

Node v20 is required for this project to run.

Run the following commands to get started:

npm install

And here are some other helpful commands defined in package.json

npm run dev (for development)

npm build (to build production version)

npm start (to serve production version of the application)

npm run test:e2e (to run Playwright)

  • Write a Playwright test that validates the TODO list is empty
  • Write a Playwright test that adds a new item to the list
  • Write a Playwright test that adds a second item to the list
  • Write a Playwright test that removes one item from the list

Create a GitHub actions workflow that runs these tests on every push.

npm run test (to run vitest)

Create UI tests using react-testing-library.

  • Mock the api using Mock Service Worker (MSW)
  • Write a test that asserts that loading is displayed when the response is not correct
  • Write a test that asserts that a single item is in the list when the component is loaded
  • Write a test that adds a new item to the list
  • Write a test that removes an item from the list

Make sure to have the test command and test:e2e command separately in package.json so that the Github action workflow can run them in parallel (separate job).


Handin

Add me (arnif) as collaborator to the repository. Also make sure to send the link in Canvas when handing in the assignment. Your solution should have implemented the tests cases described above. If you want to add any feel free to do so. The Github action workflow should be running these tests in a separate job (please note only running tests is required, linting, prettier etc were taken care of in previous assignments, but you are welcome to add them to this project as well ๐Ÿ˜Š).

Good luck and Have fun :)

assignment-4's People

Contributors

arnif avatar

Watchers

 avatar

Forkers

euwly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.