shelltestrunner icon indicating copy to clipboard operation
shelltestrunner copied to clipboard

support storing intermediate variables between tests

Open ppenguin opened this issue 4 years ago • 0 comments

I'm doing a test which needs to take the output of one command as an input for the next. Short of using temporary files I have no way of achieving this within the test script.

It would be a nice feature, if we could e.g. refer to (ideally a regex match) of stdout (or stderr) of the last command, or support pushing such a match to a variable name.

Maybe something like:

$ myapicli --getsession
> /([0-9]*)/sid=$1
>= 0

$ myapicli --getitem --sid=${sid}
> /\w+/
>= 0

Even better if one could do multiple matching groups like so:

> /([0-9]*)\s+([0-9]*)/num1=$1;num2=$2
# or with some separator or different assignment of course

ppenguin avatar Feb 11 '21 21:02 ppenguin