Last Monday, I was also confronted with the need to automate 'Password, Please!' routine in a test-harness. I did a bit of research, read the PT section, and said "Eureka". I then ran into a spot of difficulty dealing with password prompting - I was only prompting one time and then moving on, rather than re-issuing a prompt in a loop and waiting for the User to say 'done, enough'. After a bit of playing around, I sorted a way to allow me to get this behavior to work in the context of Expect::Simple. Last Thursday I sent a patch off to the maintainer (Leon Brocard).
Basically, the patch adds the prompt-string and the quit-string to the results obtained from the test-code, before the results are passed on to Expect::Simple. This results in Expect::Simple returning the right stuff to the test-harness, and then, since the quit-string appeared following the 'next prompt', Expect::Simple cleans up and exits normally. I set things up so that you can call-out this behavior at will via a parameter passed into the Test::Expect::expect_run() routine.
/msg me if you need the work-around immediately, or wait until it gets incorporated formally into Test::Expect.
----
I Go Back to Sleep, Now.
OGB
In reply to Re: Interactive prompts inside a test harness
by Old_Gray_Bear
in thread Interactive prompts inside a test harness
by jkeenan1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |