Skip to content

Commit 123a546

Browse files
authored
Update README.md
1 parent 24b2d8e commit 123a546

File tree

1 file changed

+26
-50
lines changed

1 file changed

+26
-50
lines changed

README.md

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,55 +9,33 @@ This is a [Helper](https://codecept.io/helpers/) for [CodeceptJS](https://codece
99

1010
## Install
1111

12+
**_Step 1 of 2_: Install the helper**
13+
1214
```bash
1315
npm install --save codeceptjs-dbhelper
1416
```
1517

16-
👉 You will also have to install the drivers of [database-js](https://github.com/mlaanderson/database-js) for the desired databases. For instance, whether you want to access a JSON file, just install the JSON driver.
17-
18-
### Available drivers
19-
20-
*Only install those you need*
21-
22-
- Access databases or SQL Server databases
23-
```bash
24-
npm install --save-dev database-js-adodb
25-
```
26-
- CSV files
27-
```bash
28-
npm install --save-dev database-js-csv
29-
```
30-
- Excel files
31-
```bash
32-
npm install --save-dev database-js-xlsx
33-
```
34-
- INI files
35-
```bash
36-
npm install --save-dev database-js-ini
37-
```
38-
- Firebase databases
39-
```bash
40-
npm install --save-dev database-js-firebase
41-
```
42-
- JSON files
43-
```bash
44-
npm install --save-dev database-js-json
45-
```
46-
- MySQL databases
47-
```bash
48-
npm install --save-dev database-js-mysql
49-
```
50-
- PostgreSQL databases
51-
```bash
52-
npm install --save-dev database-js-postgres
53-
```
54-
- SQLite databases
55-
```bash
56-
npm install --save-dev database-js-sqlite
57-
```
58-
59-
60-
## How to configure it
18+
**_Step 2 of 2_: Install the driver for the database you need to use**
19+
20+
| Driver (wrapper) | Note | Installation command |
21+
| ---------------- | ---- | -------------------- |
22+
| [ActiveX Data Objects](//github.com/mlaanderson/database-js-adodb) | *Windows only* | `npm i database-js-adodb` |
23+
| [CSV files](//github.com/mlaanderson/database-js-csv) | | `npm i database-js-csv` |
24+
| [Excel files](//github.com/mlaanderson/database-js-xlsx) | | `npm i database-js-xlsx` |
25+
| [Firebase](//github.com/mlaanderson/database-js-firebase) | | `npm i database-js-firebase` |
26+
| [INI files](//github.com/mlaanderson/database-js-ini) | | `npm i database-js-ini` |
27+
| [JSON files](//github.com/thiagodp/database-js-json) | | `npm i database-js-json` |
28+
| [MySQL](//github.com/mlaanderson/database-js-mysql) | | `npm i database-js-mysql` |
29+
| [MS SQL Server](https://github.com/thiagodp/database-js-mssql) | | `npm i database-js-mssql` |
30+
| [PostgreSQL](//github.com/mlaanderson/database-js-postgres) | | `npm i database-js-postgres` |
31+
| [SQLite](//github.com/mlaanderson/database-js-sqlite) | | `npm i database-js-sqlite` |
32+
33+
See [database-js](https://github.com/mlaanderson/database-js) for the full list of available drivers.
34+
35+
36+
## Usage
37+
38+
### Configuration in CodeceptJS
6139

6240
In your `codecept.json`, include **DbHelper** in the property **helpers** :
6341

@@ -71,13 +49,11 @@ In your `codecept.json`, include **DbHelper** in the property **helpers** :
7149
},
7250
...
7351
```
74-
75-
## How to use it
52+
### Examples
7653

7754
The object `I` of your tests and events will have access to new methods. [See the API](#api).
7855

79-
80-
### Example 1
56+
#### Example 1
8157

8258
```js
8359
BeforeSuite( async( I ) => {
@@ -108,7 +84,7 @@ await I.run( "testdb", "INSERT INTO user ( username, password ) VALUES ( ?, ? )"
10884
// ... your scenarios ...
10985
```
11086

111-
### Example 2
87+
#### Example 2
11288

11389
```js
11490
Feature( 'Foo' );

0 commit comments

Comments
 (0)