Skip to content

Commit 599b071

Browse files
committed
Test: Password reset flow
1 parent a98671d commit 599b071

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use voku\helper\HtmlDomParser;
4+
5+
$I = new AcceptanceTester( $scenario );
6+
$I->amOnPage( '/login' );
7+
$I->see( 'Login' );
8+
$I->click( 'Lost your password?' );
9+
$I->see( 'Password Reset' );
10+
$I->fillField( 'username_email', 'wpwp_admin' );
11+
$I->click( 'Reset password' );
12+
$I->waitForEmailWithSubject( "Reset your " . $I->grabOptionFromDatabase( 'blogname' ) . " password" );
13+
$lastMessage = $I->fetchLastMessage();
14+
$dom = HtmlDomParser::str_get_html( $lastMessage->html_body );
15+
$anchor = $dom->findOne( 'a' );
16+
$I->amOnUrl( str_replace( '&amp;', '&', $anchor->href ) );
17+
$I->see( 'Enter a new password below' );

0 commit comments

Comments
 (0)