MCPcopy Create free account
hub / github.com/Rello/analytics / runScenario

Function runScenario

tests/playwright/full_regression.js:79–115  ·  view source on GitHub ↗
(scenario)

Source from the content-addressed store, hash-verified

77}
78
79function runScenario(scenario) {
80 return new Promise((resolve) => {
81 const env = {
82 ...process.env,
83 REPORT_NAME: reportName,
84 GROUP_NAME: groupName,
85 ARTIFACT_DIR: artifactRoot,
86 ARTIFACT_FLAT: '1',
87 ARTIFACT_PREFIX: `${scenario.id}_${scenario.title}`,
88 };
89
90 const child = spawn(process.execPath, [path.join(process.cwd(), scenario.script)], {
91 cwd: process.cwd(),
92 env,
93 stdio: ['ignore', 'pipe', 'pipe'],
94 });
95
96 let stdout = '';
97 let stderr = '';
98 child.stdout.on('data', (chunk) => {
99 stdout += chunk.toString();
100 });
101 child.stderr.on('data', (chunk) => {
102 stderr += chunk.toString();
103 });
104 child.on('close', (code) => {
105 const json = parseScenarioOutput(stdout, scenario);
106 resolve({
107 code,
108 stdout,
109 stderr,
110 json,
111 scenario,
112 });
113 });
114 });
115}
116
117(async () => {
118 await fs.mkdir(artifactRoot, { recursive: true });

Callers 1

full_regression.jsFile · 0.85

Calls 2

parseScenarioOutputFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected