Module: Navigation
- Defined in:
- lib/page_objects/modules/navigation.rb
Instance Method Summary collapse
- #get_domain_by_country ⇒ Object
- #get_home_domain_by_country ⇒ Object
- #go_activities_home ⇒ Object
- #go_home ⇒ Object
- #go_ticket_detail(trackingId) ⇒ Object
- #go_to_activities ⇒ Object
- #go_to_insurances_landing ⇒ Object
- #next_page ⇒ Object
- #next_page? ⇒ Boolean
- #on_url(url) ⇒ Object
- #prev_page ⇒ Object
Instance Method Details
#get_domain_by_country ⇒ Object
50 51 52 53 |
# File 'lib/page_objects/modules/navigation.rb', line 50 def get_domain_by_country !$DOMAIN.include?('decolar') ? (url = $DOMAIN + '/actividades/') : (url = $DOMAIN + '/atracoes-turisticas/') url end |
#get_home_domain_by_country ⇒ Object
55 56 57 58 |
# File 'lib/page_objects/modules/navigation.rb', line 55 def get_home_domain_by_country url = DOMAIN url end |
#go_activities_home ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/page_objects/modules/navigation.rb', line 11 def go_activities_home url = '' url = get_domain_by_country browser.goto(url) if !on_url(url) end |
#go_home ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/page_objects/modules/navigation.rb', line 3 def go_home url = '' url = get_home_domain_by_country browser.goto(url) if !on_url(url) end |
#go_ticket_detail(trackingId) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/page_objects/modules/navigation.rb', line 36 def go_ticket_detail(trackingId) url = '' url = get_domain_by_country + "/d-#{trackingId}" browser.goto(url) end |
#go_to_activities ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/page_objects/modules/navigation.rb', line 19 def go_to_activities date = (Time.now + 2629743).strftime('%Y-%m') destination = TO_CITY url = $DOMAIN + "/actividades/shopping#!/search/#{destination}/#{date}/1" browser.goto(url) end |
#go_to_insurances_landing ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/page_objects/modules/navigation.rb', line 28 def go_to_insurances_landing url = $DOMAIN + "/actividades/insurance" browser.goto(url) end |
#next_page ⇒ Object
60 61 62 |
# File 'lib/page_objects/modules/navigation.rb', line 60 def next_page browser.li(:class, 'next').click end |
#next_page? ⇒ Boolean
64 65 66 |
# File 'lib/page_objects/modules/navigation.rb', line 64 def next_page? browser.li(:class, 'next').present? and !browser.li(:class, 'next disabled').present? end |
#on_url(url) ⇒ Object
45 46 47 48 |
# File 'lib/page_objects/modules/navigation.rb', line 45 def on_url(url) entire_url = 'http://' + url.to_s browser.url.eql?("#{entire_url}") end |
#prev_page ⇒ Object
68 69 70 |
# File 'lib/page_objects/modules/navigation.rb', line 68 def prev_page browser.li(:class, 'prev').click unless @browser.li(:class, 'prev disabled').present? end |