Skip to content
Rubens Dos Santos Filho edited this page Feb 7, 2019 · 7 revisions

Selects one or more records in the informed database table during the test execution.

Parameters

Attribute Type Name
table string Table name
where string Query's where clause

This method returns a Promise with a TEMP-TABLE JSON result returned by the executed query or an Error instance if the command counldn't be executed.

it('should query the new departments', () => {
  oeAgent.query('Department', 'DeptCode = "PRC" OR DeptCode = "HRM"').then((result) => {
    // result:
    // {
    //   'Department': [{
    //     'DeptCode': 'PRC',
    //     'DeptName': 'Purchasing'
    //   },{
    //     'DeptCode': 'HRM',
    //     'DeptName': 'HR Management'
    //   }]
    // }
    expect(result['Department'].length).toBeGreaterThan(0);
  });
});
Clone this wiki locally