From 777f72f85d832a9901cc8c49e3d86124120a318d Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Fri, 14 Feb 2025 19:23:31 -0700 Subject: [PATCH] refine instructions & remove duplicate info --- .env.development | 14 ++-- .env.production | 4 ++ .env.staging | 11 +++ BUILDING.md | 3 +- README.md | 136 +++---------------------------------- test-playwright/TESTING.md | 20 +++--- 6 files changed, 45 insertions(+), 143 deletions(-) create mode 100644 .env.staging diff --git a/.env.development b/.env.development index 6da6399..91a5e54 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,11 @@ +# Only the variables that start with VITE_ are seen in the application import.meta.env in Vue. -# I tried and failed to set things here with vue-cli-service but -# things may be more reliable with vite so let's try again. - -VITE_APP_SERVER=http://localhost:8080 +# iOS doesn't like spaces in the app title. +TIME_SAFARI_APP_TITLE="TimeSafari_Dev" +VITE_APP_SERVER=http://localhost:3000 +# This is the claim ID for actions in the BVC project, with the JWT ID on this environment (not production). +VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HWE8FWHQ1YGP7GFZYYPS272F +VITE_DEFAULT_ENDORSER_API_SERVER=http://localhost:3000 +VITE_DEFAULT_IMAGE_API_SERVER=http://localhost:3000 +VITE_DEFAULT_PARTNER_API_SERVER=http://localhost:3000 +VITE_PASSKEYS_ENABLED=true \ No newline at end of file diff --git a/.env.production b/.env.production index 3919a67..01c23cb 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,9 @@ # Only the variables that start with VITE_ are seen in the application import.meta.env in Vue. + + + VITE_APP_SERVER=https://timesafari.app +# This is the claim ID for actions in the BVC project. VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H VITE_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch VITE_DEFAULT_IMAGE_API_SERVER=https://image-api.timesafari.app diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..efddb24 --- /dev/null +++ b/.env.staging @@ -0,0 +1,11 @@ +# Only the variables that start with VITE_ are seen in the application import.meta.env in Vue. + +# iOS doesn't like spaces in the app title. +TIME_SAFARI_APP_TITLE="TimeSafari_Test" +VITE_APP_SERVER=https://test.timesafari.app +# This is the claim ID for actions in the BVC project, with the JWT ID on this environment (not production). +VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HWE8FWHQ1YGP7GFZYYPS272F +VITE_DEFAULT_ENDORSER_API_SERVER=https://test-api.endorser.ch +VITE_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app +VITE_DEFAULT_PARTNER_API_SERVER=https://test-partner-api.endorser.ch +VITE_PASSKEYS_ENABLED=true diff --git a/BUILDING.md b/BUILDING.md index ac2a150..2917f37 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -251,6 +251,7 @@ Create a `.env.development` file: ```bash TIME_SAFARI_APP_TITLE="TimeSafari_Dev" VITE_APP_SERVER=http://localhost:3000 +VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HWE8FWHQ1YGP7GFZYYPS272F VITE_DEFAULT_ENDORSER_API_SERVER=http://localhost:3000 VITE_DEFAULT_IMAGE_API_SERVER=http://localhost:3000 VITE_DEFAULT_PARTNER_API_SERVER=http://localhost:3000 @@ -289,7 +290,7 @@ The `.env.production` file will be used automatically for production builds. npm run build -- --mode staging # Deploy to test server -rsync -azvu -e "ssh -i ~/.ssh/your_key" dist/ ubuntutest@test.timesafari.app:time-safari/ +rsync -azvu -e "ssh -i ~/.ssh/your_key" dist ubuntutest@test.timesafari.app:time-safari/ ``` ### Production Server diff --git a/README.md b/README.md index 5858002..211bb60 100644 --- a/README.md +++ b/README.md @@ -8,152 +8,32 @@ and expand to crowd-fund with time & money, then record and see the impact of co See [project.task.yaml](project.task.yaml) for current priorities. (Numbers at the beginning of lines are estimated hours. See [taskyaml.org](https://taskyaml.org/) for details.) -## Setup & Building -See [BUILDING.md](BUILDING.md) for detailed build and setup instructions. -## Tests - -### Automated +## Setup & Building -Use the locally running Endorser server: +Quick start: -* Clone and set up https://github.com/trentlarson/endorser-ch and run the following in that directory: -``` +```bash npm install -test/test.sh -cp .env.local .env -NODE_ENV=test-local npm run dev -``` - -If that fails, go to the README.md in the endorser-ch directory and follow the instructions there. - -* Install playwright browsers: +npm run dev ``` -npx playwright install -``` - -* Now you can run the local tests: -``` -npm run test-all -``` - -Note that a test will sometimes fail and rerunning may succeed (and repeat if a different test fails). - - - -It's possible to use the global test Endorser (ledger) server (but currently the tests don't all succeed): -`npx playwright test` - - - - -It's possible to run with a minimal set of data; the following starts with the bare minimum of test data: -``` -rm ../endorser-ch-test-local.sqlite3 -NODE_ENV=test-local npm run flyway migrate -NODE_ENV=test-local npm run test test/controller0 -NODE_ENV=test-local npm run dev -``` - - -To run a single test like above with the screenshots, use the following: -``` -npx playwright test -c playwright.config-local.ts --trace on test-playwright/40-add-contact.spec.ts -``` - - - -### Register new user on test server +See [BUILDING.md](BUILDING.md) for detailed build and setup instructions. -On the test server, User #0 has rights to register others, so you can start -playing by importing that user and registering others. Import the keys for the test User -`did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F` by importing this seed phrase: -`rigid shrug mobile smart veteran half all pond toilet brave review universe ship congress found yard skate elite apology jar uniform subway slender luggage` -(Other test users are found [here](https://github.com/trentlarson/endorser-ch/blob/master/test/util.js).) -### Create multiple identifiers -Under the "Your Identity" screen, click "Advanced", click "Switch Identity / No Identity", then "Add Another Identity...". +## Tests -### Create keys with alternate tools +See [TESTING.md](test-playwright/TESTING.md) for detailed test instructions. -[This page](openssl_signing_console.rst) is a tool to create a JWT from a locally-generated keypair. -### Web-push -For your own web-push tests, change the push server URL in Advanced settings on the account page, and install Time Safari & push server on the same domain. -### Icons +## Icons To add an icon, add to main.ts and reference with `fa` element and `icon` attribute with the hyphenated name. -### Manual walk-through test - -- Backup seed & data & get a CSV dump from Endorser Mobile. -- If there were any DB changes, check that you're on the old version and reload the page and ensure you can still act and haven't lost data (ie. contacts, identities). -- Use a mobile user as well as a desktop user. -- Check that the version is updated. - - Clear the browser data & add identity & import Time Safari contacts and then CSV contacts. -- Make sure that it's using the test API (under Identity in 'Advanced'). -- Clear the browser data again. (See "Reset" below.) - - Go to the account page before visiting the home page to see that there is no ID. - - On the home page: - - Check that it generated an ID. - - Check the feed without names. - - Copy the contact URL. - - On each page, verify the messaging, and that they cannot take action. - - On the discovery page, check that they can see projects, and set a search area to see projects nearby. - - On the contacts page, check that they can add a contact even without their own ID. -- Install the PWA. -- As User 0 in another browser on the test API, add a give & a project. - - Note that some combinations of desktop with mobile emulation stretch the image. - - Import User 0 with seed: `rigid shrug mobile smart veteran half all pond toilet brave review universe ship congress found yard skate elite apology jar uniform subway slender luggage` - - Add new user as a contact (which allows them to see User 0). - - With the new user on the home page, see the feed that shows User 0 in network but without the name. -- As the new user, import contacts & identifiers. -- As the new user on the contacts page, add User 0 as a contact. - - On the home page, see the feed that shows User 0 with a name. -- Switch back to the generated identifier. - - On the account page, check that they see messages on limits. -- As User 0, register the ID. -- As the new user on the home page, check that they can now record a gift, and record an offer & delivery. -- On the contacts page, check that they cannot register someone else yet. -- Walk through the functions on each page. -- Set and run notifications. -- Export & import, both seed and contacts & settings. -- Choose location on the search map. -- Offer, deliver a give, and confirm. Create a third user and test connections. -- On mobile, share an image with the app. -- Switch to "no identifier" to see that things look OK without any ID. - -### Clear/Reset data & restart - -* Clear cache for site. (In Chrome, go to `chrome://settings/cookies` and "all site data and permissions"; in Firefox, go to `about:preferences` and search for "cache" then "Manage Data", and also manually remove the IndexedDB data if the DBs still show.) -* Clear notification permission. (In Chrome, go to `chrome://settings/content/notifications`; in Firefox, go to `about:preferences` and search for "notifications".) -* Unregister service worker. (In Chrome, go to `chrome://serviceworker-internals`; in Firefox, go to `about:serviceworkers`.) -* Clear Cache Storage manually, possibly deleting the DB. (In Chrome, in dev tools under Application; in Firefox, in dev tools under Storage.) - -(If you find more, add them to the HelpNotificationsView.vue file.) - - - -## Troubleshooting - -* A problem with `GET http://localhost:8080/web-push/vapid` means the py-push-server is not running - (and notifications won't work for a local app without special routing from the browser's web push service provider, anyway). - -* Red errors everywhere with a console message like this: - `Error: An ID is chosen but there are no keys for it so it cannot be used to talk with the service` - ... has happened on account switching when the current account was erased (or maybe replaced -- once I had a duplicate and I don't know how). - -* The error `DEXIE ENCRYPT ADDON: Could not decrypt message!` or - `Encryption key has changed` means that the encryption key is wrong, - sometimes seen after clearing storage for testing; you can make it happen by clearing localStorage. - Maybe only part of the storage was cleared out. Unless you got a copy of that password, you'll - have to erase storage and reload the identifier. - ## Other diff --git a/test-playwright/TESTING.md b/test-playwright/TESTING.md index 26d968c..88b045e 100644 --- a/test-playwright/TESTING.md +++ b/test-playwright/TESTING.md @@ -7,8 +7,8 @@ 1. Clone and set up the Endorser server: ```bash -git clone https://github.com/time-endorser/endorser-api.git -cd endorser-api +git clone https://github.com/time-endorser/endorser-ch.git +cd endorser-ch npm install test/test.sh cp .env.local .env @@ -59,9 +59,9 @@ NODE_ENV=test-local npm run dev ``` -### Test User Setup +## Test User Setup -#### Register New User on Test Server +### Register New User on Test Server On the test server, User #0 has rights to register others. Import User #0 with this seed phrase: ```bash @@ -72,9 +72,9 @@ This corresponds to: `did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F` (Other test users can be found [here](https://github.com/trentlarson/endorser-ch/blob/master/test/util.js).) -### Manual Testing Steps +## Manual Testing Steps -#### Identity Management +### Identity Management 1. Create multiple identifiers: - Go to "Your Identity" screen - Click "Advanced" @@ -84,12 +84,12 @@ This corresponds to: `did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F` 2. Create keys with alternate tools: - See [openssl_signing_console.rst](openssl_signing_console.rst) for JWT creation with local keypairs -#### Web Push Testing +### Web Push Testing For web-push tests: 1. Change push server URL in Advanced settings on the account page 2. Install Time Safari & push server on the same domain -#### Manual Walk-through Test Checklist +### Manual Walk-through Test Checklist 1. Initial Setup - Backup seed & data @@ -133,7 +133,7 @@ For web-push tests: - Check third-user connections - Test mobile image sharing -### Data Reset Instructions +## Data Reset Instructions To clear/reset data: @@ -156,7 +156,7 @@ To clear/reset data: (Additional reset steps may be documented in HelpNotificationsView.vue) -### Troubleshooting +## Troubleshooting 1. Web Push Issues: - `GET http://localhost:8080/web-push/vapid` errors indicate py-push-server is not running