@monitorapex/cypress-oracle-db

1.0.2 • Public • Published

Introduction

Oracle DB extension for Cypress

Install

Add git repo to your package.json dependencies

"@monitorapex/cypress-oracle-db": "*"

or use npm install and save

npm install --save-dev @monitorapex/cypress-oracle-db

Configure

Plugin file

This extension requires the Oracle Node driver and connection details as a dependency. Pass them in when instantiating the plug-in.

The code below should be added to your cypress/plugins/index.js file.

const oracle = require('oracledb'),
      configSwitcher = require('@monitorapex/cypress-config-switcher'),
      db = require('@monitorapex/cypress-oracle-db');

module.exports = (on, config) => {
  config = configSwitcher.loadEnvConfig(config);

  tasks = db.loadDBPlugin(oracle, config.db);
  on('task', tasks);
}

Commands file

Example support/index.js file.

import mis from '@monitorapex/cypress-oracle-db';
mis.loadDBCommands();
import './commands.js';

Usage

cy.oracle(query)

cy.oracle(`SELECT 'something'
           FROM dual`).should('eq', 'something');
let sql;
let binds;

sql = `test_data_management_pkg.proc_test(:p1, :p2);`;

binds = {
p1:  'Something',
p2:  {dir: 'out' }
};

cy.oracle(sql, binds).should(r => {
  expect(r.outBinds.p2).to.eq(`You Sent ${binds.p1}`);
});

Readme

Keywords

Package Sidebar

Install

npm i @monitorapex/cypress-oracle-db

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

4.04 kB

Total Files

5

Last publish

Collaborators

  • drumbeg
  • dlawton