Skip to content

Commit 825ad6d

Browse files
committed
Fix cypress tests
Since `dotenv` in the backend now loads configuration from a file relative to the current file, we don't have to duplicate the neo4j configuration settings here.
1 parent 8f0ce19 commit 825ad6d

File tree

5 files changed

+8
-23
lines changed

5 files changed

+8
-23
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ install:
1212
- yarn global add wait-on
1313
# Install Codecov
1414
- yarn install
15-
- cp cypress.env.template.json cypress.env.json
15+
- cp backend/.env.template backend/.env
1616

1717
before_script:
1818
- docker-compose -f docker-compose.yml build --parallel

cypress.env.template.json

-6
This file was deleted.

cypress/README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ First, you have to tell cypress how to connect to your local neo4j database
1616
among other things. You can copy our template configuration and change the new
1717
file according to your needs.
1818

19-
Make sure you are at the root level of the project. Then:
20-
```bash
21-
# in the top level folder Human-Connection/
22-
$ cp cypress.env.template.json cypress.env.json
23-
```
24-
To start the services that are required for cypress testing, run this:
19+
To start the services that are required for cypress testing, run:
2520

2621
```bash
2722
# in the top level folder Human-Connection/

cypress/support/factories.js

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
import Factory from '../../backend/src/seed/factories'
22
import { getDriver, getNeode } from '../../backend/src/bootstrap/neo4j'
3-
import setupNeode from '../../backend/src/bootstrap/neode'
43
import neode from 'neode'
54

65
const backendHost = Cypress.env('SEED_SERVER_HOST')
7-
const neo4jConfigs = {
8-
uri: Cypress.env('NEO4J_URI'),
9-
username: Cypress.env('NEO4J_USERNAME'),
10-
password: Cypress.env('NEO4J_PASSWORD')
11-
}
12-
const neo4jDriver = getDriver(neo4jConfigs)
13-
const factoryOptions = { seedServerHost: backendHost, neo4jDriver, neodeInstance: setupNeode(neo4jConfigs)}
6+
const neo4jDriver = getDriver()
7+
const neodeInstance = getNeode()
8+
const factoryOptions = { seedServerHost: backendHost, neo4jDriver, neodeInstance }
149
const factory = Factory(factoryOptions)
1510

1611
beforeEach(async () => {
1712
await factory.cleanDatabase()
1813
})
1914

2015
Cypress.Commands.add('neode', () => {
21-
return setupNeode(neo4jConfigs)
16+
return neodeInstance
2217
})
2318
Cypress.Commands.add(
2419
'first',

webapp/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
```bash
88
# install all dependencies
9+
$ cd webapp/
910
$ yarn install
1011
```
1112

1213
Copy:
1314

1415
```text
16+
# in webapp/
1517
cp .env.template .env
16-
cp cypress.env.template.json cypress.env.json
1718
```
1819

1920
Configure the files according to your needs and your local setup.

0 commit comments

Comments
 (0)