本文整理汇总了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');
}
示例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');
}
示例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');
}
示例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']);
示例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]);
示例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]);
示例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
示例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]);
示例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 "00000000".');
$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');
示例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
示例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]);
示例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]);
示例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]);
示例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]);
示例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]);