Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
96d3d07
fix(wasm-sdk): fix nested examples in Get Identity Keys documentation
thephez Jul 28, 2025
6c47cab
fix(wasm-sdk): fix container structure for Get Identity Keys examples
thephez Jul 28, 2025
1329919
feat(wasm-sdk): update getDataContractHistory example with specific c…
thephez Jul 28, 2025
1b9032a
fix(wasm-sdk): fix getDataContractHistory serialization and remove WI…
thephez Jul 28, 2025
46306b1
feat(wasm-sdk): add third example for Get Identity Keys search functi…
thephez Jul 28, 2025
5e9345e
fix: make getIdentityKeys specific example work by disabling proofs i…
thephez Jul 28, 2025
6f9f401
fix: update getIdentityKeys search example
thephez Jul 28, 2025
3bc5bf5
fix: temporarily bypass get_token_perpetual_distribution_last_claim p…
thephez Jul 28, 2025
76b88f5
Merge branch 'v2.1-dev' into fix-wasm-sdk-examples
thephez Jul 29, 2025
673e92b
fix(wasm-sdk): fix getTokenPerpetualDistributionLastClaim raw bytes d…
thephez Jul 29, 2025
b32cd43
docs(wasm-sdk): add comprehensive documentation and validation for ra…
thephez Jul 29, 2025
71db515
trivial: minor cleanup
thephez Jul 29, 2025
e4447c4
docs: update example contract id
thephez Jul 29, 2025
243e31e
docs: revert change
thephez Jul 29, 2025
7d833b1
feat: ui test initial draft (not working)
thephez Jul 29, 2025
eb6cd0a
fix: run tests successfully from location
thephez Jul 29, 2025
fcf4214
feat: get smoke tests working plus some queries
thephez Jul 29, 2025
b58f18e
fix: wait for proof toggle
thephez Jul 29, 2025
42e4f25
fix: parse getIdentityBalance response properly
thephez Jul 29, 2025
777b3ea
fix: getCurrentEpoch working
thephez Jul 30, 2025
f187b6e
fix: getDataContracts working
thephez Jul 30, 2025
691fa91
fix: correct / expand category list in smoke test
thephez Jul 30, 2025
819edfe
test: add getIdentityNonce, getIdentityContractNonce, getIdentitiesBa…
thephez Jul 30, 2025
78a5ba1
test: add tests for more endpoints
thephez Jul 30, 2025
1f86dfd
test: fix broken tests
thephez Jul 30, 2025
88fba24
test: improve proof handling
thephez Jul 30, 2025
ccf6e24
test: getIdentity with and without proof
thephez Jul 30, 2025
6d2cbe0
test: update proof toggle handling and add test
thephez Jul 30, 2025
ba67d8f
test: do identity tests for both with and without proof scenarios
thephez Jul 30, 2025
2c8ddcc
test: disable proof test for queries that don't support them yet in t…
thephez Jul 30, 2025
d191257
Merge branch 'v2.1-dev' into automate-ui-testing
thephez Jul 30, 2025
282a13e
refactor: extract common test validation helpers
thephez Jul 30, 2025
afc59e3
test: logging cleanup
thephez Jul 30, 2025
ab7b56a
test: add complete data contract and document query coverage
thephez Jul 30, 2025
b4e00ce
test: remove ui test from main wasm-sdk package.json
thephez Jul 31, 2025
b8fbe4e
style: fix line endings
thephez Jul 31, 2025
737eae8
ci: add workflow for ui test
thephez Jul 31, 2025
89e249a
debug: enable on failing test to check ci
thephez Jul 31, 2025
168a9ea
test: revert previous change and skip test again
thephez Jul 31, 2025
5dab3a6
docs: update README
thephez Jul 31, 2025
eacf0c7
style: fix eof
thephez Jul 31, 2025
9d8a8bc
ci: disable automatic runs for now
thephez Jul 31, 2025
7ad4bd6
fix: browser check improved
thephez Jul 31, 2025
ff04d2c
chore: remove duplicate web sserver startup code
thephez Jul 31, 2025
6f1e8fa
docs: minor readme update
thephez Jul 31, 2025
4bbddc4
chore: updates per review comments
thephez Jul 31, 2025
33f244a
chore: address more review comments
thephez Jul 31, 2025
96dcbbf
test: update invalid id tests for base58 validation
thephez Jul 31, 2025
1d74241
chore: address review comments
thephez Jul 31, 2025
d874de1
refactor: parameterized identity tests
thephez Aug 1, 2025
dc9def2
chore: address review comment
thephez Aug 1, 2025
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
236 changes: 236 additions & 0 deletions .github/workflows/wasm-sdk-ui-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
name: WASM SDK UI Automation Tests

