Skip to content

AcquiescenceElement State Querying & Waiting

A powerful TypeScript library for querying and waiting for element states in the browser

Quick Example

typescript
import { ElementStateInspector } from 'acquiescence';

const inspector = new ElementStateInspector();
const button = document.querySelector('#submit-button');

// Check if an element is visible and enabled
const result = await inspector.queryElementStates(button, ['visible', 'enabled']);

if (result.status === 'success') {
  console.log('Button is ready!');
} else {
  console.log(`Button is ${result.missingState}`);
}

// Wait for an element to be ready for interaction
try {
  const hitPoint = await inspector.waitForInteractionReady(
    button,
    'click',
    5000 // 5 second timeout
  );
  console.log(`Element ready at point (${hitPoint.x}, ${hitPoint.y})`);
} catch (error) {
  console.error('Element not ready within timeout');
}

Why Acquiescence?

Modern web applications are dynamic and complex. Elements appear, disappear, move around, and change state constantly. Acquiescence provides a robust way to:

  • Query element states with precision, going beyond simple visibility checks
  • Wait intelligently for elements to be ready for user interactions
  • Detect stability to ensure elements aren't moving or animating
  • Handle edge cases like Shadow DOM, fixed positioning, and overflow detection
  • Get actionable feedback when elements aren't in the expected state

Perfect for:

  • End-to-end testing frameworks
  • Browser automation tools
  • Interactive UI frameworks
  • Accessibility testing tools
  • Any scenario requiring reliable element state detection

Installation

bash
npm install acquiescence
bash
yarn add acquiescence
bash
pnpm add acquiescence

Next Steps

Released under the Apache License 2.0.