Skip to content

Commit

Permalink
fix tests for uiautomator2 (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored May 2, 2017
1 parent ab8ecf8 commit 8e600af
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
10 changes: 9 additions & 1 deletion android_tests/lib/android/specs/android/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ def id_value
t 'find by id' do
wait { find('accessibility').click }
wait { find('accessibility node provider').click }
wait { id 'accessibility_node_provider' } # Accessibility/Accessibility Node Provider

if !automation_name_is_uiautomator2?
wait { text 'Accessibility/Accessibility Node Provider' }
else
# With string.xml
# Only for uiautomator1
wait { id 'accessibility_node_provider' }
end

2.times { back }
end

Expand Down
13 changes: 10 additions & 3 deletions android_tests/lib/android/specs/common/patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@
end

t 'id success' do
wait do
el = id 'autocomplete_3_button_7' # <string name="autocomplete_3_button_7">Text</string>
el.name.must_equal 'Text'
if !automation_name_is_uiautomator2?
wait do
el = id 'autocomplete_3_button_7' # <string name="autocomplete_3_button_7">Text</string>
el.name.must_equal 'Text'
end
else
wait do
el = text 'text' # <string name="autocomplete_3_button_7">Text</string>
el.name.must_equal 'Text'
end
end
end

Expand Down

0 comments on commit 8e600af

Please sign in to comment.