Verification Library
The Verification Library in Maeris provides a comprehensive set of verification methods to validate that your application behaves correctly. Learn about different verification types and how to use them effectively.
What is Verification?
Verification is the process of checking that your application meets expected conditions. Verifications are assertions that validate the state of elements, content, or application behavior.
Why Verification Matters
- Validate Functionality: Ensure features work as expected
- Detect Regressions: Catch bugs before they reach production
- Document Expected Behavior: Tests serve as living documentation
- Build Confidence: Verify changes don't break existing functionality
Verification Types
Element Verification
Verify properties and state of UI elements.
- Element Exists: Check if element is present on page
- Element Visible: Verify element is visible to users
- Element Enabled: Check if element is enabled/clickable
- Element Selected: Verify checkbox/radio is selected
- Element Count: Verify number of matching elements
Text Verification
Verify text content on the page.
- Text Equals: Exact text match
- Text Contains: Text contains specific substring
- Text Matches: Text matches regex pattern
- Text Not Empty: Verify text is not empty
- Text Case Insensitive: Case-insensitive text comparison
Attribute Verification
Verify HTML attributes of elements.
- Attribute Exists: Check if attribute is present
- Attribute Value: Verify attribute has specific value
- Attribute Contains: Attribute value contains substring
- CSS Class: Verify element has specific CSS class
- Data Attributes: Check data-* attribute values
URL Verification
Verify current page URL and navigation.
- URL Equals: Current URL matches exactly
- URL Contains: URL contains specific path or parameter
- URL Matches: URL matches regex pattern
- Title Verification: Verify page title
Value Verification
Verify values in form fields and inputs.
- Input Value: Verify input field value
- Dropdown Selection: Check selected option in dropdown
- Checkbox State: Verify checkbox checked/unchecked state
- Radio Selection: Verify selected radio button
Visual Verification
Verify visual appearance and layout.
- Element Position: Verify element position on page
- Element Size: Check element dimensions
- Color Verification: Verify element colors
- Screenshot Comparison: Compare visual appearance
Using Verifications in Tests
Adding Verifications
- In the Test Management Modal, add a new test step
- Select "Verify" as the action type
- Choose the verification type from the library
- Specify the element selector and expected value
- Configure verification options (if available)
- Save the step
Verification Best Practices
- Verify critical functionality and user-facing elements
- Use specific verifications rather than generic checks
- Verify outcomes after actions, not just that actions completed
- Use appropriate verification types for different scenarios
- Combine multiple verifications for comprehensive validation
Verification Examples
Example 1: Login Success
- Navigate to login page
- Enter username and password
- Click login button
- Verify: "Welcome" text is visible
- Verify: URL contains "/dashboard"
- Verify: User menu element exists
Example 2: Form Submission
- Fill out form fields
- Submit form
- Verify: Success message text contains "Thank you"
- Verify: Success message element is visible
- Verify: Form is no longer visible
Example 3: Element State
- Click on toggle button
- Verify: Toggle button has "active" class
- Verify: Content panel is visible
- Verify: Content panel text equals "Panel is open"
Advanced Verification Options
Conditional Verifications
- Verify only if certain conditions are met
- Skip verifications based on element state
- Use conditional logic in verification steps
Custom Verifications
- Create custom verification logic
- Use JavaScript for complex verifications
- Combine multiple verification types
Soft Verifications
- Verifications that don't fail the test if they fail
- Useful for non-critical checks
- Results are logged but don't stop execution
Best Practices
- Verify Outcomes, Not Just Actions: Check that actions produced expected results
Don't just verify that a button was clicked; verify the result
- Use Specific Verifications: Choose the most specific verification type
More specific = better error messages and debugging
- Verify Critical Paths: Focus on user-critical functionality
Prioritize verifications that matter most to users
- Balance Verification Coverage: Don't over-verify, but don't under-verify
Find the right balance for your needs
- Use Meaningful Error Messages: Configure clear messages for failures
Helps with debugging when tests fail
Next Steps
Continue building comprehensive tests:
- Create Your First Testcase - Learn to add verifications to tests
- API Hooks for Tests - Set up pre and post-verification hooks
- Advanced Settings - Configure verification behavior