本文整理汇总了PHP中FunctionalTester::dontSeeElement方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::dontSeeElement方法的具体用法?PHP FunctionalTester::dontSeeElement怎么用?PHP FunctionalTester::dontSeeElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::dontSeeElement方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submitFormSuccessfully
public function submitFormSuccessfully(\FunctionalTester $I)
{
$I->submitForm('#contact-form', ['ContactForm[name]' => 'tester', 'ContactForm[email]' => 'tester@example.com', 'ContactForm[subject]' => 'test subject', 'ContactForm[body]' => 'test content', 'ContactForm[verifyCode]' => 'testme']);
$I->seeEmailIsSent();
$I->dontSeeElement('#contact-form');
$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
}
示例2: loginSuccessfully
public function loginSuccessfully(\FunctionalTester $I)
{
$I->amOnRoute('site/login');
$I->submitForm('#login-form', ['LoginForm[username]' => 'admin', 'LoginForm[password]' => 'admin']);
$I->see('Главное меню');
$I->see('Система "Фрегат"');
$I->see('Регистр глаукомных пациентов');
$I->see('Настройки портала');
$I->see('Сменить пароль');
$I->dontSeeElement('form#login-form');
$I->canSeeCookie('_identity');
$I->canSeeCookie('PHPSESSID');
$this->cookie_identity = $I->grabCookie('_identity');
$this->cookie_session = $I->grabCookie('PHPSESSID');
}
示例3: FunctionalTester
<?php
/**
* ------------------------------------
* Reply deletion
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Delete a reply as a visitor, normal member and admin.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
$reply = $I->have('Reply', ['topic_id' => $topic->id]);
// Testing as a visitor
$I->am('as a visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#reply-delete-' . $reply->id);
$I->amOnRoute('topics.delete', $topic->id);
$I->seeCurrentRouteIs('login-required');
// Test as a normal member
$I->am('as a member');
$I->signIn();
$I->dontSeeElement('#reply-delete-' . $reply->id);
$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('#reply-delete-' . $reply->id);
$I->click('#reply-delete-' . $reply->id);
$I->dontSeeRecord('replies', ['id' => $reply->id]);
示例4: FunctionalTester
<?php
/**
* ------------------------------------
* 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
示例5: FunctionalTester
<?php
/**
* ------------------------------------
* User editing
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Editing user profile as a Visitor and the Owner.');
$user = $I->have('User');
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('users.show', $user->id);
$I->dontSeeElement('#user-edit-button');
$I->amOnRoute('users.edit', $user->id);
$I->seeCurrentRouteIs('login-required');
// --------------- As a member --------------
$user = $I->signIn();
$I->am('as the Owner');
$I->amOnRoute('users.show', $user->id);
$I->seeElement('#user-edit-button');
$I->click('#user-edit-button');
$I->seeCurrentRouteIs('users.edit', $user->id);
$I->fillField(['name' => 'city'], 'My city');
$I->fillField(['name' => 'company'], 'My company');
$I->fillField(['name' => 'twitter_account'], 'My twitter_account');
$I->fillField(['name' => 'personal_website'], 'My personal_website');
$I->fillField(['name' => 'signature'], 'My signature');
$I->fillField(['name' => 'introduction'], 'My introduction');
$I->click('#user-edit-submit');
示例6:
$I->seeResponseCodeIs(200);
$I->see('Messages');
$I->see('Search', 'div.panel form button.btn-info');
$I->see('Status overview');
$I->seeLink('ID');
$I->seeLink('Created');
$I->seeLink('Type');
$I->seeLink('Status');
$I->see('Action');
$I->seeLink('Details');
$I->see('1.502', 'table tfoot');
# buttons
$I->seeLink('', '/message/set-status');
// for status buttons
# buttons: item with "Ready" status
$I->dontSeeElement('table#results tr.status-new a.btn-success span.glyphicon-check');
$I->seeElement('table#results tr.status-new a.btn-primary span.glyphicon-play');
$I->seeElement('table#results tr.status-new a.btn-warning span.glyphicon-pause');
$I->seeElement('table#results tr.status-new a.btn-danger span.glyphicon-remove');
$I->seeElement('table#results tr.status-new div.icon-button-placeholder-xs');
# buttons: item with "Halted" status
$I->seeElement('table#results tr.status-halted a.btn-primary span.glyphicon-play');
$I->seeElement('table#results tr.status-halted a.btn-success span.glyphicon-check');
$I->dontSeeElement('table#results tr.status-halted a.btn-warning span.glyphicon-pause');
$I->seeElement('table#results tr.status-halted a.btn-danger span.glyphicon-remove');
$I->seeElement('table#results tr.status-halted div.icon-button-placeholder-xs');
// coloured statuses on list
$I->see('New', 'td span[class="label label-default"]');
$I->see('Error', 'td span[class="label label-danger"]');
$I->see('In progress', 'td span[class="label label-primary"]');
$I->see('Halted', 'td span[class="label label-warning"]');
示例7: FunctionalTester
<?php
/**
* ------------------------------------
* Topic editing function
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Editing a topic as a Visitor, Member and Author.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-edit-button');
$I->amOnRoute('topics.edit', $topic->id);
$I->seeCurrentUrlEquals('/login-required');
// --------------- As a member --------------
$user = $I->signIn();
$I->am('as the author');
$topic = $I->postATopic(['title' => 'My Awsome Topic.', 'user_id' => $user->id]);
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-edit-button');
$I->click('#topic-edit-button');
$I->selectOption('form select[name=node_id]', 'php');
$I->fillField(['name' => 'title'], 'My first post!');
$I->fillField(['name' => 'body'], 'My first post body.');
$I->click('#topic-create-submit');
$I->see('My first post!');
示例8: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
// Prep
$sentry = $I->grabService('sentry');
$user = $sentry->findUserByLogin('user@user.com');
$admin = $sentry->findUserByLogin('admin@admin.com');
// Test
$I->amActingAs('user@user.com');
$I->wantTo('edit another users profile');
$I->amOnPage('/users/' . $admin->id . '/edit');
$I->dontSeeElement('form', ['class' => 'form-horizontal']);
示例9: FunctionalTester
<?php
/**
* Created by PhpStorm.
* User: Evhanz
* Date: 2/11/2015
* Time: 7:28 PM
*/
$I = new FunctionalTester($scenario);
//when
$I->wantTo('Probar el registro de prestamos');
$I->amOnPage('prestamos/getViewNewPrestamo');
$I->see('Formulario de Registro','h3');
$I->fillField('dniProveedor','qw');
$I->dontSeeElement('#dniProveedor', ['value' => 'qw']);
$I->click(':::');
$I->see('Exito');
$I->selectOption('#selRecuso','1');
$I->fillField('#descripcion','prestamo rapido');
$I->fillField('#cantidad','a');
$I->dontSeeElement('#cantidad', ['value' => 'a']);
$I->click('#btnGuardar');
示例10: FunctionalTester
<?php
/**
* ------------------------------------
* 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');
示例11: loginSuccessfully
public function loginSuccessfully(\FunctionalTester $I)
{
$I->submitForm('#login-form', ['LoginForm[username]' => 'admin', 'LoginForm[password]' => 'admin']);
$I->see('Logout (admin)');
$I->dontSeeElement('form#login-form');
}
示例12: FunctionalTester
<?php
/**
* ------------------------------------
* 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
示例13: FunctionalTester
<?php
/**
* ------------------------------------
* 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
示例14: removeAttachment
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function removeAttachment(FunctionalTester $I)
{
$I->am('Manager User');
$I->wantTo('remove an attachment from a project issue comments');
$fileName = 'upload1.txt';
$manager = $I->createUser(1, 3);
$I->amLoggedAs($manager);
$issue = $I->createIssue(1, $manager);
$project = $issue->project;
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$uploadToken = $I->grabValueFrom('//form/input[@name="upload_token"]');
$uri = $I->getApplication()->url->action('Project\\IssueController@postUploadAttachment', ['project' => $project]);
$I->submitFormWithFileToUri('.new-comment form', $uri, ['upload' => $fileName], ['comment' => 'Comment 1']);
$attachment = $issue->comments->first()->attachments->first();
$I->amOnAction('Project\\IssueController@getDownloadAttachment', ['project' => $project, 'issue' => $issue, 'attachment' => $attachment]);
$I->seeResponseCodeIs(200);
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->seeElement('.attachments a', ['title' => $fileName]);
$uri = $I->getApplication()->url->action('Project\\IssueController@postRemoveAttachment', ['project' => $project]);
$I->sendAjaxPostRequest($uri, ['_token' => csrf_token(), 'upload_token' => $uploadToken, 'filename' => $fileName]);
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->dontSeeElement('.attachments a', ['title' => $fileName]);
$I->amOnAction('Project\\IssueController@getDisplayAttachment', ['project' => $project, 'issue' => $issue, 'attachment' => $attachment]);
$I->seeResponseCodeIs(404);
}