当前位置: 首页>>代码示例>>PHP>>正文


PHP AcceptanceTester::expect方法代码示例

本文整理汇总了PHP中AcceptanceTester::expect方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::expect方法的具体用法?PHP AcceptanceTester::expect怎么用?PHP AcceptanceTester::expect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AcceptanceTester的用法示例。


在下文中一共展示了AcceptanceTester::expect方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doFindTable

 public function doFindTable(\AcceptanceTester $I)
 {
     $I->amGoingTo('find a table in the selected restaurant');
     $I->lookForwardTo('reserve a reservation time slot');
     $I->amOnPage('/reservation');
     $I->seeElement('.panel-find-table');
     $I->selectOption('location', 'Lewisham');
     $I->selectOption('guest_num', '4');
     $I->fillField('reserve_date', date('d-m-Y', strtotime('+ 1 month', time())));
     $I->fillField('reserve_time', '2:45 PM');
     $I->click('Find Table', '#find-table-form');
     $I->expect('success with available reservation times slot displayed');
     $I->seeElement('.panel-time-slots');
     $I->seeNumberOfElements('#time-slots .btn-group > .btn', 5);
     // 5 elements
     $I->click('#time-slots .btn-group > .btn:nth-child(4)');
     $I->click('Select Time', '#find-table-form');
     $I->expectTo('see the reservation summary');
     $I->seeElement('.panel-summary');
 }
开发者ID:allrested,项目名称:TastyIgniter,代码行数:20,代码来源:Acceptance.php

示例2: submitASession

 /**
  * @param \AcceptanceTester $I
  */
 public function submitASession(AcceptanceTester $I)
 {
     $I->am('an attendee');
     $I->wantTo('submit a session');
     $I->expect('to be able a submit a new session');
     // Login user.
     $I->amOnPage('/user/login');
     $I->submitForm('#user-login-form', ['name' => 'user1', 'pass' => '123456']);
     $I->seeElement('body.user-logged-in');
     // Fill session submission.
     $I->amOnPage('/node/add/session');
     $node_title = $this->faker->text(30);
     $I->fillField('title[0][value]', $node_title);
     $I->fillCkEditorByName('body[0][value]', $this->faker->text(100));
     $I->fillField('field_author[0][target_id]', 'user1 (2)');
     $I->selectOption('field_exp_level', 0);
     $I->selectOption('field_session_track', 'development');
     $I->makeScreenshot('session_form');
     $I->submitForm('#node-session-form', [], 'op');
     $I->makeScreenshot('session_view');
     $I->see($node_title, '.l-content');
 }
开发者ID:itamair,项目名称:ddd-website,代码行数:25,代码来源:SessionCest.php

示例3: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('login a valid user');
// 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' => 0]);
// First - ensure that we are logged out
$I->amOnPage('/logout');
$I->amOnPage('/login');
//--------------------------------------------------------------------
// Error without info
//--------------------------------------------------------------------
$I->expect('the form is not submitted');
$I->seeElement('#submit');
$I->submitForm('form', [], '#submit');
$I->seeElement('.alert-danger');
//--------------------------------------------------------------------
// Error without bad password
//--------------------------------------------------------------------
$I->expect('error returned due to bad password');
$I->seeElement('#submit');
$I->submitForm('#login_form', ['email' => 'tester@example.com', 'password' => 'badstuff'], '#submit');
$I->seeElement('.alert-danger');
$I->expect('login attempt was logged');
$I->seeInDatabase('auth_login_attempts', ['email' => 'tester@example.com']);
//--------------------------------------------------------------------
// Error without bad email
//--------------------------------------------------------------------
$I->expect('error returned due to bad email');
$I->seeElement('#submit');
$I->submitForm('#login_form', ['email' => 'testy@examples.com', 'password' => 'mylittlepony'], '#submit');
开发者ID:leloulight,项目名称:Sprint,代码行数:31,代码来源:LoginCept.php

