Digital ET3 form within the in-house ET microservice architecture, replacing a third party supplier. ET3 allows respondents to make a response to an ET1 claim.
This is a Ruby on Rails app which uses GOV.UK Elements and sits within the ET service. The form submits to the ET API which has been configured, via Docker, within the ET Full System. Running this app will enable development of the app itself, with its test suite mocking the final submission.
- Ruby 2.5.1 (we recommend using RVM)
- Rails 5.2
- Docker & Docker Compose
- Node.js & NPM
- Google Chrome & ChromeDriver (Default browser for test suite)
- Clone the repo
- [Optional] Install Google Chrome & ChromeDriver in order to run the test suite without further configuration later.
- Install RVM (link above) and install Ruby 2.5.1
- Install node.js and npm (links above)
- Install Docker and Docker Compose (links above)
- Change directory into the repo and run
bundle install
to install the gems - Copy
.env.example
and rename to.env
- Run
./bin/dev/docker-support-services up
- Run
bundle exec rake parallel:create parallel:migrate
- Run
bundle exec rails db:create db:migrate
Please refer to https://github.com/hmcts/et_full_system_gem for instructions on general use and starting an environment. Once you have an environment running, read on below ...
The easiest way to develop is to use the full system to provide everything that you need (database, API etc..) and use a special command to redirect the full system admin URL to your local machine. The command to redirect to your local machine on port 3000 is (note you can use any free port) :-
et_full_system docker local_et3 3000
Then, in this project directory run
et_full_system docker et3_env > .env
which will setup all environment variables to the correct values to work in the full system environment.
then run
rails s
which will run the web server. The url is
http://et3.et.127.0.0.1.nip.io:3100
The suite for ET3 consists of unit, integration and feature tests, therefore requiring Chrome. It also uses the parallel_tests gem which utilises multiple threads for more efficient testing.
Run bundle exec rake parallel:spec
Run bundle exec rspec
Tests are separated by directories within the /spec/
folder.
Run bundle exec rspec spec/<directory name>
to run all specs within a directory.
Run bundle exec rspec spec/<directory name>/<spec_name>_spec.rb
to run an individual spec.
This app is essentially a frontend microservice and should not be deployed by itself. To test ET3 in full, including RTF upload and form submission, use the ET Full System. Before running the full system ensure ET3 is set to the branch or commit you wish to test. Please see the README for further details.
In order to stop people using the system a maintenance page has been added which is controlled using environment variables.
These are :-
MAINTENANCE_ENABLED - Set to 'true' to enable maintenance page to be enabled
Any of the environment variables below can be added if you want to customize from the defaults
MAINTENANCE_ALLOWED_IPS MAINTENANCE_END - If added you will see "You will be able to use the service from " followed by this text
Used to specify the database port.
For example, used within the docker-compose configuration.
Used to expose Selenium to a viewer.
For example, used in conjunction with Zalenium to take a video of tests being run.