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
69 changes: 69 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Deploy VitePress site to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- master
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Install dependencies
run: cd docs && npm ci

- name: Build with VitePress
run: cd docs && npm run docs:build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
133 changes: 133 additions & 0 deletions .maestro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Maestro Test Flows for Screenshot Generation

This directory contains Maestro test flows for automatically generating screenshots of the apps for documentation purposes.

## About Maestro

[Maestro](https://maestro.mobile.dev/) is a mobile UI testing framework that allows you to automate app interactions and capture screenshots.

## Installation

Install Maestro:

```bash
# On macOS or Linux
curl -Ls "https://get.maestro.mobile.dev" | bash

# On Windows
powershell -c "iwr https://get.maestro.mobile.dev/win | iex"
```

## Available Flows

### Document Scanner

- `screenshot_document_scanner_main.yaml` - Captures the main document list screen
- `screenshot_document_scanner_camera.yaml` - Captures the camera scanning view
- `screenshot_document_scanner_detail.yaml` - Captures a document detail view

### Card Wallet

- `screenshot_card_wallet_main.yaml` - Captures the main card list screen
- `screenshot_card_wallet_camera.yaml` - Captures the camera scanning view for cards
- `screenshot_card_wallet_detail.yaml` - Captures a card detail view with barcode

## Usage

### Prerequisites

1. Build and install the app on a connected device or emulator
2. Ensure Maestro is installed
3. Ensure the device/emulator is running

### Running Flows

To run a single flow:

```bash
# For Document Scanner
maestro test .maestro/screenshot_document_scanner_main.yaml

# For Card Wallet
maestro test .maestro/screenshot_card_wallet_main.yaml
```

To run all flows for an app:

```bash
# Document Scanner flows
maestro test .maestro/screenshot_document_scanner_*.yaml

# Card Wallet flows
maestro test .maestro/screenshot_card_wallet_*.yaml
```

### Capturing Screenshots

Screenshots are automatically saved by Maestro. By default, they are stored in:
- `~/.maestro/tests/<test-run-id>/screenshots/`

To specify a custom output directory:

```bash
maestro test --output /path/to/output .maestro/screenshot_document_scanner_main.yaml
```

### Updating Documentation Screenshots

After running the flows and capturing screenshots:

1. Review the generated screenshots
2. Copy the desired screenshots to the documentation:
```bash
# For Document Scanner
cp ~/.maestro/tests/<test-run-id>/screenshots/*.png docs/public/scanner-images/phoneScreenshots/

# For Card Wallet
cp ~/.maestro/tests/<test-run-id>/screenshots/*.png docs/public/wallet-images/phoneScreenshots/
```
3. Update the image references in the documentation if needed

## Customizing Flows

You can customize the flows to capture different screens or interactions:

1. Edit the YAML files
2. Use Maestro's [flow reference](https://maestro.mobile.dev/api-reference/commands) for available commands
3. Test the modified flows

## Tips

- Ensure the app has sample data for better screenshots
- Use a clean device/emulator state for consistent results
- Consider different screen sizes and orientations
- Test flows on both Android and iOS

## Troubleshooting

### Flow fails to find elements

- Check the element IDs in the app code
- Use Maestro Studio for interactive debugging: `maestro studio`
- Add longer timeouts if the app is slow to load

### Screenshots are blank or incomplete

- Increase `waitForAnimationToEnd` timeouts
- Ensure the device screen is unlocked
- Check device/emulator display settings

### Camera permission issues

- Grant camera permissions manually before running flows
- Add permission grant commands to the flow if needed

## CI/CD Integration

These flows can be integrated into CI/CD pipelines to automatically generate screenshots for different app versions or languages. See the GitHub Actions workflow in `.github/workflows/` for an example.

## Resources

- [Maestro Documentation](https://maestro.mobile.dev/)
- [Maestro Flow Reference](https://maestro.mobile.dev/api-reference/commands)
- [Maestro Studio](https://maestro.mobile.dev/getting-started/maestro-studio)
26 changes: 26 additions & 0 deletions .maestro/screenshot_card_wallet_camera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
appId: com.akylas.cardwallet
---
# Card Wallet - Camera View Screenshot
# This flow captures the camera scanning screen for cards

- launchApp
- waitForAnimationToEnd

# Wait for the app to load
- waitForAnimationToEnd:
timeout: 3000

# Tap the camera button to open camera
- tapOn:
id: ".*camera.*"
timeout: 5000

# Wait for camera to initialize
- waitForAnimationToEnd:
timeout: 3000

# Take screenshot of camera view
- takeScreenshot: screenshot_card_wallet_camera

# Go back to main screen
- back
28 changes: 28 additions & 0 deletions .maestro/screenshot_card_wallet_detail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
appId: com.akylas.cardwallet
---
# Card Wallet - Card Detail Screenshot
# This flow captures a card detail view with barcode

- launchApp
- waitForAnimationToEnd

# Wait for the app to load
- waitForAnimationToEnd:
timeout: 3000

# Tap on the first card (if exists)
- tapOn:
id: ".*card.*"
index: 0
optional: true
timeout: 5000

# Wait for card to open
- waitForAnimationToEnd:
timeout: 2000

# Take screenshot of card view
- takeScreenshot: screenshot_card_wallet_detail

# Go back to main screen
- back
17 changes: 17 additions & 0 deletions .maestro/screenshot_card_wallet_main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
appId: com.akylas.cardwallet
---
# Card Wallet - Main Screen Screenshot
# This flow captures the main card list screen

- launchApp
- waitForAnimationToEnd

# Wait for the app to fully load
- waitForAnimationToEnd:
timeout: 5000

# Take screenshot of main screen
- takeScreenshot: screenshot_card_wallet_main

# Optional: Ensure we're on the main screen
- assertVisible: "Cards"
26 changes: 26 additions & 0 deletions .maestro/screenshot_document_scanner_camera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
appId: com.akylas.documentscanner
---
# Document Scanner - Camera View Screenshot
# This flow captures the camera scanning screen

- launchApp
- waitForAnimationToEnd

# Wait for the app to load
- waitForAnimationToEnd:
timeout: 3000

# Tap the camera button to open camera
- tapOn:
id: ".*camera.*"
timeout: 5000

# Wait for camera to initialize
- waitForAnimationToEnd:
timeout: 3000

# Take screenshot of camera view
- takeScreenshot: screenshot_document_scanner_camera

# Go back to main screen
- back
28 changes: 28 additions & 0 deletions .maestro/screenshot_document_scanner_detail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
appId: com.akylas.documentscanner
---
# Document Scanner - Document View Screenshot
# This flow captures a document detail view

- launchApp
- waitForAnimationToEnd

# Wait for the app to load
- waitForAnimationToEnd:
timeout: 3000

# Tap on the first document (if exists)
- tapOn:
id: ".*document.*"
index: 0
optional: true
timeout: 5000

# Wait for document to open
- waitForAnimationToEnd:
timeout: 2000

# Take screenshot of document view
- takeScreenshot: screenshot_document_scanner_detail

# Go back to main screen
- back
17 changes: 17 additions & 0 deletions .maestro/screenshot_document_scanner_main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
appId: com.akylas.documentscanner
---
# Document Scanner - Main Screen Screenshot
# This flow captures the main document list screen

- launchApp
- waitForAnimationToEnd

# Wait for the app to fully load
- waitForAnimationToEnd:
timeout: 5000

# Take screenshot of main screen
- takeScreenshot: screenshot_document_scanner_main

# Optional: Ensure we're on the main screen
- assertVisible: "Documents"
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ This repository is now the home of 2 apps
[![Small translation badge](https://hosted.weblate.org/widgets/oss-document-scanner/-/svg-badge.svg)](https://hosted.weblate.org/engage/oss-document-scanner/?utm_source=widget)
</div>

## 📚 Documentation

For detailed information about the apps, features, and usage guides, visit our documentation website:

🌐 **[https://akylas.github.io/OSS-DocumentScanner/](https://akylas.github.io/OSS-DocumentScanner/)**

## Installation

<!-- [<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="80">](https://f-droid.org/packages/com.machiav3lli.backup/) -->
Expand Down
16 changes: 16 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules
.vitepress/dist
.vitepress/cache
.DS_Store
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Loading
Loading