示例#1
0
 /**
  * Login a admin user and logout again
  *
  * @param Kasper $I
  */
 public function tryToTest(Kasper $I)
 {
     $I->wantTo('login with admin');
     $I->loginAsAdmin();
     // user is redirected to 'about modules' after login, and must see the 'admin tools' section
     $I->see('Admin tools');
     $I->logout();
     $I->waitForElement('#t3-username');
 }
 /**
  * Call backend login page and verify login button changes color on mouse over,
  * verifies page is available and CSS is properly loaded.
  *
  * @param Kasper $I
  */
 public function tryToTest(Kasper $I)
 {
     $I->wantTo('check login functions');
     $I->amOnPage('/typo3/index.php');
     $I->waitForElement('#t3-username', 10);
     $I->wantTo('mouse over css change login button');
     // Make sure mouse is not over submit button from a previous test
     $I->moveMouseOver('#t3-username');
     $bs = $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
         return $webdriver->findElement(\WebDriverBy::cssSelector('#t3-login-submit'))->getCSSValue('box-shadow');
     });
     $I->moveMouseOver('#t3-login-submit');
     $I->wait(1);
     $bsmo = $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
         return $webdriver->findElement(\WebDriverBy::cssSelector('#t3-login-submit'))->getCSSValue('box-shadow');
     });
     $I->assertFalse($bs === $bsmo);
 }
 /**
  * Call backend login page and submit invalid login data.
  * Verifies login is not accepted and an error message is rendered.
  *
  * @param Kasper $I
  */
 public function tryToTest(Kasper $I)
 {
     $I->wantTo('check login functions');
     $I->amOnPage('/typo3/index.php');
     $I->waitForElement('#t3-username');
     $I->wantTo('check empty credentials');
     $required = $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
         return $webdriver->findElement(\WebDriverBy::cssSelector('#t3-username'))->getAttribute('required');
     });
     $I->assertEquals('true', $required, '#t3-username');
     $required = $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
         return $webdriver->findElement(\WebDriverBy::cssSelector('#t3-password'))->getAttribute('required');
     });
     $I->assertEquals('true', $required, '#t3-password');
     $I->wantTo('use bad credentials');
     $I->fillField('#t3-username', 'testify');
     $I->fillField('#t3-password', '123456');
     $I->click('#t3-login-submit-section > button');
     $I->waitForText('Verifying Login Data');
     $I->waitForElement('#t3-login-error');
     $I->see('Your login attempt did not succeed');
 }