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

  1. In the Test Management Modal, add a new test step
  2. Select "Verify" as the action type
  3. Choose the verification type from the library
  4. Specify the element selector and expected value
  5. Configure verification options (if available)
  6. 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

  1. Navigate to login page
  2. Enter username and password
  3. Click login button
  4. Verify: "Welcome" text is visible
  5. Verify: URL contains "/dashboard"
  6. Verify: User menu element exists

Example 2: Form Submission

  1. Fill out form fields
  2. Submit form
  3. Verify: Success message text contains "Thank you"
  4. Verify: Success message element is visible
  5. Verify: Form is no longer visible

Example 3: Element State

  1. Click on toggle button
  2. Verify: Toggle button has "active" class
  3. Verify: Content panel is visible
  4. 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: