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


PHP FunctionalTester::seeElement方法代码示例

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


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

示例1: it_should_render_extended_shortcode

 /**
  * @test
  * it should render extended shortcode
  */
 public function it_should_render_extended_shortcode(\FunctionalTester $I)
 {
     $content = 'Lorem ipsum [idlikethis]Some idea of mine[/idlikethis]';
     $post_id = $I->havePostInDatabase(['post_name' => 'foo', 'post_content' => $content]);
     $I->amOnPage('/foo');
     $text = "Some idea of mine";
     $I->seeElement('.idlikethis-button[data-post-id="' . $post_id . '"][data-text="' . $text . '"] button');
 }
开发者ID:lucatume,项目名称:idlikethis,代码行数:12,代码来源:ShortcodeCest.php

示例2: deleteADiscussion

 public function deleteADiscussion(FunctionalTester $I, UserSteps $userSteps)
 {
     $userId = $userSteps->amRegularUser();
     $catId = $userSteps->haveCategory();
     $postId = $userSteps->havePost(['title' => 'Is there a way to validate only some fields?', 'users_id' => $userId, 'categories_id' => $catId]);
     $I->amOnPage("/discussion/{$postId}/abc");
     $I->seeInTitle('Is there a way to validate only some fields? - Discussion');
     $I->seeElement(['css' => 'a.btn-delete-post']);
     $I->click(['css' => 'a.btn-delete-post']);
     $I->see('Discussion was successfully deleted', '//body/div[1]/div/div/div');
 }
开发者ID:phalcon,项目名称:forum,代码行数:11,代码来源:DeletePostsCest.php

示例3: deleteADiscussion

 public function deleteADiscussion(FunctionalTester $I, UserSteps $userSteps)
 {
     $userId = $userSteps->amRegularUser();
     $catId = $userSteps->haveCategory(['name' => 'Some Category', 'slug' => 'some-category', 'description' => 'A description of the category']);
     $postId = $userSteps->havePost(['title' => 'Is there a way to validate only some fields?', 'content' => 'as I see, only the form itself can be validated. It validates if all fields passes, right?' . ' Well, this time I have to validate 3 fields - but those fields what passes, should go inside database.' . ' With the original schema, I cant do that', 'users_id' => $userId, 'slug' => 'is-there-a-way-to-validate-only-some-fields', 'categories_id' => $catId]);
     $I->amOnPage("/discussion/{$postId}/is-there-a-way-to-validate-only-some-fields");
     $I->seeInTitle('Is there a way to validate only some fields? - Discussion - Phalcon Framework');
     $I->seeElement(['css' => 'a.btn-delete-post']);
     $I->click(['css' => 'a.btn-delete-post']);
     $I->see('Discussion was successfully deleted', '//body/div[1]/div/div/div');
 }
开发者ID:kjmtrue,项目名称:forum,代码行数:11,代码来源:DeletePostsCest.php

示例4: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
// Prep
$sentry = $I->grabService('sentry');
$user = $sentry->findUserByLogin('user@user.com');
// Test
$I->amActingAs('user@user.com');
$I->wantTo('edit my own profile');
$I->amOnPage('/users/' . $user->id . '/edit');
$I->seeElement('form', ['class' => 'form-horizontal']);
$I->fillField('first_name', 'Irina');
$I->fillField('last_name', 'Sergeyevna');
$I->click('Submit Changes');
$I->seeRecord('users', ['email' => 'user@user.com', 'first_name' => 'Irina', 'last_name' => 'Sergeyevna']);
开发者ID:periodthree,项目名称:mhd,代码行数:15,代码来源:UserCanEditTheirProfileCept.php

示例5: FunctionalTester

/**
 * ------------------------------------
 * 			Mark a topic as Wiki
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Mark a topic as Community Wiki being a visitor, normal member and admin.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// Testing as a visitor
$I->am('a Phphub visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-wiki-button');
$I->amOnRoute('topics.wiki', $topic->id);
$I->seeCurrentRouteIs('login-required');
// Test as a normal member
$I->am('a Phphub member');
$I->signIn();
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-wiki-button');
$I->amOnRoute('topics.wiki', $topic->id);
$I->seeCurrentRouteIs('admin-required');
// Testing as a admin user
$I->am('a Phphub admin');
$I->signInAsAdmin();
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-wiki-button');
$I->click('#topic-wiki-button');
// Succeed
$I->seeElement('.ribbon-wiki');
$I->seeRecord('topics', ['id' => $topic->id, 'is_wiki' => true]);
开发者ID:adminrt,项目名称:phphub,代码行数:31,代码来源:TopicMarkAsWikiCept.php

示例6: FunctionalTester

 * ------------------------------------
 *          Pin a topic to top
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Pin a topic on Top of the topic default list');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// Testing as a visitor
$I->am('a Phphub visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-pin-button');
$I->amOnRoute('topics.pin', $topic->id);
$I->seeCurrentRouteIs('login-required');
// Test as a normal member
$I->am('a Phphub member');
$I->signIn();
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-pin-button');
$I->amOnRoute('topics.pin', $topic->id);
$I->seeCurrentRouteIs('admin-required');
// Testing as a admin user
$I->am('a Phphub admin');
$I->signInAsAdmin();
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-pin-button');
$I->click('#topic-pin-button');
// check the list
$I->amOnRoute('topics.index');
$I->seeElement('#pin-' . $topic->id);
$I->seeRecord('topics', ['id' => $topic->id, 'order' => 1]);
开发者ID:adminrt,项目名称:phphub,代码行数:31,代码来源:TopicPinCept.php

示例7: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->wantTo('ensure that User create work');
$I->fixtureLogin('user1');
$I->go(['/user/user/create']);
$I->testForm('#user-form', 'User', [], ['email' => 123, 'password' => '']);
$I->testForm('#user-form', 'User', ['email' => 'test@test.test', 'password' => 'admin']);
$I->seeElement('.alert-warning');
// needs polling
开发者ID:bariew,项目名称:sitown,代码行数:10,代码来源:01_UserCept.php

示例8: FunctionalTester

<?php

/**
 * ------------------------------------
 *          Down vote a topic
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Down Vote Topic as a visitor and a menber.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->click('#down-vote');
$I->seeCurrentUrlEquals('/login-required');
// --------------- As a member --------------
$user = $I->signIn();
$I->am('as a Member');
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#down-vote');
$I->click('#down-vote');
$I->see('My Awsome Topic.');
$I->seeRecord('topics', ['id' => $topic->id, 'vote_count' => -1]);
开发者ID:TopJohn,项目名称:phphub,代码行数:24,代码来源:TopicDownVoteCept.php

示例9: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->mockMuleConnectorServiceForVatStatus();
$I->reloadFixtures();
$I->wantTo('create account');
$I->amOnPage('/account/create');
$I->seeResponseCodeIs(200);
$I->see('Create Account', '#top-menu');
$I->seeElement('form');
$I->see('VAT country', 'form');
$I->see('VAT number', 'form');
$I->see('DK', 'form select option');
$I->click('Create Account', 'form button');
$I->seeResponseCodeIs(200);
$I->see('This value should not be blank.');
$I->submitForm('form', ['create_account' => ['vatCountry' => 'DK', 'vatNumber' => '00000000']]);
$I->see('This value should not be equal to &quot;00000000&quot;.');
$I->submitForm('form', ['create_account' => ['vatCountry' => 'DK', 'vatNumber' => '12345']]);
//$I->see('VAT Status', 'h2');
//$I->seeElement('#status-table');
//$I->see('Error', '#status-table td');
//$I->see('Duplicate', '#status-table td');
//$I->see('Success', '#status-table td');
//$I->see('Back', 'a.btn');
开发者ID:Viktechkso,项目名称:message-handler,代码行数:25,代码来源:CreateAccountCept.php

示例10: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->am('registered common user');
$I->wantTo('perform authentication actions');
// When
$I->amOnPage('login');
// Then
$I->see('Log in', 'h2');
$I->see('Username', 'label');
$I->see('Password', 'label');
$I->see('Remember me', 'label');
$I->seeElement('input', ['value' => 'Log in', 'class' => 'btn btn-primary btn-block']);
$I->amGoingTo('fill an invalid user in order to see the errors');
// When
$I->fillField('username', 'admin');
$I->fillField('password', '12345');
// And
$I->click('Log in', 'input[type=submit]');
// Then
$I->expectTo('see an error message');
$I->seeCurrentUrlEquals('/login');
$I->seeInField('username', 'admin');
$I->see('Invalid data', '.alert-danger');
$I->haveRecord('users', ['first_name' => 'System', 'last_name' => 'Administrator', 'username' => 'admin', 'password' => Hash::make('secret'), 'email' => 'dacosta.dev@nucleogps.com', 'remember_token' => null]);
$I->amGoingTo('full a valid user and see the result');
// When
$I->fillField('password', 'secret');
// And
$I->click('Log in', 'input[type=submit]');
// Then
开发者ID:hramose,项目名称:Nufarm-Encuesta,代码行数:31,代码来源:AuthenticateUserCept.php

示例11: FunctionalTester

/**
 * ------------------------------------
 * 			Topic deletion
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Delete a topic as a visitor, normal member and admin.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// Testing as a visitor
$I->am('a Phphub visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-delete-button');
$I->amOnRoute('topics.delete', $topic->id);
$I->seeCurrentRouteIs('login-required');
// Test as a normal member
$I->am('a Phphub member');
$I->signIn();
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-delete-button');
$I->amOnRoute('topics.delete', $topic->id);
$I->seeCurrentRouteIs('admin-required');
// Testing as a admin user
$I->am('a Phphub admin');
$I->signInAsAdmin();
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-delete-button');
$I->click('#topic-delete-button');
$I->seeCurrentRouteIs('topics');
$I->dontSeeRecord('topics', ['id' => $topic->id]);
开发者ID:adminrt,项目名称:phphub,代码行数:30,代码来源:TopicDeletionCept.php

示例12: FunctionalTester

<?php

/**
 * ------------------------------------
 *           Favorite a topic
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Favorite a Topic as a visitor and a menber.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->click('#topic-favorite-button');
$I->seeCurrentUrlEquals('/login-required');
// --------------- As a member --------------
$user = $I->signIn();
$I->am('as a Member');
// -- favorite
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-favorite-button');
$I->click('#topic-favorite-button');
$I->see('My Awsome Topic.');
$I->seeRecord('favorites', ['topic_id' => $topic->id, 'user_id' => $user->id]);
// -- cancel favorite
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-favorite-cancel-button');
$I->click('#topic-favorite-cancel-button');
$I->see('My Awsome Topic.');
$I->dontSeeRecord('favorites', ['topic_id' => $topic->id, 'user_id' => $user->id]);
开发者ID:adminrt,项目名称:phphub,代码行数:31,代码来源:TopicFavoriteCept.php

示例13: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->resetEmails();
//setup
$I->am('a user');
$I->wantTo('activate my phone number with expired code');
$I->amAuthenticatedWithCredentials();
$I->haveRecord('users_confirmations', ['type' => 'phone', 'confirmation_code' => '1234', 'user_id' => 1, 'created_at' => '2015-05-08 00:00:00', 'updated_at' => '2015-05-08 00:00:00']);
//action
//step 1
$code = $I->grabRecord('users_confirmations', ['user_id' => 1, 'type' => 'phone']);
//step2
$I->amOnPage('/confirmation/phone');
$I->fillField(['name' => 'code'], $code->confirmation_code);
$I->click('submit-confirmation-code');
//step5
$I->seeCurrentUrlEquals('/confirmation');
$I->seeElement('#submit-phone-code');
$I->dontSeeRecord('users_profiles', ['user_id' => 1, 'phone_confirmed' => 1]);
开发者ID:iris-it,项目名称:irispass-webapp-laravel,代码行数:20,代码来源:ConfirmPhoneExpiredCept.php

示例14: FunctionalTester

/**
 * ------------------------------------
 * 			Mark a topic as exellent
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Recomend a topic to the home page as a visitor, normal member and admin.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// Testing as a visitor
$I->am('a Phphub visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-recomend-button');
$I->amOnRoute('topics.recomend', $topic->id);
$I->seeCurrentRouteIs('login-required');
// Test as a normal member
$I->am('a Phphub member');
$I->signIn();
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-recomend-button');
$I->amOnRoute('topics.recomend', $topic->id);
$I->seeCurrentRouteIs('admin-required');
// Testing as a admin user
$I->am('a Phphub admin');
$I->signInAsAdmin();
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-recomend-button');
$I->click('#topic-recomend-button');
// Succeed
$I->seeElement('.ribbon-excellent');
$I->seeRecord('topics', ['id' => $topic->id, 'is_excellent' => true]);
开发者ID:adminrt,项目名称:phphub,代码行数:31,代码来源:TopicRecomendCept.php

示例15: FunctionalTester

<?php

/**
 * ------------------------------------
 *           Upvote a reply
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('UP Vote a Reply as a visitor and a menber.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
$reply = $I->have('Reply', ['topic_id' => $topic->id]);
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->click('#reply-up-vote-' . $reply->id);
$I->seeCurrentUrlEquals('/login-required');
// --------------- As a member --------------
$user = $I->signIn();
$I->am('as a Member');
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#reply-up-vote-' . $reply->id);
$I->click('#reply-up-vote-' . $reply->id);
$I->see('My Awsome Topic.');
$I->seeRecord('replies', ['id' => $reply->id, 'vote_count' => 1]);
开发者ID:adminrt,项目名称:phphub,代码行数:25,代码来源:ReplyUpVoteCept.php


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