cheezy / te3270

Automates a 3270 Terminal Emulator
MIT License
17 stars 22 forks source link

How can I use the methods defined in extra.rb in a cucumber step definition? #8

Closed srutarshid closed 7 years ago

srutarshid commented 8 years ago

I put the following code snippet in the env.rb file under the features folder. Before do @emulator = TE3270.emulator_for :extra do |platform| platform.session_file = 'sessionfile.edp' end end

The extra session is launched successfully. Now I want to use the send_key method defined under extra.rb, in my cucumber step definition.

How can I do that? Can I get a sample code snippet?

ReddytoRumble commented 8 years ago

This is how you would use it.

send_keys(TE3270.Enter)

This will cause the enter key to be sent to the terminal

cheezy commented 8 years ago

Did you define screen objects? If so, the standard way of using them is to use the on method to create your instance and then call methods on it.

cheezy commented 7 years ago

I'm going to close this issue since you haven't followed up to my questions