element icon indicating copy to clipboard operation
element copied to clipboard

Allow serving multiple files to Flood.io via CLI

Open imajus opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Currently we can only pass single filename as an argument to Element Flood running command, e.g.:

element flood run test.perf.js --vu 10 --duration 5

This limits our coding approach and prevents from extracting common functions to external files. We're planning to make a sophisticated tests structure, covering multiple apps, and our test scripts source code is going to be short and declarative, e.g.:

import { MyPageTest } from './tests/my-page';
export default new MyPageTest({ rootUrl: 'https://example.com' });

Describe the solution you'd like I've noticed that a command element flood compile makes a single JS file recursively consolidating all imported entities source code, but I was not able to run resulting JS file in the Flood.io. Is it possible to do something similar with TS file? Or maybe you could allow running Element JS files on Flood.io?

Describe alternatives you've considered It would be also helpful to be able to list multiple files for element flood run command but this won't cover our case exactly, because our files structure is going to be hierarchical. Maybe with an ability to include folder contents recursively it would be an acceptable option for us.

imajus avatar Apr 30 '21 08:04 imajus

UPDATE: I was able to compile TypeScript file using element compile which outputs single JavaScript file with all the dependencies embedded. Then, I was able to execute that JavaScript file locally with element run. Apparently, the problem is that on Flood.io they keep using old Element (v1.5) to run the scripts, but it doesn't support JavaScript files execution. So as soon as Flood.io upgrade to Element 2.0 the problem will be resolved, because we'll be able to compile TypeScript files locally and feed single JavaScript file with embedded dependencies to Flood.io.

imajus avatar May 11 '21 21:05 imajus