Module: MobyBehaviour::QT::TypeText

Includes:
Behaviour
Defined in:
lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/type_text.rb

Overview

description

TypeText specific behaviours

behaviour

QtTypeText

requires

testability-driver-qt-sut-plugin

input_type

*

sut_type

QT

sut_version

*

objects

*

Instance Method Summary collapse

Methods included from Behaviour

#command_params

Instance Method Details

#type_text(text) ⇒ Object

Write text on to a widget (e.g QLineEdit) as if it was typed by user n

arguments

text

String
 description: Text to type
 example: "abc"

returns

NilClass

description: -
example: -

exceptions

Exception

description: No special exceptions, may throw any exception


68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/type_text.rb', line 68

def type_text( text )
  ret = nil

  begin
    command = command_params #in qt_behaviour           
    command.command_name('TypeText')
    command.command_value(text)
    @sut.execute_command(command)
    sleep 0.2

  rescue Exception => e

    $logger.behaviour "FAIL;Failed type_text with text \"#{text}\".;#{identity};type_text;"
    raise e

  end      

  $logger.behaviour "PASS;Operation type_text executed successfully with text \"#{text}\".;#{identity};type_text;"

  ret

end