Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # encoding: UTF-8
- module Actionwords
- def search_for_topic_article(topic)
- switch_to_native_context
- search = find_element :class_name, "android.widget.TextView"
- search.click
- search.send_keys topic
- @wait.until { @driver.text(topic).displayed? }
- end
- def navigate_to_first_suggestion
- text(1).click
- switch_to_webview_context
- @wait.until {@driver.find_element(:css, '.section_heading')}
- end
- def open_the_panel_label_panel(panel_label)
- switch_to_native_context
- toolbar = find_element :id, "main_toolbar"
- burger_menu = toolbar.find_element :class_name, "android.widget.ImageButton"
- burger_menu.click
- @wait.until { find_element(:id, "design_navigation_view") }
- nav_items = find_elements :id, "design_menu_item_text"
- nav_items.each do |nav_item|
- if nav_item.text == panel_label
- nav_item.click
- return
- end
- end
- end
- def the_history_list_contains_page_title_page_link_at_index_index(page_title, index)
- history_list = find_element :id, "history_entry_list"
- history_list_items = history_list.find_elements :id, "page_list_item_title"
- expect(history_list_items[index.to_i - 1].text).to eq page_title
- end
- def app_opened_as_unregistered_user
- switch_to_webview_context
- h2s = find_elements :tag_name, "h2"
- expect(h2s.first.text).to eq "Today's featured article"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement