/ e2e / README.md
README.md
 1  # E2E tests for Caroster
 2  
 3  This directory is used to test all Graphql endpoints used by Caroster's frontend.
 4  
 5  ## Run tests
 6  
 7  1. Install dependencies
 8     ```bash
 9     yarn
10     ```
11  1. Refresh GQL generated file (if any change)
12     ```bash
13     yarn gql
14     ```
15  1. Start Strapi in test env
16     ```bash
17     cd backend/
18     yarn start-test
19     ```
20  1. Run E2E tests
21     ```bash
22     cd e2e/
23     yarn test # Add '--watch' for watch mode
24     ```
25  
26  ## Credentials
27  
28  ### Admin & User
29  
30  test@octree.ch | Testtest1
31  
32  ## How to generate a new template db
33  
34  Tests need a seeded Sqlite db for Strapi.
35  Following Strapi upgrades, the db file has to be updated.
36  
37  To generate a new template db, follow these steps:
38  
39  1. Upgrade Strapi
40  1. Start Strapi with the old db file
41  1. Ensure following data are presents (Check `constants.ts` for right values):
42     - User with email _test@octree.ch_ and password _Testtest1_
43     - Event with UUID _2c336e59-087d-4dec-bf9b-f74b1ca22cd4_
44     - Travel associated to the event
45     - Vehicle associated to the user
46     - Settings exist in fr and en
47  1. Stop Strapi
48  1. Rename `template.db` by `test.db` content in `e2e/strapi` directory