Frontend for the Energy Performance Certificate Data
Make sure you have the following installed:
This short guide will use Git
.
- Clone the repository:
$ git clone [email protected]:communitiesuk/epb-data-frontend.git
- Change into the cloned repository:
$ cd epb-data-frontend
- Install the Ruby gems:
$ bundle install
- Build the frontend assets:
$ make frontend-build
To run the Capybara user-journey tests, the following must be downloaded and installed.
- Chrome
- ChromeDriver
- download the same ChromeDriver version as your version of Chrome.
Depending on how ChromeDriver was installed, it may need to be added to the
PATH
environment variable. Instructions below are for MacOS users.
- Create local
bin
directory:$ mkdir ~/bin
- Move the downloaded ChromeDriver to the
bin
directory:$ mv ~/Downloads/chromedriver ~/bin
- Make the ChromeDriver executable:
cd ~/bin && chmod +x chromedriver
- Add the
bin
directory to thePATH
environment variable in your shell profile:
# ~/.bash_profile, ~/.zprofile, etc
...
export PATH="$PATH:$HOME/bin" # Add this line at the end of the file
Run $ source ~/.bash_profile
, or .zprofile
. Alternatively, restart the
terminal.
- You must add additional local hosts to your hosts file on your machine with:
127.0.0.1 get-energy-performance-data.epb-frontend
127.0.0.1 get-energy-performance-data.local.gov.uk
You can add these to your hosts file automatically by running $ sudo make hosts
.
You can check what hosts you already have by typing $ cat /etc/hosts
in the
frontend directory.
Don't forget to ensure bundles are up to date
To run the respective test suites:
- All tests:
$ make test
- To run the test stubs server (i.e. the frontend in isolation from the local API),
change directory into the root of the cloned folder:
$ cd epb-frontend
- Start the web server(s) using the following command:
$ make run ARGS=config_test.ru
- Open http://get-energy-performance-data.epb-frontend:9292 in your favourite browser to run the test stubs server.
- To run the local frontend alongside your local API in Docker, make sure that the Docker images from the epb-dev-tools repo are running
- Then access the frontend at http://get-energy-performance-data.epb-frontend (without the specified ports).