コード例 #1
0
 /**
  * @param AcceptanceTester $I
  */
 public function startAConversation(AcceptanceTester $I)
 {
     $I->wantToTest('if I can start a conversation');
     $I->amOnPage('/messages');
     $I->click('#startConversation');
     $I->see('Send a message');
 }
コード例 #2
0
 public function administratorCreateCategoryWithoutTitleFails(AcceptanceTester $I)
 {
     $I->am('Administrator');
     $I->wantToTest('Category creation in /administrator/ without title fails');
     $I->doAdministratorLogin();
     $I->amGoingTo('Navigate to Categories page in /administrator/');
     $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
     $I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
     $I->expectTo('see categories page');
     $I->amGoingTo('try to save a category with empty title and it should fail');
     $I->clickToolbarButton('new');
     $I->waitForText('Weblinks: New Category', '60', ['css' => 'h1']);
     $I->clickToolbarButton('save');
     $I->expectTo('see an error when trying to save a category without title');
     $I->see('Invalid field:  Title', ['id' => 'system-message-container']);
 }
コード例 #3
0
 public function administratorUnpublishCategory(AcceptanceTester $I)
 {
     $I->am('Administrator');
     $I->wantToTest('Category unpublishing in /administrator/');
     $I->doAdministratorLogin();
     $I->amGoingTo('Navigate to Categories page in /administrator/');
     $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
     $I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
     $I->expectTo('see categories page');
     $I->checkForPhpNoticesOrWarnings();
     $I->amGoingTo('try to save a category with a filled title');
     $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('category.add')\"]"]);
     $I->waitForText('Category Manager: Add A New Weblinks Category', '30', ['css' => 'h1']);
     $I->fillField(['id' => 'jform_title'], 'automated testing unpub' . rand(1, 100));
     $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('category.save')\"]"]);
     $I->expectTo('see a success message after saving the category');
     $I->see('Category successfully saved', ['id' => 'system-message-container']);
     $I->amGoingTo('Search for automated testing');
     $I->fillField(['xpath' => "//input[@id=\"filter_search\"]"], "automated testing unpub" . "\n");
     $I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
     $I->amGoingTo('Select the first weblink');
     $I->click(['xpath' => "//input[@id=\"cb0\"]"]);
     $I->amGoingTo('Try to publish a weblink category');
     $I->click(['xpath' => "//button[@onclick=\"if (document.adminForm.boxchecked.value==0){alert('Please first make a selection from the list.');}else{ Joomla.submitbutton('categories.publish')}\"]"]);
     $I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
     $I->expectTo('See a success message after publishing the category');
     $I->see('1 category successfully published.', ['id' => 'system-message-container']);
     // Unpublish it again
     $I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
     $I->amGoingTo('Select the first weblink');
     $I->click(['xpath' => "//input[@id=\"cb0\"]"]);
     $I->amGoingTo('Try to unpublish a weblink category');
     $I->click(['xpath' => "//button[@onclick=\"if (document.adminForm.boxchecked.value==0){alert('Please first make a selection from the list.');}else{ Joomla.submitbutton('categories.unpublish')}\"]"]);
     $I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
     $I->expectTo('See a success message after unpublishing the category');
     $I->see('1 category successfully unpublished', ['id' => 'system-message-container']);
 }
コード例 #4
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantToTest('force password reset redirects properly');
// Test user
$I->haveInDatabase('users', ['id' => 1, 'email' => '*****@*****.**', 'username' => 'tester', 'password_hash' => '$2y$10$wEzfeu4AdmR4mQSit3TCH.je1THv/Z8XqzDI4AOCov4lssqeA/gwS', 'created_on' => date('Y-m-d H:i:s', strtotime('-1 month')), 'active' => 1, 'deleted' => 0, 'force_pass_reset' => 1]);
// First - ensure that we are logged out
$I->amOnPage('/logout');
$I->amOnPage('/login');
//--------------------------------------------------------------------
// Successfully login
//--------------------------------------------------------------------
$I->expect('am sent to change password page');
$I->seeElement('#submit');
$I->submitForm('#login_form', ['email' => '*****@*****.**', 'password' => 'mylittlepony'], '#submit');
$I->dontSeeElement('.alert-danger');
$I->see('Change Password');
$I->seeInCurrentUrl('password');
コード例 #5
0
ファイル: SigninCept.php プロジェクト: AlexShKiev/sailing
<?php

$I = new AcceptanceTester($scenario);
$I->wantToTest('front page of my site');
$I->amOnPage('/');
$I->see('AlexTest');
<?php

/**
 * @package     redCORE
 * @subpackage  Cept
 * @copyright   Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
// Load the Step Object Page
$I = new \AcceptanceTester($scenario);
$I->wantToTest('Activate the default webservices available in redCORE');
$I->doAdministratorLogin();
$I->comment('I enable basic authentication');
$I->amOnPage('administrator/index.php?option=com_plugins');
$I->waitForText('Plugins', 30, ['css' => 'H1']);
$I->fillField(['id' => 'filter_search'], 'redcore - system plugin');
$I->click(['xpath' => "//div[@id='filter-bar']/div[2]/button"]);
// search button
$I->click(['link' => 'redCORE - System plugin']);
$I->waitForText('Plugins: redCORE - System plugin', 30, ['css' => 'h1']);
$I->click(['link' => 'Webservice options']);
$I->selectOptionInRadioField('Enable webservices', 'Yes');
$I->selectOptionInRadioField('Enable SOAP Server', 'Yes');
$I->selectOptionInChosen('Check user permission against', 'Joomla - Use already defined authorization checks in Joomla');
$I->click(['xpath' => "//div[@id='toolbar-apply']/button"]);
$I->waitForText('Plugin successfully saved.', 30, ['id' => 'system-message-container']);
$I->amOnPage('administrator/index.php?option=com_redcore&view=webservices');
$I->waitForText('Webservice Manager', 30, ['css' => 'H1']);
$I->click(['class' => 'lc-not_installed_webservices']);
$I->click(['class' => 'lc-install_all_webservices']);
$I->waitForElement(['id' => 'oauthClientsList'], 30);
コード例 #7
0
ファイル: LoginCept.php プロジェクト: phpffcms/ffcms
<?php

$I = new AcceptanceTester($scenario);
$I->wantToTest('do login');
$I->amOnPage('/user/login');
$I->fillField('FormLogin[login]', 'test');
$I->fillField('FormLogin[password]', 'test');
$I->click('Do Login');
$I->see('Profile', 'a');
コード例 #8
0
 public function administratorCreateWeblinkWithoutTitleFails(AcceptanceTester $I)
 {
     $I->am('Administrator');
     $I->wantToTest('Weblink creation without title fails in /administrator/');
     $I->doAdministratorLogin();
     $I->amGoingTo('Navigate to Weblinks page in /administrator/');
     $I->amOnPage('administrator/index.php?option=com_weblinks');
     $I->waitForText('Web Links', '30', ['css' => 'h1']);
     $I->expectTo('see weblinks page');
     $I->checkForPhpNoticesOrWarnings();
     $I->amGoingTo('try to save a weblink with empty title and it should fail');
     $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.add')\"]"]);
     $I->waitForText('Web Link: New', '30', ['css' => 'h1']);
     $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.apply')\"]"]);
     $I->expectTo('see an error when trying to save a weblink without title and without URL');
     $I->see('Invalid field:  Title', ['id' => 'system-message-container']);
     $I->see('Invalid field:  URL', ['id' => 'system-message-container']);
 }
コード例 #9
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantToTest('users are throttled under brute force attacks');
// Test user
$I->haveInDatabase('users', ['id' => 1, 'email' => '*****@*****.**', 'username' => 'tester', 'password_hash' => '$2y$10$wEzfeu4AdmR4mQSit3TCH.je1THv/Z8XqzDI4AOCov4lssqeA/gwS', 'created_on' => date('Y-m-d H:i:s', strtotime('-1 month')), 'active' => 1, 'deleted' => 0]);
// First - ensure that we are logged out
$I->amOnPage('/logout');
$I->amOnPage('/login');
// Now populate the auth_login_attempts table with 101 attempts
for ($i = 0; $i <= 101; $i++) {
    //	$I->submitForm('form', ['email' => '*****@*****.**', 'password' => 'badstuff'], 'submit');
    $I->haveInDatabase('auth_login_attempts', ['email' => '*****@*****.**', 'datetime' => date('Y-m-d H:i:s')]);
}
//--------------------------------------------------------------------
// Try to login - should be on same page with error
//--------------------------------------------------------------------
$I->submitForm('#login_form', ['email' => '*****@*****.**', 'password' => 'mylittlepony'], '#submit');
$I->seeElement('.alert-danger');
$I->see('throttled');
$I->dontSeeInDatabase('auth_logins', ['user_id' => 1, 'ip_address' => '127.0.0.1']);
コード例 #10
0
ファイル: UserTestCest.php プロジェクト: fritzdenim/pangMoves
 /**
  * Test to make sure WPEM doesn't load if WP is not fresh (eg. Migrated manually)
  *
  * @before reset
  * @before generatePosts
  * @before login
  *
  * @param AcceptanceTester $I
  */
 public function validateUnloadWPNotFresh(AcceptanceTester $I)
 {
     $I->wantToTest("The user doesn't see WPEM if WP isn't a fresh install");
     $I->see('Dashboard');
     $I->canSeeSetting('wpem_opt_out', 1);
     $I->canSeeSetting('wpem_done', 1);
     $I->canSeeSetting('wpem_log');
 }
