Files
puter/tests/README.md
Xiaochen Cui c93a53ead2 ci: init e2e test for browser env, tidy other tests (#1796)
* ci: init e2e test for browser env

stash changes

* test: update fsentry definition, add tests

stash changes

* test: pass puter-js mkdir test

* test: add test for puter-js move

* tidy code

* tidy code

* doc: add docs for playwright test

* recover memoryfs

* test: puter-js readdir/stat

* test: puter-js write

* test: puter-js read

* test: puter-js move_cart

* test: fix failed tests on move

* tests: rename files

* test: puter-js copy_cart

* tests: puter-js batch/delete, read config from file

* ci: add vitest

* ci: update names and timeout

* ci: simplify playwright-test

* ci: simplify api-test

* move "api-tester" from tools to tests

* test: update example config

* test: remove folder tests/api-tester/ci

* test: unify config location

* test: remove unused files

* ci: fix wrong config

* ci: fix wrong path

* test: add docs

* ci: update timeout, print artifact url
2025-10-28 16:35:37 -07:00

49 lines
1.2 KiB
Markdown

## Table of Contents
- [Summary](#summary)
- [How to use](#how-to-use)
- [Initialize the Client Config](#initialize-the-client-config)
- [Run API-Tester (test http API)](#run-api-tester-test-http-api)
- [Run Playwright (test puter-js API with browser environment)](#run-playwright-test-puter-js-api-with-browser-environment)
- [Run Vitest (test puter-js API with node environment)](#run-vitest-test-puter-js-api-with-node-environment)
## Summary
End-to-end tests for puter-js and http API.
## How to use
### Initialize the Client Config
1. Start a backend server:
```bash
npm start
```
2. Copy `example-client-config.yaml` and edit the `auth_token` field. (`auth_token` can be obtained by logging in on the webpage and typing `puter.authToken` in Developer Tools's console)
```bash
cp ./tests/example-client-config.yaml ./tests/client-config.yaml
```
### Run API-Tester (test http API)
```bash
node ./tests/api-tester/apitest.js --unit --stop-on-failure
```
### Run Playwright (test puter-js API with browser environment)
```bash
cd ./tests/playwright
npm install
npx playwright install --with-deps
npx playwright test
```
### Run Vitest (test puter-js API with node environment)
```bash
npm run test:puterjs-api
```