Skip to content

Commit

Permalink
Merge pull request #114 from arthurspa/fixSearchContentDescCase
Browse files Browse the repository at this point in the history
Fix search content description case
  • Loading branch information
alexal1 committed Sep 24, 2020
2 parents 59d0471 + 3a00c9b commit c898806
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from src.utils import *

SEARCH_CONTENT_DESC = 'Search and Explore'
SEARCH_CONTENT_DESC_REGEX = '[Ss]earch and [Ee]xplore'


def navigate(device, tab):
Expand Down Expand Up @@ -78,7 +78,7 @@ def _navigate_to_search(device):
# "Home" tab and press search in the action bar.

tab_bar = device.find(resourceId='com.instagram.android:id/tab_bar', className='android.widget.LinearLayout')
search_in_tab_bar = tab_bar.child(description=SEARCH_CONTENT_DESC)
search_in_tab_bar = tab_bar.child(descriptionMatches=SEARCH_CONTENT_DESC_REGEX)
if search_in_tab_bar.exists():
# Two clicks to reset tab content
search_in_tab_bar.click()
Expand All @@ -89,7 +89,7 @@ def _navigate_to_search(device):
navigate(device, Tabs.HOME)
print("Press search in the action bar")
action_bar = device.find(resourceId='com.instagram.android:id/action_bar', className='android.widget.LinearLayout')
search_in_action_bar = action_bar.child(description=SEARCH_CONTENT_DESC)
search_in_action_bar = action_bar.child(descriptionMatches=SEARCH_CONTENT_DESC_REGEX)
if search_in_action_bar.exists():
# Two clicks to reset tab content
search_in_action_bar.click()
Expand Down

0 comments on commit c898806

Please sign in to comment.