File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11include :
22 -
3- path : vendor/johnbillion/plugin-infrastructure/tests/docker-compose.yml
3+ path :
4+ - vendor/johnbillion/plugin-infrastructure/tests/docker-compose.yml
5+ - tests/mu-plugins/acceptance.yml
46 project_directory : .
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export default defineConfig({
1010 outputDir : '../test-results' ,
1111 fullyParallel : false ,
1212 forbidOnly : ! ! process . env . CI ,
13+ retries : process . env . CI ? 1 : 0 ,
1314 workers : 1 ,
1415 reporter : 'list' ,
1516 use : {
Original file line number Diff line number Diff line change @@ -62,7 +62,12 @@ export class UserSwitchingUtils {
6262 await this . page . fill ( 'input[name="pwd"]' , password ) ;
6363 await this . page . locator ( '#wp-submit' ) . click ( ) ;
6464
65- // @todo verify we're logged in (can't use HTTP status code as WP returns 200 even on failed login)
65+ // Wait for the redirect to complete before returning, otherwise a subsequent
66+ // navigation can race the login request and land without the auth cookie.
67+ await this . page . waitForURL ( / \/ w p - a d m i n \/ / ) ;
68+
69+ // WP returns a 200 for a failed login, so assert on the logged-in state instead.
70+ await expect ( this . page . locator ( '#wpadminbar' ) ) . toBeVisible ( ) ;
6671 }
6772
6873 /**
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ // The autofocus timer on wp-login.php races Playwright filling in the login form.
4+ add_filter ( 'enable_login_autofocus ' , '__return_false ' );
Original file line number Diff line number Diff line change 1+ services :
2+ php :
3+ volumes :
4+ - ./tests/mu-plugins/acceptance.php:/var/www/html/wp-content/mu-plugins/acceptance.php
You can’t perform that action at this time.
0 commit comments