Skip to content

E2E: Fix media settings test on Atomic #99413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/e2e/specs/media/settings__media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ describe( DataHelper.createSuiteTitle( 'Jetpack Settings: Media' ), function ()
} else {
await testAccount.authenticate( page );
}

// Atomic tests sites might have local users, so the Jetpack SSO login will
// show up when visiting the Jetpack dashboard directly. We can bypass it if
// we simulate a redirect from Calypso to WP Admin with a hardcoded referer.
// @see https://github.com/Automattic/jetpack/blob/12b3b9a4771169398d4e1982573aaec820babc17/projects/plugins/wpcomsh/wpcomsh.php#L230-L254
const siteUrl = testAccount.getSiteURL( { protocol: true } );
await page.goto( `${ siteUrl }wp-admin/`, {
timeout: 15 * 1000,
referer: 'https://wordpress.com/',
} );
} );

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