🚨 Shai-Hulud Strikes Again:More than 500 packages and 700+ versions compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@ictu/testx-keywords-postgres

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ictu/testx-keywords-postgres

Keywords to test postgres db with testx

latest
Source
npmnpm
Version
3.0.6
Version published
Maintainers
3
Created
Source

Build Status

@ictu/testx-keywords-postgres

A library that extends testx with keywords for testing Postgres databases. @ictu/testx-keywords-postgres is a fork of @testx/keywords-postgres, maintained and used by ICTU (www.ictu.nl). This library is packaged as a npm package.

How does it work

From the directory of the art code install the package as follows:

npm install @ictu/testx-keywords-postgres --save

After installing the package you add these keywords to testx by adding the following line to your protractor config file:

testx.keywords.add(require('@ictu/testx-keywords-postgres'))

Example testx script:

- execute sql:
    sql: SELECT 1;
    expected result:
      - ?column?: 1
    save result to: saved
- execute sql:
    sql: SELECT 1;
    expected result: '{{saved}}'
- execute sql:
    sql: |-
      DROP TABLE IF EXISTS test;
      CREATE TABLE test (first varchar(20), second integer);
      INSERT INTO test(first, second) VALUES ('test1', 12), ('test2', 34);
      SELECT * FROM test;
    expected result:
      - first: test1
        second: 12
      - first: test2
        second: 34

Keywords

KeywordArgument nameArgument valueDescription
execute sqlConnect to the database, execute the SQL query/statement and optionally check the expected result and/or save it in the test context.
connection stringConnection string in the format of postgres://user:password@host:port/database.Optional. If not set, the postgresConnectionString command line (or config file) parameter will be used.
sqlSQL query/statement to execute.Required.
expected resultExpected result of the query.Optional. It will be compared to the result of the query. The keyword will fail if they are different. The expected result should be a list of rows. Every row is an object (see the example).
save result tovarnameOptional. The name of a context variable, that will be used to save the result of the query.

Keywords

testx

FAQs

Package last updated on 06 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts