本文整理汇总了PHP中AcceptanceTester::wantToTest方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::wantToTest方法的具体用法?PHP AcceptanceTester::wantToTest怎么用?PHP AcceptanceTester::wantToTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcceptanceTester
的用法示例。
在下文中一共展示了AcceptanceTester::wantToTest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startAConversation
/**
* @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: administratorCreateCategoryWithoutTitleFails
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: administratorUnpublishCategory
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: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantToTest('force password reset redirects properly');
// Test user
$I->haveInDatabase('users', ['id' => 1, 'email' => 'tester@example.com', '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' => 'tester@example.com', 'password' => 'mylittlepony'], '#submit');
$I->dontSeeElement('.alert-danger');
$I->see('Change Password');
$I->seeInCurrentUrl('password');
示例5: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantToTest('front page of my site');
$I->amOnPage('/');
$I->see('AlexTest');
示例6:
<?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);
开发者ID:thangredweb,项目名称:redCORE,代码行数:31,代码来源:04-ActivateDefaultWebservicesWithBasicAuthenticationCept.php
示例7: AcceptanceTester
<?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: administratorCreateWeblinkWithoutTitleFails
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: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantToTest('users are throttled under brute force attacks');
// Test user
$I->haveInDatabase('users', ['id' => 1, 'email' => 'tester@example.com', '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' => 'tester@example.com', 'password' => 'badstuff'], 'submit');
$I->haveInDatabase('auth_login_attempts', ['email' => 'tester@example.com', 'datetime' => date('Y-m-d H:i:s')]);
}
//--------------------------------------------------------------------
// Try to login - should be on same page with error
//--------------------------------------------------------------------
$I->submitForm('#login_form', ['email' => 'tester@example.com', 'password' => 'mylittlepony'], '#submit');
$I->seeElement('.alert-danger');
$I->see('throttled');
$I->dontSeeInDatabase('auth_logins', ['user_id' => 1, 'ip_address' => '127.0.0.1']);
示例10: validateUnloadWPNotFresh
/**
* 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:
<?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: AcceptanceTester
<?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:
<?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:
<?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: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantToTest('main page');
$I->amOnPage('/');
$I->see('ffcms');
$I->seeLink('Sign up');
$I->seeLink('Sign in');