Skip to content

Commit

Permalink
feat: improve env setup AB#13492
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisvisser committed Apr 25, 2022
1 parent 88fb1e9 commit 6c5baa2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,7 @@ Installation: 0. (Potentially on Ubuntu?:
- If it fails, find out why and/or install Cypress in some other way (e.g.
`npm install cypress`)

2. Set necessary environment variables, for example by using a CYPRESS\_\*
prefix (see https://docs.cypress.io/guides/guides/environment-variables for
more)

- e.g. on Windows Powershell: $env:CYPRESS_LOGIN_USER = "<login>"
2. Set necessary environment variables by copying `cypress.env.json.example` to `cypress.env.json` and filling in the variables.

3. Run `npm run cypress:open`

Expand Down
5 changes: 5 additions & 0 deletions cypress.env.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"LOGIN_USER": "",
"LOGIN_PASSWORD": "",
"API_URL": ""
}
4 changes: 1 addition & 3 deletions tests/cypress/cypress.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"baseUrl": "http://localhost:4200",
"env": {
"apiUrl": "https://ibf-test.510.global/api"
},
"env": {},
"projectId": "jkaw7k",
"fixturesFolder": "tests/cypress/fixtures",
"integrationFolder": "tests/cypress/integration",
Expand Down
24 changes: 11 additions & 13 deletions tests/cypress/support/constants.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
export default {
envApiUrl: "apiUrl",
loginPageTitle: "Login",
envLoginUser: "LOGIN_USER",
envLoginPassword: "LOGIN_PASSWORD",
loginToken: "jwt",
userDisplayNameLabelText: "Logged In As:",
loginPagePath: "/login",
loginApiUrl: "/user/login",
dashboardPagePath: "/",
ExposedPopulationText:' Exposed population ',
TotalPopulationText:' Total Population ',
CattleExposedText: ' Cattle exposed ',
SmallRuminantsText: ' Small ruminants exposed '
loginPageTitle: 'Login',
envApiUrl: 'API_URL',
envLoginUser: 'LOGIN_USER',
envLoginPassword: 'LOGIN_PASSWORD',
loginToken: 'jwt',
userDisplayNameLabelText: 'Logged In As:',
loginPagePath: '/login',
loginApiUrl: '/user/login',
dashboardPagePath: '/',
ExposedPopulationText: 'Exposed population',
TotalPopulationText: 'Total Population',
};

0 comments on commit 6c5baa2

Please sign in to comment.