Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add embedded test website #14

Merged
merged 6 commits into from
Jun 21, 2016
Merged

Conversation

Cruikshanks
Copy link
Member

@Cruikshanks Cruikshanks commented Jun 21, 2016

Prior to this change the web based tests used wikipedia. This means Quke has a dependency on an external system it does not control. The structure and content could change and it may not always be available.

This change adds an embedded web application in Quke against which the demo tests can then be run. This benefits Quke by

  • removing the external dependency
  • simplifying CI (something we'd like to add to Quke)
  • allowing for more in depth examples of tests and the Site Prism page objects

The last is an important driver for this change. Initial use of Quke has demonstrated that the included examples are not representative or detailed enough for our intended audience. Having an embedded web application which we control means we can generate the pages and content needed to best demonstrate the features of Capybara and SitePrism.

@Cruikshanks Cruikshanks self-assigned this Jun 21, 2016
@Cruikshanks Cruikshanks added the enhancement New feature or request label Jun 21, 2016
Prior to this change the web based tests used wikipedia. This means Quke has a dependency on an external system it does not control. The struture and content could change and it may not always be available.

This change adds an embedded web application in Quke against which the demo tests can then be run. This benefits Quke by

- removing the external dependency
- simplifying CI (something we'd like to add to Quke)
- allowing for more in depth examples of tests and the Site Prism page objects

The last is an important driver for this change. Initial use of Quke has demonstrated that the included examples are not representative or detailed enough for our intended audience. Having an embedded web application which we control means we can generate the pages and content needed to best demonstrate the features of Capybara and SitePrism.
With the inclusion of essentially html pages (the erb views) in the project due to the demo web app we still wanted to ensure the html in those views is valid.

For this we have adopted htmlhint (in some teams). Because the erb files includ embedded code (normally within <% %> tags) we need the config file to ensure these elements are ignored, and to keep consistent with how actual services are checking their html files.

Therefore this change adds a .htmlhintrc file with the same settings as the Waste Exemptions digital service and the Flood Risk Activity Exemptions digital service.
Added a rake task to make the commands used when doing things in Quke consistent. Also updated the README accordingly.
In order to start demonstrating how to use Quke to test web pages this change adds the first example, which is a search page that displays 2 results if 'capybara' is entered.

This change encompasses the work to add the search functionality to Quke's internal web app, and the accompanying tests.
[Rerun](https://github.com/alexch/rerun) is a gem that 'Restarts an app when the filesystem changes'. When working on a Sinatra app like the demo app included this project it can save a developer lots of time as they don't have to keep stopping and starting the app after each code change.

However its not a requirement for Quke to work so have chosen not include it as a dependency in the Gemfile. This change simply updates the rake task 'run' to use a bit of intelligence to work out if its installed and if it is, to start the app using it.
@Cruikshanks Cruikshanks force-pushed the feature/add-embedded-test-website branch from 367324c to c77ac4a Compare June 21, 2016 08:08
This was mainly done to update Nokogiri due to an exploit found in versions less than 1.6.8 (CVE-2015-8806).
@Cruikshanks Cruikshanks merged commit ec574b9 into master Jun 21, 2016
@Cruikshanks Cruikshanks deleted the feature/add-embedded-test-website branch June 21, 2016 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant