Cypress plugin to query PostgreSQL databases directly from Cypress tests. Current stable version is 1.1.1, with low release cadence (last update 2020). Allows passing SQL queries via cy.task() and retrieving results for assertions. Supports multiple database connections by passing connection details inline. Limited to Node-based Cypress runner; no TypeScript support.
npm install cypress-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows plugin setup in plugins file, database configuration, and a sample test query.
Store credentials in cypress.env.json and reference via Cypress.env('db') instead of hardcoding in cypress.json.Ensure npm install --save-dev cypress-postgres is run and the package is present in node_modules.
Wrap cy.task in a try/catch or use .catch to handle query failures gracefully.
Migrate to Cypress's new component testing or use a different database plugin that supports modern Cypress.
Run 'npm install --save-dev cypress-postgres'.
Verify user, password, host, database, and port in db configuration.
Add on('task', { dbQuery: ... }) as shown in the README.