Commit 9c5f8733 authored by Tasneem Natshah's avatar Tasneem Natshah
Browse files

Issue #3313165: Using webship-js commands to read step-definitions js files

parent e1176a06
Loading
Loading
Loading
Loading
+61 −1
Original line number Diff line number Diff line
# Cucumber UI

The Cucumber UI module lets any person to run automated tests and create new tests
(and also run them while they are being created).
The user can later download the updated feature with the newly created test.
It's fully customizable and the interface is very interactive/intuitive.

Features on running an existing test suite:

* The Cucumber binary and behat.yml can be located at any place, you just need to
  provide the path to them
* HTTP authentication, for both headless testing and real browser testing
  (Selenium)
* Tests run on background, the module checks for the process periodically and
  the output is updated on the screen (because some large test suites can take
  even hours to run)
* Kill execution
* Colored and meaningful output
* Export output as HTML or plain text

Features on creating a new test (scenario) through the interface:

* Choose feature (among the existing ones), title and whether it requires a
  real browser (i.e., needs JavaScript or not)
* Check available step types
* Choose step type from select field ("given", "when", "and" and "then")
* Auto-complete and syntax highlighting on the step fields
* Add new steps
* Remove a step
* Reorder steps
* Run test at any time (even if it's not completed yet)
* Download the updated feature with the new scenario

YAML extension is required. You can install it through
   PECL: `# pecl install yaml`

Check the example FeatureContext.php file for two examples of useful steps:

* Take screenshot (very useful for debugging specially if you run Selenium
  headless, using XVFB or something like that)
* HTTP authentication

You can run the tests using PhantomJS instead of Selenium. In order to do that,
just run PhantomJS on port 8643,
this way: `phantomjs --webdriver=8643 --cookies-file=/tmp/cookies.txt`.
In that case, you should put
the path `http://localhost:8643/wd/hub` as the `wd_host` in `behat.yml`. It
didn't work with PhantomJS 2.0, but it does work with PhantomJS 1.9.8.

If you don't know from where to start, please check the file
   sample-test-suite.zip.

Check [this video](http://ca.ios.ba/files/drupal/behatui.ogv) to understand
 better how it works.

Check the module on [Drupal.org](https://www.drupal.org/project/behat_ui).

## Sponsored
* [Vardot](http://www.vardot.com).
* [Webship](http://webship.org).
* [Meedan](http://meedan.org).
+2 −1
Original line number Diff line number Diff line
config_path: "."
bin_path: "php ./bin/cucumber"
config_file: "nightwatch.conf.js"
config_file: "cucumber.yml"
features_path: "tests/features"
autoload_path: "../../../vendor/autoload.php"
html_report: true
html_report_dir: "tests/reports"
log_report_dir: "tests/logs"
+3 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@ cucumber_ui.settings:
    features_path:
      type: string
      label: "Cucumber Features path"
    autoload_path:
      type: string
      label: "Vendor autoload path"
    html_report:
      type: boolean
      label: "Enable HTML report"
+3 −3
Original line number Diff line number Diff line
name: "Cucumber UI"
description: "Create and run Cucumber/Mink tests from the web interface"
name: "cucumber UI"
description: "Create and run cucumber/Mink tests from the web interface"
type: module
configure: cucumber_ui.settings
core_version_requirement: ^9 || ^10
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
 * Implements hook_install().
 */
function cucumber_ui_install() {
  $install_message = t("Automated tests using Cucumber/Mink, Run tests, and create tests under Administration -> Configuration -> Development -> Cucumber UI");
  $install_message = t("Automated tests using cucumber/Mink, Run tests, and create tests under Administration -> Configuration -> Development -> cucumber UI");
  \Drupal::logger('cucumber_ui')->notice($install_message);
  \Drupal::messenger()->addWarning($install_message);
}
Loading