示例4: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo("change a post slug");
$I->loginAs("test@example.com", "secret");
$I->OpenAnArticle("foo-test");
$I->amGoingTo("change the article slug");
$I->seeInField("#slug_input", "foo-test");
$I->fillField("#slug_input", "bar-test");
$I->click("Save");
$I->expect("the article slug to have changed");
$I->OpenAnArticle("bar-test");
$I->seeInField("#slug_input", "bar-test");
开发者ID:apsdsm,项目名称:spectre,代码行数:13,代码来源:EditArticleSlugCept.php

示例5: AcceptanceTester

<?php

use yii\helpers\Url;
/* @var $scenario Codeception\Scenario */
$I = new AcceptanceTester($scenario);
$I->wantTo('vérifier que la page cms/web-texts/index fonctionne bien');
$pageUrl = Url::to(['/cms/web-texts/index']);
$wait = 1;
// secondes
$I->checkAccessFiltersAndLog($pageUrl, 'c.brun@hypothese.net', 'ew0oVQQkaCvCGwmIxK7a', 'Liste des textes');
$I->expect('le lien de création fonctionne');
$I->seeLink('Ajouter un texte');
$I->click('Ajouter un texte');
$I->see('Ajouter un texte', 'h1');
$I->expect('le lien de mise à jour fonctionne');
$I->amOnPage(Url::to(['/cms/web-texts/index']));
$url = Url::to(['/cms/web-texts/update', 'id' => 2], true);
$I->seeElement(['css' => 'a[href="' . $url . '"]']);
$I->click(['css' => 'a[href="' . $url . '"]']);
$I->wait($wait);
$I->see('Modifier un texte', 'h1');
$I->expect('le lien vers la fiche fonctionne');
$I->amOnPage(Url::to(['/cms/web-texts/index']));
$url = Url::to(['/cms/web-texts/view', 'id' => 2], true);
$I->seeElement(['css' => 'a[href="' . $url . '"]']);
$I->click(['css' => 'a[href="' . $url . '"]']);
$I->wait($wait);
$I->see('Fiche d\'un texte', 'h1');
$I->expect('la suppression fonctionne');
$I->amOnPage(Url::to(['/cms/web-texts/index']));
$url = Url::to(['/cms/web-texts/delete', 'id' => 2], true);
开发者ID:ChristopheBrun,项目名称:hLib,代码行数:31,代码来源:IndexCept.php

示例6: 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');
开发者ID:leloulight,项目名称:Sprint,代码行数:18,代码来源:ForcePasswordResetCept.php

示例7: AcceptanceTester

<?php

// @group optional
use dmstr\modules\pages\tests\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Pages works');
$I->expect('no access with guest user');
$I->amOnPage('/pages');
$I->see('Sign in', 'h3');
$I->makeScreenshot('pages-login');
$I->amGoingTo('try to login with correct credentials');
$loginPage = LoginPage::openBy($I);
$I->see('Sign in', 'h3');
$loginPage->login('admin', 'admin');
$I->dontSee('Sign in', 'h3');
$I->makeScreenshot('pages-after-login');
$I->amGoingTo('try to view and create pages');
$I->amOnPage('/pages');
$I->see('Pages', 'h1');
$I->makeScreenshot('success-pages-index');
开发者ID:dmstr,项目名称:yii2-pages-module,代码行数:20,代码来源:BaseCept.php

示例8: array

$I->seeResponseCodeIs(200);
$I->seeResponseIsXml();
$I->haveHttpHeader('Content-Type', 'application/xml; charset=utf-8');
$I->seeResponseContains('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"');
$I->dontSee('<b>Notice</b>');
// error sometimes thrown if Wordpress timezone not set
$I->dontSee('error');
$I->expectTo('see a paginated XML sitemap');
$I->sendGET('/sitemap.xml?page=1');
$I->seeResponseCodeIs(200);
$I->seeResponseIsXml();
$I->haveHttpHeader('Content-Type', 'application/xml; charset=utf-8');
$I->seeResponseContains('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"');
$I->dontSee('<b>Notice</b>');
$I->dontSee('error');
$page_1 = $I->grabResponse();
$I->expect('that page 2 will be different than page 1');
$I->sendGET('/sitemap.xml?page=2');
$I->assertNotEquals($page_1, $I->grabResponse());
$I->expectTo('see a full XML sitemap');
$I->sendGET('/sitemap-all.xml');
$I->seeResponseCodeIs(200);
$I->seeResponseIsXml();
$I->haveHttpHeader('Content-Type', 'application/xml; charset=utf-8');
$I->seeResponseContains('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"');
$I->dontSee('<b>Notice</b>');
// error sometimes thrown if Wordpress timezone not set
$I->dontSee('error');
$I->expect('sitemap link tag in HTML HEAD');
$I->amOnPage('/');
$I->seeElement('link', array('rel' => 'sitemap'));
开发者ID:micahtaylor,项目名称:wordpress-xml-sitemap,代码行数:31,代码来源:SitemapCept.php

