I have to automate and test the happy path of a command line tool hosted in an AWS server. I am stuck in simulating a F2 key. Is there a way, we could pass it to the server as bytes? A sample example code is added below. F2 is needed as it is used to save the entry.
describe(testName, async()=>{
it('Verify Connection', async(done) => {
const stream = await conPromise.connectPromise();
const writable = await fs.createWriteStream('file.txt');
await sleep(5000);
await stream.write('3\n');
await sleep(5000);
await stream.write('T\n');
});
})
Please help out with some suggestions as I have tried many and failed.