click() public method

Perform a click on a link or a button, given by a locator. If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched. For images, the "alt" attribute and inner text of any parent links are searched. The second parameter is a context (CSS or XPath locator) to narrow the search. Note that if the locator matches a button of type submit, the form will be submitted. php click('Logout'); button of form $I->click('Submit'); CSS button $I->click('#form input[type=submit]'); XPath $I->click('//form/*[@type=submit]'); link in context $I->click('Logout', '#nav'); using strict locator $I->click(['link' => 'Login']); ?>
See also: Codeception\Lib\InnerBrowser::click()
public click ( $link, $context = null )
$link
$context
示例#1
0
 /**
  * Test for requirement 130 of SLC
  * @param  WebGuy $I [description]
  */
 public function gebruikerKoppelenAanCursus(\WebGuy $I)
 {
     $I->amOnPage('/login');
     $I->see('Uren');
     $I->fillField('Username', 'slc');
     $I->fillField('Password', 'slc');
     $I->click('Login');
     $I->amOnPage('/slc/3');
     $I->amOnPage('/slc/3/course/students/1');
     $I->click('Voeg toe');
     $I->amOnPage('/slc/3/course/students/1');
     $I->see('student');
 }
 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');
 }
 public function _addInterface(WebGuy $I)
 {
     $I->waitForText('interfaces', 10);
     $I->click('.create-child[rel="--*?1!"]');
     CommonScenarios::waitAndClickInTypeahead($I, 'interface');
     $I->fillField('.generatedForm input.value[name*="--*?1!--*?1!--*?1!"]', 'test-name' . time());
     $I->selectOption('.generatedForm select[name*="--*?1!--*?1!--*?2!"]', 'ianaift:other');
     $I->click('.create-child', '.generatedForm');
     CommonScenarios::waitAndClickInTypeahead($I, 'description');
     $I->fillField('input.value[name*="--*?1!--*?1!--*?3!"]', 'loopback interface');
 }
 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 testEditConfig(WebGuy $I)
 {
     $I->wantTo('create new interface using submit button');
     $inputValue = 'test-name' . time();
     $I->click('.create-child[rel="--*--*?3!"]');
     CommonScenarios::waitAndClickInTypeahead($I, 'group');
     $I->waitForElement('input.value[name*="--*--*?3!--*?1!--*?1!"]');
     $I->fillField('input.value[name*="--*--*?3!--*?1!--*?1!"]', $inputValue);
     $I->click('Create new node');
     $I->waitForElementNotVisible('#ajax-spinner');
     $I->wait(2);
     //		$I->canSee($inputValue);
     CommonScenarios::checkNumberOfFlashes($I, 1);
     $I->canSee('group');
 }
<?php

/**
 * DefaultController Test
 *
 * @var $scenario \Codeception\Scenario
 *
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-email-module
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-email-module/master/LICENSE
 *
 * @package yii-email-module
 */
$I = new WebGuy($scenario);
$I->wantTo('ensure DefaultController works');
$I->amOnPage('email');
$I->see('You may use the following tools');
$I->click('Spool');
$I->see('Spools');
$I->click('Template');
$I->see('Templates');
$I->click('Email');
$I->see('You may use the following tools');
示例#7
0
文件: LoginCept.php 项目: ajb/rfpez
<?php

