PHP code example of webforge / behat-css-extension
1. Go to this page and download the library: Download webforge/behat-css-extension library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webforge / behat-css-extension example snippets
use Behat\MinkExtension\Context\MinkContext;
use Behat\Behat\Context\Context;
use Webforge\Behat\CssUtilitiesTrait;
class MyFeatureContext extends MinkContext implements Context
{
use CssUtilitiesTrait;
/**
* @Given /^I wait for the page to load$/
*/
public function iWaitForThePageToLoad()
{
$this->context = $this->css('.v-dialog--active')->exists();
$this->context('.container .headline:contains("Wähle dein Fotobuch-Format")')->waitForVisible(5000);
}
/**
* @When /^I click on the position button$/
*/
public function iClickOnThePositionButton()
{
$this->css('.v-btn:contains("Position")')->exists()->click();
}
/**
* @Given /^I click on the undock headline icon$/
*/
public function iClickOnTheUndockHeadlineIcon()
{
$this->context('.v-btn:contains("Überschrift ablösen")')->exists()->click();
}
/**
* @Given /^the headline is displayed in text$/
*/
public function theHeadlineIsDisplayedInText()
{
$this->css('.pb-container.headline')->waitForExist() // selector is: .pb-container.headline
->css('.headline.visible')->notExists()->end() // selector is: .pb-container.headline .headline.visible
->css('.headline h1')->isNotVisible(); // selector is now: .pb-container.headline .headline h1
}
}