public function dontSeeVisualChangesAndHideElement(WebGuy $I, $scenario)
 {
     $I->amOnPage("/VisualCeption/seeVisualChanges.php");
     $I->dontSeeVisualChanges("hideTheBlock", "body", "#theblock");
     $I->wait(1);
     // the test has to be called twice for comparison on the travis server
     $I->amOnPage("/VisualCeption/seeVisualChanges.php");
     $I->dontSeeVisualChanges("hideTheBlock", "body", array("#theblock"));
 }
 /**
  * Comparing a div, that change it's size
  */
 public function seeVisualChangesAfterSizeChanges(WebGuy $I, $scenario)
 {
     $I->amOnPage("/VisualCeption/notSameSize.php");
     $I->seeVisualChanges("getRedDiv", "div");
     $I->wait(1);
     // the test has to be called twice for comparison on the travis server
     $I->amOnPage("/VisualCeption/notSameSize.php");
     $I->seeVisualChanges("getRedDiv", "div");
 }
 public function _turingAddTransition(WebGuy $I, $addDelta = false, $state = 0)
 {
     $I->wait(2);
     if ($addDelta === false) {
         $I->click('.create-child');
         $I->waitForText('transition-function');
         $I->click('transition-function');
         $I->wait(2);
         $I->click('.create-child[rel*="--*?1!--*?1!"]', '.generatedForm');
         $prefix = '--*?1!';
     } else {
         $I->click('.create-child[rel*="--*--*?1!"]');
         $prefix = '--*';
     }
     CommonScenarios::waitAndClickInTypeahead($I, 'delta');
     $I->fillField('.generatedForm input.value[name*="' . $prefix . '--*?1!--*?1!--*?1!"]', 'test-name' . time());
     // add input subtree
     $I->click('.create-child[rel*="' . $prefix . '--*?1!--*?1!"]', '.generatedForm');
     CommonScenarios::waitAndClickInTypeahead($I, 'input');
     $I->waitForElement('.generatedForm input.value[name*="' . $prefix . '--*?1!--*?1!--*?2!--*?1!"]');
     $I->fillField('.generatedForm input.value[name*="' . $prefix . '--*?1!--*?1!--*?2!--*?1!"]', $state);
     $I->fillField('.generatedForm input.value[name*="' . $prefix . '--*?1!--*?1!--*?2!--*?2!"]', '1');
     // add output subtree
     $I->click('.create-child[rel*="' . $prefix . '--*?1!--*?1!"]', '.generatedForm');
     CommonScenarios::waitAndClickInTypeahead($I, 'output');
     $I->click('.create-child[rel*="' . $prefix . '--*?1!--*?1!--*?3!"]', '.generatedForm');
     CommonScenarios::waitAndClickInTypeahead($I, 'state');
     $I->waitForElement('.generatedForm input.value[name*="' . $prefix . '--*?1!--*?1!--*?3!--*?1!"]');
     $I->fillField('.generatedForm input.value[name*="' . $prefix . '--*?1!--*?1!--*?3!--*?1!"]', $state + 1);
     $I->click('.create-child[rel*="' . $prefix . '--*?1!--*?1!--*?3!"]', '.generatedForm');
     CommonScenarios::waitAndClickInTypeahead($I, 'symbol');
     $I->waitForElement('.generatedForm input.value[name*="' . $prefix . '--*?1!--*?1!--*?3!--*?2!"]');
     $I->fillField('.generatedForm input.value[name*="' . $prefix . '--*?1!--*?1!--*?3!--*?2!"]', '2');
     $I->click('.create-child[rel*="' . $prefix . '--*?1!--*?1!--*?3!"]', '.generatedForm');
     CommonScenarios::waitAndClickInTypeahead($I, 'head-move');
     $I->waitForElement('.generatedForm select[name*="' . $prefix . '--*?1!--*?1!--*?3!--*?3!"]');
     $I->selectOption('.generatedForm select[name*="' . $prefix . '--*?1!--*?1!--*?3!--*?3!"]', 'right');
 }
 public function _createEmptyModule(WebGuy $I)
 {
     $I->canSee('Create empty root element');
     $I->wait(2);
     $I->click('.typeaheadName');
     $I->waitForElement('.typeahead');
     $I->click('interfaces');
     $I->click('.typeaheadNS');
     $I->expectTo('see only one available NS');
     $I->seeNumberOfElements('.typeaheadNS + .typeahead a', 1);
     $I->click('urn:ietf:params:xml:ns:yang:ietf-interfaces');
     $I->click('Create');
     $I->waitForText('interfaces');
 }
 /**
  * fail the test. lookup is current image is written
  */
 public function writeCurrentImageFile(WebGuy $I, $scenario)
 {
     $I->amOnPage("/VisualCeption/seeVisualChanges.php");
     $I->dontSeeVisualChanges("currentImageIdentifier", "#theblock");
     $I->wait(2);
     // the test has to be called twice for comparison on the travis server
     // expect failing the test
     $I->amOnPage("/VisualCeption/seeVisualChanges.php");
     try {
         $I->dontSeeVisualChanges("currentImageIdentifier", "#theblock");
     } catch (ImageDeviationException $exception) {
         $currentImagePath = $exception->getCurrentImage();
         if (!is_file($exception->getCurrentImage())) {
             throw new \PHPUnit_Framework_ExpectationFailedException("The screenshot was not saved successfully.");
         }
     }
 }
<?php

$I = new WebGuy($scenario);
include 'constant.php';
$I->wantTo('Reset my password');
$I->amOnPage('/');
$I->click(LoginPopUp::$loginPopup);
$I->waitForText('Create account');
$I->click(ForgotPopUp::$passwordLink);
$I->waitForText('Forgot password');
$I->wait(1);
$I->waitForElement(ForgotPopUp::$emailField);
$I->seeElement(ForgotPopUp::$emailField);
$I->seeElement(ForgotPopUp::$resetButton);
$I->fillField(ForgotPopUp::$emailField, $email);
$I->click(ForgotPopUp::$resetButton);
$I->waitForText('Reset password link was sent on your e-mail address');
<?php

$I = new WebGuy($scenario);
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
$I->seeVisualChanges("SimpleBlock", "#theblock");
// the test has to be called twice for comparison on the travis server
$I->wait(2);
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
$I->seeVisualChanges("SimpleBlock", "#theblock");
Exemple #8
0
<?php

$I = new WebGuy($scenario);
include 'constant.php';
$I->wantTo('Login to muzza.life');
$I->amOnPage(LoginPopUp::$URL);
$I->click(LoginPopUp::$loginPopup);
$I->waitForText(LoginPopUp::$createAccountLink);
$I->see(LoginPopUp::$createAccountLink);
$I->see(LoginPopUp::$createAccountLink);
$I->seeElement(LoginPopUp::$emailField);
$I->seeElement(LoginPopUp::$passwordField);
$I->seeElement(LoginPopUp::$loginButton);
$I->fillField(LoginPopUp::$emailField, $email);
$I->fillField(LoginPopUp::$passwordField, $pass);
$I->click(LoginPopUp::$loginButton);
$I->waitForText($username);
$I->wait(3);
///