irb(main):017:0> query('UITextFieldLabel')[0]
{
"id" => nil,
"description" => "<UITextFieldLabel: 0x7f9a5a815f90; frame = (70 1.5; 186 34.5); text = 'Ronald Reagan Washington ...'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7f9a5a816410>>",
"label" => "Ronald Reagan Washington National (DCA)",
"frame" => {
"y" => 1.5,
"x" => 70,
"width" => 186,
"height" => 34.5
},
"accessibilityElement" => true,
"value" => "Ronald Reagan Washington National (DCA)",
"alpha" => 1,
"enabled" => true,
"visible" => 1,
"text" => "Ronald Reagan Washington National (DCA)",
"class" => "UITextFieldLabel",
"rect" => {
"y" => 154,
"center_x" => 173,
"center_y" => 171.25,
"x" => 80,
"width" => 186,
"height" => 34.5
}
}
irb(main):018:0> query('UITextFieldLabel', :description)[0]
"<UITextFieldLabel: 0x7f9a5a815f90; frame = (70 1.5; 186 34.5); text = 'Ronald Reagan Washington ...'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7f9a5a816410>>"
irb(main):019:0> my_city = "Ronald Reagan Washington National (DCA)"
"Ronald Reagan Washington National (DCA)"
irb(main):020:0> query('UITextFieldLabel', :description)[0].include?(my_city)
false
irb(main):021:0> truncated = "Ronald Reagan Washington ..."
"Ronald Reagan Washington ..."
irb(main):022:0> query('UITextFieldLabel', :description)[0].include?(truncated)
true
@Label
Scenario: Create Philips Account Steps # features/my_first.feature:18
Given I am on the Register Screen # features/step_definitions/my_first_steps.rb:2
Then I wait to see label 'ExplanatoryLabel' with key Create_Account_Hint_Password_lbltxt # features/step_definitions/check_localization.rb:12
Langauage :en Create_Account_Hint_Password_lbltxt
Label Description : <UILabel: 0x7f818b67e5c0; frame = (57.5 17; 260 12); text = 'Protect your privacy by c...'; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; tintColor = UIDeviceRGBColorSpace 0 0 0 1; layer = <_UILabelLayer: 0x7f818b67d330>>
Localization text: Protect your privacy by choosing a strong password.
Truncation Check Result :false
Then I wait for 10 seconds # calabash-cucumber-0.16.4/features/step_definitions/calabash_steps.rb:208
Regards,
Ravi
@Label
Scenario: Create Philips Account Steps # features/my_first.feature:18
Given I am on the Register Screen # features/step_definitions/my_first_steps.rb:2
Then I wait to see label 'ExplanatoryLabel' with key Create_Account_Hint_Password_lbltxt # features/step_definitions/check_localization.rb:12
Langauage :en Create_Account_Hint_Password_lbltxt
Label Description : <UILabel: 0x7f82dbe4cc50; frame = (57.5 17; 260 24); text = 'Protect your privacy by c...'; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; tintColor = UIDeviceRGBColorSpace 0 0 0 1; layer = <_UILabelLayer: 0x7f82dbe622e0>>
Localization text: Protect your privacy by choosing a strong password.
Text is truncated, <UILabel: 0x7f82dbe4cc50; frame = (57.5 17; 260 24); text = 'Protect your privacy by c...'; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; tintColor = UIDeviceRGBColorSpace 0 0 0 1; layer = <_UILabelLayer: 0x7f82dbe622e0>>
Then I wait for 10 seconds # calabash-cucumber-0.16.4/features/step_definitions/calabash_steps.rb:208
ExpectedOutPut : Text is not truncated,<Label Description has to print>
Regards,
Ravi