本文整理汇总了PHP中FunctionalTester::amOnPage方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::amOnPage方法的具体用法?PHP FunctionalTester::amOnPage怎么用?PHP FunctionalTester::amOnPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::amOnPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dontSeeVisualChanges
/**
* @param FunctionalTester $I
*/
public function dontSeeVisualChanges(FunctionalTester $I)
{
$I->amOnPage('/');
$I->dontSeeVisualChanges('same');
// the test has to be called twice for comparison on the travis server
$I->amOnPage('/');
$I->dontSeeVisualChanges('same');
}
示例2: checkAuthEndpoint
public function checkAuthEndpoint(FunctionalTester $I)
{
$I->wantTo('Visit login endpoint');
$I->amOnPage('login');
$I->seeResponseCodeIs(200);
$I->wantTo('Visit register endpoint');
$I->amOnPage('register');
$I->seeResponseCodeIs(200);
}
示例3: requireAuthenticationForRoute
public function requireAuthenticationForRoute(FunctionalTester $I)
{
$I->dontSeeAuthentication();
$I->amOnPage('/secure');
$I->seeCurrentUrlEquals('/auth/login');
$I->see('Login');
$I->amLoggedAs(User::firstOrNew($this->userAttributes));
$I->amOnPage('/secure');
$I->seeResponseCodeIs(200);
$I->see('Hello World');
}
示例4: testRegisterSuccsess
public function testRegisterSuccsess(FunctionalTester $I)
{
$I->wantTo('register a user');
$I->amOnPage('/register');
$I->fillField('name', 'JohnDoe');
$I->fillField('email', 'johnDoe@gmail.com');
$I->fillField('password', 'admin');
$I->fillField('password_confirmation', 'admin');
$I->click('Continue');
$I->amOnPage('/');
}
示例5: requireAuthenticationForRoute
public function requireAuthenticationForRoute(FunctionalTester $I)
{
$I->haveEnabledFilters();
$I->amOnPage('/secure');
$I->seeCurrentUrlEquals('/auth/login');
$I->see('Login');
$I->amLoggedAs(User::create($this->userAttributes));
$I->amOnPage('/secure');
$I->seeResponseCodeIs(200);
$I->see('Hello World');
}
示例6: append_token_to_reset_password_route
private function append_token_to_reset_password_route(FunctionalTester $I)
{
// get reset token
$password_reset = $I->grabRecord('password_resets', ['email' => self::EMAIL]);
// fill password reset form
$I->amOnPage('/password/reset/' . $password_reset->token);
}
示例7: seeContact
/**
* @param FunctionalTester $I
*/
public function seeContact(FunctionalTester $I)
{
$I->wantToTest('if I can see the contact form as anonymous user');
$I->amOnPage('/');
$I->click(['link' => 'Contact']);
$I->see('ContactForm');
}
示例8: cantCreateDuplicateKeyEntry
public function cantCreateDuplicateKeyEntry(FunctionalTester $I)
{
$I->am('an equipment team member');
$I->wantTo('make sure I cant create duplicate entries');
//Load and login a known member
$I->loginEquipmentTeamMember();
$I->amOnPage('/equipment');
$I->canSee('Record a new item');
$name = $this->faker->word;
$slug = substr($this->faker->slug, 0, 10);
//First item
$I->click('Record a new item');
$I->fillField('Name', $name);
$I->fillField('Slug', $slug);
$I->click('Save');
$I->seeCurrentUrlEquals('/equipment/' . $slug . '/edit');
/*
//Second item
$I->click('Record a new item');
$I->fillField('Name', $name);
$I->fillField('Key', $slug);
$I->assertTrue(
$I->seeExceptionThrown('BB\Exceptions\FormValidationException', function() use ($I){
$I->click('Save');
})
);
*/
}
示例9: should_correctly_route_to_index
/** @test */
public function should_correctly_route_to_index(FunctionalTester $I)
{
// given .. I am on index page
$I->amOnPage('/');
// then ... I should see correct route
$I->seeCurrentUrlEquals('/');
}
示例10: _before
public function _before(FunctionalTester $I)
{
$this->tester = ['name' => 'Tester', 'email' => 'tester+' . str_random(8) . '@stellardestiny.online', 'password' => 'password'];
$I->amOnPage('/');
$I->click('Register');
$I->seeCurrentUrlEquals('/auth/register');
}
示例11: seeLinksList
public function seeLinksList(FunctionalTester $I)
{
$I->haveRecord('links', $this->linkRecord);
$I->amOnPage(LinksPage::$URL);
$I->see('Links');
$I->see('/' . $this->link['uri']);
$I->see($this->link['description']);
}
示例12: 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');
}
示例13: guestCantVisitRolesPage
public function guestCantVisitRolesPage(FunctionalTester $I)
{
$I->am('a guest');
$I->wantTo('make sure I can\'t view the roles page');
//I can see the menu item
$I->amOnPage('/roles');
$I->canSeeCurrentUrlEquals('/login');
}
示例14: deletePost
public function deletePost(FunctionalTester $I)
{
$id = $I->haveRecord('posts', $this->postAttributes);
$I->amOnPage(PostsPage::$url);
$I->see('Hello Universe');
PostsPage::of($I)->deletePost($id);
$I->seeCurrentUrlEquals(PostsPage::$url);
$I->dontSee('Hello Universe');
}
示例15: checkIfLogin
/**
* Define custom actions here
*/
function checkIfLogin(\FunctionalTester $I)
{
//if ($I->loadSessionSnapshot('login')) return;
$I->amOnPage('/login');
$I->fillField(['name' => 'email'], Fixtures::get('username'));
$I->fillField(['name' => 'password'], Fixtures::get('password'));
$I->click('#loginButton');
//$I->saveSessionSnapshot('login');
}