Skip to content

Commit 6c20287

Browse files
authored
E2E: Fix media settings test on Atomic (#99413)
PR #99393 switched from clicking the link in Calypso to visiting wp-admin directly. On Atomic this runs into the SSO login screen. Copy-paste the workaround used in other tests to avoid that.
1 parent 265f8db commit 6c20287

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/e2e/specs/media/settings__media.ts

+10
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ describe( DataHelper.createSuiteTitle( 'Jetpack Settings: Media' ), function ()
4343
} else {
4444
await testAccount.authenticate( page );
4545
}
46+
47+
// Atomic tests sites might have local users, so the Jetpack SSO login will
48+
// show up when visiting the Jetpack dashboard directly. We can bypass it if
49+
// we simulate a redirect from Calypso to WP Admin with a hardcoded referer.
50+
// @see https://github.com/Automattic/jetpack/blob/12b3b9a4771169398d4e1982573aaec820babc17/projects/plugins/wpcomsh/wpcomsh.php#L230-L254
51+
const siteUrl = testAccount.getSiteURL( { protocol: true } );
52+
await page.goto( `${ siteUrl }wp-admin/`, {
53+
timeout: 15 * 1000,
54+
referer: 'https://wordpress.com/',
55+
} );
4656
} );
4757

4858
if ( envVariables.JETPACK_TARGET !== 'remote-site' ) {

0 commit comments

Comments
 (0)