示例9: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('TOPページが正常に見られているかを確認する。');
$I->amOnPage('/');
$I->see('EC-CUBE発!世界中を旅して見つけた立方体グルメを立方隊長が直送!');
$I->seeElement('#site_description');
$I->seeElement('#main_image');
$I->expect('システムエラーが出ていない');
$I->dontSeeElement('.error');
$I->expect('TOPページはパンくずを表示しない');
$I->dontSeeElement('.breadcrumb');
开发者ID:ec-cube-plugin,项目名称:BreadcrumbList,代码行数:12,代码来源:WelcomeCept.php

示例10:

<?php

/**
 * @package     Joomla
 * @subpackage  Tests
 *
 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
$I = new \AcceptanceTester($scenario);
$I->wantTo('Install Joomla CMS');
$I->expect('no configuration.php is in the Joomla CMS folder');
$I->dontSeeFileFound('configuration.php', $I->getConfiguration('Joomla folder'));
$I->amOnPage('/installation/index.php');
// I Wait for the text Main Configuration, meaning that the page is loaded
$I->waitForText('Main Configuration', 10, 'h3');
// I instantiate the Installation Configuration Page Elements:
$configurationPage = \JoomlaInstallationConfigurationPage::$elements;
$I->click($configurationPage['Language Selector']);
$I->click($configurationPage[$I->getConfiguration('Language')]);
$I->fillField('Site Name', 'Joomla CMS test');
$I->fillField('Description', 'Site for testing Joomla CMS');
// I get the configuration from acceptance.suite.yml (see: tests/_support/acceptancehelper.php)
$I->fillField('Admin Email', $I->getConfiguration('Admin email'));
$I->fillField('Admin Username', $I->getConfiguration('Username'));
$I->fillField('Admin Password', $I->getConfiguration('Password'));
$I->fillField('Confirm Admin Password', $I->getConfiguration('Password'));
$I->click($configurationPage['No Site Offline']);
$I->click('Next');
$I->wantTo('Fill the form for creating the Joomla site Database');
$I->waitForText('Database Configuration', 10, 'h3');
开发者ID:klas,项目名称:joomla-cms,代码行数:31,代码来源:InstallJoomlaCept.php

示例11: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('create a new user account');
$I->amOnPage('/join');
//--------------------------------------------------------------------
// Error without info
//--------------------------------------------------------------------
$I->expect('the form is not submitted');
$I->seeElement('#submit');
$I->submitForm('form', [], '#submit');
$I->seeElement('.alert-danger');
//--------------------------------------------------------------------
// Error with weak password
//--------------------------------------------------------------------
$fields = ['first_name' => 'Test', 'last_name' => 'User', 'email' => 'tester@example.com', 'username' => 'tester', 'password' => '123456', 'pass_confirm' => '123456'];
$I->expect('the form is not submitted');
$I->submitForm('#join_form', $fields, '#submit');
$I->seeElement('.alert-danger');
//--------------------------------------------------------------------
// Can create user
//--------------------------------------------------------------------
$fields = ['first_name' => 'Test', 'last_name' => 'User', 'email' => 'tester@example.com', 'username' => 'tester', 'password' => 'mylittlepony', 'pass_confirm' => 'mylittlepony'];
$I->expect('the form is submitted and a user is created');
$I->submitForm('#join_form', $fields, '#submit');
$I->dontSeeElement('.alert-danger');
开发者ID:leloulight,项目名称:Sprint,代码行数:26,代码来源:JoinCept.php


注:本文中的AcceptanceTester::expect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。