mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	docs: Add some details on running and debugging the e2e tests (#526)
* docs: Add some details on running and debugging the e2e tests * docs: Designate code block in README as bash * refactor: update e2e instructions * refactor: remove e2e timeout warning Co-authored-by: Simon Hornby <simon@getunleash.ai> Co-authored-by: olav <mail@olav.io>
This commit is contained in:
		
							parent
							
								
									8771302dac
								
							
						
					
					
						commit
						66f3967812
					
				@ -1,27 +1,53 @@
 | 
				
			|||||||
# unleash-frontend
 | 
					# unleash-frontend
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Run with a local instance of the unleash-api:
 | 
					This repo contains the Unleash Admin UI frontend app.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
You need to first start the unleash-api on port 4242
 | 
					## Run with a local instance of the unleash-api
 | 
				
			||||||
before you can start working on unleash-frontend.
 | 
					 | 
				
			||||||
Start webpack-dev-server with hot-reload:
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					First, start the unleash-api backend on port 4242.
 | 
				
			||||||
 | 
					Then, start the unleash-frontend dev server:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
cd ~/unleash-frontend
 | 
					cd ~/unleash-frontend
 | 
				
			||||||
yarn install
 | 
					yarn install
 | 
				
			||||||
yarn run start
 | 
					yarn run start
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Run with a heroku-hosted unleash-api:
 | 
					## Run with a heroku-hosted instance of unleash-api
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					Alternatively, instead of running unleash-api on localhost, use a remote instance:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
cd ~/unleash-frontend
 | 
					cd ~/unleash-frontend
 | 
				
			||||||
yarn install
 | 
					yarn install
 | 
				
			||||||
yarn run start:heroku
 | 
					yarn run start:heroku
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## UI Framework
 | 
					## Running end-to-end Tests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
We are using [material-ui](http://material-ui.com/).
 | 
					We have a set of Cypress tests that run on the build before a PR can be merged so it's important that you check these yourself before submitting a PR.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Happy coding!
 | 
					On the server the tests will run against the deployed Heroku app so this is what you probably want to test against:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					yarn run start:heroku
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					In a different shell, you can run the tests themselves:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					yarn run e2e:heroku
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If you need to test against patches against a local server instance, you'll need to run that, and then run the end to end tests using:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					yarn run e2e
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					You may also need to test that a feature works against the enterprise version of unleash. Assuming the Heroku instance is still running, this can be done by:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					yarn run start:enterprise
 | 
				
			||||||
 | 
					yarn run e2e
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
				
			|||||||
@ -28,12 +28,13 @@
 | 
				
			|||||||
    "lint": "eslint src",
 | 
					    "lint": "eslint src",
 | 
				
			||||||
    "start": "react-scripts start",
 | 
					    "start": "react-scripts start",
 | 
				
			||||||
    "start:heroku": "UNLEASH_API=https://unleash.herokuapp.com yarn run start",
 | 
					    "start:heroku": "UNLEASH_API=https://unleash.herokuapp.com yarn run start",
 | 
				
			||||||
    "start:ea": "UNLEASH_API=https://unleash4.herokuapp.com yarn run start",
 | 
					    "start:enterprise": "UNLEASH_API=https://unleash4.herokuapp.com yarn run start",
 | 
				
			||||||
    "test": "react-scripts test",
 | 
					    "test": "react-scripts test",
 | 
				
			||||||
    "prepare": "yarn run build",
 | 
					    "prepare": "yarn run build",
 | 
				
			||||||
    "fmt": "prettier src --write --loglevel warn",
 | 
					    "fmt": "prettier src --write --loglevel warn",
 | 
				
			||||||
    "fmt:check": "prettier src --check",
 | 
					    "fmt:check": "prettier src --check",
 | 
				
			||||||
    "e2e": "yarn run cypress open --config baseUrl='http://localhost:3000' --env AUTH_USER=admin,AUTH_PASSWORD=unleash4all"
 | 
					    "e2e": "yarn run cypress open --config baseUrl='http://localhost:3000' --env AUTH_USER=admin,AUTH_PASSWORD=unleash4all",
 | 
				
			||||||
 | 
					    "e2e:heroku": "yarn run cypress open --config baseUrl='http://localhost:3000' --env AUTH_USER=example@example.com"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@material-ui/core": "4.12.3",
 | 
					    "@material-ui/core": "4.12.3",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user