on:
# Trigger after wasm-sdk-build workflow completes successfully
# TODO: Temporarily disabled - uncomment to re-enable automatic triggering
# workflow_run:
# workflows: ["Build WASM SDK"]
# types:
# - completed
# branches:
# - master
# - 'v[0-9]+.[0-9]+-dev'

# Manual trigger for standalone testing
workflow_dispatch:
inputs:
test_type:
description: 'Type of tests to run'
required: true
default: 'all'
type: choice
options:
- smoke
- queries
- parameterized
- all
browser:
description: 'Browser to use for testing'
required: false
default: 'chromium'
type: choice
options:
- chromium
- firefox
- webkit
headed:
description: 'Run tests in headed mode (visible browser)'
required: false
default: false
type: boolean
debug:
description: 'Enable debug output'
required: false
default: false
type: boolean
workflow_run_id:
description: 'Workflow run ID to download WASM SDK build from (for manual runs)'
required: false
type: string

jobs:
ui-tests:
name: Run WASM SDK UI Tests
runs-on: ubuntu-latest
timeout-minutes: 20
# Only run if build workflow succeeded (for workflow_run) or if manually triggered
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}

env:
CI: true
DEBUG: ${{ inputs.debug || 'false' }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Download WASM SDK build artifacts
uses: actions/download-artifact@v4
with:
# For workflow_run, download from the triggering workflow
# For manual dispatch, use provided workflow_run_id or latest
run-id: ${{ github.event.workflow_run.id || inputs.workflow_run_id }}
name: wasm-sdk-build
path: packages/wasm-sdk/pkg/
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Verify WASM SDK artifacts
working-directory: packages/wasm-sdk
run: |
echo "Verifying downloaded WASM SDK artifacts..."
ls -lah pkg/

# Verify all required files exist
required_files=(
"pkg/wasm_sdk_bg.wasm"
"pkg/optimized.wasm"
"pkg/wasm_sdk.js"
"pkg/wasm_sdk.d.ts"
"pkg/package.json"
)

for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
echo "❌ Missing required file: $file"
exit 1
else
echo "✅ Found: $file"
fi
done

echo "🎉 All WASM SDK artifacts verified successfully!"

- name: Install test dependencies
working-directory: packages/wasm-sdk/test/ui-automation
run: |
echo "Installing UI test dependencies..."
npm install

- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('packages/wasm-sdk/test/ui-automation/package.json') }}
restore-keys: |
${{ runner.os }}-playwright-

- name: Install Playwright browsers
working-directory: packages/wasm-sdk/test/ui-automation
run: |
echo "Installing Playwright browsers..."
npx playwright install --with-deps ${{ inputs.browser || 'chromium' }}

- name: Run smoke tests
if: (inputs.test_type == 'smoke' || inputs.test_type == 'all') || github.event_name == 'workflow_run'
working-directory: packages/wasm-sdk/test/ui-automation
run: |
echo "🧪 Running smoke tests..."
if [ "${{ inputs.headed }}" == "true" ]; then
npm run test:headed -- tests/basic-smoke.spec.js
else
npm run test:smoke
fi

