plum-e2e 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ function scheduleJob(taskName, cronExpression, tags, workers) {
39
39
  const env = { ...process.env, TAG: tags, TRIGGER: taskName };
40
40
  if (workers && workers > 1) env.PARALLEL = String(workers);
41
41
 
42
- const task = spawn('npm', ['run', 'test'], { env });
42
+ const task = spawn('npm', ['run', 'test'], { env, shell: true });
43
43
  task.stdout.on('data', (data) => console.log(data.toString()));
44
44
  task.stderr.on('data', (data) => console.error(data.toString()));
45
45
  task.on('close', (code) => {
@@ -31,7 +31,7 @@ const socketHandler = (io) => {
31
31
  };
32
32
  if (workers && workers > 1) env.PARALLEL = String(workers);
33
33
 
34
- const testProcess = spawn('npm', ['run', 'test'], { env });
34
+ const testProcess = spawn('npm', ['run', 'test'], { env, shell: true });
35
35
 
36
36
  testProcess.stdout.on('data', (data) => {
37
37
  socket.emit('log', data.toString());
package/bin/plum.js CHANGED
@@ -161,35 +161,31 @@ switch (command) {
161
161
  // Scaffold plum.plugins.json for user-managed dependencies
162
162
  scaffoldPluginsFile();
163
163
 
164
- // Create .vscode/settings.json and install Cucumber extension — only if VS Code is available
164
+ // Always create .vscode/settings.json for Cucumber extension config
165
165
  {
166
- let vscodeAvailable = false;
166
+ const vscodeSettingsPath = path.join(process.cwd(), '.vscode', 'settings.json');
167
+ if (!fs.existsSync(vscodeSettingsPath)) {
168
+ fs.mkdirSync(path.dirname(vscodeSettingsPath), { recursive: true });
169
+ fs.writeFileSync(
170
+ vscodeSettingsPath,
171
+ JSON.stringify(
172
+ {
173
+ 'cucumber.glue': ['tests/step_definitions/**/*.ts'],
174
+ 'cucumber.features': ['tests/features/**/*.feature']
175
+ },
176
+ null,
177
+ 2
178
+ ) + '\n',
179
+ 'utf8'
180
+ );
181
+ console.log('✅ .vscode/settings.json created for Cucumber extension.\n');
182
+ } else {
183
+ console.log('⚠️ .vscode/settings.json already exists. Skipping.\n');
184
+ }
185
+
186
+ // Install extension via CLI only when the code command is available
167
187
  try {
168
188
  execSync('code --version', { stdio: 'ignore' });
169
- vscodeAvailable = true;
170
- } catch {}
171
-
172
- if (vscodeAvailable) {
173
- const vscodeSettingsPath = path.join(process.cwd(), '.vscode', 'settings.json');
174
- if (!fs.existsSync(vscodeSettingsPath)) {
175
- fs.mkdirSync(path.dirname(vscodeSettingsPath), { recursive: true });
176
- fs.writeFileSync(
177
- vscodeSettingsPath,
178
- JSON.stringify(
179
- {
180
- 'cucumber.glue': ['tests/step_definitions/**/*.ts'],
181
- 'cucumber.features': ['tests/features/**/*.feature']
182
- },
183
- null,
184
- 2
185
- ) + '\n',
186
- 'utf8'
187
- );
188
- console.log('✅ .vscode/settings.json created for Cucumber extension.\n');
189
- } else {
190
- console.log('⚠️ .vscode/settings.json already exists. Skipping.\n');
191
- }
192
-
193
189
  try {
194
190
  execSync('code --install-extension cucumberopen.cucumber-official', { stdio: 'inherit' });
195
191
  console.log('✅ Cucumber VS Code extension installed.\n');
@@ -198,8 +194,43 @@ switch (command) {
198
194
  '⚠️ Could not install VS Code extension automatically. Install manually: cucumberopen.cucumber-official\n'
199
195
  );
200
196
  }
197
+ } catch {
198
+ console.log(
199
+ 'ℹ️ Install the Cucumber VS Code extension manually: cucumberopen.cucumber-official\n'
200
+ );
201
+ }
202
+ }
203
+
204
+ // Scaffold tsconfig.json so VS Code resolves Plum's types without a local node_modules
205
+ {
206
+ const tsconfigPath = path.join(process.cwd(), 'tsconfig.json');
207
+ if (!fs.existsSync(tsconfigPath)) {
208
+ const backendModules = path.join(plumRoot, 'backend', 'node_modules').replace(/\\/g, '/');
209
+ const tsconfig = {
210
+ compilerOptions: {
211
+ target: 'ES2020',
212
+ module: 'CommonJS',
213
+ moduleResolution: 'node',
214
+ esModuleInterop: true,
215
+ strict: false,
216
+ skipLibCheck: true,
217
+ baseUrl: '.',
218
+ paths: {
219
+ playwright: [`${backendModules}/playwright`],
220
+ '@playwright/test': [`${backendModules}/@playwright/test`],
221
+ '@cucumber/cucumber': [`${backendModules}/@cucumber/cucumber`],
222
+ dotenv: [`${backendModules}/dotenv`],
223
+ chai: [`${backendModules}/chai`],
224
+ 'chai-soft-assert': [`${backendModules}/chai-soft-assert`]
225
+ },
226
+ typeRoots: [`${backendModules}/@types`]
227
+ },
228
+ include: ['tests/**/*.ts']
229
+ };
230
+ fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2) + '\n', 'utf8');
231
+ console.log('✅ tsconfig.json created for IDE type resolution.\n');
201
232
  } else {
202
- console.log('ℹ️ VS Code not detected — skipping .vscode setup.\n');
233
+ console.log('⚠️ tsconfig.json already exists. Skipping.\n');
203
234
  }
204
235
  }
205
236
 
@@ -405,7 +436,7 @@ switch (command) {
405
436
 
406
437
  case 'create-step': {
407
438
  const createStepScript = path.join(plumRoot, 'backend', 'config', 'scripts', 'create-step.mjs');
408
- execSync(`node ${createStepScript}`, {
439
+ execSync(`node "${createStepScript}"`, {
409
440
  cwd: process.cwd(),
410
441
  stdio: 'inherit',
411
442
  env: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plum-e2e",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/silverlunah/plum.git"
@@ -8,7 +8,7 @@
8
8
  "description": "A detached test automation environment that combines Playwright and Cucumber with a Svelte frontend and an Express backend. It allows users to trigger tests, monitor reports, and schedule test runs through an intuitive UI.",
9
9
  "main": "index.js",
10
10
  "scripts": {
11
- "init": "(npm install) && (cd backend && npm install && npm run init) && (cd frontend && npm install && echo 'Frontend install complete')",
11
+ "init": "npm install && npm --prefix backend install && npm --prefix backend run init && npm --prefix frontend install",
12
12
  "format": "prettier --write .",
13
13
  "add-license": "npx license-check-and-add add -f license-config.json",
14
14
  "prepare": "husky",