Skip to main content

Determining Terminal Status

Cycle's terminal emulator enables a user's interactions with a terminal emulator to be simulated for automated testing. In order to properly emulate a user's actions, there are Steps that can be used to determine what status the terminal emulator is in. It is helpful to know if a screen contains some text or where the cursor is located to determine if text should be entered or keys should be pressed. These Steps are the validations that make automated testing function as it should, so when the cursor does not move to where we expect it to move, the test will fail.

Verifying that the Terminal is Opened or Closed in Cycle

To determine if the terminal emulator is opened or closed in Cycle, use the following Step:

I verify terminal is <OPENED|CLOSED>

Verifying Text

Using the following Step, Cycle can determine if the terminal emulator contains some text. This Step is useful to verify the screen changed to the next screen, or to verify some text is displayed before entering text. If the terminal emulator does not contain this text within the given timeframe, the Step would fail.

To determine if the terminal emulator contains some text, use the following Step:

I see "< TEXT >" in terminal within < NUMBER > seconds

Example:

I see "Full Inv Move" in terminal within 10000 ms

Cycle also supports the reverse logic to determine if the terminal emulator does not contain some text within a timeframe or time-out period.

To determine if the terminal emulator does not contain some text, use the following Step:

I do not see "< TEXT >" in terminal within < NUMBER > seconds

Example:

I do not see "Full Inv Move" in terminal within 10000 ms

Note: The default time-out period for a terminal connection or any terminal Step that does not include a "within" parameter can be set or changed in the Execution settings section of Cycle's Preferences. In the figure below, the default terminal connection timeout is set to 90000 ms and the "within" terminal wait time is set to 100 ms.

Default Terminal Within Settings

Cycle can also determine where the cursor is located to verify any text entered will be entered into the correct field. Cycle uses the line (Y) and column (X) numbers of the terminal device to determine the cursor location. Each character is considered an increase in the value on the axis, and since the terminal emulators use a monospaced font, it is easy to determine the line and column values. The counting for the cursor position begins at 1 in the upper left-hand corner of the terminal emulator screen.

Verifying Cursor Position

To determine if the cursor is located at a certain position, use the following Step:

I see cursor at line <LINE_NUMBER> column <COLUMN_NUMBER> in terminal

Example:

I see cursor at line 12 column 5 in terminal

To determine if the cursor is not located at a certain position, use the following Step:

I do not see the cursor at line <LINE_NUMBER> column < COLUMN_NUMBER > in terminal

Example:

I do not see the cursor at line 12 column 5 in terminal

Using Cycle to determine the location of the cursor, paired with verifying that the screen contains (or does not contain) some text, is the recommended method to progress through the terminal emulator screens.