mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 08:30:39 +00:00
c93a53ead2
* 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
1.1 KiB
1.1 KiB
Summary
Playwright test the puter-js API in browser environment.
Motivation
Some features of the puter-js/puter-GUI only work in the browser environment:
- file system
- naive-cache
- client-replica (WIP)
- wspush
Setup
Install dependencies:
cd ./tests/playwright
npm install
npx playwright install --with-deps
Initialize the client config (working directory: ./tests/playwright):
cp ../example-client-config.yaml ../client-config.yaml- Edit the
client-config.yamlto set theauth_token
Run tests
CLI
Working directory: ./tests/playwright
# run all tests
npx playwright test
# run a test by name
# e.g: npx playwright test -g "mkdir in root directory is prohibited"
npx playwright test -g "mkdir in root directory is prohibited"
# run the tests that failed in the last test run
npx playwright test --last-failed
# open the report of the last test run in the browser
npx playwright show-report
VSCode/Cursor
- Install the "Playwright Test for VSCode" extension.
- Go to "Testing" tab in the sidebar.
- Click buttons to run tests.