$I = new WebGuy($scenario);
/* Vendor login with wrong password fails */
$I->amOnPage('/signin');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'wrongpassword');
$I->click('button.btn');
$I->see('Login incorrect', '.alert');
$I = new WebGuy($scenario);
/* Vendor login succeeds */
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'password');
$I->click('button.btn');
$I->see('Projects', 'h4');
/* Signout works */
$I->click('Sign Out');
$I->see('RFP-EZ Marketplace');
/* Officer login wrong password fails */
$I->amOnPage('/signin');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'wrongpassword');
$I->click('button.btn');
$I->see('Login incorrect', '.alert');
/* Then officer login works */
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'password');
$I->click('button.btn');
$I->see('My Projects', 'h4');
$I->see('Hello guest');
// add user to the database
$I->haveInDatabase('account_user', array('username' => 'demo-activate', 'password' => '$2a$13$.m7wlozeIJuRtKp01lR4peYybArVLdO6Pf1JsPSnX6eISL9GXDWBu', 'first_name' => 'demo-activate', 'last_name' => 'demo-activate', 'email' => '*****@*****.**', 'activated' => 0));
// add a token to the database
$I->haveInDatabase('token', array('token' => '$2a$13$lRkdb6kwbIC9aGTkdei2h.NQNlZht9Bpdo2J0PqsJ3tHAFsYJNg7C', 'model_name' => 'AccountActivate', 'model_id' => 2, 'uses_allowed' => 1, 'uses_remaining' => 1, 'expires' => strtotime('+1day'), 'created' => time()));
// check with invalid token
$I->amOnPage('/account/account/activate/user_id/2/token/test-invalid-token');
$I->see('Invalid token.');
// reset password with empty details
$I->amOnPage('/account/account/activate/user_id/2/token/test-token');
$I->see('Your account has been activated and you have been logged in.');
// check login
$I->amOnPage('/');
$I->see('Hello demo-activate');
// logout
$I->amOnPage('/account/account/logout');
$I->see('Your have been logged out.');
// ensure token is expired
$I->amOnPage('/account/account/activate/user_id/2/token/test-token');
$I->see('Invalid token.');
// check login
$I->amOnPage('/account/account/login');
$I->fillField('AccountLogin_username', 'demo-activate');
$I->fillField('AccountLogin_password', 'demo-activate');
$I->click('Login');
$I->see('You have successfully logged in.');
$I->amOnPage('/');
$I->see('Hello demo-activate');
// logout
$I->amOnPage('/account/account/logout');
$I->see('Your have been logged out.');
<?php

$I = new WebGuy($scenario);
$I->wantTo('create and edit Pages as pagewriter user');
$I->loginAs($users['pagewriter']);
$I->see('New Page');
$I->click('New Page');
$I->see('Actions for this Page');
$I->fillField('title', 'A page I made');
$I->fillField('teaser', 'Woop woop woop! Crazy nice stuff inside!');
$I->fillField('body', 'Take it, take it! I have three more of these!');
$I->click('Save Page');
$I->see('A page I made');
$I->see('Woop woop woop');
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-account-module
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-account-module/master/LICENSE
 *
 * @package yii-account-module
 */
$I = new WebGuy($scenario);
$I->wantTo('ensure AccountAccountController update works');
// check we are not logged in
$I->amOnPage('/');
$I->see('Hello guest');
// login
$I->amOnPage('/account/account/login');
$I->fillField('AccountLogin_username', 'admin');
$I->fillField('AccountLogin_password', 'admin');
$I->click('Login');
$I->see('You have successfully logged in.');
// update details with empty fields
$I->amOnPage('/account/account/update');
$I->fillField('AccountUpdate_first_name', '');
$I->fillField('AccountUpdate_last_name', '');
$I->fillField('AccountUpdate_email', '');
$I->fillField('AccountUpdate_username', '');
$I->click('Save');
$I->see('Please fix the following input errors:');
$I->see('Email cannot be blank.');
$I->see('Username cannot be blank.');
$I->see('First Name cannot be blank.');
// update details with invalid email
$I->amOnPage('/account/account/update');
$I->fillField('AccountUpdate_first_name', 'admin-first-name');
<?php

$foobar = array('username' => 'foobar', 'password' => 'foobar123');
$I = new WebGuy($scenario);
$I->wantTo('Create a user');
$I->loginAs($users['admin']);
$I->click('Users');
$I->click('New user');
$I->see("Create a new user");
$I->fillField('form[username]', $foobar['username']);
$I->fillField('form[password]', $foobar['password']);
$I->fillField('form[password_confirmation]', $foobar['password']);
$I->fillField('form[email]', '*****@*****.**');
$I->fillField('form[displayname]', 'Foo Bar');
$I->click('input[type=submit]');
$I->see("has been saved");
$I->click('Logout');
$I->loginAs($foobar);
$I->see('Dashboard');
示例#12
0
 /**
  * Test for requirement 50 of student
  * @param  WebGuy $I [description]
  * @return [type]    [description]
  */
 public function profielInzienStudent(\WebGuy $I)
 {
     $I->amOnPage('/login');
     $I->see('Uren');
     $I->fillField('Username', 'student');
     $I->fillField('Password', 'student');
     $I->click('Login');
     $I->amOnPage('/student/1');
     $I->see('Student Page');
     $I->wantTo('Profiel Inzien');
     $I->click('Profiel');
     $I->amOnPage('/student/1/profiel');
     $I->see('student');
     $I->see('I12R');
 }
示例#13
0
<?php

$I = new WebGuy($scenario);
include 'loginCept.php';
$I->wantTo('Logout');
$I->click(LoginPopUp::$imgAvatar);
$I->click(LoginPopUp::$logoutButton);
<?php

$I = new WebGuy($scenario);
$I->wantTo('install component/module/plugin');
// Direct install URL call
$I->amOnPage('/administrator/index.php?option=com_installer');
// Login first
$I->fillField("#mod-login-username", 'TestAdmin');
$I->fillField("#mod-login-password", 'PassAdmin');
$I->click('Log in');
// Where i want to be
$I->see('Extension Manager: Install');
// Move "directory tab" into foreground
$I->seeLink('Install from Directory');
$I->click('Install from Directory');
// -> find input button (Can be found twice)
// <div id="directory"
//     <fieldset class="uploadform">
//         <div class="form-actions">
//             <input class="btn btn-primary" type="button" onclick="Joomla.submitbutton3()" value="Install">
$I->seeElement('#directory > fieldset > div > input');
$I->click('#directory > fieldset > div > input');
$I->see('was successful');
示例#15
0
$I = new WebGuy($scenario);
$WP = new wordpress_controller($I);
$I->wantTo('Test the Authentication Plugin');
$WP->admin_login('admin', 'password');
$I->resizeWindow(1280, 1024);
$I->see('Dashboard');
$WP->enable_plugins($plugins);
$WP->logout();
foreach ($affiliates as $a) {
    $I->amGoingTo('Input settings for the base plugin');
    $WP->admin_login();
    $I->amOnPage($plugins['base']['admin_page']);
    // Fill out the form
    $I->fillField('agora_core_framework_config[prod_token]', $mw_settings[$a]['prod_token']);
    $I->fillField('agora_core_framework_config[uat_token]', $mw_settings[$a]['uat_token']);
    $I->click('Save');
    $I->amGoingTo('Configure some Authcodes');
    $I->amOnPage($plugins['auth']['admin_page']);
    $I->see('Add new Authentication Code');
    foreach ($pubcodes[$a] as $authcode) {
        $I->fillField('#add_new_authcode .authcode_name', $authcode['name']);
        $I->fillField('#add_new_authcode .authcode_advantage_code', $authcode['advantage_code']);
        $I->fillField('#add_new_authcode .authcode_description', $authcode['description']);
        $I->selectOption('#add_new_authcode .authcode_type', $authcode['auth_type']);
        $I->click('Add New', '#add_new_authcode');
        $I->waitForJS('return jQuery.active == 0', 5);
        $I->see($authcode['description']);
    }
    $I->amGoingTo('Insert some Test Content');
    foreach ($pubcodes[$a] as $authcode) {
        $I->amOnPage('/wp-admin/post-new.php');
<?php

$I = new WebGuy($scenario);
$I->wantTo('base check modules and plugins for images');
//--- Component control panel ------------------------------
// Direct mdules URL call
//$I->amOnPage('http://127.0.0.1/Joomla3x/administrator/index.php?option=com_modules');
$I->amOnPage('/administrator/index.php?option=com_modules');
// Login first
$I->fillField("#mod-login-username", 'TestAdmin');
$I->fillField("#mod-login-password", 'PassAdmin');
$I->click('Log in');
//----------------------------------------------------------
// Modules
//----------------------------------------------------------
// Where i want to be
$I->makeScreenshot('Modules.SelectionPage');
$I->see('Modules');
//--- Image wall ----------------------------------------------
$I->click('RSGallery2 Image Wall module');
$I->makeScreenshot('Modules.ImageWall.Module');
// I see ...
$I->click('Menu Assignment');
$I->makeScreenshot('Modules.ImageWall.ModuleAssignment');
$I->click('Module Permissions');
$I->makeScreenshot('Modules.ImageWall.ModulePermissions');
$I->click('Advanced');
$I->makeScreenshot('Modules.ImageWall.Advanced');
$I->click('Close');
$I->amOnPage('/administrator/index.php?option=com_modules');
//--- Latest Images  ----------------------------------------------
示例#17
0
<?php

$I = new WebGuy($scenario);
$I->wantTo('update a page');
$I->amOnPage('users/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'admin');
$I->click('button[type=submit]');
$I->amOnPage('/admin/pages/1/edit');
$I->fillField('fr[title]', 'title test');
$I->click('Save and exit');
$I->seeCurrentUrlEquals('/admin/pages');
示例#18
0
 /**
  * Opens responsive menu (if it was closed).
  *
  * @return bool operation success.
  * @since 0.1.0
  */
 public function openResponsiveMenu()
 {
     try {
         $this->guy->click(\GeneralPage::$menuToggleButton);
         return true;
     } catch (\Behat\Mink\Exception\ElementException $e) {
         return false;
     }
 }
$I = new WebGuy($scenario);
$I->wantTo('ensure AccountAccountController sign up works');
// check we are not logged in
$I->amOnPage('/');
$I->see('Hello guest');
// check the form is there
$I->amOnPage('/account/account/signUp');
$I->see('First Name');
$I->see('Last Name');
$I->see('Email');
$I->see('Username');
$I->see('Password');
$I->see('Confirm Password');
// signup with empty details
$I->amOnPage('/account/account/signUp');
$I->click('Sign Up');
$I->see('Please fix the following input errors:');
$I->see('Email cannot be blank.');
$I->see('First Name cannot be blank.');
$I->see('Username cannot be blank.');
$I->see('Password cannot be blank.');
$I->see('Confirm Password cannot be blank.');
// signup with invalid email
$I->amOnPage('/account/account/signUp');
$I->fillField('AccountSignUp_first_name', 'demo_first_name');
$I->fillField('AccountSignUp_last_name', 'demo_last_name');
$I->fillField('AccountSignUp_email', 'demo!mailinator.com');
$I->fillField('AccountSignUp_username', 'demo');
$I->fillField('AccountSignUp_password', 'demo123');
$I->fillField('AccountSignUp_confirm_password', 'demo123');
$I->click('Sign Up');
<?php

$I = new WebGuy($scenario);
$I->wantTo('log out of the backend as Admin');
$I->loginAs($users['admin']);
$I->see('Dashboard');
$I->click('Logout Admin');
$I->see('You have been logged out');
$I->amOnPage('bolt');
$I->see('Please log on');
示例#21
0
文件: SanityCept.php 项目: ajb/rfpez
$I->fillField("bid[approach]", "Approach.");
$I->fillField("bid[previous_work]", "Previous work.");
$I->fillField("bid[employee_details]", "Employee details.");
$I->click("Submit Bid");
$I->see("Thanks for submitting your bid.");
$I->see("Approach.", 'p');
$I->see("Previous work.", 'p');
$I->see("Employee details.", 'p');
$I->click("Sign Out");
/** Officer Sanity **/
$I = new WebGuy($scenario);
$I->amOnPage('/signin');
/* Officer login succeeds */
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'password');
$I->click('button.btn');
$I->see('My Projects', 'h4');
$I->amOnPage("/notifications");
$I->see("{$vendorName} has submitted a bid", ".line1");
$I->click("submitted a bid");
$I->see("Bid from", "h1");
$I->click("(view profile)");
$I->see("Contact Name");
$I->see("SAM.gov");
$I->see("DSBS");
$I->click('Projects');
$I->see('My Projects', 'h4');
$I->click('API for SBA.gov Dynamic Small Business Search');
$I->see('Bids awaiting review', 'h5');
$I->see($vendorName, '.bid[data-vendor-company-name=' . $vendorName . ']');
$I->click('a[href*=comments]');
示例#22
0
<?php

$I = new WebGuy($scenario);
$I->wantTo('register with existing email');
$I->amOnPage('users/register');
$I->fillField('email', '*****@*****.**');
$I->fillField('first_name', 'Samuel');
$I->fillField('last_name', 'De Backer');
$I->fillField('password', 'trucmuche');
$I->fillField('password_confirmation', 'trucmuche');
$I->click('Register');
$I->amOnPage('users/register');
示例#23
0
<?php

$I = new WebGuy($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
$I->see('My Company');
$I->seeLink('About');
$I->click('About');
$I->see('This is the About page.');
示例#24
0
<?php

$I = new WebGuy($scenario);
$I->wantTo('submit contact form');
$I->amOnPage('fr/contact');
$I->selectOption('Titre', 'M.');
$I->fillField('first_name', 'John');
$I->fillField('last_name', 'Doe');
$I->fillField('email', '*****@*****.**');
$I->fillField('message', 'Hello');
$I->click('Envoyer');
$I->amOnPage('fr/contact');
示例#25
0
<?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->wantTo('login and see result');
$I->amOnPage('WelcomePage');
$I->fillField('username', '*****@*****.**');
$I->fillField('Password', '');
$I->click('Submit');
$I->see('Passaword', '#login-result');
<?php

/**
* Testing /clients/create form
* For now do not tests all fields in Form.
**/
$I = new WebGuy($scenario);
$I->wantTo('Test Form:New Client. /clients/create');
$I->amOnPage('/');
$I->click('#startButton');
$I->amOnPage('/clients/create');
$I->click('Add contact');
$I->fillField('input#email0', '*****@*****.**');
$I->fillField('input#email1', '*****@*****.**');
$I->click('Remove contact');
$I->click('Add contact');
$I->fillField('input#email1', '*****@*****.**');
$I->seeInField('input#email0', '*****@*****.**');
$I->seeInField('input#email1', '*****@*****.**');
//-----------Fields done-----
//add more fields
$I->fillField('input#name', 'Some User');
$I->fillField('input#website', 'http://google.com');
$I->fillField('input#work_phone', '+308123456789');
$I->fillField('input#address1', 'Test Address 1');
$I->fillField('input#address2', 'Test Address 2 APPTMT SUITE');
$I->fillField('input#city', 'Zaporozhe');
$I->fillField('input#state', 'Test Province');
$I->fillField('input#postal_code', 'postcode 123455677');
$option = 'Net 7';
$I->selectOption("#payment_terms", $option);
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-account-module
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-account-module/master/LICENSE
 *
 * @package yii-account-module
 */
$I = new WebGuy($scenario);
$I->wantTo('ensure AccountAccountController lost password works');
// check we are not logged in
$I->amOnPage('/');
$I->see('Hello guest');
// lost password with invalid username
$I->amOnPage('/account/account/lostPassword');
$I->fillField('AccountLostPassword_email_or_username', 'admin123');
$I->click('Recover Password');
$I->see('Please fix the following input errors:');
$I->see('Username does not exist.');
// lost password with invalid email
$I->amOnPage('/account/account/lostPassword');
$I->fillField('AccountLostPassword_email_or_username', '*****@*****.**');
$I->click('Recover Password');
$I->see('Please fix the following input errors:');
$I->see('Email does not exist.');
// lost password with correct username
$I->amOnPage('/account/account/lostPassword');
$I->fillField('AccountLostPassword_email_or_username', 'admin');
$I->click('Recover Password');
$I->see('Password reset instructions have been sent to admin@mailinator.com. Please check your email.');
$I->seeInDatabase('email_spool', array('template' => 'account_lost_password', 'status' => 'pending', 'model_name' => 'AccountUser', 'model_id' => 1, 'to_address' => '{"*****@*****.**":"admin admin"}', 'from_address' => '{"webmaster@localhost":"My Application"}'));
$I->seeInDatabase('token', array('model_name' => 'AccountLostPassword', 'model_id' => 1, 'uses_allowed' => 1, 'uses_remaining' => 1));
示例#29
0
<?php

$I = new WebGuy($scenario);
include 'constant.php';
$I->wantTo('Register new user');
$I->amOnPage("/");
$I->see('Registration');
$I->see('Login');
$I->see('Genre');
$I->see('Stations');
$I->click(Registration::$registrationlink);
$I->waitForText('Sign Up');
$I->see('Sign Up');
$I->seeElement(Registration::$username);
$I->seeElement(Registration::$emailField);
$I->seeElement(Registration::$passwordField);
$I->seeElement(Registration::$confirmPasswordField);
$I->seeElement(Registration::$registrationButton);
$I->fillField(Registration::$username, $username);
$I->fillField(Registration::$emailField, $email);
$I->fillField(Registration::$passwordField, $pass);
$I->fillField(Registration::$confirmPasswordField, $pass_conf);
$I->click(Registration::$registrationButton);
示例#30
0
<?php

// Login requires 2 steps
// 1. step: load front page
$I = new WebGuy($scenario);
$I->wantTo('ensure the standard login works');
$I->amOnPage('/index.php');
$I->see('Login');
// 2. step: continue to login form
$I->click('Login');
$I->amOnPage('/index.php');
$I->see('Herzlich willkommen');
$I->fillField('loginname', 'test_autor');
$I->fillField('password', 'testing');
$I->click('button[name=Login]');
// test, that we are really logged in and see typical elements
$I->see('Meine Startseite');