- name: Run query execution tests
if: (inputs.test_type == 'queries' || inputs.test_type == 'all') || github.event_name == 'workflow_run'
working-directory: packages/wasm-sdk/test/ui-automation
run: |
echo "🔍 Running query execution tests..."
if [ "${{ inputs.headed }}" == "true" ]; then
npm run test:headed -- tests/query-execution.spec.js
else
npm run test:queries
fi

- name: Run parameterized tests
if: (inputs.test_type == 'parameterized' || inputs.test_type == 'all') || github.event_name == 'workflow_run'
working-directory: packages/wasm-sdk/test/ui-automation
run: |
echo "⚙️ Running parameterized tests..."
if [ "${{ inputs.headed }}" == "true" ]; then
npm run test:headed -- tests/parameterized-queries.spec.js
else
npm run test:parameterized
fi

- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ inputs.test_type || 'all' }}-${{ inputs.browser || 'chromium' }}-${{ github.run_number }}
path: packages/wasm-sdk/test/ui-automation/playwright-report/
retention-days: 30

- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ inputs.test_type || 'all' }}-${{ inputs.browser || 'chromium' }}-${{ github.run_number }}
path: |
packages/wasm-sdk/test/ui-automation/test-results/
packages/wasm-sdk/test/ui-automation/test-results.json
retention-days: 30

- name: Upload Screenshots and Videos
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-failures-${{ inputs.test_type || 'all' }}-${{ inputs.browser || 'chromium' }}-${{ github.run_number }}
path: |
packages/wasm-sdk/test/ui-automation/test-results/**/*.png
packages/wasm-sdk/test/ui-automation/test-results/**/*.webm
retention-days: 30

- name: Display Test Summary
if: always()
working-directory: packages/wasm-sdk/test/ui-automation
run: |
echo "## WASM SDK UI Test Results" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"

if [ "${{ github.event_name }}" == "workflow_run" ]; then
echo "- **Triggered by**: WASM SDK Build (workflow_run)" >> "$GITHUB_STEP_SUMMARY"
echo "- **Build Workflow**: ${{ github.event.workflow_run.html_url }}" >> "$GITHUB_STEP_SUMMARY"
else
echo "- **Triggered by**: Manual dispatch" >> "$GITHUB_STEP_SUMMARY"
echo "- **Test Type**: ${{ inputs.test_type }}" >> "$GITHUB_STEP_SUMMARY"
echo "- **Browser**: ${{ inputs.browser }}" >> "$GITHUB_STEP_SUMMARY"
echo "- **Headed Mode**: ${{ inputs.headed }}" >> "$GITHUB_STEP_SUMMARY"
fi

echo "- **Debug**: ${{ env.DEBUG }}" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"

# Show test results if available
if [ -f "test-results.json" ]; then
echo "### Test Results" >> "$GITHUB_STEP_SUMMARY"
echo '```json' >> "$GITHUB_STEP_SUMMARY"
jq '.stats' test-results.json >> "$GITHUB_STEP_SUMMARY" 2>/dev/null || echo "Test results available in artifacts" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
fi

# List available artifacts
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "### Available Artifacts" >> "$GITHUB_STEP_SUMMARY"
echo "- **Playwright Report**: Detailed HTML report with test results" >> "$GITHUB_STEP_SUMMARY"
echo "- **Test Results**: JSON results and raw output files" >> "$GITHUB_STEP_SUMMARY"
if [ "${{ job.status }}" == "failure" ]; then
echo "- **Test Failures**: Screenshots and videos of failed tests" >> "$GITHUB_STEP_SUMMARY"
fi

# Add quick links
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "### Quick Links" >> "$GITHUB_STEP_SUMMARY"
echo "- [WASM SDK](https://github.com/${{ github.repository }}/tree/${{ github.sha }}/packages/wasm-sdk)" >> "$GITHUB_STEP_SUMMARY"
echo "- [UI Tests](https://github.com/${{ github.repository }}/tree/${{ github.sha }}/packages/wasm-sdk/test/ui-automation)" >> "$GITHUB_STEP_SUMMARY"

Loading
Loading