complered tools 2 and guide
This commit is contained in:
@@ -128,12 +128,22 @@ async function createSubsite(config, sessionId) {
|
||||
}
|
||||
|
||||
const url = resolveSubsiteUrl(config, slug);
|
||||
const configureCmd = buildWpCliCommand(
|
||||
|
||||
// Configure permalink structure
|
||||
const permalinkCmd = buildWpCliCommand(
|
||||
config,
|
||||
url,
|
||||
'option update permalink_structure "/%postname%/" && wp rewrite flush'
|
||||
'option update permalink_structure "/%postname%/"'
|
||||
);
|
||||
await runSshCommand(config, configureCmd, { timeout: config.testTimeoutMs });
|
||||
await runSshCommand(config, permalinkCmd, { timeout: config.testTimeoutMs });
|
||||
|
||||
// Flush rewrite rules
|
||||
const rewriteCmd = buildWpCliCommand(
|
||||
config,
|
||||
url,
|
||||
'rewrite flush'
|
||||
);
|
||||
await runSshCommand(config, rewriteCmd, { timeout: config.testTimeoutMs });
|
||||
|
||||
return { slug, url, adminUrl: `${url.replace(/\/$/, '')}/wp-admin` };
|
||||
}
|
||||
@@ -460,7 +470,11 @@ function createExternalWpTester(options = {}) {
|
||||
|
||||
const installedPlugins = await installRequiredPlugins(config, subsite.url, requiredPlugins);
|
||||
if (pluginSlug) {
|
||||
await runSshCommand(config, buildWpCliCommand(config, subsite.url, `plugin activate ${pluginSlug}`));
|
||||
const activateCmd = buildWpCliCommand(config, subsite.url, `plugin activate ${pluginSlug}`);
|
||||
const activateRes = await runSshCommand(config, activateCmd, { timeout: config.testTimeoutMs });
|
||||
if (activateRes.code !== 0) {
|
||||
errors.push(`Failed to activate plugin ${pluginSlug}: ${activateRes.stderr || activateRes.stdout}`);
|
||||
}
|
||||
}
|
||||
|
||||
const scenarios = normalizeTestScenarios(input, pluginSlug, config);
|
||||
|
||||
Reference in New Issue
Block a user