### Start Client and Demo Apps for E2E Testing Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/README.md These commands concurrently start both the NFID Wallet client and the legacy SDK playground. Running both applications is a prerequisite for executing end-to-end tests, as E2E tests often require a fully operational environment. ```bash npx nx serve nfid-wallet-client npx nx serve nfid-demo ``` -------------------------------- ### Install Project Dependencies with Yarn Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/README.md This command installs all required Node.js packages and project dependencies using Yarn, ensuring the development environment is ready for application setup and execution. ```bash yarn ``` -------------------------------- ### Run Legacy SDK Playground Locally Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/README.md This command starts the legacy SDK playground application locally using Nx. This optional step provides a separate environment to test older SDK functionalities or demo specific features without affecting the main client application. ```bash npx nx serve nfid-demo ``` -------------------------------- ### Run NFID Wallet Client Locally Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/README.md This command starts the NFID Wallet client application locally using Nx. Once running, the application can be accessed in a web browser at http://localhost:9090 for development and testing purposes. ```bash npx nx serve nfid-wallet-client ``` -------------------------------- ### Copy Local Environment Configuration Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/README.md This command copies the template environment file to a local configuration file. This allows developers to customize environment variables for local development without modifying the original template, ensuring sensitive information or specific settings are handled appropriately. ```bash cp .env.local.template .env.local ``` -------------------------------- ### Execute Integration Tests Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/README.md This command runs integration tests across the project using Nx, configured with a specific test environment file (.env.test). It includes retries and limits parallel execution to ensure stable and reliable test runs, validating component interactions. ```bash npx env-cmd -f .env.test nx run-many --target=test --skip-nx-cache --maxAttempts=2 --maxParallel=1 ``` -------------------------------- ### Execute End-to-End Tests Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/README.md This command runs the end-to-end tests for the NFID frontend using Nx, configured with a specific test environment file (.env.test). These tests validate the complete user flow and system integration, ensuring the application functions as expected from a user's perspective. ```bash npx env-cmd -f .env.test nx test:e2e nfid-frontend-e2e ``` -------------------------------- ### Execute Specific E2E Test Scenario with Nx and Cucumber Tags Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/apps/nfid-frontend-e2e/README.md This command runs a targeted end-to-end test scenario within the `nfid-frontend-e2e` project by specifying a custom Cucumber tag. This allows for isolated testing of the new user setup process. ```Shell npx nx test:e2e nfid-frontend-e2e --cucumberOpts.tagExpression='@runthis' ``` -------------------------------- ### Build the config library Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/config/README.md Builds the 'config' library using Nx. ```Shell nx build config ``` -------------------------------- ### Build Nx Integration Library Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/integration/README.md Command to build the 'integration' library using the Nx build system. ```shell nx build integration ``` -------------------------------- ### Build client-db library Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/client-db/README.md Command to build the client-db library using the Nx build system. ```shell nx build client-db ``` -------------------------------- ### Run Unit Tests for Nx Integration Library Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/integration/README.md Command to execute unit tests for the 'integration' library via Jest, orchestrated by Nx. ```shell nx test integration ``` -------------------------------- ### Build Validation Library Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/utils/README.md This command compiles the 'validation' library using the Nx build system, preparing it for distribution or further development. ```Shell nx build validation ``` -------------------------------- ### Run Docker Container for nfid-wallet-client E2E Tests Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/docker-e2e-tests/README.md This command executes the Docker container for the nfid-wallet-client e2e tests. It sets up volume mounts for the source code and npmrc file, loads environment variables from `docker_env`, and enables CI debug messages. The container will automatically build the frontend and run the tests upon startup. ```Shell docker run --rm -it \ -v $(pwd):/home/user/workdir \ -v npmrc_file:/home/user/.npmrc \ --env-file docker_env \ -e CI_DEBUG=true \ test:e2e ``` -------------------------------- ### Run Unit Tests for UI Library Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/ui/README.md Execute the unit tests for the 'ui' library using the Nx CLI, which utilizes Jest as the test runner. ```Shell nx test ui ``` -------------------------------- ### Run Unit Tests for Validation Library Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/utils/README.md This command executes the unit tests for the 'validation' library via Jest, integrated through Nx, to ensure code correctness. ```Shell nx test validation ``` -------------------------------- ### Run client-db unit tests Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/client-db/README.md Command to execute unit tests for the client-db library using Nx and Jest. ```shell nx test client-db ``` -------------------------------- ### Run unit tests for config library Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/packages/config/README.md Executes unit tests for the 'config' library via Jest using Nx. ```Shell nx test config ``` -------------------------------- ### Build Docker Image for nfid-wallet-client E2E Tests Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/docker-e2e-tests/README.md This command builds the Docker image for the nfid-wallet-client end-to-end tests. The image is tagged as `test:e2e` and is built from the current directory containing the Dockerfile. Build arguments like `TAG`, `USER_ID`, `GROUP_ID`, and `NODE_VERSION` can be customized during this process. ```Shell docker build -t test:e2e . ``` -------------------------------- ### Sequence Diagram for Email Sign-in Flow Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/docs/new-auth-flow.md Illustrates the sequence of interactions between the user, dApp, NFID frontend, NFID Lambda, and NFID Canister for email-based sign-in, including token exchange, session key registration, and delegation chain creation. ```mermaid sequenceDiagram participant A as User participant B as dApp participant C as NFID FE participant D as NFID Lambda participant E as NFID Canister B->>C: ic_getDelegation payload(sessionPublicKey) C->>D: sign in via email (public key in payload) D->>A: sends token A->>C: enters token C->>C: signs token C->>D: send signed token D->>C: key pair (like google identity) (TODO: delegation) C->>E: get account E->>C: account C->>D: register session key on lambda D->>C: lambdaPublicKey C->>C: create DelegationChain from identity to lambdaPublicKey C->>D: getGlobalDelegation(DelegationChain, targets, lambdaPublicKey, sessionPublicKey) D->>C: delegationChain C->>B: delegationChain B->>A: delegationIdentity ``` -------------------------------- ### Sequence Diagram for Google Sign-in Flow Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/docs/new-auth-flow.md Depicts the sequence of operations for Google-based sign-in, involving Google Auth, NFID components (frontend, Lambda, Canister), and the dApp, leading to the creation of a delegation identity. ```mermaid sequenceDiagram participant A as User participant B as dApp participant C as NFID FE participant D as NFID Lambda participant E as NFID Canister participant F as Google Auth B->>C: ic_getDelegation payload(sessionPublicKey) C->>F: getAuthToken F->>C: authToken C->>D: google signin(authToken) D->>C: google identity C->>E: get account E->>C: account C->>D: register session key on lambda D->>C: lambdaPublicKey C->>C: create DelegationChain from identity to lambdaPublicKey C->>D: getGlobalDelegation(DelegationChain, targets, lambdaPublicKey, sessionPublicKey) D->>C: delegationChain C->>B: delegationChain B->>A: delegationIdentity ``` -------------------------------- ### Define Test User Data Structure for users.json Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/apps/nfid-frontend-e2e/README.md This JSON structure outlines the required fields for a new test user entry in the `users.json` file. It includes placeholders for the user's seed phrase, account data extracted from IndexedDB, and WebAuthn credentials captured during the test run. The `account` field should contain data copied from IndexedDb (profile-db -> profile-store -> account), ensuring the 'anchor' field matches the seed phrase. The `credentials` field should contain WebAuthn credentials captured from browser logs. It also notes the possibility of extending the `TestUser` type in `types.d.ts` for additional fields. ```JSON { "seed_phrase": "YOUR_SEED_PHRASE_HERE", "account": {}, "credentials": [] } ``` -------------------------------- ### Capture WebAuthn Credentials and Debug in WebDriverIO E2E Tests Source: https://github.com/internet-identity-labs/nfid-wallet-client/blob/main/apps/nfid-frontend-e2e/README.md This JavaScript/TypeScript code block demonstrates how to programmatically interact with WebAuthn authenticators in a WebDriverIO test. It captures the authenticator ID, retrieves WebAuthn credentials, logs them for inspection, and pauses the test execution for manual debugging. ```JavaScript const auth = await browser.addVirtualWebAuth... const creds = await browser.getWebauthnCredentials(auth) console.log(JSON.stringify(creds.toString)) await browser.debug() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.