Browse Source

Merging

qrcode-reboot
Matt Raymer 2 days ago
parent
commit
04193f61c7
  1. 65
      src/views/AccountViewView.vue
  2. 20
      src/views/ContactQRScanShowView.vue
  3. 14
      test-playwright/README.md
  4. 65
      test-playwright/TESTING.md

65
src/views/AccountViewView.vue

@ -94,25 +94,40 @@
</span> </span>
<div v-else class="text-center"> <div v-else class="text-center">
<template v-if="isRegistered"> <template v-if="isRegistered">
<div class @click="openImageDialog()"> <div class="inline-block text-md bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md" @click="openImageDialog()">
<font-awesome <font-awesome
icon="image-portrait" icon="user"
class="bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-2 rounded-l" class="fa-fw"
/> />
<font-awesome <font-awesome
icon="camera" icon="camera"
class="bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-2 rounded-r" class="fa-fw"
/> />
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="text-center text-lg text-slate-500 py-8">Register to Upload a Photo</div> <div
id="noticeBeforeUpload"
class="bg-amber-200 text-amber-900 border-amber-500 border-dashed border text-center rounded-md overflow-hidden px-4 py-3"
role="alert"
aria-live="polite"
>
<p class="mb-2">
Before you can upload a photo, a friend needs to register you.
</p>
<router-link
:to="{ name: 'contact-qr' }"
class="inline-block text-md uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
>
Share Your Info
</router-link>
</div>
</template> </template>
</div> </div>
<ImageMethodDialog ref="imageMethodDialog" :isRegistered="isRegistered" /> <ImageMethodDialog ref="imageMethodDialog" :isRegistered="isRegistered" />
</div> </div>
<div class="mt-6"> <div class="mt-4">
<div class="flex justify-center text-center"> <div class="flex justify-center text-center text-sm leading-tight mb-1">
People {{ profileImageUrl ? "without your image" : "" }} see this People {{ profileImageUrl ? "without your image" : "" }} see this
<br /> <br />
(if you've let them see your activity): (if you've let them see your activity):
@ -146,13 +161,13 @@
</div> </div>
</div> </div>
<div class="text-slate-500 text-sm font-bold">ID</div>
<div <div
class="text-sm text-slate-500 flex justify-start items-center mb-1" class="text-sm text-slate-500 flex justify-start items-center mt-2 mb-1"
data-testId="didWrapper" data-testId="didWrapper"
role="region" role="region"
aria-label="Your Identifier" aria-label="Your Identifier"
> >
<div class="font-bold">ID:&nbsp;</div>
<code class="truncate" aria-label="Your DID">{{ activeDid }}</code> <code class="truncate" aria-label="Your DID">{{ activeDid }}</code>
<button <button
class="ml-2" class="ml-2"
@ -185,8 +200,8 @@
role="alert" role="alert"
aria-live="polite" aria-live="polite"
> >
<p class="mb-4"> <p class="mb-2">
<b>Note:</b> Before you can publicly announce a new project or time Before you can publicly announce a new project or time
commitment, a friend needs to register you. commitment, a friend needs to register you.
</p> </p>
<router-link <router-link
@ -208,7 +223,7 @@
<div> <div>
Reminder Notification Reminder Notification
<button <button
class="text-slate-400 fa-fw ml-2 cursor-pointer" class="text-slate-400 fa-fw cursor-pointer"
@click.stop="showReminderNotificationInfo" @click.stop="showReminderNotificationInfo"
aria-label="Learn more about reminder notifications" aria-label="Learn more about reminder notifications"
> >
@ -243,7 +258,7 @@
New Activity Notification New Activity Notification
<font-awesome <font-awesome
icon="question-circle" icon="question-circle"
class="text-slate-400 fa-fw ml-2 cursor-pointer" class="text-slate-400 fa-fw cursor-pointer"
@click.stop="showNewActivityNotificationInfo" @click.stop="showNewActivityNotificationInfo"
/> />
</div> </div>
@ -269,21 +284,23 @@
<div v-if="notifyingNewActivityTime" class="w-full text-right"> <div v-if="notifyingNewActivityTime" class="w-full text-right">
{{ notifyingNewActivityTime.replace(" ", "&nbsp;") }} {{ notifyingNewActivityTime.replace(" ", "&nbsp;") }}
</div> </div>
<router-link class="pl-4 text-sm text-blue-500" to="/help-notifications"> <div class="mt-2 text-center">
Troubleshoot your notifications. <router-link class="text-sm text-blue-500" to="/help-notifications">
Troubleshoot your notifications&hellip;
</router-link> </router-link>
</div>
</section> </section>
<PushNotificationPermission ref="pushNotificationPermission" /> <PushNotificationPermission ref="pushNotificationPermission" />
<section <section
id="sectionSearchLocation" id="sectionSearchLocation"
class="flex justify-between bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8" class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8"
aria-labelledby="searchLocationHeading" aria-labelledby="searchLocationHeading"
> >
<h2 id="searchLocationHeading" class="mb-2 font-bold">Location for Searches</h2> <h2 id="searchLocationHeading" class="mb-2 font-bold">Location for Searches</h2>
<router-link <router-link
:to="{ name: 'search-area' }" :to="{ name: 'search-area' }"
class="text-m bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md mb-2" class="block w-full text-center bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
> >
{{ isSearchAreasSet ? "Change" : "Set" }} Search Area {{ isSearchAreasSet ? "Change" : "Set" }} Search Area
</router-link> </router-link>
@ -295,10 +312,10 @@
class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8" class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8"
aria-labelledby="userProfileHeading" aria-labelledby="userProfileHeading"
> >
<h2 id="userProfileHeading" class="flex items-center mb-2"> <h2 id="userProfileHeading" class="mb-2 font-bold">
<span class="font-bold">Public Profile</span> Public Profile
<button <button
class="text-slate-400 fa-fw ml-2 cursor-pointer" class="text-slate-400 fa-fw cursor-pointer"
@click="showProfileInfo" @click="showProfileInfo"
aria-label="Learn more about public profile" aria-label="Learn more about public profile"
> >
@ -353,9 +370,9 @@
</l-map> </l-map>
</div> </div>
<div v-if="!loadingProfile && !savingProfile"> <div v-if="!loadingProfile && !savingProfile">
<div class="flex justify-between items-center"> <div class="grid grid-cols-1 sm:grid-cols-2 gap-2 mt-4">
<button <button
class="mt-2 px-4 py-2 bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white rounded-md" class="px-4 py-2 bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white rounded-md"
:disabled="loadingProfile || savingProfile" :disabled="loadingProfile || savingProfile"
:class="{ :class="{
'opacity-50 cursor-not-allowed': loadingProfile || savingProfile, 'opacity-50 cursor-not-allowed': loadingProfile || savingProfile,
@ -365,7 +382,7 @@
Save Profile Save Profile
</button> </button>
<button <button
class="mt-2 px-4 py-2 bg-gradient-to-b from-red-400 to-red-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white rounded-md" class="px-4 py-2 bg-gradient-to-b from-red-400 to-red-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white rounded-md"
:disabled="loadingProfile || savingProfile" :disabled="loadingProfile || savingProfile"
:class="{ :class="{
'opacity-50 cursor-not-allowed': 'opacity-50 cursor-not-allowed':
@ -436,7 +453,7 @@
</p> </p>
</div> </div>
<button <button
class="block float-right w-fit text-center text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md mt-2" class="block w-full text-center text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md mt-4"
@click="checkLimits()" @click="checkLimits()"
> >
Recheck Limits Recheck Limits

20
src/views/ContactQRScanShowView.vue

@ -23,20 +23,20 @@
</h1> </h1>
</div> </div>
<p <div
v-if="!givenName" v-if="!givenName"
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 my-4" class="bg-amber-200 text-amber-900 border-amber-500 border-dashed border text-center rounded-md overflow-hidden px-4 py-3 my-4"
> >
<span class="text-red">Beware!</span> <p class="mb-2">
You aren't sharing your name, so quickly <b>Note:</b> your identity currently does <b>not</b> include a name.
<br /> </p>
<span <button
class="bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 rounded-md" class="inline-block text-md uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
@click="openUserNameDialog" @click="openUserNameDialog"
> >
click here to set it for them. Set Your Name
</span> </button>
</p> </div>
<UserNameDialog ref="userNameDialog" /> <UserNameDialog ref="userNameDialog" />

14
test-playwright/README.md

@ -29,6 +29,14 @@ Tests are organized by feature area and numbered for execution order:
## Prerequisites ## Prerequisites
1. Endorser server running locally (see TESTING.md for setup) 1. Endorser server running locally (see TESTING.md for setup)
```bash
git clone https://github.com/time-endorser/endorser-ch.git
cd endorser-ch
npm install
test/test.sh
cp .env.local .env
NODE_ENV=test-local npm run dev
```
2. Playwright browsers installed: 2. Playwright browsers installed:
```bash ```bash
npx playwright install npx playwright install
@ -78,9 +86,9 @@ npx playwright test -c playwright.config-local.ts --trace on test-playwright/40-
## Test Data ## Test Data
The test suite uses predefined test users, with User #0 having registration privileges: The test suite uses predefined test users, with User #0 having registration privileges. To use it: Profile -> Advanced -> Switch Identifier -> Add Another Identity -> You Have A Seed -> Advanced -> Use mnemonic for Test User #0 -> Import
- DID: `did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F`
- Seed phrase available in TESTING.md More details available in TESTING.md
## Troubleshooting ## Troubleshooting

65
test-playwright/TESTING.md

@ -1,69 +1,6 @@
# Testing Guide # Testing Guide
## Automated Tests Start with [README.md](./README.md). This file has more details.
### Setup
1. Clone and set up the Endorser server:
```bash
git clone https://github.com/time-endorser/endorser-ch.git
cd endorser-ch
npm install
test/test.sh
cp .env.local .env
NODE_ENV=test-local npm run dev
```
If that fails, follow the instructions in the endorser-ch directory's README.md.
2. Install Playwright browsers:
```bash
npx playwright install
```
### Running Tests
#### Full Test Suite
To run all tests, make sure XCode is started and either Android Studio is started or an Android device is connected.
```bash
npm run test:all
```
Run only web tests:
```bash
npm run test:web
```
Note: Tests may occasionally fail and succeed on rerun (especially if a different test fails).
#### Single Test
To run a single test with tracing enabled:
```bash
npx playwright test -c playwright.config-local.ts --trace on test-playwright/40-add-contact.spec.ts
```
#### Global Test Server
It's possible to use the global test Endorser (ledger) server, though not all tests currently succeed:
```bash
VITE_DEFAULT_ENDORSER_API_SERVER=https://test-ledger.time.com npm run dev
```
#### Minimal Test Data
To run with minimal test data:
```bash
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
```
## Test User Setup ## Test User Setup

Loading…
Cancel
Save