MOBILE-4061 behat: Group all moodleappbehat plugin files

main
Pau Ferrer Ocaña 2022-05-05 13:41:27 +02:00
parent f48885b822
commit 0fd5078cf9
11 changed files with 10 additions and 13 deletions

View File

@ -46,23 +46,20 @@ async function main() {
// Copy plugin template.
const { version: appVersion } = require(projectPath('package.json'));
const templatePath = projectPath('scripts/templates/behat-plugin');
const templatePath = projectPath('local-moodleappbehat');
copySync(templatePath, pluginPath);
// Update version.php
const pluginFilePath = pluginPath + '/version.php';
const fileContents = readFileSync(pluginFilePath).toString();
const replacements = {
appVersion,
pluginVersion: getMoodlePluginVersion(),
};
copySync(templatePath, pluginPath);
for await (const templateFilePath of getDirectoryFiles(templatePath)) {
const pluginFilePath = pluginPath + templateFilePath.substr(templatePath.length);
const fileContents = readFileSync(pluginFilePath).toString();
writeFileSync(pluginFilePath, replaceArguments(fileContents, replacements));
}
// Copy plugin files.
copySync(projectPath('tests/behat'), `${pluginPath}/tests/behat`);
writeFileSync(pluginFilePath, replaceArguments(fileContents, replacements));
// Copy feature files.
const behatTempFeaturesPath = `${pluginPath}/behat-tmp`;