コード例 #11
0
<?php

/**
 * @package     redCORE
 * @subpackage  Cept
 * @copyright   Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
// Load the Step Object Page
$I = new \AcceptanceTester($scenario);
$I->wantToTest(' that there are no Warnings or Notices in redCORE');
$I->doAdministratorLogin();
$I->wantTo('Activate redCORE system plugin features');
$I->amOnPage('administrator/index.php?option=com_plugins');
$I->fillField(['id' => 'filter_search'], 'redcore - system plugin');
$I->click(['xpath' => "//div[@id='filter-bar']/div[2]/button"]);
// search button
$I->click(['link' => 'redCORE - System plugin']);
$I->waitForText('Plugins: redCORE - System plugin', 30, ['css' => 'h1']);
$I->click(['link' => 'Translation options']);
$I->selectOptionInRadioField('Enable translations', 'Yes');
$I->click(['link' => 'Webservice options']);
$I->selectOptionInRadioField('Enable webservices', 'Yes');
$I->click(['xpath' => "//div[@id='toolbar-apply']/button"]);
$I->waitForText('Plugin successfully saved.', 30, ['id' => 'system-message-container']);
$I->checkForPhpNoticesOrWarnings('administrator/index.php?option=com_redcore');
$I->checkForPhpNoticesOrWarnings('administrator/index.php?option=com_redcore&view=translations&contentelement=&layout=manage');
$I->checkForPhpNoticesOrWarnings('administrator/index.php?option=com_redcore&view=translations&component=com_banners&contentelement=banner_clients');
$I->checkForPhpNoticesOrWarnings('administrator/index.php?option=com_redcore&view=translations&component=com_banners&contentelement=banners&return');
$I->checkForPhpNoticesOrWarnings('administrator/index.php?option=com_redcore&view=translations&component=com_banners&contentelement=categories');
$I->checkForPhpNoticesOrWarnings('administrator/index.php?option=com_redcore&view=translations&component=com_banners&contentelement=contact_details');
コード例 #12
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('login to backend');
$I->amOnPage('/typo3');
$I->waitForElement('#t3-username');
$I->seeInCurrentUrl('/typo3/');
$I->wantToTest('Login failed');
$I->fillField('#t3-username', 'testify');
$I->fillField('#t3-password', 'jsdlabvj');
$I->click('Login');
$I->waitForElement('body');
$I->seeNumberOfElements('#t3-login-error', 1);
コード例 #13
0
ファイル: 01-InstallJoomlaCept.php プロジェクト: 810/redCORE
<?php

/**
 * @package     redCORE
 * @subpackage  Cept
 * @copyright   Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
// Load the Step Object Page
$I = new \AcceptanceTester($scenario);
$I->wantToTest('Joomla 3 Installation');
$I->installJoomla();
$I->doAdministratorLogin();
$I->setErrorReportingToDevelopment();
$path = $I->getConfiguration('repo_folder');
$I->installExtensionFromDirectory($path);
コード例 #14
0
<?php

/**
* @package     redCORE
* @subpackage  Cept
* @copyright   Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved.
* @license     GNU General Public License version 2 or later; see LICENSE.txt
*/
// Load the Step Object Page
$I = new \AcceptanceTester($scenario);
$I->wantToTest('redCORE installation in Joomla 3');
$I->doAdministratorLogin();
$path = $I->getConfiguration('repo_folder');
$I->installExtensionFromDirectory($path);
コード例 #15
0
ファイル: MainCept.php プロジェクト: phpffcms/ffcms
<?php

$I = new AcceptanceTester($scenario);
$I->wantToTest('main page');
$I->amOnPage('/');
$I->see('ffcms');
$I->seeLink('Sign up');
$I->seeLink('Sign in');