Skip to content

Commit

Permalink
Playwright: fix request utils for non Docker envs (#48206)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored and ntsekouras committed Feb 28, 2023
1 parent fac5049 commit a7b888a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
import type { RequestUtils } from './index';
import { WP_BASE_URL } from '../config';

const THEMES_URL = new URL( '/wp-admin/themes.php', WP_BASE_URL ).href;
const THEMES_URL = new URL( 'wp-admin/themes.php', WP_BASE_URL ).href;

async function activateTheme(
this: RequestUtils,
themeSlug: string
): Promise< void > {
let response = await this.request.get( THEMES_URL );
const html = await response.text();
const optionalFolder = '([a-z0-9-]+%2F)?';
const matchGroup = html.match(
`action=activate&amp;stylesheet=${ encodeURIComponent(
`action=activate&amp;stylesheet=${ optionalFolder }${ encodeURIComponent(
themeSlug
) }&amp;_wpnonce=[a-z0-9]+`
);
Expand Down

1 comment on commit a7b888a

@github-actions
Copy link

@github-actions github-actions bot commented on a7b888a Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in a7b888a.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4294393063
📝 Reported issues:

Please sign in to comment.