Introduce InternJS framework for UI functional tests
Fuel front-end should be covered with functional tests to avoid regression.
Functional tests for the front-end layer of Fuel are currently created with
CasperJS framework, while tests are run against headless browser phantomjs
as a part of CI procedure.
Developer that works on bug fix or creates a new feature supposed to cover
them with both unit and functional tests to avoid regression. The way
functional tests are created and maintained currently is complex since
CasperJS is not that flexible with the single-page web applications as
InternJS. In addition there is no way to run tests against browsers with
UI for debugging purposes.
Adopt InternJS as the primary testing framework for UI functional tests.
Test runner run_tests.sh should be updated correspondingly to utilize
Intern instead of Casper. Expected syntax:
- ../run_tests.sh --ui-func - to run all tests
- ../run_tests.sh -t static/tests/functional/test_welcome_page.js - to
run single test suite
Other end user impact
As soon Intern-based tests are run against Firefox browser it will take
additional time for CI to validate patchsets committed.
Other deployer impact
Front-end developers have to cover features and fixes they work on with
functional tests. These efforts should be taken into account while planning.
CI workers should be able to run Firefox browser in order to execute
functional tests against it.
- Research the way how Intern tests should be created and organized
- Update test runner run_tests.sh to utilize InternJS for ui tests
- Make sure xvfb integration is set up, so it is possible to run
functional tests headlessly (like with CasperJS and phantomjs)
- Configure InternJS runner so it provides informative trace info
of tests execution
- Create initial helper library to cover the most frequent tasks (log
in, skip welcome page, create cluster, remove cluster)
- Create several tests as an example
- Functional tests for the UI are the part of the CI process and are executed
on every commit. Execution result affects build status
- InternJS runner is configured to utilize more informative reporter
- It is possible to start tests execution using xvfb to avoid browser window
- Helper library (page) that covers below use-cases is created:
- Log In
- Log Out
- Skip Welcome page
- Create Cluster
- Remove Cluster
- Add Cluster nodes
- The following pages (partially) covered with functional tests:
- Log In
- Welcome page
- Clusters page
- Cluster page
Documentation should be modified to remove mentions of CasperJS and its
installation prerequisites. Usage and installation of InternJS should
be described instead.