Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.46 KB

File metadata and controls

51 lines (33 loc) · 1.46 KB

Testing

Component testing

For component testing the project uses vitest. The component tests include DOM- , unit- and snapshot testing, and can be found in the folder with the corresponding component or page.

Running the tests

  1. cd frontend
  2. npm run test

End-to-end testing

For E2E testing the project uses cypress. The tests can be found in the cypress folder in the root of the frontend directory, and consists of two complex user scenarios:

"Listing an item for sale" (file: listing.cy.ts)

  • This test simulates the process of:
    1. creating a profile
    2. navigating to the sell page
    3. filling in the necessary product information
    4. listing an item for sale
    5. verifying that its appearance on their profile page

"Bid on a product" (file: bidOnProduct.cy.ts)

  • This test simulates the process of:
    1. creating a profile
    2. navigating to the explore page
    3. performing a search,
    4. applying filters
    5. selecting a product
    6. sending a bid message to the seller

We selected these user scenarios because we felt that they represent the most important and significant aspects of our functionality. They were also complex enough to cover a wide range of different features.

Running the tests

In the terminal

  1. cd frontend
  2. npm run cypress

In the Cypress UI Test Runner

  1. cd frontend
  2. npx cypress open

Linting

The project uses eslint for linting. To begin linting, run npm run lint in the frontend folder