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 Feb 21, 2023
1 parent b744199 commit 3076405
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 3076405

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 3076405.
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/4231091702
📝 Reported issues:

Please sign in to comment.