CRUD Operations (JSONPLACHOLDER APIS)
It is simple crud operations app using jsonplaceholder APIS, where user can add, update and delete posts.
- Make sure that you have Node.js v16.15.1 and npm v5 or above installed.
- Clone this repo using
https://github.com/AhmadFaraz-crypto/crud-operation-jsonplaceholderAPI-react-typescript.git
- Move to the appropriate directory:
cd crud-operation-jsonplaceholderAPI-react-typescript
. - Run
yarn install
in order to install dependencies and clean the git repo.
At this point you can runyarn start
to see the example app athttp://localhost:3000
. - Run
yarn test
to run test cases. - Run
yarn run clean
to delete the example app.
To run end-to-end tests with Playwright, follow this command:
npm run test-e2e
By default, the tests will run in headless mode. To run the tests in non-headless mode, run:
npm run test-e2e -- --headed
To run the tests in a specific browser, run:
npm run test-e2e -- --project=chromium
To run the tests only in a specific file, run:
npm run test-e2e -- fileName.spec.ts
To debug a test, you can either run:
npm run test-e2e -- --debug fileName.spec.ts
or you can use a combination of await page.pause()
and npm run test:e2e -- --headed fileName.spec.ts
.