{"id":20038793,"url":"https://github.com/defra/quke","last_synced_at":"2025-08-11T06:08:49.126Z","repository":{"id":52545657,"uuid":"58418092","full_name":"DEFRA/quke","owner":"DEFRA","description":"A gem that lets you focus on your Cucumber acceptance tests, and not worry about configuring the drivers","archived":false,"fork":false,"pushed_at":"2023-08-23T16:16:50.000Z","size":439,"stargazers_count":6,"open_issues_count":4,"forks_count":3,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-08-09T20:55:58.769Z","etag":null,"topics":["acceptance-testing","browserstack","capybara","cucumber","poltergeist","quke","selenium"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DEFRA.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-10T00:49:23.000Z","updated_at":"2023-08-23T16:16:54.000Z","dependencies_parsed_at":"2024-11-13T10:43:23.124Z","dependency_job_id":null,"html_url":"https://github.com/DEFRA/quke","commit_stats":{"total_commits":144,"total_committers":3,"mean_commits":48.0,"dds":0.01388888888888884,"last_synced_commit":"1f250163f608db37a71e194421666faa5a1d7ff3"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/DEFRA/quke","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fquke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fquke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fquke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fquke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/quke/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fquke/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269838444,"owners_count":24483200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acceptance-testing","browserstack","capybara","cucumber","poltergeist","quke","selenium"],"created_at":"2024-11-13T10:32:59.559Z","updated_at":"2025-08-11T06:08:49.105Z","avatar_url":"https://github.com/DEFRA.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"/quke.png\" alt=\"Quke logo\" /\u003e\n\n![Build Status](https://github.com/DEFRA/quke/workflows/CI/badge.svg?branch=main)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_quke\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=DEFRA_quke)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_quke\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=DEFRA_quke)\n[![Gem Version](https://badge.fury.io/rb/quke.svg)](https://badge.fury.io/rb/quke)\n[![Licence](https://img.shields.io/badge/Licence-OGLv3-blue.svg)](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3)\n\nQuke is a gem that helps you to build a suite of [Cucumber](https://cucumber.io/) acceptance tests.\n\nQuke tries to simplify the process of writing and running these tests by setting up **Cucumber** for you. It handles the config to allow you to run them in [Firefox](https://www.mozilla.org/en-GB/firefox/new/) (via Selenium) and [Chrome](https://www.google.co.uk/chrome/browser/desktop/) via [Selenium](https://github.com/SeleniumHQ/selenium/tree/master/rb). It also has out of the box support for using [Browserstack automate](https://www.browserstack.com). This leaves you to focus on just your tests.\n\nIt was born out of trying to make the process for team members without a development background as simple as possible, and to get them involved in writing and building acceptance tests that they then manage.\n\nIt also includes the ability to run those tests using **Browserstack**. **Browserstack** gives you the ability to test your application with different combinations of platform, OS, and browser all in the cloud.\n\n## Pre-requisites\n\nYou'll need [Ruby](https://www.ruby-lang.org/en/) installed (ideally the latest version available) plus the [Bundler](http://bundler.io/) gem.\n\nThe only other dependency this project has is the browsers you intend to use it with. It is currently setup to work with\n\n- [Chrome](https://www.google.co.uk/chrome/browser/desktop/) (via [Selenium](https://github.com/SeleniumHQ/selenium/tree/master/rb))\n- [Firefox](https://www.mozilla.org/en-GB/firefox/new/) (via Selenium)\n\n## Installation\n\nAdd this line to your application's Gemfile\n\n```ruby\ngem 'quke'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as\n\n    $ gem install quke\n\n## Configuration\n\nYou can configure Quke using a `.config.yml` file. What can be configured essentially falls into one of 3 groups.\n\n- **Quke configuration** - things like which driver to use, whether to pause between steps, or if Quke should stop in the event of an error\n- **Custom configuration** - add your own custom values using the `custom:` node\n- **Browserstack configuration** - specify exactly how you want your Browserstack session to run, for example which browser and OS to test against, the project name, and your credentials.\n\nSee [.config.example.yml](.config.example.yml) for full details of the options you can specify in your `.config.yml`.\n\n### Multiple configs\n\nWhen Quke runs it will default to looking for `.config.yml`. However you can override this and tell Quke which one to use. This allows you to create multiple config files.\n\nYou do this using an environment variable. The most flexible way is to set the variable as part of your command.\n\n```bash\nQUKE_CONFIG='chrome.config.yml' bundle exec quke\n```\n\nThe use case is to allow you to have different configs setup ready to go, and enable you to switch between them. For example when testing with Chrome and Firefox you set a 1 second delay between steps so you can observe the tests as they run through, but in your default `.config.yml` you want no pauses.\n\n### Security\n\nIf you are testing a site that requires some form of login, or you are using **Browserstack** you'll need to tell Quke about the credentials. Generally we advise not committing your `.config.yml` to source control, but we understand you may well build up a suite of them that you want to store with the project and share with others.\n\nIf that's the case make use of the following features.\n\n#### Browserstack environment variables\n\n[.config.example.yml](.config.example.yml) is an example of a config file which contains `username`, `auth_key`, and if local testing `local_key`. You really don't want these becoming known so if you have to commit the config file, remove them and instead set the following environment variables wherever you need to run the tests.\n\n- BROWSERSTACK_USERNAME\n- BROWSERSTACK_AUTH_KEY\n- BROWSERSTACK_LOCAL_KEY\n\nQuke looks for them when configuring the **Browserstack** driver and only if not found does it then go looking in the config file.\n\n#### Ruby's ENV classs\n\nYou can access any environment variable from within your project using [ENV](https://ruby-doc.org/core-2.4.2/ENV.html).\n\n```ruby\nsecret_key = ENV['SUPER_SECRET_KEY']\n```\n\nYou can set them by calling `export SUPER_SECRET_KEY=\"password123\"` in your terminal prior to running Quke. In this way for example, the passwords featured in the custom section in [.config.example.yml](.config.example.yml) could be removed, and instead your step could read the value it needs to submit from an environment variable.\n\n## Usage\n\nTODO: Write usage instructions here\n\n## Behaviours\n\nYou should be aware of some default behaviours included in Quke.\n\n### Displaying web pages on fail\n\nCapybara includes the ability to save the source of the current page at any point. Quke has been configured so that if you are not using a headless browser and a step fails it will save the source to file and then use a tool called [Launchy](https://github.com/copiousfreetime/launchy) to open it in your default browser.\n\nYou can disable this behaviour using `display_failures: false` in your `.config.yml`\n\n### Quit on 5 failures\n\nIf you are running using Chrome or Firefox after the 5th failure Quke will automatically stop. This is to prevent scores of tabs being opened in the browser when an error is found and Quke is set to show failures, which may just be the result of an error in the test code.\n\n### Automatically setting Browserstack session status\n\nIf you are using the Browserstack driver, Quke will automatically update the status of the session recorded in Browserstack for you. If all tests pass, it will be marked as 'passed', else it will be marked as 'failed' (it defaults to 'completed').\n\n## Browser drivers\n\nA very simple overview of how things work is that\n\n- [Cucumber](https://github.com/cucumber/cucumber-ruby) runs the tests\n- [Capbybara](https://github.com/teamcapybara/capybara) is used in the tests to simplify working with Selenium\n- [Selenium](https://github.com/SeleniumHQ/selenium/tree/master/rb) is used to tell the browsers what to do\n- each browser has a driver ([Chromedriver](https://chromedriver.chromium.org/), [Geckodriver](https://github.com/mozilla/geckodriver) etc) which can interpret Selenium commands into actual actions\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n### Running\n\nWhilst just developing a gem like Quke you can execute it with\n\n    $ ruby -Ilib ./exe/quke\n\nand pass in arguments as well\n\n    $ ruby -Ilib ./exe/quke --tags @wip\n\n## Contributing to this project\n\nIf you have an idea you'd like to contribute please log an issue.\n\nAll contributions should be submitted via a pull request.\n\n## License\n\nTHIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:\n\nhttp://www.nationalarchives.gov.uk/doc/open-government-licence/version/3\n\nThe following attribution statement MUST be cited in your products and applications when using this information.\n\n\u003e Contains public sector information licensed under the Open Government license v3\n\n### About the license\n\nThe Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.\n\nIt is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fquke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Fquke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fquke/lists"}