sstephenson / bats

Bash Automated Testing System
MIT License
7.12k stars 518 forks source link

[Question] Automated Test Case for Prompting Case #215

Closed salmanhasni closed 7 years ago

salmanhasni commented 7 years ago

I have binary let say abc(executable) I execute this file as ./abc and there are bunch of commands like help, version, list, login, ask-question, I can easily automate help, version, and list arguments as they immediate give me response, whereas login and ask-question they suppose the prompt username, password and question respectively. how can i automated them e.g $./abc login type username:

dimo414 commented 7 years ago

This doesn't really seem related to Bats in any way. How would you like your application to behave in a non-interactive shell? Perhaps add flag variants for these inputs? Or use expect.

salmanhasni commented 7 years ago

@dimo414 Yes now i have used the expect, thanks