irs/behat-popup-extension

Behat context for popup manipulations with Selenium 2.

dev-master 2014-01-27 10:59 UTC

This package is auto-updated.

Last update: 2024-03-22 19:37:31 UTC


README

Build Status

The extension adds following step definitions to feature context that allows to test popups:

Given /^(?:|I )press ok on alert$/
Given /^(?:|I )press ok on confirmation$/
Given /^(?:|I )press ok on input popup$/
Given /^(?:|I ) press cancel on confirmation$/
Given /^(?:|I ) press cancel on input popup$/
Given /^(?:|I ) type "([^"]*)" into input popup$/
Given /^the alert message should contain "([^"]*)"$/
Given /^the confirmation message should contain "([^"]*)"$/
Given /^the prompt message should contain "([^"]*)"$/
Given /^the alert message should not contain "([^"]*)"$/
Given /^the confirmation message should not contain "([^"]*)"$/
Given /^the prompt message should not contain "([^"]*)"$/

Installation

The simplest way to install the extension is to add following code to your composer.json:

{
    "require": {
        "irs/behat-popup-extension": "dev-master"
    }
}

After that do composer install and add following lines to behat.yml to enable extension:

default:
  extensions:
    Irs\BehatPopupExtension\Extension: ~

Now you can use Irs\BehatPopupExtension\PopupContext trait in the feature context. And do not forget that features' context should implement Behat\MinkExtension\Context\MinkAwareInterface.