Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 25 additions & 51 deletions examples/angular-example/README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,33 @@
# AngularExample
# Cloud Wallet Demo

This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.13.
This web application leverages the **Truvera Wallet SDK** and **Truvera Cloud Wallet** for managing credentials and data storage.

## Development server
## Usage Instructions

To start a local development server, run:
1. **Start the Application:**
- Run the app with the following commands:
```bash
npm install
npm start
```

```bash
ng serve
```
2. **Initialize the Wallet:**
- Option 1: Upload an existing wallet key file.
- Option 2: Generate a new wallet by clicking "Create New Wallet."

Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
3. **Import an OpenID Credential Offer:**
- Click **"Import OpenIDCredential"** and enter the Credential Offer URL.
- Also, you can use DID distribution
- Fetch DIDComm messages using the **"Fetch Messages"** button.

## Code scaffolding
4. **View and Manage Credentials:**
- Use the **"Refresh"** button to reload credentials.
- Credentials are displayed in a structured format.

Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
5. **Verify a Credential:**
- Click **"Verify Credential"** and provide a **Proof Request URL**.
- Follow the steps to select a credential and send the proof.

```bash
ng generate component component-name
```

For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:

```bash
ng generate --help
```

## Building

To build the project run:

```bash
ng build
```

This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.

## Running unit tests

To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:

```bash
ng test
```

## Running end-to-end tests

For end-to-end (e2e) testing, run:

```bash
ng e2e
```

Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.

## Additional Resources

For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
6. **Cloud Storage Operations:**
- Use **"Clear EDV"** to reset cloud-stored documents.
- Sync with the cloud wallet via **"Refresh."**
2 changes: 1 addition & 1 deletion examples/swift-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The project includes bundled web assets in `wallet-sdk-web/`:
- `index.html`: Main WebView entry point
- `main.eeb62a29.js`: Compiled Wallet SDK JavaScript
- Additional assets and dependencies
- You can generate new assets by running `yarn build` in the ../examples/webview-server project
- You can generate new assets by running `npm run build` in the ../examples/webview-server project

## Linking WebView Files in Xcode (Optional)

Expand Down
4 changes: 2 additions & 2 deletions examples/web-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This web application leverages the **Truvera Wallet SDK** and **Truvera Cloud Wa
1. **Start the Application:**
- Run the app with the following commands:
```bash
yarn install
yarn start
npm install
npm start
```

2. **Initialize the Wallet:**
Expand Down
62 changes: 31 additions & 31 deletions examples/web-example/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ This directory contains end-to-end tests for the Wallet SDK Web Example applicat

1. Install dependencies:
```bash
yarn install
npm install
```

2. **Important**: Install Playwright browsers (required for tests to run):
```bash
yarn playwright install
npm playwright install
```

Without this step, you'll get "Executable doesn't exist" errors.
Expand All @@ -44,35 +44,35 @@ Without this step, you'll get "Executable doesn't exist" errors.

```bash
# Run all e2e tests (Chrome only by default)
yarn test:e2e
npm run test:e2e

# Run tests in UI mode (interactive, great for development)
yarn test:e2e:ui
npm run test:e2e:ui

# Run tests in headed mode (see browser actions)
yarn test:e2e:headed
npm run test:e2e:headed

# Run tests in debug mode (step-by-step)
yarn test:e2e:debug
npm run test:e2e:debug

# Show test report after running
yarn test:e2e:report
npm run test:e2e:report
```

### Running Specific Tests

```bash
# Run a specific test file
yarn playwright test e2e/app-loading.spec.ts
npx playwright test e2e/app-loading.spec.ts

# Run tests matching a pattern
yarn playwright test -g "should create a new wallet"
npx playwright test -g "should create a new wallet"

# Run a specific test by name
yarn playwright test e2e/wallet-creation.spec.ts -g "should create a new wallet successfully"
npx playwright test e2e/wallet-creation.spec.ts -g "should create a new wallet successfully"

# Run only failing tests from last run
yarn playwright test --last-failed
npx playwright test --last-failed
```

### Browser Configuration
Expand Down Expand Up @@ -103,32 +103,32 @@ projects: [

```bash
# Run tests in headed mode to see browser actions
yarn playwright test --headed
npx playwright test --headed

# Run tests in debug mode with step-by-step execution
yarn playwright test --debug
npx playwright test --debug

# Run a specific failing test in debug mode
yarn playwright test e2e/wallet-creation.spec.ts -g "should create" --debug
npx playwright test e2e/wallet-creation.spec.ts -g "should create" --debug

# Run with browser console output
yarn playwright test --headed --reporter=line
npx playwright test --headed --reporter=line
```

### Debugging Tools

```bash
# Generate test code by recording interactions
yarn playwright codegen http://localhost:3000
npx playwright codegen http://localhost:3000

# Run single test with maximum verbosity
yarn playwright test e2e/app-loading.spec.ts --headed --debug --reporter=line
npx playwright test e2e/app-loading.spec.ts --headed --debug --reporter=line

# Run tests with custom timeout
yarn playwright test --timeout=60000
npx playwright test --timeout=60000

# Keep browser open after test completion
yarn playwright test --headed --debug --pause-on-failure
npx playwright test --headed --debug --pause-on-failure
```

### Analyzing Test Results
Expand All @@ -141,10 +141,10 @@ Tests automatically capture on failure:

```bash
# Open the HTML report to view test results
yarn playwright show-report
npx playwright show-report

# View traces for failed tests (very detailed)
yarn playwright show-trace test-results/path-to-trace.zip
npx playwright show-trace test-results/path-to-trace.zip
```

### Adding Debug Logs
Expand Down Expand Up @@ -172,7 +172,7 @@ export TEST_CREDENTIAL_URL="openid-credential-offer://your-test-url"
export TEST_PROOF_REQUEST_URL="https://your-proof-request-url"

# Run tests with environment variables
yarn test:e2e
npm run test:e2e
```

## Common Issues and Solutions
Expand All @@ -182,7 +182,7 @@ yarn test:e2e
**Problem**: Playwright browsers not installed
```bash
# Solution
yarn playwright install
npx playwright install
```

### 2. Tests Timing Out
Expand Down Expand Up @@ -267,7 +267,7 @@ export default defineConfig({
video: 'retain-on-failure',
},
webServer: {
command: 'yarn start',
command: 'npm start',
port: 3000,
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000, // 2 minutes for server start
Expand Down Expand Up @@ -301,13 +301,13 @@ For continuous integration:
```yaml
# Example GitHub Actions configuration
- name: Install dependencies
run: yarn install
run: npm install

- name: Install Playwright browsers
run: yarn playwright install
run: npx playwright install

- name: Run e2e tests
run: yarn test:e2e
run: npm run test:e2e
env:
CI: true

Expand Down Expand Up @@ -424,13 +424,13 @@ The credential import test is skipped by default because it requires a real cred
When tests fail:

1. **Check the basics**:
- Are dependencies installed? (`yarn install`)
- Are browsers installed? (`yarn playwright install`)
- Are dependencies installed? (`npm install`)
- Are browsers installed? (`npx playwright install`)
- Is the dev server starting properly?

2. **Run tests visually**:
```bash
yarn playwright test --headed --debug
npx playwright test --headed --debug
```

3. **Check test artifacts**:
Expand All @@ -439,7 +439,7 @@ When tests fail:
- Browser console output

4. **Verify app behavior manually**:
- Start dev server: `yarn start`
- Start dev server: `npm start`
- Test the failing functionality manually in browser

5. **Check for timing issues**:
Expand Down
21 changes: 9 additions & 12 deletions examples/web-example/e2e/app-loading.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ import { test, expect } from '@playwright/test';
test.describe('App Loading', () => {
test('should load the application successfully', async ({ page }) => {
await page.goto('/');

// Check if the app header is visible
await expect(page.locator('.App-header')).toBeVisible();

// Should show either welcome screen (no wallet) or documents screen (wallet exists)

// Should show either welcome screen (no wallet) or wallet interface (wallet exists)
const welcomeText = page.getByText('Welcome to the Wallet App');
const documentsText = page.getByText('Documents');
// Wait for either welcome or documents to be visible
await expect(welcomeText.or(documentsText)).toBeVisible();
const credentialsText = page.getByText('Credentials (');

// Wait for either welcome or credentials section to be visible
await expect(welcomeText.or(credentialsText)).toBeVisible();
});

test('should show wallet setup options when no wallet exists', async ({ page }) => {
Expand Down Expand Up @@ -54,8 +51,8 @@ test.describe('App Loading', () => {
buffer: buffer
}]);

// After file upload, should eventually show the documents page
// Wait for the documents header to appear (may briefly show loading)
await expect(page.getByText('Documents')).toBeVisible({ timeout: 10000 });
// After file upload, should eventually show the credentials section
// Wait for the credentials section to appear (may briefly show loading)
await expect(page.getByText('Credentials (')).toBeVisible({ timeout: 10000 });
});
});
Loading
Loading