# cypress
```
This service is based on Sorry-cypress is an open-source, on-premise, self-hosted alternative to Cypress.

```

## Dockerfiles
```
The repository consists of 3 docker files, each one represents a service:
- director_Dockerfile - is a service that's responsibe for parallelization and saving test results
- api_Dockerfile - is a GraphQL server that allows to read test run details and results
- dashboard_Dockerfile - is a web dashboard (ReactJS)
```

#### Docker ports by service
- director  = 1234
- api       = 4000
- dashboard = 8080

### Environment variable for each service

#### Director
```
 By default execution memory drivers are used.
# Path the the execution driver
EXECUTION_DRIVER="../execution/in-memory"

# Path the the storage driver
SCREENSHOTS_DRIVER="../screenshots/dummy.driver"
```


#### API
```
API service is a simple GraphQL wrapper, these environment variables allows querying data persisted by MongoDB execution driver.
MONGODB_URI='mongodb://mongo:27017'
MONGODB_DATABASE='sorry-cypress'
```

#### Dashboard
```
GRAPHQL_SCHEMA_URL='https://cypress-api.dev.theorchard.io'
```

#### Each service url
```
https://dev-cypress-director.dev.theorchard.io/
https://dev-cypress-api.dev.theorchard.io/
https://dev-cypress-dashboard.dev.theorchard.io/
```


### Run cypress agent locally
```
- Check out this repo locally: https://github.com/theorchard/cucumber-cypress-tests
- rm -f ./.npmrc
- curl -s https://6bd4037e86b46b80283617ab4a2d836cde73271b342a357d:@packagecloud.io/install/repositories/orchardit/npm/script.node.sh | DIR=. bash
- npm install
- Modify the director api url to
api_url: "https://dev-cypress-director.dev.theorchard.io"
in /Users/home_dir/Library/Caches/Cypress/5.4.0/Cypress.app/Contents/Resources/app/packages/server/config/app.yml
- npx cypress run --record --key whatever --parallel --ci-build-id local-01
```