-
Notifications
You must be signed in to change notification settings - Fork 44
test(sdk): automate wasm-sdk page UI testing (partial) #2715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixed HTML structure issue where Example 2 was nested inside Example 1 in the Get Identity Keys endpoint documentation. Both examples are now properly displayed at the same level. Changes: - Updated generate_docs.py to close the first example container before starting the second one - Regenerated docs.html with correct HTML structure - Updated AI_REFERENCE.md and docs_manifest.json accordingly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fixed HTML container structure where the special handling for Get Identity Keys was causing improper container closing, making all subsequent query sections display as new columns instead of normal layout. Changes: - Added early return for getIdentityKeys special case to prevent double closing - Both examples now have proper result div placement within their containers - Subsequent query sections now display with correct layout 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ontract ID Updated the getDataContractHistory example to use contract ID HLY575cNazmc5824FxqaEMEBuzFeE4a98GDRNKbyJqCM instead of the default test contract. This provides a better example for testing contract history functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…P flag - Fix BTreeMap serialization issue by using String keys instead of u64 - Update example to use specific contract ID HLY575cNazmc5824FxqaEMEBuzFeE4a98GDRNKbyJqCM - Remove "Work in Progress" notification from getDataContractHistory - Regenerate documentation with updated parameters 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…onality Add Example 3 - Search Keys by Purpose to getIdentityKeys documentation, demonstrating how to use the search key request type with purpose mapping for authentication and encryption keys. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Returns no results but doesn't error
…roofs to get example working Claude identified an issue in the rs-drive-proof-verifier preventing the SDK from properly handling the proof
…ecoding - Implement direct gRPC calls with prove: false to bypass proof verification issues - Fix raw bytes decoding to properly parse 8-byte server response format: - First 4 bytes: timestamp (u32, in seconds) - Last 4 bytes: block height (u32) - Update test parameters to use identity/token with actual completed claims - Function now returns actual claim data instead of errors or zero values 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…w bytes parsing - Document exact 8-byte format specification for PaidAt::RawBytes parsing - Add validation ranges for timestamp (>= Jan 1, 2021) and block height (>= 1) - Include defensive programming with console warnings for invalid values - Implement graceful fallbacks to safe defaults instead of silent failures - Maintain backward compatibility while improving robustness 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Remove WIP note and sync contract id in getDataContractHistory example
…lances, and getIdentityBalanceAndRevision
getIdentityByNonUniquePublicKeyHash, getIdentityByPublicKeyHash, getIdentityTokenBalances, getIdentitiesTokenBalances, getIdentityTokenInfos, getIdentitiesTokenInfos
- Add getDataContractHistory query test with test data - Add proof support tests for all data contract queries - Add proof support tests for all document queries - Create validateContractResult() and validateDocumentResult() helper functions - Update existing data contract and document tests to use helper functions - Skip getDataContracts and getDataContractHistory proof tests (not yet implemented) - Fix contract validation to check for 'id' and 'config' properties 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Re-use wasm-sdk artifact from the WASM build action
Handled by Playwright config only now
WalkthroughThis change introduces a comprehensive UI automation test suite for the WASM SDK using Playwright, including test utilities, parameter management, test data, and a GitHub Actions workflow for CI integration. It adds new test cases, scripts, configuration files, and documentation to support automated, parameterized, and cross-browser UI testing of the WASM SDK web interface. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant Runner (Ubuntu)
participant WASM SDK Repo
participant Playwright Test Suite
GitHub Actions->>Runner (Ubuntu): Trigger workflow (manual or on build success)
Runner (Ubuntu)->>WASM SDK Repo: Checkout code
Runner (Ubuntu)->>Runner (Ubuntu): Setup Node.js & Python
Runner (Ubuntu)->>WASM SDK Repo: Download WASM SDK build artifacts
Runner (Ubuntu)->>Runner (Ubuntu): Install dependencies (npm, Playwright browsers)
Runner (Ubuntu)->>Playwright Test Suite: Run UI tests (smoke, queries, parameterized)
Playwright Test Suite-->>Runner (Ubuntu): Generate reports, screenshots, videos
Runner (Ubuntu)->>GitHub Actions: Upload artifacts and summary
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 12
🔭 Outside diff range comments (1)
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js (1)
1-1390
: Consider splitting this large test file into smaller, focused files.This 1390-line file is difficult to maintain. Consider splitting it by query category (e.g.,
identity-queries.spec.js
,contract-queries.spec.js
, etc.) for better organization and maintainability.Create separate test files:
tests/queries/identity.spec.js
tests/queries/data-contract.spec.js
tests/queries/document.spec.js
tests/queries/system.spec.js
tests/queries/error-handling.spec.js
tests/queries/network-switching.spec.js
Move shared helper functions to a dedicated file:
tests/helpers/query-helpers.js
🧹 Nitpick comments (20)
packages/wasm-sdk/test/ui-automation/package.json (1)
18-18
: Consider making the serve path more robust.The serve script uses a relative path (
cd ../../
) which could be fragile if the directory structure changes. Consider using a more explicit path resolution.- "serve": "cd ../../ && python3 -m http.server 8888", + "serve": "cd \"$npm_package_config_wasm_sdk_dir\" && python3 -m http.server 8888",And add to the package.json:
"config": { "wasm_sdk_dir": "../../" }packages/wasm-sdk/test/ui-automation/playwright.config.js (2)
44-56
: Consider adding more browser projects for comprehensive testing.Currently only testing with Chromium. For better coverage, consider adding Firefox and WebKit projects to ensure cross-browser compatibility.
projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'], // Enable headless mode by default headless: true, // Use a larger viewport for better testing viewport: { width: 1920, height: 1080 } }, }, + { + name: 'firefox', + use: { + ...devices['Desktop Firefox'], + headless: true, + viewport: { width: 1920, height: 1080 } + }, + }, + { + name: 'webkit', + use: { + ...devices['Desktop Safari'], + headless: true, + viewport: { width: 1920, height: 1080 } + }, + }, ],
60-61
: Consider making the port configurable.The hardcoded port 8888 could conflict with other services. Consider making it configurable via environment variable.
- command: 'python3 -m http.server 8888', - url: 'http://localhost:8888', + command: `python3 -m http.server ${process.env.TEST_SERVER_PORT || 8888}`, + url: `http://localhost:${process.env.TEST_SERVER_PORT || 8888}`,Also update the baseURL:
- baseURL: 'http://localhost:8888', + baseURL: `http://localhost:${process.env.TEST_SERVER_PORT || 8888}`,packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js (1)
41-68
: Move parseNumericResult to handle BigInt for large numbers.The function might lose precision for very large numbers. Consider supporting BigInt for balance/nonce values.
function parseNumericResult(resultStr, propertyName = 'balance') { const trimmedStr = resultStr.trim(); // Try to parse as JSON first (in case it's a JSON response) let numericValue; try { const parsed = JSON.parse(trimmedStr); // Check if it's a JSON object with the expected property if (typeof parsed === 'object' && parsed[propertyName] !== undefined) { - numericValue = Number(parsed[propertyName]); + // Handle potentially large numbers + const value = parsed[propertyName]; + numericValue = typeof value === 'string' && value.length > 15 + ? BigInt(value) + : Number(value); } else if (typeof parsed === 'number') { numericValue = parsed; } else { numericValue = Number(parsed); } } catch { // If not JSON, try parsing directly as number - numericValue = Number(trimmedStr); + numericValue = trimmedStr.length > 15 ? BigInt(trimmedStr) : Number(trimmedStr); // If Number() fails, log the issue - if (isNaN(numericValue)) { + if (typeof numericValue === 'number' && isNaN(numericValue)) { console.error(`Failed to parse ${propertyName}:`, trimmedStr, 'type:', typeof trimmedStr); } } return numericValue; }packages/wasm-sdk/test/ui-automation/run-ui-tests.sh (2)
92-96
: Improve Node.js version parsing robustness.The current version parsing might fail on some Node.js builds with version suffixes (e.g., v18.0.0-nightly).
- NODE_VERSION=$(node --version | sed 's/v//') - NODE_MAJOR=$(echo $NODE_VERSION | cut -d. -f1) + NODE_VERSION=$(node --version | sed 's/^v//' | sed 's/-.*//') + NODE_MAJOR=$(echo "$NODE_VERSION" | cut -d. -f1) if [ "$NODE_MAJOR" -lt 18 ]; then - print_error "Node.js version $NODE_VERSION is too old. Please install Node.js 18+ and try again." + print_error "Node.js version v$NODE_VERSION is too old. Please install Node.js 18+ and try again." exit 1 fi
150-156
: Make Playwright browser detection more robust.The current approach using find might not work reliably across different systems or Playwright versions.
- # Install browsers if needed - if ! find "$HOME/.cache/ms-playwright" -maxdepth 1 -name "chromium-*" -type d -print -quit 2>/dev/null | grep -q .; then + # Install browsers if needed - check if playwright can list browsers + if ! npx playwright show-report --help &>/dev/null || ! npx playwright install --help | grep -q "is already installed"; then print_status "Installing Playwright browsers..." if ! npx playwright install chromium; then print_error "Failed to install Playwright browsers" exit 1 fi + else + print_debug "Playwright browsers already installed" fipackages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js (3)
13-40
: Extract SDK initialization retry logic to a helper function.The retry logic is useful but makes the test harder to read. Consider extracting it to a reusable helper.
Create a helper function:
async function waitForSdkInitialization(wasmSdkPage, maxAttempts = 3) { for (let attempt = 1; attempt <= maxAttempts; attempt++) { const statusState = await wasmSdkPage.getStatusBannerState(); if (statusState === 'success') { return statusState; } if (statusState === 'loading') { console.log(`⏳ SDK still loading (attempt ${attempt}/${maxAttempts}), waiting...`); await wasmSdkPage.waitForSdkReady(); const newState = await wasmSdkPage.getStatusBannerState(); if (newState === 'success') { return newState; } } if (attempt < maxAttempts) { await wasmSdkPage.page.waitForTimeout(2000); } } return await wasmSdkPage.getStatusBannerState(); } // Then in the test: test('should initialize SDK successfully', async () => { const statusState = await waitForSdkInitialization(wasmSdkPage); expect(statusState).toBe('success'); // Verify network is set to testnet const networkIndicator = wasmSdkPage.page.locator('#networkIndicator'); await expect(networkIndicator).toContainText('TESTNET'); });
38-38
: Avoid hardcoded timeout values.Hardcoded timeouts make tests brittle. Consider making them configurable or using Playwright's built-in wait mechanisms.
- await wasmSdkPage.page.waitForTimeout(2000); + await wasmSdkPage.page.waitForLoadState('networkidle'); - await wasmSdkPage.page.waitForTimeout(1000); + // Wait for UI elements to be ready + await wasmSdkPage.page.waitForSelector('#proofToggleContainer', { state: 'attached', timeout: 5000 }).catch(() => null);Also applies to: 144-144
56-71
: Make expected categories configurable or fetch dynamically.Hardcoding expected categories makes the test brittle if categories change.
Consider fetching expected categories from a configuration or test data file:
// In fixtures/test-data.js or similar export const EXPECTED_QUERY_CATEGORIES = [ 'Identity Queries', 'Data Contract Queries', 'Document Queries', // ... etc ]; // In the test const { EXPECTED_QUERY_CATEGORIES } = require('../fixtures/test-data'); test('should load query categories', async () => { await wasmSdkPage.setOperationType('queries'); const categories = await wasmSdkPage.getAvailableQueryCategories(); for (const category of EXPECTED_QUERY_CATEGORIES) { expect(categories).toContain(category); } });packages/wasm-sdk/test/ui-automation/fixtures/test-data.js (2)
310-340
: Consider consistent error handling between helper functionsThe
getTestParameters
function throws errors when data is not found, whilegetAllTestParameters
returns empty arrays. This inconsistency could lead to confusion for users of these functions.Consider either:
- Making both functions throw errors for missing data
- Making both functions return null/empty values for missing data
- Documenting the different behaviors clearly
13-30
: Add validation or default data for mainnet arraysThe mainnet arrays are currently empty. If tests attempt to use mainnet data, they might fail unexpectedly. Consider:
- Adding validation in the helper functions to provide better error messages for empty mainnet data
- Adding default/mock mainnet data for testing purposes
- Documenting that mainnet testing is not yet supported
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js (2)
79-80
: Consider making the inter-test delay configurableThe 1000ms timeout between test executions is hardcoded. Consider making this configurable for different testing scenarios (faster for CI, slower for debugging).
+const TEST_EXECUTION_DELAY = process.env.TEST_DELAY || 1000; + // Brief pause between executions - await wasmSdkPage.page.waitForTimeout(1000); + await wasmSdkPage.page.waitForTimeout(TEST_EXECUTION_DELAY);
211-211
: Add timeout for random parameter testsThe
executeQueryAndGetResult(false)
call might hang with invalid random parameters. Consider adding a timeout to prevent test hangs.- const result = await wasmSdkPage.executeQueryAndGetResult(false); + const result = await Promise.race([ + wasmSdkPage.executeQueryAndGetResult(false), + new Promise((_, reject) => setTimeout(() => reject(new Error('Query timeout')), 10000)) + ]).catch(error => ({ success: false, hasError: true, error: error.message }));.github/workflows/wasm-sdk-ui-tests.yml (3)
4-13
: Address TODO: Re-enable automatic workflow triggeringThe automatic workflow triggering is currently disabled. This TODO should be addressed before merging to ensure the UI tests run automatically after WASM SDK builds.
Would you like me to help create an issue to track enabling the automatic workflow trigger?
133-165
: Consider reducing duplication in test execution stepsThe headed mode check is repeated in all three test execution steps. Consider using a reusable composite action or environment variable to reduce duplication.
- name: Set test command run: | if [ "${{ inputs.headed }}" == "true" ]; then echo "TEST_CMD=npm run test:headed --" >> $GITHUB_ENV else echo "TEST_CMD=npm run" >> $GITHUB_ENV fi - 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..." ${{ env.TEST_CMD }} test:smoke
13-236
: Remove trailing spaces throughout the workflow fileYAMLlint detected trailing spaces on multiple lines. These should be removed for consistency and to pass linting checks.
Remove trailing spaces from lines: 13, 58, 62, 66, 71, 76, 86, 92, 96, 101, 110, 112, 118, 126, 132, 143, 154, 165, 173, 183, 193, 200, 210, 213, 221, 230, 236.
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js (2)
15-33
: Consider propagating errors for better test debugging.The method silently catches errors and returns false. For test automation, it might be helpful to propagate certain errors to help debug test failures.
Consider re-throwing errors after logging them, or at least distinguish between expected failures (no parameters found) and unexpected errors:
} catch (error) { console.error(`❌ Failed to inject parameters for ${category}.${queryType}:`, error.message); + // Re-throw for unexpected errors to help with debugging + if (!(error instanceof TypeError)) { + throw error; + } return false; }
39-93
: Consider externalizing selector mappings for maintainability.The hard-coded selector mappings could become difficult to maintain as the UI evolves. Consider moving these to a configuration file or generating them dynamically from the UI definitions.
Consider creating a separate configuration file for selectors:
// selectors-config.json { "identity": { "id": ["#id", "[name=\"id\"]", "input[placeholder*=\"Identity ID\"]"], "identityId": ["#identityId", "[name=\"identityId\"]", "input[placeholder*=\"Identity ID\"]"] }, // ... other categories }Then load it dynamically:
- getParameterFieldMapping() { - return { - // Identity parameters - 'id': ['#id', '[name="id"]', 'input[placeholder*="Identity ID"]'], - // ... rest of the mapping - }; - } + getParameterFieldMapping() { + return require('../config/selectors-config.json'); + }packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js (2)
211-211
: Make the Add Item button selector more specific.The current selector is very broad and could match unintended buttons.
Consider using a more specific selector or data attribute:
- const addButton = this.page.locator('button:has-text("+ Add Item"), button.add-array-item, button:has-text("Add Item"), button:has-text("Add"), button:has-text("add")').first(); + // Look for button within the array container context + const arrayContainer = await baseElement.locator('..').first(); + const addButton = arrayContainer.locator('button:has-text("Add Item"), button[data-action="add-array-item"]').first();
488-492
: Consider using a more robust check for details element state.The current check for the
open
attribute might be fragile.Use a more reliable approach:
- const isOpen = await configDetails.getAttribute('open') !== null; + const isOpen = await configDetails.evaluate(el => el.open);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/wasm-sdk/test/ui-automation/package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (12)
.github/workflows/wasm-sdk-ui-tests.yml
(1 hunks)packages/wasm-sdk/test/ui-automation/README.md
(1 hunks)packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
(1 hunks)packages/wasm-sdk/test/ui-automation/package.json
(1 hunks)packages/wasm-sdk/test/ui-automation/playwright.config.js
(1 hunks)packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
(1 hunks)packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
(1 hunks)packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
(1 hunks)packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
(1 hunks)packages/wasm-sdk/test/ui-automation/utils/base-test.js
(1 hunks)packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
(1 hunks)packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
(1 hunks)
🧰 Additional context used
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use comprehensive test suites at unit, integration, and e2e levels
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
📚 Learning: applies to packages/wasm-sdk/index.html : test the wasm sdk using the web interface at 'index.html' ...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/playwright.config.js
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
.github/workflows/wasm-sdk-ui-tests.yml
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/**/index.html : when adding new queries or state transitions, update th...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/playwright.config.js
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
.github/workflows/wasm-sdk-ui-tests.yml
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/**/index.html : the wasm sdk now fully supports where and orderby claus...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/playwright.config.js
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
.github/workflows/wasm-sdk-ui-tests.yml
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/src/**/*.rs : the wasm sdk now fully supports where and orderby clauses...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in `packages/wallet-contract/test/bootstrap.js`, for mocha tests in node.js, async functions like `l...
Learnt from: shumkov
PR: dashpay/platform#2314
File: packages/wallet-contract/test/bootstrap.js:14-16
Timestamp: 2024-11-06T07:27:01.722Z
Learning: In `packages/wallet-contract/test/bootstrap.js`, for Mocha tests in Node.js, async functions like `loadWasmDpp` can be assigned directly to `beforeAll` without wrapping them in another async function.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/playwright.config.js
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/**/generate_docs.py : when adding new queries or state transitions, run...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
.github/workflows/wasm-sdk-ui-tests.yml
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/src/**/*.rs : when implementing wasm sdk functionality, always refer to...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
.github/workflows/wasm-sdk-ui-tests.yml
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in packages/wasm-sdk/ai_reference.md, the documentation correctly shows the actual sdk method signat...
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
.github/workflows/wasm-sdk-ui-tests.yml
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/build.sh : build the wasm sdk by running './build.sh' in 'packages/wasm...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/playwright.config.js
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/README.md
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: applies to packages/wasm-sdk/src/**/*.rs : token functions are methods on wasmsdk, not standalone fu...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
📚 Learning: in the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification...
Learnt from: lklimek
PR: dashpay/platform#2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in packages/wasm-sdk/docs.html, quantumexplorer confirmed that placeholder private keys in documenta...
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/docs.html:2359-2383
Timestamp: 2025-07-28T20:00:24.323Z
Learning: In packages/wasm-sdk/docs.html, QuantumExplorer confirmed that placeholder private keys in documentation examples are acceptable as they are not real keys, though field name accuracy for the SDK API should still be maintained.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in ...
Learnt from: shumkov
PR: dashpay/platform#2249
File: packages/dashmate/test/unit/status/scopes/platform.spec.js:77-78
Timestamp: 2024-10-18T15:37:36.387Z
Learning: In `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in tests to increase readability, rather than refactoring them into shared `beforeEach` blocks or helper functions.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
📚 Learning: in test files for the dashmate project, such as `packages/dashmate/test/unit/status/scopes/platform....
Learnt from: shumkov
PR: dashpay/platform#2249
File: packages/dashmate/test/unit/status/scopes/platform.spec.js:466-467
Timestamp: 2024-10-18T15:37:21.329Z
Learning: In test files for the dashmate project, such as `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in tests rather than consolidating them, to increase readability.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
📚 Learning: applies to packages/wasm-sdk/generate_docs.py : keep documentation for the wasm sdk in sync by runni...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/generate_docs.py : Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'
Applied to files:
packages/wasm-sdk/test/ui-automation/package.json
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
packages/wasm-sdk/test/ui-automation/README.md
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: applies to packages/wasm-sdk/src/**/*.rs : for wasm builds, fix 'time not implemented on this platfo...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().
Applied to files:
packages/wasm-sdk/test/ui-automation/package.json
📚 Learning: in the rust sdk's `rs-sdk/tests` integration tests (e.g., in `packages/rs-sdk/tests/fetch/config.rs`...
Learnt from: lklimek
PR: dashpay/platform#2277
File: packages/rs-sdk/tests/fetch/config.rs:233-233
Timestamp: 2024-10-30T11:19:59.163Z
Learning: In the Rust SDK's `rs-sdk/tests` integration tests (e.g., in `packages/rs-sdk/tests/fetch/config.rs`), we cannot create objects during tests because there is no support for object creation in this context. Therefore, hardcoded values for test identities must be used.
Applied to files:
packages/wasm-sdk/test/ui-automation/fixtures/test-data.js
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
📚 Learning: when reviewing scripts in `packages/rs-sdk/scripts/`, avoid suggesting additional error handling and...
Learnt from: lklimek
PR: dashpay/platform#2381
File: packages/rs-sdk/scripts/connect_to_remote.sh:0-0
Timestamp: 2024-12-10T12:39:38.182Z
Learning: When reviewing scripts in `packages/rs-sdk/scripts/`, avoid suggesting additional error handling and timeout management that complicate the script without adding significant value.
Applied to files:
packages/wasm-sdk/test/ui-automation/run-ui-tests.sh
📚 Learning: use comprehensive test suites at unit, integration, and e2e levels...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use comprehensive test suites at unit, integration, and e2e levels
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/README.md
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in the ci workflows (e.g., `.github/workflows/release-docker-image.yml` and `tests-build-image.yml`)...
Learnt from: lklimek
PR: dashpay/platform#2344
File: .github/workflows/release-docker-image.yml:66-70
Timestamp: 2024-11-25T12:59:11.416Z
Learning: In the CI workflows (e.g., `.github/workflows/release-docker-image.yml` and `tests-build-image.yml`), we do not add validation steps for cache configuration variables. We rely on the build process to quickly reveal any misconfigurations.
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
🧬 Code Graph Analysis (1)
packages/wasm-sdk/test/ui-automation/utils/base-test.js (4)
packages/wasm-sdk/test/ui-automation/tests/basic-smoke.spec.js (2)
require
(1-1)require
(2-2)packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js (4)
require
(1-1)require
(2-2)require
(3-3)require
(4-4)packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js (2)
require
(1-1)require
(2-2)packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js (3)
require
(1-1)require
(2-2)require
(3-3)
🪛 actionlint (1.7.7)
.github/workflows/wasm-sdk-ui-tests.yml
197-197: shellcheck reported issue in this script: SC2086:info:1:39: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:2:12: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:5:63: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:6:77: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2129:style:8:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:8:49: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:9:54: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:10:50: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:11:53: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:14:41: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:15:12: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:19:30: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:20:21: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:21:36: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:21:118: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:22:17: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2129:style:26:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:26:12: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:27:35: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:28:75: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:29:65: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:31:73: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2129:style:35:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:35:12: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:36:27: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:37:110: Double quote to prevent globbing and word splitting
(shellcheck)
197-197: shellcheck reported issue in this script: SC2086:info:38:129: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 YAMLlint (1.37.1)
.github/workflows/wasm-sdk-ui-tests.yml
[error] 13-13: trailing spaces
(trailing-spaces)
[error] 58-58: trailing spaces
(trailing-spaces)
[error] 62-62: trailing spaces
(trailing-spaces)
[error] 66-66: trailing spaces
(trailing-spaces)
[error] 71-71: trailing spaces
(trailing-spaces)
[error] 76-76: trailing spaces
(trailing-spaces)
[error] 86-86: trailing spaces
(trailing-spaces)
[error] 92-92: trailing spaces
(trailing-spaces)
[error] 96-96: trailing spaces
(trailing-spaces)
[error] 101-101: trailing spaces
(trailing-spaces)
[error] 110-110: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 118-118: trailing spaces
(trailing-spaces)
[error] 126-126: trailing spaces
(trailing-spaces)
[error] 132-132: trailing spaces
(trailing-spaces)
[error] 143-143: trailing spaces
(trailing-spaces)
[error] 154-154: trailing spaces
(trailing-spaces)
[error] 165-165: trailing spaces
(trailing-spaces)
[error] 173-173: trailing spaces
(trailing-spaces)
[error] 183-183: trailing spaces
(trailing-spaces)
[error] 193-193: trailing spaces
(trailing-spaces)
[error] 200-200: trailing spaces
(trailing-spaces)
[error] 210-210: trailing spaces
(trailing-spaces)
[error] 213-213: trailing spaces
(trailing-spaces)
[error] 221-221: trailing spaces
(trailing-spaces)
[error] 230-230: trailing spaces
(trailing-spaces)
[error] 236-236: no new line character at the end of file
(new-line-at-end-of-file)
[error] 236-236: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build JS packages / Build JS
- GitHub Check: build-wasm-sdk
- GitHub Check: build-and-test-wasm-sdk
🔇 Additional comments (5)
packages/wasm-sdk/test/ui-automation/README.md (1)
178-178
: Documentation inconsistency with workflow configurationThe documentation states "Automatic execution after WASM SDK builds", but the workflow file has this feature commented out with a TODO. Please update the documentation to reflect the current state or fix the workflow.
Likely an incorrect or invalid review comment.
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js (2)
1-10
: LGTM!The imports and constructor are well-structured and follow standard patterns.
214-222
: Improve random parameter generation for better test coverage.Using the same hard-coded ID for all ID fields reduces test coverage. Consider generating valid random IDs or using a pool of test IDs.
Enhance the random generators:
const generators = { - id: () => 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', // Use known good ID - identityId: () => 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', - dataContractId: () => 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', + id: () => this.generateRandomDashId(), + identityId: () => this.generateRandomDashId(), + dataContractId: () => this.generateRandomDashId(), limit: () => Math.floor(Math.random() * 100) + 1, count: () => Math.floor(Math.random() * 50) + 1, epoch: () => Math.floor(Math.random() * 10000) + 1000, ascending: () => Math.random() > 0.5 };And add a helper method:
generateRandomDashId() { // Use a pool of known test IDs or generate valid-looking IDs const testIds = [ 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', 'BfHmLSgqheAL8Pu74N3hFjazHG2gBp3UkMYRnZBCq8HC', // ... more test IDs ]; return testIds[Math.floor(Math.random() * testIds.length)]; }⛔ Skipped due to learnings
Learnt from: QuantumExplorer PR: dashpay/platform#2347 File: packages/rs-drive/tests/query_tests.rs:674-678 Timestamp: 2024-11-25T01:17:20.306Z Learning: In test code, it's acceptable to assign `status` field random values without explicitly defining all possible values.
Learnt from: lklimek PR: dashpay/platform#2381 File: packages/rs-sdk/scripts/connect_to_remote.sh:0-0 Timestamp: 2024-12-10T12:39:38.182Z Learning: When reviewing scripts in `packages/rs-sdk/scripts/`, avoid suggesting additional error handling and timeout management that complicate the script without adding significant value.
Learnt from: shumkov PR: dashpay/platform#2249 File: packages/dashmate/test/unit/status/scopes/platform.spec.js:466-467 Timestamp: 2024-10-18T15:37:21.329Z Learning: In test files for the dashmate project, such as `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in tests rather than consolidating them, to increase readability.
Learnt from: shumkov PR: dashpay/platform#2249 File: packages/dashmate/test/unit/status/scopes/platform.spec.js:77-78 Timestamp: 2024-10-18T15:37:36.387Z Learning: In `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in tests to increase readability, rather than refactoring them into shared `beforeEach` blocks or helper functions.
Learnt from: QuantumExplorer PR: dashpay/platform#2257 File: packages/rs-drive-abci/tests/strategy_tests/masternodes.rs:212-220 Timestamp: 2024-11-20T20:43:41.185Z Learning: In `packages/rs-drive-abci/tests/strategy_tests/masternodes.rs`, the pattern of generating a `PrivateKey`, converting it to bytes, and reconstructing a `BlsPrivateKey` from those bytes is intentional. Avoid suggesting to simplify this code in future reviews.
Learnt from: shumkov PR: dashpay/platform#2449 File: packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs:35-38 Timestamp: 2025-02-14T04:31:17.170Z Learning: In test scenarios, it's acceptable for different types of identifiers (e.g., identity IDs and contract IDs) to share the same byte values since they operate in different scopes and contexts.
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js (2)
7-67
: Well-structured selector organization!The selectors are logically organized by functionality, making the code maintainable and easy to navigate.
459-480
: Well-designed result aggregation method!The method effectively collects all relevant information about the query execution, including proof content when available. The return object structure is comprehensive and useful for testing.
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (6)
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js (2)
24-24
: Remove console.log statements from tests.Console.log statements clutter test output. Use Playwright's built-in reporting or custom reporters for test logging.
169-1047
: Reduce test duplication with parameterized tests.Many identity query tests follow the same pattern. Consider using parameterized tests to reduce duplication.
.github/workflows/wasm-sdk-ui-tests.yml (1)
197-236
: Fix shellcheck warnings for variable quoting.Static analysis detected multiple instances of unquoted variables that could cause word splitting issues. All variables should be properly quoted.
packages/wasm-sdk/test/ui-automation/utils/base-test.js (1)
117-121
: Fix response matching logic in clickButton.The current response matching logic has issues as it matches ANY response containing 'dapi' OR having non-200 status, which could match unrelated error responses.
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js (1)
124-157
: Add validation to prevent filling unintended fields.The generic fallback selectors could potentially match unintended elements. Consider adding validation to ensure the matched element is the correct one before filling.
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js (1)
115-115
: Avoid hard-coding parameter names.The hard-coded array parameter names make the code brittle and hard to maintain. Consider moving these to a configuration.
🧹 Nitpick comments (2)
.github/workflows/wasm-sdk-ui-tests.yml (2)
1-236
: Fix YAML formatting issues.The workflow has trailing spaces on multiple lines and missing newline at end of file. These should be cleaned up for consistency.
Run a YAML formatter or manually remove trailing spaces from lines: 13, 58, 62, 66, 71, 76, 86, 92, 96, 101, 110, 112, 118, 126, 132, 143, 154, 165, 173, 183, 193, 200, 210, 213, 221, 230, 236. Also add a newline at the end of the file.
5-12
: Consider timeline for enabling automatic triggering.The automatic workflow_run trigger is currently disabled with a TODO. Consider establishing a timeline for re-enabling this once the UI tests are stable.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/wasm-sdk-ui-tests.yml
(1 hunks)packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
(1 hunks)packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
(1 hunks)packages/wasm-sdk/test/ui-automation/utils/base-test.js
(1 hunks)packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
(1 hunks)packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
(1 hunks)
🧰 Additional context used
🧠 Learnings (38)
📓 Common learnings
Learnt from: thephez
PR: dashpay/platform#2715
File: packages/wasm-sdk/test/ui-automation/run-ui-tests.sh:6-286
Timestamp: 2025-07-31T18:15:51.762Z
Learning: In packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script doesn't require cleanup handling because it relies on Playwright's built-in webServer configuration to manage the HTTP server lifecycle automatically. The script only runs foreground processes through npm/Playwright commands.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Learnt from: thephez
PR: dashpay/platform#2715
File: packages/wasm-sdk/test/ui-automation/run-ui-tests.sh:6-286
Timestamp: 2025-07-31T18:15:51.762Z
Learning: In packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script correctly relies on Playwright's built-in webServer configuration to manage the HTTP server lifecycle automatically. The script doesn't spawn any background processes and doesn't need cleanup handling because Playwright handles server start/stop automatically before and after test execution.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use comprehensive test suites at unit, integration, and e2e levels
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'
📚 Learning: in packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script doesn't require cleanup handling...
Learnt from: thephez
PR: dashpay/platform#2715
File: packages/wasm-sdk/test/ui-automation/run-ui-tests.sh:6-286
Timestamp: 2025-07-31T18:15:51.762Z
Learning: In packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script doesn't require cleanup handling because it relies on Playwright's built-in webServer configuration to manage the HTTP server lifecycle automatically. The script only runs foreground processes through npm/Playwright commands.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: applies to packages/wasm-sdk/**/index.html : when adding new queries or state transitions, update th...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script correctly relies on playwright's...
Learnt from: thephez
PR: dashpay/platform#2715
File: packages/wasm-sdk/test/ui-automation/run-ui-tests.sh:6-286
Timestamp: 2025-07-31T18:15:51.762Z
Learning: In packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script correctly relies on Playwright's built-in webServer configuration to manage the HTTP server lifecycle automatically. The script doesn't spawn any background processes and doesn't need cleanup handling because Playwright handles server start/stop automatically before and after test execution.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: applies to packages/wasm-sdk/**/index.html : the wasm sdk now fully supports where and orderby claus...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: applies to packages/wasm-sdk/index.html : test the wasm sdk using the web interface at 'index.html' ...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: applies to packages/wasm-sdk/src/**/*.rs : the wasm sdk now fully supports where and orderby clauses...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/**/generate_docs.py : when adding new queries or state transitions, run...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in packages/wasm-sdk/ai_reference.md, the documentation correctly shows the actual sdk method signat...
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in `packages/wallet-contract/test/bootstrap.js`, for mocha tests in node.js, async functions like `l...
Learnt from: shumkov
PR: dashpay/platform#2314
File: packages/wallet-contract/test/bootstrap.js:14-16
Timestamp: 2024-11-06T07:27:01.722Z
Learning: In `packages/wallet-contract/test/bootstrap.js`, for Mocha tests in Node.js, async functions like `loadWasmDpp` can be assigned directly to `beforeAll` without wrapping them in another async function.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification...
Learnt from: lklimek
PR: dashpay/platform#2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in ...
Learnt from: shumkov
PR: dashpay/platform#2249
File: packages/dashmate/test/unit/status/scopes/platform.spec.js:77-78
Timestamp: 2024-10-18T15:37:36.387Z
Learning: In `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in tests to increase readability, rather than refactoring them into shared `beforeEach` blocks or helper functions.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in test files for the dashmate project, such as `packages/dashmate/test/unit/status/scopes/platform....
Learnt from: shumkov
PR: dashpay/platform#2249
File: packages/dashmate/test/unit/status/scopes/platform.spec.js:466-467
Timestamp: 2024-10-18T15:37:21.329Z
Learning: In test files for the dashmate project, such as `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in tests rather than consolidating them, to increase readability.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
📚 Learning: when reviewing scripts in `packages/rs-sdk/scripts/`, avoid suggesting additional error handling and...
Learnt from: lklimek
PR: dashpay/platform#2381
File: packages/rs-sdk/scripts/connect_to_remote.sh:0-0
Timestamp: 2024-12-10T12:39:38.182Z
Learning: When reviewing scripts in `packages/rs-sdk/scripts/`, avoid suggesting additional error handling and timeout management that complicate the script without adding significant value.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in listr tasks, when in debug mode, prefer using `console.warn` for logging instead of `task.output`...
Learnt from: shumkov
PR: dashpay/platform#2298
File: packages/dashmate/src/listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js:66-69
Timestamp: 2024-10-31T15:43:16.094Z
Learning: In Listr tasks, when in debug mode, prefer using `console.warn` for logging instead of `task.output`.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
📚 Learning: in rust tests, only include `setup_logs()` when logging is necessary; there's no need to add it to e...
Learnt from: lklimek
PR: dashpay/platform#2277
File: packages/rs-sdk/tests/fetch/mock_fetch.rs:159-159
Timestamp: 2024-10-30T11:04:54.154Z
Learning: In Rust tests, only include `setup_logs()` when logging is necessary; there's no need to add it to every test.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
📚 Learning: in this project, using the `delete` operator in test code is acceptable even if it can impact perfor...
Learnt from: shumkov
PR: dashpay/platform#2345
File: packages/wallet-utils-contract/test/unit/walletContract.spec.js:64-64
Timestamp: 2024-11-25T07:47:52.009Z
Learning: In this project, using the `delete` operator in test code is acceptable even if it can impact performance, as these are not performance-critical paths.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
📚 Learning: quantumexplorer determined that a coderabbit suggestion about fixing signable_bytes calculation in i...
Learnt from: QuantumExplorer
PR: dashpay/platform#2673
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs:1164-1197
Timestamp: 2025-06-18T03:44:14.385Z
Learning: QuantumExplorer determined that a CodeRabbit suggestion about fixing signable_bytes calculation in identity update tests with contract-bound keys was incorrect - the code flow is working as intended without the suggested changes.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
📚 Learning: in the rust sdk's `rs-sdk/tests` integration tests (e.g., in `packages/rs-sdk/tests/fetch/config.rs`...
Learnt from: lklimek
PR: dashpay/platform#2277
File: packages/rs-sdk/tests/fetch/config.rs:233-233
Timestamp: 2024-10-30T11:19:59.163Z
Learning: In the Rust SDK's `rs-sdk/tests` integration tests (e.g., in `packages/rs-sdk/tests/fetch/config.rs`), we cannot create objects during tests because there is no support for object creation in this context. Therefore, hardcoded values for test identities must be used.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
📚 Learning: in rust test files (`packages/rs-drive/tests/query_tests.rs`), when code is used only in tests, defi...
Learnt from: QuantumExplorer
PR: dashpay/platform#2347
File: packages/rs-drive/tests/query_tests.rs:438-460
Timestamp: 2024-11-25T01:17:02.001Z
Learning: In Rust test files (`packages/rs-drive/tests/query_tests.rs`), when code is used only in tests, defining explicit enums for fields (like the `status` field in the `Withdrawal` struct) may not be necessary; using primitive types is acceptable.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
📚 Learning: use comprehensive test suites at unit, integration, and e2e levels...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use comprehensive test suites at unit, integration, and e2e levels
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
packages/wasm-sdk/test/ui-automation/utils/base-test.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in packages/wasm-sdk/docs.html, quantumexplorer confirmed that placeholder private keys in documenta...
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/docs.html:2359-2383
Timestamp: 2025-07-28T20:00:24.323Z
Learning: In packages/wasm-sdk/docs.html, QuantumExplorer confirmed that placeholder private keys in documentation examples are acceptable as they are not real keys, though field name accuracy for the SDK API should still be maintained.
Applied to files:
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: when matching on `response.version`, prefer the code to fail when a new version enum is introduced, ...
Learnt from: lklimek
PR: dashpay/platform#2139
File: packages/rs-drive-proof-verifier/src/types.rs:638-666
Timestamp: 2024-09-27T08:23:10.759Z
Learning: When matching on `response.version`, prefer the code to fail when a new version enum is introduced, and avoid adding a wildcard arm to handle unexpected versions.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/base-test.js
📚 Learning: in the `mnowatch.checkportstatus` function, failures should resolve with `portstateenum.error` inste...
Learnt from: shumkov
PR: dashpay/platform#2162
File: packages/dashmate/src/status/providers.js:121-127
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the `mnowatch.checkPortStatus` function, failures should resolve with `PortStateEnum.ERROR` instead of rejecting the promise.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/base-test.js
📚 Learning: in the `checkportstatus` function, it's better to use `options.timeout` to set the socket timeout fo...
Learnt from: shumkov
PR: dashpay/platform#2162
File: packages/dashmate/src/status/providers.js:87-96
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the `checkPortStatus` function, it's better to use `options.timeout` to set the socket timeout for both request and response.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/base-test.js
📚 Learning: description length validation for data contracts (ensuring it's between 3 and 100 characters) is alr...
Learnt from: pauldelucia
PR: dashpay/platform#2523
File: packages/rs-drive/src/drive/contract/update/update_contract/v1/update_description/v1/mod.rs:147-151
Timestamp: 2025-04-11T09:08:05.652Z
Learning: Description length validation for data contracts (ensuring it's between 3 and 100 characters) is already handled at the data contract validation level in packages/rs-dpp/src/data_contract/methods/validate_update/v0/mod.rs, making additional checks in the update operations redundant.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
📚 Learning: in `creategrpctransporterror.js`, the size of consensus error data is already validated by grpc tran...
Learnt from: shumkov
PR: dashpay/platform#2274
File: packages/js-dapi-client/lib/transport/GrpcTransport/createGrpcTransportError.js:127-127
Timestamp: 2024-10-25T09:33:50.383Z
Learning: In `createGrpcTransportError.js`, the size of consensus error data is already validated by gRPC transport, so adding an additional size check before base64 decoding in the `createGrpcTransportError` function is unnecessary.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
📚 Learning: description length validation for data contracts is already handled in the data contract validation ...
Learnt from: pauldelucia
PR: dashpay/platform#2523
File: packages/rs-drive/src/drive/contract/update/update_contract/v1/update_description/v1/mod.rs:147-151
Timestamp: 2025-04-11T09:08:05.652Z
Learning: Description length validation for data contracts is already handled in the data contract validation process, specifically in packages/rs-dpp/src/data_contract/methods/validate_update/v0/mod.rs.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
📚 Learning: in `obtainzerosslcertificatetaskfactory.js`, when handling zerossl api errors during domain verifica...
Learnt from: shumkov
PR: dashpay/platform#2365
File: packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js:206-213
Timestamp: 2024-12-03T05:47:30.524Z
Learning: In `obtainZeroSSLCertificateTaskFactory.js`, when handling ZeroSSL API errors during domain verification, the error detail structure is consistent when an error occurs, so additional null checks on `e.details[ctx.externalIp]` may not be necessary.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js
📚 Learning: applies to packages/wasm-sdk/src/**/*.rs : when implementing wasm sdk functionality, always refer to...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: applies to packages/wasm-sdk/build.sh : build the wasm sdk by running './build.sh' in 'packages/wasm...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: applies to packages/wasm-sdk/generate_docs.py : keep documentation for the wasm sdk in sync by runni...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/generate_docs.py : Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in the `.github/actions/sccache/action.yaml` file, the environment variables `cc` and `cxx` need quo...
Learnt from: lklimek
PR: dashpay/platform#2344
File: .github/actions/sccache/action.yaml:0-0
Timestamp: 2024-11-26T12:46:54.812Z
Learning: In the `.github/actions/sccache/action.yaml` file, the environment variables `CC` and `CXX` need quotes around their values (e.g., `CC="sccache cc"`) to be interpreted correctly.
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in the ci workflows (e.g., `.github/workflows/release-docker-image.yml` and `tests-build-image.yml`)...
Learnt from: lklimek
PR: dashpay/platform#2344
File: .github/workflows/release-docker-image.yml:66-70
Timestamp: 2024-11-25T12:59:11.416Z
Learning: In the CI workflows (e.g., `.github/workflows/release-docker-image.yml` and `tests-build-image.yml`), we do not add validation steps for cache configuration variables. We rely on the build process to quickly reveal any misconfigurations.
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: environment variables set via `$github_env` are not available within the same step they are set; the...
Learnt from: shumkov
PR: dashpay/platform#2325
File: .github/workflows/manage-runs.yml:24-25
Timestamp: 2024-12-03T15:41:51.012Z
Learning: Environment variables set via `$GITHUB_ENV` are not available within the same step they are set; they become available in subsequent steps.
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: the `sensitive` keyword is not allowed in the inputs section of github actions `action.yaml` files....
Learnt from: lklimek
PR: dashpay/platform#2344
File: .github/actions/aws_credentials/action.yaml:6-16
Timestamp: 2024-11-25T12:59:14.524Z
Learning: The `sensitive` keyword is not allowed in the inputs section of GitHub Actions `action.yaml` files.
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in `.github/workflows/prebuild-devcontainers.yml`, the qemu setup step is intentionally enabled unco...
Learnt from: shumkov
PR: dashpay/platform#2346
File: .github/workflows/release-docker-image.yml:57-59
Timestamp: 2024-11-25T08:31:59.900Z
Learning: In `.github/workflows/prebuild-devcontainers.yml`, the QEMU setup step is intentionally enabled unconditionally because devcontainers are built for both platforms (`linux/amd64` and `linux/arm64`), so QEMU is needed regardless of platform.
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
📚 Learning: in the build step for `librocksdb` in `.github/actions/librocksdb/action.yaml`, the condition to che...
Learnt from: lklimek
PR: dashpay/platform#2316
File: .github/actions/librocksdb/action.yaml:33-44
Timestamp: 2024-11-08T09:31:07.177Z
Learning: In the build step for `librocksdb` in `.github/actions/librocksdb/action.yaml`, the condition to check for the existence of the `.git` directory before cloning the repository is not needed.
Applied to files:
.github/workflows/wasm-sdk-ui-tests.yml
🧬 Code Graph Analysis (1)
packages/wasm-sdk/test/ui-automation/utils/base-test.js (1)
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js (2)
require
(1-1)require
(2-2)
🪛 YAMLlint (1.37.1)
.github/workflows/wasm-sdk-ui-tests.yml
[error] 13-13: trailing spaces
(trailing-spaces)
[error] 58-58: trailing spaces
(trailing-spaces)
[error] 62-62: trailing spaces
(trailing-spaces)
[error] 66-66: trailing spaces
(trailing-spaces)
[error] 71-71: trailing spaces
(trailing-spaces)
[error] 76-76: trailing spaces
(trailing-spaces)
[error] 86-86: trailing spaces
(trailing-spaces)
[error] 92-92: trailing spaces
(trailing-spaces)
[error] 96-96: trailing spaces
(trailing-spaces)
[error] 101-101: trailing spaces
(trailing-spaces)
[error] 110-110: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 118-118: trailing spaces
(trailing-spaces)
[error] 126-126: trailing spaces
(trailing-spaces)
[error] 132-132: trailing spaces
(trailing-spaces)
[error] 143-143: trailing spaces
(trailing-spaces)
[error] 154-154: trailing spaces
(trailing-spaces)
[error] 165-165: trailing spaces
(trailing-spaces)
[error] 173-173: trailing spaces
(trailing-spaces)
[error] 183-183: trailing spaces
(trailing-spaces)
[error] 193-193: trailing spaces
(trailing-spaces)
[error] 200-200: trailing spaces
(trailing-spaces)
[error] 210-210: trailing spaces
(trailing-spaces)
[error] 213-213: trailing spaces
(trailing-spaces)
[error] 221-221: trailing spaces
(trailing-spaces)
[error] 230-230: trailing spaces
(trailing-spaces)
[error] 236-236: no new line character at the end of file
(new-line-at-end-of-file)
[error] 236-236: trailing spaces
(trailing-spaces)
🔇 Additional comments (25)
packages/wasm-sdk/test/ui-automation/tests/query-execution.spec.js (5)
1049-1183
: Well-structured data contract tests.Good use of helper validation functions and consistent test patterns. The tests properly handle both proof and non-proof scenarios.
1185-1261
: Clean document query tests.Document query tests are well-implemented with proper validation and consistent patterns.
1263-1314
: Appropriate system query tests.System queries are tested correctly with suitable validation approaches for each query type.
1316-1363
: Comprehensive error handling tests.Good coverage of error scenarios including invalid base58 IDs and empty required fields.
1365-1389
: Effective network switching test.Good choice of using getStatus query for network switching verification as it doesn't require network-specific parameters.
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js (4)
16-112
: Excellent parameterized test implementation.This dynamic test generation effectively addresses the code duplication concerns from query-execution.spec.js. Good use of test.skip for missing parameter sets and comprehensive result tracking.
114-157
: Good cross-network test coverage.Effective validation of system queries across different networks with appropriate success criteria.
159-200
: Thorough parameter validation tests.Excellent coverage of parameter validation scenarios including edge cases for base58 IDs and empty values.
202-238
: Effective stress testing approach.Good implementation of random parameter testing to ensure UI resilience. Appropriate handling of expected errors.
packages/wasm-sdk/test/ui-automation/utils/base-test.js (2)
54-65
: Good implementation of screenshot directory creation.The screenshot method now properly creates the directory if it doesn't exist, addressing the previous concern.
126-230
: Well-structured utility methods.The remaining utility methods provide comprehensive UI interaction capabilities with proper error handling and state validation.
packages/wasm-sdk/test/ui-automation/utils/parameter-injector.js (6)
15-33
: Well-implemented parameter injection method.The method properly handles parameter set selection with a sensible fallback to the first set, includes comprehensive error handling, and provides helpful logging for debugging.
39-93
: Comprehensive field mapping implementation.The parameter-to-selector mapping is well-organized by category and provides multiple fallback selectors for each parameter, which increases the robustness of field detection.
98-119
: Clean implementation with good debugging support.The method effectively tracks field filling success/failure and provides clear logging to aid in debugging test issues.
162-173
: Well-designed test metadata generation.The method creates clear, descriptive test cases with all necessary context for parameterized testing.
213-230
: Robust base58 Dash ID validation implementation.The validation correctly checks for proper length (43-44 characters) and validates against the base58 alphabet, with an additional check for excluded characters. This provides comprehensive ID format validation.
235-264
: Good implementation of random parameter generation.The method effectively generates valid test data using known good IDs and provides appropriate randomization for numeric parameters. The fallback mechanism ensures robustness.
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js (8)
1-67
: Well-organized Page Object Model structure.The selectors are comprehensively defined and logically organized by category, making the code maintainable and easy to understand.
72-99
: Clean initialization and setup methods.The methods provide a fluent interface with proper initialization sequence and support for method chaining.
161-187
: Comprehensive input handling implementation.The method effectively handles all input types including selects, checkboxes, arrays, and objects with appropriate fallback mechanisms.
192-253
: Well-implemented dynamic array input handling.The method robustly handles the complex case of dynamic array inputs with proper checks for existing fields, add buttons, and fallback mechanisms.
260-332
: Excellent refactoring to eliminate code duplication.The proof toggle functionality has been properly refactored into a shared
_toggleProofInfo
method, withenableProofInfo
anddisableProofInfo
as thin wrappers. This follows the DRY principle perfectly.
337-390
: Well-implemented utility methods.The getter methods properly handle element existence checks and provide clean interfaces for accessing UI state.
395-447
: Comprehensive result handling implementation.The methods effectively handle proof content retrieval, split view detection, and provide a complete result object with all necessary information for test assertions.
452-506
: Well-designed configuration and discovery methods.The advanced SDK configuration properly handles UI state and the discovery methods effectively filter out placeholder options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (3)
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js (3)
5-10
: Good refactoring of hard-coded parameter names.The configuration object properly addresses the previous review comment about hard-coded array parameter names. Using an object for O(1) lookup is a good choice.
263-326
: Excellent refactoring to eliminate code duplication.The
_toggleProofInfo
helper method successfully addresses the previous review comment about DRY principle violations. The implementation includes robust visibility checks and clear error handling.
328-340
: Clean implementation of proof toggle methods.These methods now properly delegate to the shared helper, eliminating the previous code duplication.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
(1 hunks)packages/wasm-sdk/test/ui-automation/utils/base-test.js
(1 hunks)packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/wasm-sdk/test/ui-automation/utils/base-test.js
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/wasm-sdk/test/ui-automation/tests/parameterized-queries.spec.js
🧰 Additional context used
🧠 Learnings (15)
📓 Common learnings
Learnt from: thephez
PR: dashpay/platform#2715
File: packages/wasm-sdk/test/ui-automation/run-ui-tests.sh:6-286
Timestamp: 2025-07-31T18:15:51.762Z
Learning: In packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script doesn't require cleanup handling because it relies on Playwright's built-in webServer configuration to manage the HTTP server lifecycle automatically. The script only runs foreground processes through npm/Playwright commands.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Learnt from: thephez
PR: dashpay/platform#2715
File: packages/wasm-sdk/test/ui-automation/run-ui-tests.sh:6-286
Timestamp: 2025-07-31T18:15:51.762Z
Learning: In packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script correctly relies on Playwright's built-in webServer configuration to manage the HTTP server lifecycle automatically. The script doesn't spawn any background processes and doesn't need cleanup handling because Playwright handles server start/stop automatically before and after test execution.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use comprehensive test suites at unit, integration, and e2e levels
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'
📚 Learning: applies to packages/wasm-sdk/**/index.html : when adding new queries or state transitions, update th...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/index.html : test the wasm sdk using the web interface at 'index.html' ...
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/**/index.html : the wasm sdk now fully supports where and orderby claus...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in packages/wasm-sdk/ai_reference.md, the documentation correctly shows the actual sdk method signat...
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/src/**/*.rs : the wasm sdk now fully supports where and orderby clauses...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script doesn't require cleanup handling...
Learnt from: thephez
PR: dashpay/platform#2715
File: packages/wasm-sdk/test/ui-automation/run-ui-tests.sh:6-286
Timestamp: 2025-07-31T18:15:51.762Z
Learning: In packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script doesn't require cleanup handling because it relies on Playwright's built-in webServer configuration to manage the HTTP server lifecycle automatically. The script only runs foreground processes through npm/Playwright commands.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script correctly relies on playwright's...
Learnt from: thephez
PR: dashpay/platform#2715
File: packages/wasm-sdk/test/ui-automation/run-ui-tests.sh:6-286
Timestamp: 2025-07-31T18:15:51.762Z
Learning: In packages/wasm-sdk/test/ui-automation/run-ui-tests.sh, the script correctly relies on Playwright's built-in webServer configuration to manage the HTTP server lifecycle automatically. The script doesn't spawn any background processes and doesn't need cleanup handling because Playwright handles server start/stop automatically before and after test execution.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/src/**/*.rs : when implementing wasm sdk functionality, always refer to...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: applies to packages/wasm-sdk/**/generate_docs.py : when adding new queries or state transitions, run...
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in `packages/wallet-contract/test/bootstrap.js`, for mocha tests in node.js, async functions like `l...
Learnt from: shumkov
PR: dashpay/platform#2314
File: packages/wallet-contract/test/bootstrap.js:14-16
Timestamp: 2024-11-06T07:27:01.722Z
Learning: In `packages/wallet-contract/test/bootstrap.js`, for Mocha tests in Node.js, async functions like `loadWasmDpp` can be assigned directly to `beforeAll` without wrapping them in another async function.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in packages/wasm-sdk/docs.html, quantumexplorer confirmed that placeholder private keys in documenta...
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/docs.html:2359-2383
Timestamp: 2025-07-28T20:00:24.323Z
Learning: In packages/wasm-sdk/docs.html, QuantumExplorer confirmed that placeholder private keys in documentation examples are acceptable as they are not real keys, though field name accuracy for the SDK API should still be maintained.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in ...
Learnt from: shumkov
PR: dashpay/platform#2249
File: packages/dashmate/test/unit/status/scopes/platform.spec.js:77-78
Timestamp: 2024-10-18T15:37:36.387Z
Learning: In `packages/dashmate/test/unit/status/scopes/platform.spec.js`, prefer to keep mocks explicitly in tests to increase readability, rather than refactoring them into shared `beforeEach` blocks or helper functions.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: when reviewing scripts in `packages/rs-sdk/scripts/`, avoid suggesting additional error handling and...
Learnt from: lklimek
PR: dashpay/platform#2381
File: packages/rs-sdk/scripts/connect_to_remote.sh:0-0
Timestamp: 2024-12-10T12:39:38.182Z
Learning: When reviewing scripts in `packages/rs-sdk/scripts/`, avoid suggesting additional error handling and timeout management that complicate the script without adding significant value.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
📚 Learning: in the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification...
Learnt from: lklimek
PR: dashpay/platform#2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.
Applied to files:
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build-and-test-wasm-sdk
- GitHub Check: Build JS packages / Build JS
- GitHub Check: Determine changed packages
- GitHub Check: build-wasm-sdk
🔇 Additional comments (8)
packages/wasm-sdk/test/ui-automation/utils/wasm-sdk-page.js (8)
1-3
: LGTM!Import statements are correct and follow standard conventions.
12-76
: Well-structured Page Object Model implementation.The class structure follows POM best practices with comprehensive, well-organized selectors grouped by functionality.
77-88
: LGTM!The initialization method follows a clear sequence and supports method chaining.
90-107
: LGTM!The query setup method provides a clean interface for test configuration.
109-164
: Robust parameter filling implementation.Good use of the configuration object for array parameters and comprehensive fallback selectors for finding inputs. The warning message helps with debugging missing inputs.
166-195
: LGTM!Comprehensive input type handling with appropriate fallback strategies.
197-261
: Well-implemented array input handling.The method handles various edge cases effectively with good fallback strategies and error handling.
342-377
: LGTM!The utility methods are well-implemented with appropriate error handling and clear single responsibilities.
Also applies to: 392-516
@QuantumExplorer can you review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but only glaced at.
Issue being fixed or feature implemented
The WASM SDK web interface (index.html) lacked automated testing coverage, making it difficult to validate query functionality and catch regressions across different query types and network configurations.
What was done?
Note: there are more tests to be implemented. This is an initial PR to avoid going too far down a rabbit trail if we aren't going to use it.
How Has This Been Tested?
Example test runs:
Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Documentation
Chores