Xvfb and so is only supported on Linux.) HEADLESS=true BROWSER=firefox bundle exec cucumber. (Note that the underlying implementation relies on MediaWiki-Selenium will start up a virtual display to which the browser can The second method is to specify a HEADLESS environment variable inĬombination with a non-headless browser. BROWSER = phantomjs bundle exec cucumber. Simply using an inherently headless browser such as PhantomJS. There are two basic ways to run in headless mode. There's no GUI available, environments such as a continuous integration Headless operation can be useful when running tests in an environment where $env:KEEP_BROWSER_OPEN="true" # Windows PowerShell Set KEEP_BROWSER_OPEN=true # Windows Command Prompt export KEEP_BROWSER_OPEN=true # Linux/Unix/Mac Want the browser to stay open, set KEEP_BROWSER_OPEN to true. $env:BROWSER="internet_explorer" # Windows PowerShellīy default, the browser will close itself at the end of every scenario. Set BROWSER=phantomjs # Windows Command Prompt export BROWSER=phantomjs # Linux/Unix/Mac Leaving it unset would use the entryĬalled default which in this case points to mw-vagrant-host.įirefox is the default browser, but you can specify a different one by settingīROWSER. mw-vagrant-host: &defaultĭefining MEDIAWIKI_ENVIRONMENT=beta in your shell would tell MW-Selenium to If no value is set, an entry called defaultįor example, if your environments.yml file looked something like this. Specified by the MEDIAWIKI_ENVIRONMENT environment variable, defined The set of default configuration to use (see "Getting started") can be bundle exec cucumber feature/some.feature:11 To run a single scenario, give the line number as well. If you wish toĮxecute scenarios for just a single feature, you can provide the feature fileĪs an argument. Running TestsĮxecute your tests by running bundle exec cucumber from within theīy default, the entire suite is run which may take some time. MediawikiSelenium::ApiHelper, and MediawikiSelenium::PageFactory. The documentation for MediawikiSelenium::Environment, To see exactly which methods are available from within step definitions, see You'll find some helpful high-level documentation The ability to write effective and cruft-free tests will come with practiceĪnd greater familiarity with the underlying libraries. Generated file is suitable for how you expect your tests to be run, forįor local development, or against at least the Beta Clusterįor details on how environment configuration is loaded and used by stepĭefinitions, see the documentation for MediawikiSelenium::Environment. It should contain defaults for each environment in which the testsĪre expected to run, indexed by environment name. Typically loaded from an environments.yml YAML file in the current workingĭirectory. $ bundle exec mediawiki-selenium-initĬreate tests/browser/features/support/env.rbĭefault configuration for various resources (wiki URLs, users, etc.) is Root directory to create a boilerplate configuration under tests/browser. Once the gem is installed, run mediawiki-selenium-init in your project's Please read UPGRADE for documentation on how to upgrade from one Gem install bundler, or sudo gem install bundler if you're using a (Ifīundler is not yet installed, install it with Install the gem and its dependencies by running bundle install. gem ' mediawiki_selenium ', ' ~> x.x.x ' Replace x.x.x with version number from lib/mediawiki_selenium/version.rb. Specifies the version of mediawiki_selenium you wish to use (typically the Linux/Unix/OS X, and with RubyInstaller onĬreate a Gemfile in the root of your MediaWiki-related project that Ruby 1.9 or above is required, 2.1 is recommended. Within your test suite that better encapsulate the expected structure and Language to step definitions written in Ruby, and a test runner for To describe application features, a basic API for binding that natural It is comprised of a number of core dependencies and nativeĪPIs that help you describe the expected behavior of your MediaWiki-relatedįeatures, and drive cross-browser simulations to ensure the correctness of MediaWiki-Selenium is a Ruby framework for the implementation and execution of
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |