flights_gui_henry_tests_ds 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. data/Gemfile +3 -0
  2. data/features/data/home-offers-config.csv +883 -0
  3. data/features/data/host.yml +78 -0
  4. data/features/data/miles.yml +216 -0
  5. data/features/data/search.yml +27 -0
  6. data/features/data/sites.yml +49 -0
  7. data/features/data/sites.yml.orig +54 -0
  8. data/features/data/tag_microsoft.yml +68 -0
  9. data/features/step_definitions/checkout/agencia_steps.rb +6 -0
  10. data/features/step_definitions/checkout/cash_payment_steps.rb +70 -0
  11. data/features/step_definitions/checkout/chat_steps.rb +57 -0
  12. data/features/step_definitions/checkout/checkout_steps.rb +265 -0
  13. data/features/step_definitions/checkout/cupones_steps.rb +36 -0
  14. data/features/step_definitions/checkout/error_messages.rb +291 -0
  15. data/features/step_definitions/checkout/fast_checkout.rb +55 -0
  16. data/features/step_definitions/checkout/price_jump_steps.rb +70 -0
  17. data/features/step_definitions/checkout/seguros_steps.rb +79 -0
  18. data/features/step_definitions/checkout/thanks_steps.rb +81 -0
  19. data/features/step_definitions/content/contents_steps.rb +140 -0
  20. data/features/step_definitions/desambiguation/disambiguation_airports_steps.rb +82 -0
  21. data/features/step_definitions/desambiguation/disambiguation_city_steps.rb +53 -0
  22. data/features/step_definitions/filter/filters_airlines.rb +37 -0
  23. data/features/step_definitions/filter/filters_airports_steps.rb +31 -0
  24. data/features/step_definitions/filter/filters_price_steps.rb +91 -0
  25. data/features/step_definitions/filter/filters_stops_steps.rb +44 -0
  26. data/features/step_definitions/filter/filters_time_steps.rb +146 -0
  27. data/features/step_definitions/filter/matrix_steps.rb +276 -0
  28. data/features/step_definitions/landing/landing_checkout_steps.rb +49 -0
  29. data/features/step_definitions/landing/landing_filters_steps.rb +17 -0
  30. data/features/step_definitions/landing/landing_home_alerts_steps.rb +21 -0
  31. data/features/step_definitions/landing/landing_home_steps.rb +82 -0
  32. data/features/step_definitions/landing/landing_long_tail.rb +58 -0
  33. data/features/step_definitions/landing/landing_negative_steps.rb +128 -0
  34. data/features/step_definitions/landing/landing_passenger_review_steps.rb +8 -0
  35. data/features/step_definitions/landing/landing_steps.rb +348 -0
  36. data/features/step_definitions/orders/orders.rb +83 -0
  37. data/features/step_definitions/others/advancedgui_steps.rb +28 -0
  38. data/features/step_definitions/others/advancednogui_steps.rb +34 -0
  39. data/features/step_definitions/others/anticipatedsearch_steps.rb +13 -0
  40. data/features/step_definitions/others/cookies_steps.rb +40 -0
  41. data/features/step_definitions/others/flights_tracker_steps.rb +74 -0
  42. data/features/step_definitions/others/generic_steps.rb +33 -0
  43. data/features/step_definitions/others/newsletter_steps.rb +29 -0
  44. data/features/step_definitions/others/one_day_search.rb +58 -0
  45. data/features/step_definitions/others/print_steps.rb +26 -0
  46. data/features/step_definitions/others/querystringparameters_steps.rb +6 -0
  47. data/features/step_definitions/others/recommendation_steps.rb +78 -0
  48. data/features/step_definitions/others/render_steps.rb +70 -0
  49. data/features/step_definitions/others/tag_steps.rb +164 -0
  50. data/features/step_definitions/others/upgrade_bussines_steps.rb +27 -0
  51. data/features/step_definitions/results/devtools_steps.rb +10 -0
  52. data/features/step_definitions/results/itineraries_steps.rb +43 -0
  53. data/features/step_definitions/results/load_steps.rb +73 -0
  54. data/features/step_definitions/results/results_steps.rb +79 -0
  55. data/features/step_definitions/results/search_steps.rb +115 -0
  56. data/features/step_definitions/search/alerts_steps.rb +132 -0
  57. data/features/step_definitions/search/basefare_steps.rb +88 -0
  58. data/features/step_definitions/search/bestprices_steps.rb +70 -0
  59. data/features/step_definitions/search/cross_sell_row_hoteles.rb +52 -0
  60. data/features/step_definitions/search/cross_sell_steps.rb +15 -0
  61. data/features/step_definitions/search/delays_steps.rb +67 -0
  62. data/features/step_definitions/search/details_steps.rb +9 -0
  63. data/features/step_definitions/search/ecoflights_steps.rb +9 -0
  64. data/features/step_definitions/search/errors_steps.rb +24 -0
  65. data/features/step_definitions/search/fenix_steps.rb +99 -0
  66. data/features/step_definitions/search/flight_gui_steps.rb +376 -0
  67. data/features/step_definitions/search/miles_step.rb +13 -0
  68. data/features/step_definitions/search/pagination_steps.rb +29 -0
  69. data/features/step_definitions/search/reviews_step.rb +58 -0
  70. data/features/step_definitions/search/search_no_gui_steps.rb +185 -0
  71. data/features/step_definitions/search/wish_list_steps.rb +128 -0
  72. data/features/support/env.rb +86 -0
  73. data/features/support/lib/clusters.rb +6 -0
  74. data/features/support/lib/clusters/checkout_cluster.rb +111 -0
  75. data/features/support/lib/clusters/data/data.rb +33 -0
  76. data/features/support/lib/clusters/details/details_cluster.rb +36 -0
  77. data/features/support/lib/clusters/results/landing_cluster.rb +87 -0
  78. data/features/support/lib/clusters/results/render_cluster.rb +86 -0
  79. data/features/support/lib/clusters/results_cluster.rb +168 -0
  80. data/features/support/lib/helpers.rb +5 -0
  81. data/features/support/lib/helpers/browser.rb +235 -0
  82. data/features/support/lib/helpers/checkout.rb +29 -0
  83. data/features/support/lib/helpers/clusters.rb +166 -0
  84. data/features/support/lib/helpers/landing.rb +121 -0
  85. data/features/support/lib/helpers/render.rb +135 -0
  86. data/features/support/lib/price.rb +66 -0
  87. data/features/support/lib/process_manager.rb +104 -0
  88. data/features/support/lib/services.rb +4 -0
  89. data/features/support/lib/services/fenix.rb +14 -0
  90. data/features/support/lib/services/landing.rb +18 -0
  91. data/features/support/lib/services/results.rb +62 -0
  92. data/features/support/matchers.rb +120 -0
  93. data/features/support/redefinitions.rb +42 -0
  94. data/features/tests/checkout/agency.feature +27 -0
  95. data/features/tests/checkout/button_cac.feature +53 -0
  96. data/features/tests/checkout/cash_payment.feature +50 -0
  97. data/features/tests/checkout/compras_duplicadas.feature +95 -0
  98. data/features/tests/checkout/cupones.feature +34 -0
  99. data/features/tests/checkout/error_messages.feature +80 -0
  100. data/features/tests/checkout/fast_checkout.feature +82 -0
  101. data/features/tests/checkout/integration.feature +235 -0
  102. data/features/tests/checkout/low_cost.feature +62 -0
  103. data/features/tests/checkout/online_payment.feature +50 -0
  104. data/features/tests/checkout/price_jump.feature +103 -0
  105. data/features/tests/checkout/providers.feature +76 -0
  106. data/features/tests/checkout/seguros.feature +42 -0
  107. data/features/tests/contents/costs.feature +29 -0
  108. data/features/tests/contents/rules.feature +58 -0
  109. data/features/tests/contents/webcheckin.feature +26 -0
  110. data/features/tests/desambiguation/airports.feature +89 -0
  111. data/features/tests/desambiguation/airports_landing.feature +88 -0
  112. data/features/tests/desambiguation/city.feature +86 -0
  113. data/features/tests/filters/filters.feature +113 -0
  114. data/features/tests/fixes/advancedgui.feature +171 -0
  115. data/features/tests/fixes/advancednogui.feature +60 -0
  116. data/features/tests/fixes/book_no_gui.feature +21 -0
  117. data/features/tests/fixes/cross_sell_row_hoteles.feature +70 -0
  118. data/features/tests/fixes/facebook.feature +31 -0
  119. data/features/tests/fixes/landing_checkout.feature +286 -0
  120. data/features/tests/fixes/landing_home_alerts.feature +82 -0
  121. data/features/tests/fixes/matrix_stops.feature +104 -0
  122. data/features/tests/fixes/one_day_search.feature +63 -0
  123. data/features/tests/fixes/print.feature +87 -0
  124. data/features/tests/fixes/searches_no_gui.feature +85 -0
  125. data/features/tests/fixes/upgrade_bussines.feature +100 -0
  126. data/features/tests/landing/landing_alerts.feature +93 -0
  127. data/features/tests/landing/landing_filters.feature +171 -0
  128. data/features/tests/landing/landing_home.feature +68 -0
  129. data/features/tests/landing/landing_integration.feature +149 -0
  130. data/features/tests/landing/landing_long_tail.feature +169 -0
  131. data/features/tests/landing/landing_matrix.feature +152 -0
  132. data/features/tests/landing/landing_negative.feature +151 -0
  133. data/features/tests/landing/landing_orders.feature +79 -0
  134. data/features/tests/landing/landing_pagination.feature +141 -0
  135. data/features/tests/landing/landing_passenger_review.feature +135 -0
  136. data/features/tests/landing/landing_positive.feature +151 -0
  137. data/features/tests/landing/landing_reviews.feature +135 -0
  138. data/features/tests/landing/landing_sort.feature +140 -0
  139. data/features/tests/landing/landing_tags.feature +142 -0
  140. data/features/tests/matrix/matrix_airlines.feature +80 -0
  141. data/features/tests/matrix/matrix_fare_chart.feature +40 -0
  142. data/features/tests/matrix/matrix_price.feature +40 -0
  143. data/features/tests/others/alerts.feature +89 -0
  144. data/features/tests/others/anticipatedsearch.feature +82 -0
  145. data/features/tests/others/chat.feature +23 -0
  146. data/features/tests/others/flights_tracker.feature +94 -0
  147. data/features/tests/others/newsletter.feature +118 -0
  148. data/features/tests/others/querystringparameters.feature +82 -0
  149. data/features/tests/others/recommendation.feature +107 -0
  150. data/features/tests/others/semaphore.feature +206 -0
  151. data/features/tests/search/basefare.feature +89 -0
  152. data/features/tests/search/errors.feature +198 -0
  153. data/features/tests/search/itineraries.feature +92 -0
  154. data/features/tests/search/orders.feature +88 -0
  155. data/features/tests/search/pagination.feature +73 -0
  156. data/features/tests/search/reviews.feature +83 -0
  157. data/features/tests/search/searches.feature +214 -0
  158. data/features/tests/search/wish_list.feature +58 -0
  159. data/flights_gui_henry_tests.gemspec +32 -0
  160. data/henry-context.yml +17262 -0
  161. metadata +382 -0
@@ -0,0 +1,83 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Then /^Elijo ordenamiento "(.*)"$/ do |value|
3
+ begin
4
+ BROWSER.select_list(:id,'orderby').select_value(value)
5
+ rescue Timeout::Error
6
+ stop_browser(BROWSER)
7
+ end
8
+ # rescue Watir::Exception::NoValueFoundException
9
+ # puts "Elijo otro ordenamiento"
10
+ # begin
11
+ # BROWSER.select_list(:id,'orderby').select_value("FLIGHTCLASS_ASCENDING")
12
+ # rescue Timeout::Error
13
+ # stop_browser(BROWSER)
14
+ # end
15
+ # end
16
+ end
17
+
18
+ Then /^Levanto los datos de los clusters "(.*)"$/ do |type|
19
+ @clusters = []
20
+ i=0
21
+ doc = Hpricot.parse(BROWSER.div(:id,'clusters').html)
22
+ (doc/"div.cluster").each do |cluster|
23
+ itinerary = ResultsCluster.new(type,cluster)
24
+ i += 1
25
+ @clusters << itinerary
26
+ end
27
+ end
28
+
29
+ Then /^Verifico ordenamiento FARE_ASCENDING$/ do
30
+ after = @clusters.first.tarifas['tarifa_adulto']
31
+ @clusters.each do |cluster|
32
+ after.value.should_not is_greater_than(cluster.tarifas['tarifa_adulto'].value)
33
+ after = cluster.tarifas['tarifa_adulto']
34
+ end
35
+ end
36
+
37
+ Then /^Verifico ordenamiento FARE_DESCENDING$/ do
38
+ after = @clusters.first.tarifas['tarifa_adulto']
39
+ @clusters.each do |cluster|
40
+ after.value.should is_greater_equal_than(cluster.tarifas['tarifa_adulto'].value)
41
+ after = cluster.tarifas['tarifa_adulto']
42
+ end
43
+ end
44
+
45
+ Then /^Verifico ordenamiento STOPSCOUNT_DESCENDING$/ do
46
+ after = @clusters.first
47
+ @clusters.each do |cluster|
48
+ after.total_escalas.last.should is_greater_equal_than(cluster.total_escalas.first)
49
+ after = cluster
50
+ end
51
+ end
52
+
53
+ Then /^Verifico ordenamiento STOPSCOUNT_ASCENDING$/ do
54
+ after = @clusters.first
55
+ @clusters.each do |cluster|
56
+ after.total_escalas.last.should_not is_greater_than(cluster.total_escalas.last)
57
+ after = cluster
58
+ end
59
+ end
60
+
61
+ Then /^Verifico ordenamiento TOTALFARE_ASCENDING$/ do
62
+ after = @clusters.first.tarifas['total']
63
+ @clusters.each do |cluster|
64
+ after.value.should_not is_greater_than(cluster.tarifas['total'].value)
65
+ after = cluster.tarifas['total']
66
+ end
67
+ end
68
+
69
+ Then /^Verifico ordenamiento TOTALFARE_DESCENDING$/ do
70
+ after = @clusters.first.tarifas['total']
71
+ @clusters.each do |cluster|
72
+ after.value.should is_greater_equal_than(cluster.tarifas['total'].value)
73
+ after = cluster.tarifas['total']
74
+ end
75
+ end
76
+
77
+ Then /^Verifico ordenamiento DURATION_ASCENDING$/ do
78
+ after = @clusters.first.duracion
79
+ @clusters.each do |cluster|
80
+ after.should_not is_greater_than(cluster.duracion)
81
+ after = cluster.duracion
82
+ end
83
+ end
@@ -0,0 +1,28 @@
1
+ # -*- encoding : utf-8 -*-
2
+ When /^Especifico filtro "(.*)"$/ do |query|
3
+ begin
4
+ BROWSER.goto "#{@path}#{query}"
5
+ rescue Timeout::Error
6
+ begin Timeout::Error
7
+ BROWSER.goto "#{@path}#{query}"
8
+ rescue
9
+ sleep(5)
10
+ end
11
+ end
12
+ end
13
+
14
+ When /^Seteo path$/ do
15
+ @path = BROWSER.url
16
+ end
17
+
18
+ Then /^Espero que de la carga devuelva "(.*)"$/ do |expected_result|
19
+ BROWSER.text.should match(expected_result)
20
+ end
21
+
22
+ Then /^Verifico que el panel de opciones avanzadas este (cerrado|abierto)$/ do |status|
23
+ if status == "cerrado"
24
+ BROWSER.div(:class,"com-advancedlink").present?
25
+ else
26
+ BROWSER.div(:class,"com-advancedlink active").present?
27
+ end
28
+ end
@@ -0,0 +1,34 @@
1
+ # -*- encoding : utf-8 -*-
2
+ When /^Verifico las combinaciones de busqueda avanzada "(.*)"$/ do |tipo|
3
+ escala = ["0","1","2","3","4","5"][rand(6)]
4
+ clase = ["YC","C","F"][rand(3)]
5
+ horario_salida = ["00","01","02","03","04","05","06","07","08","09","10","11","12"][rand(13)]
6
+ horario_llegada = ["00","01","02","03","04","05","06","07","08","09","10","11","12"][rand(13)]
7
+ aerolineas = ["AA","JJ","AR"]
8
+ aerolinea = aerolineas[rand(aerolineas.length)]
9
+ options = [ [horario_salida,horario_llegada,clase,escala,aerolinea].collect{|option| [option,"NA"][rand(2)]},
10
+ [horario_salida,horario_llegada,clase,escala,aerolinea],
11
+ ["NA",horario_llegada,clase,escala,aerolinea],
12
+ [horario_salida,"NA",clase,escala,aerolinea],
13
+ [horario_salida,horario_llegada,"NA",escala,aerolinea],
14
+ [horario_salida,horario_llegada,clase,"NA",aerolinea],
15
+ [horario_salida,horario_llegada,clase,escala,"NA"]]
16
+ options.each do |option|
17
+ option.delete_at(1) if tipo.downcase.match(/oneway/)
18
+ respond = nil
19
+ begin
20
+ respond = HTTParty.get(%!#{@url_resultado}/#{option.join('/')}!,:headers=>{"x-uow"=>"ROBOT"})
21
+ rescue Errno::ECONNRESET
22
+ nil.should be_true
23
+ rescue Timeout::Error
24
+ nil.should be_true
25
+ end
26
+ respond.should be_true
27
+ respond.code.should equal(200)
28
+ end
29
+ end
30
+
31
+ When /^Especifico path "(.*)""(.*)""(.*)"$/ do |site,cabotage,type|
32
+ @search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
33
+ @url_resultado = @search.generate_url_results_search()
34
+ end
@@ -0,0 +1,13 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Then /^Verifico la busqueda anticipada "(.*)""(.*)""(.*)"$/ do |site,cabotage,type|
3
+ begin
4
+ @search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
5
+ respond = HTTParty.get(@search.generate_url_anticipated_search(),:headers=>{"x-uow"=>"ROBOT"})
6
+ rescue Errno::ECONNRESET
7
+ nil.should be_true
8
+ rescue Timeout::Error
9
+ nil.should be_true
10
+ end
11
+ respond.should be_true
12
+ respond.code.should equal(200)
13
+ end
@@ -0,0 +1,40 @@
1
+ # -*- encoding : utf-8 -*-
2
+ When /^Fuerzo la cookie de abztesting el valor "(.*)" al "(.*)"$/ do |name,value|
3
+ cookie = BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="abzTestingId"}.first
4
+ new_value = cookie[:value].gsub(/#{get_abtesting(name)}/,value)
5
+ delete_cookie("abzTestingId")
6
+ add_cookie("abzTestingId",new_value,{:expires => cookie[:expires],:domain=>cookie[:domain]})
7
+ end
8
+
9
+ When /^Fuerzo la cookie de newsletter al "(.*)"$/ do |value|
10
+ if BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="-#{@search.description.upcase}-#{@search.city_from_1.code.upcase}-#{@search.city_to_1.code.upcase}"}.first
11
+ tracker_id = BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="trackerid"}.first[:value]
12
+ end
13
+ cookie = BROWSER.cookies.to_a.select{|cookie| cookie[:name].match("#{@search.description.upcase}-#{@search.city_from_1.code.upcase}-#{@search.city_to_1.code.upcase}")}.first
14
+ BROWSER.cookies.to_a.each{|cookie| delete_cookie(cookie[:name]) if cookie[:name].match("#{@search.description.upcase}-#{@search.city_from_1.code.upcase}-#{@search.city_to_1.code.upcase}")}
15
+ add_cookie("#{tracker_id}#{cookie[:name]}",value.to_i,{:expires => cookie[:expires],:domain=>cookie[:domain]})
16
+ end
17
+
18
+ When /^Verifico que se creen las cookies$/ do
19
+ puts BROWSER.cookies.to_a.select{|cookie| cookie[:name].match("#{@search.description.upcase}-#{@search.city_from_1.code.upcase}-#{@search.city_to_1.code.upcase}")}
20
+ puts BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="abzTestingId"}
21
+ puts BROWSER.cookies.to_a.select{|cookie| cookie[:name]=="trackerid"}
22
+ end
23
+
24
+ And /^Modifico la cookie trackerid con valor "(.*)"$/ do |value|
25
+ cookie = get_cookie("trackerid")
26
+ delete_cookie("trackerid")
27
+ add_cookie("trackerid","#{value}#{rand(5)}#{rand(10)}#{rand(3)}#{rand(8)}#{rand(9)}",{:expires => cookie[:expires],:domain=>cookie[:domain]})
28
+ end
29
+
30
+ And /^Verifico que se cree la cookie "(.+)" con valor "(.+)"$/ do |name,value|
31
+ cookie = get_cookie(name)
32
+ cookie.should be_true
33
+ cookie[:value].should equal(value)
34
+ end
35
+
36
+ And /^Elimino la cookie de cross sell row hoteles$/ do
37
+ if get_cookie("crossSellRow")
38
+ delete_cookie("crossSellRow")
39
+ end
40
+ end
@@ -0,0 +1,74 @@
1
+ Then /^Ingreso a la pagina de trackeo de vuelos "(.*)"$/ do |site|
2
+ set_site(site)
3
+ @search = MockSearchRoundtrip.new($SITE,$ENV,"nil")
4
+ puts @search.host + "/flights/tracker/"
5
+ BROWSER.goto(@search.host + "/flights/tracker/")
6
+ #BROWSER.div(:class,'flight-tracker-alert').links[0].click
7
+ end
8
+ Then /^Espero que termine de cargar la pagina de trackeo de vuelos$/ do
9
+ Watir::Wait.until(timeout=20){BROWSER.image(:class,'flight-tracker-banner').present?}
10
+ end
11
+ Then /^Verifico que se encuentren los elementos de la pagina de trackeo de vuelos$/ do
12
+ doc = Hpricot.parse(BROWSER.html)
13
+ (doc/"div#searchContainer").length.should equal(1)
14
+ (doc/"div#searchContainer div#flights-tracker-searchbox").length.should equal(1)
15
+ (doc/"div#searchContainer div#flights-tracker-searchbox").length.should equal(1)
16
+ (doc/"div#searchContainer div#flights-tracker-searchbox input#airline").length.should equal(1)
17
+ (doc/"div#searchContainer div#flights-tracker-searchbox input#flightNumber").length.should equal(1)
18
+ (doc/"div#searchContainer div#flights-tracker-searchbox input#no-flight-number-checkbox").length.should equal(1)
19
+ (doc/"div#searchContainer div#flights-tracker-searchbox input[@name='flight-date']").length.should equal(3)
20
+ (doc/"div#searchContainer div#flights-tracker-searchbox a.flights-search-button").length.should equal(1)
21
+ (doc/"div#searchContainer div#flights-tracker-searchbox input#flight-tracker-origin-city").length.should equal(1)
22
+ (doc/"div#searchContainer div#flights-tracker-searchbox input#flight-tracker-destiny-city").length.should equal(1)
23
+ (doc/"div#searchContainer div#flights-tracker-searchbox select#flight-tracker-hours").length.should equal(1)
24
+ end
25
+ Then /^Ingreso aerolinea$/ do
26
+ @caja = BROWSER.div(:id,'flights-tracker-searchbox')
27
+ @caja.text_field(:id,'airline').set("austral")
28
+ sleep(0.5)
29
+ BROWSER.send_keys :enter
30
+ end
31
+ Then /^Ingreso numero de vuelo "(.*)"$/ do |nro|
32
+ @flight_number = nro
33
+ @caja.text_field(:id,'flightNumber').set(@flight_number)
34
+ end
35
+ Then /^Ingreso fecha de partida "(.*)"$/ do |fecha|
36
+ @caja.radio(:value,fecha).set()
37
+ end
38
+ Then /^Selecciono buscar$/ do
39
+ @caja.link(:class,"flights-search-button").click
40
+ sleep(0.5)
41
+ end
42
+ Then /^Espero que termine de cargar el vuelo trackeado$/ do
43
+ Watir::Wait.until(timeout=30){!BROWSER.div(:class,"flight-tracker-loader-content").present?}
44
+ end
45
+ Then /^Verifico que no encuentre resultados de trackeo$/ do
46
+ BROWSER.div(:id,'results-error').should visible("no se encontraron resultados")
47
+ end
48
+ Then /^Verifico que encuentre resultados de trackeo$/ do
49
+ BROWSER.div(:id,'results-error').should_not visible("no se encontraron resultados")
50
+ BROWSER.div(:id,'flight-info').should visible("informacion del vuelo")
51
+ end
52
+ Then /^Verifico que los datos de trackeo sean correctos$/ do
53
+ doc=Hpricot.parse(BROWSER.div(:id,'flight-info').html)
54
+ (doc/"span.flight-info-number").inner_text.should equal("AU #{@flight_number}")
55
+ (doc/"div.airport-info-outbound div.airport-info-description").inner_text.should match('Aeroporto Buenos Aires Ministro Pistarini Ezeiza \(EZE\) \- Buenos Aires|Aeropuerto Buenos Aires Ministro Pistarini Ezeiza \(EZE\) \- Buenos Aires|Buenos Aires Ministro Pistarini Ezeiza Airport \(EZE\) \- Buenos Aires')
56
+ (doc/"div.airport-info-inbound div.airport-info-description").inner_text.should match('Arturo Merino Benitez Airport \(SCL\) \- Santiago de Chile|Aeropuerto Arturo Merino Benitez \(SCL\) \- Santiago de Chile|Aeroporto Arturo Merino Benitez \(SCL\) \- Santiago')
57
+ (doc/"span.flight-info-airline-name").inner_text.no_accents.should equal("Austral")
58
+ end
59
+ Then /^Elijo no se el numero de vuelo$/ do
60
+ BROWSER.checkbox(:id,"no-flight-number-checkbox").set(true)
61
+ end
62
+ Then /^Elijo origen$/ do
63
+ @caja.text_field(:id,'flight-tracker-origin-city').set("ezeiza")
64
+ sleep(0.5)
65
+ BROWSER.send_keys :enter
66
+ end
67
+ Then /^Elijo destino$/ do
68
+ @caja.text_field(:id,'flight-tracker-destiny-city').set("santiago")
69
+ sleep(0.5)
70
+ BROWSER.send_keys :enter
71
+ end
72
+ Then /^Elijo horario de partida "(.*)"/ do |horario|
73
+ @caja.select_list(:id,'flight-tracker-hours').select_value(horario)
74
+ end
@@ -0,0 +1,33 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Before do |scenario|
3
+ @validaciones = []
4
+ end
5
+
6
+ After do |scenario|
7
+ if $henry_params['browser']
8
+ if scenario.failed?
9
+ FileUtils.mkdir_p(Henry::Environment.output_path+"/reports/html/screenshots/")
10
+ name = "FAILED_#{scenario.name.gsub(' ','').gsub(/[^0-9A-Za-z]/, '')}.png"
11
+ screenshot = "#{Henry::Environment.output_path}/reports/html/screenshots/#{name}"
12
+ BROWSER.driver.save_screenshot(screenshot)
13
+ embed "./screenshots/#{name}", 'image/png'
14
+ end
15
+ end
16
+ end
17
+
18
+ at_exit do
19
+ BROWSER.close
20
+ ProcessManager.kill_all_childs(Process.pid)
21
+ end
22
+
23
+ When /^Si (.*), (.*)$/ do |condition, paso |
24
+ doit = true
25
+ begin
26
+ step condition
27
+ rescue RSpec::Expectations::ExpectationNotMetError => e
28
+ doit = false
29
+ end
30
+ if doit
31
+ step paso
32
+ end
33
+ end
@@ -0,0 +1,29 @@
1
+ # -*- encoding : utf-8 -*-
2
+ When /^Verifico los textos del popup grande de newsletter$/ do
3
+ BROWSER.div(:id,'flights-alerts-popup').p(:class,'nibbler-advice').text.no_accents.should match('Can\’t find the price you are looking for\? Create a flight price alert and receive the best deals in your e\-mail|\¿No encuentra el precio que busca\? Reciba las mejores ofertas en su e-mail|Nao encontra o preco que deseja\? Crie seu aviso personalizado e receba as melhores ofertas no seu e-mail')
4
+ end
5
+
6
+ When /^Verifico que cargue el popup chico de newsletter$/ do
7
+ Watir::Wait.until(timeout=10){BROWSER.div(:id,'create-alert-popup').present?}
8
+ BROWSER.div(:id,'create-alert-popup').should visible("popup chico de newsletter")
9
+ end
10
+
11
+ When /^Verifico los textos del popup chico de newsletter$/ do
12
+ BROWSER.div(:id,'create-alert-popup').div(:class,'popup-header').text.no_accents.should match('Can\’t find what you are looking for\?|\¿No encuentra lo que busca\?|Nao encontrou o que deseja\?')
13
+ BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').link(:class,'create-alert-button flights-best-price-button').should visible("link de crear alerta personalizada")
14
+ BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').link(:class,'cancel-button').should visible("link de cancelar alerta personalizada")
15
+ end
16
+
17
+ When /^Elijo crear alerta personalizada$/ do
18
+ BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').link(:class,'create-alert-button flights-best-price-button').click
19
+ end
20
+
21
+ When /^No elijo crear alerta personalizada$/ do
22
+ BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').link(:class,'cancel-button').click
23
+ end
24
+
25
+ When /^Verifico que no cargue el popup de newsletter$/ do
26
+ sleep(2)
27
+ BROWSER.div(:id,'flights-alerts-popup').p(:class,'nibbler-advice').should_not visible("popup grande de newsletter")
28
+ BROWSER.div(:id,'create-alert-popup').div(:id,'create-alert-popup-content').should_not visible("popup chico de newsletter")
29
+ end
@@ -0,0 +1,58 @@
1
+ # -*- encoding : utf-8 -*-
2
+ When /^genero los datos para realizar una busqueda en "(.*)"$/ do |site|
3
+ set_site(site)
4
+ @search = MockSearchRoundtrip.new(site,$ENV,"nil")
5
+ end
6
+
7
+ When /^ingreso a la home de "(.*)"$/ do |site|
8
+ BROWSER.goto(@search.host)
9
+ set_cookies(BROWSER)
10
+ end
11
+
12
+ Then /^realizo la busqueda para mañana$/ do
13
+ BROWSER.li(:class,/tab-flights/).click
14
+ sleep(0.5)
15
+ BROWSER.checkbox(:id,'sb-oneway').set
16
+ BROWSER.text_field(:id,'sb-origin-flights').set($SITE=~/MX|UY/ ? "RIO" : @search.city_from_1.code)
17
+ sleep(0.5)
18
+ BROWSER.send_keys :enter
19
+ BROWSER.text_field(:id,'sb-destination-flights').set($SITE=="AR" ? "MIA" : "BUE")
20
+ sleep(0.5)
21
+ BROWSER.send_keys :enter
22
+ BROWSER.text_field(:id,'sb-datein-flights').click
23
+ if !(BROWSER.div(:id,'sb-datein-flights-datepicker').div(:class,'calendar first').span(:class,"in day-#{(Date.today+1).strftime('%-d')} disabled").present? or BROWSER.div(:id,'sb-datein-flights-datepicker').div(:class,'calendar first').span(:class,"in day-#{(Date.today+1).strftime('%-d')} weekend disabled").present?)
24
+ BROWSER.div(:id,'sb-datein-flights-datepicker').div(:class,'calendar first').span(:class,"in day-#{(Date.today+1).strftime('%-d')}").click
25
+ else
26
+ puts "deshabilitado"
27
+ @habilitado = nil
28
+ @disabled = true
29
+ #BROWSER.div(:id,'sb-datein-flights-datepicker').div(:class,'calendar last').div(:class,'next').span(:class,'nextArrow').click
30
+ #BROWSER.div(:id,'sb-datein-flights-datepicker').div(:class,'calendar first').span(:class,"in day-#{(Date.today+1).strftime('%-d')}").click
31
+ end
32
+ BROWSER.div(:id,'sb-datein-flights-datepicker').div(:class,'commonSprite closePopUp closeBlueIcon').click
33
+ sleep(0.5)
34
+ if $SITE=="VE"
35
+ BROWSER.div(:class,"pdt-flights").div(:class,'com-searchbutton').link(:class,'ctn-searchbutton').click
36
+ else
37
+ BROWSER.div(:class,"pdt-flights fh").div(:class,'com-searchbutton').link(:class,'ctn-searchbutton').click
38
+ end
39
+ end
40
+
41
+ Then /^Espero salir de home$/ do
42
+ Watir::Wait.until(timeout=15){BROWSER.span(:class,'search-info').present?}
43
+ end
44
+
45
+ Then /^esta habilitado$/ do
46
+ @disabled.should_not be_true
47
+ end
48
+
49
+ And /^Verifico si se puede comprar o no$/ do
50
+ @habilitado = !BROWSER.div(:id,'results-error').text.match(/es una fecha demasiado cercana para comprar en nuestro sitio web|uma data muito pr.{1,2}xima ao embarque para voc.{1,2} comprar sua passagem em nosso website/)
51
+ puts @habilitado
52
+ end
53
+
54
+ And /^guardo los resultados en un archivo$/ do
55
+ file = File.open("data.txt","a+")
56
+ file.puts "#{$SITE} (#{Time.now.strftime('%H:%M')}) [#{Date.today} -> #{Date.today+1}] #{@habilitado ? 'Habilitado' : 'No habilitado'}"
57
+ file.close
58
+ end
@@ -0,0 +1,26 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Then /^elijo un ticket "(.*)"$/ do |type|
3
+ doc = Hpricot.parse(BROWSER.div(:id,'clusters').div(:class,/cluster/).html)
4
+ @ticket = ResultsCluster.new(type,doc)
5
+ end
6
+
7
+ Then /^verifico que exista el icono de impresion$/ do
8
+ BROWSER.div(:id,'clusters').divs(:class,'cluster flights-cluster oldCluster').each do |cluster|
9
+ cluster.link(:class,'main-sprite icon-print icon').should visible("No se mostro el icono de impresion")
10
+ end
11
+ end
12
+
13
+ Then /^abro el popup de impresion$/ do
14
+ #BROWSER.div(:id,'clusters').div(:class,/cluster/).link(:class,'main-sprite icon-print icon').click
15
+ # attach_browser(BROWSER, :title, "Imprimir")
16
+ # sleep(1)
17
+ # errores_http(BROWSER)
18
+ # BROWSER.div(:id,'clusters').divs(:class,/cluster flights-cluster/).length.should_not is_greater_than(1)
19
+ # attach_browser(BROWSER, :url, ($SITE=="BR") ? "decolar" : "despegar")
20
+ end
21
+
22
+ Then /^verifico que los datos sean correctos$/ do
23
+ end
24
+
25
+ Then /^envio a imprimir$/ do
26
+ end
@@ -0,0 +1,6 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Then /^Verifico que se propaguen los parametros "(.*)""(.*)""(.*)"$/ do |site,cabotage,type|
3
+ @search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
4
+ BROWSER.goto(@search.generate_url_results_search("?params=1"))
5
+ BROWSER.url.should equal(@search.generate_url_results_search("?params=1").gsub(/search/,'results'))
6
+ end
@@ -0,0 +1,78 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Then /^Verifico que exista el icono de enviar recomendacion$/ do
3
+ BROWSER.div(:class,'actions').div(:class,'icons').span(:class,'main-sprite icon-mail icon').should visible
4
+ end
5
+
6
+ When /^Hago click en el icono de enviar recomendacion$/ do
7
+ BROWSER.radio(:id,"0-outbound-0").click if BROWSER.radio(:id,"0-outbound-0").present?
8
+ if BROWSER.radio(:id,"0-inbound-0").present?
9
+ BROWSER.radio(:id,"0-inbound-0").click
10
+ end
11
+ BROWSER.div(:class,'actions').div(:class,'icons').span(:class,'main-sprite icon-mail icon').click
12
+ end
13
+
14
+ Then /^Verifico que cargue el contenido del popup$/ do
15
+ Watir::Wait.until{BROWSER.div(:class,"flights-popup").present?}
16
+ end
17
+
18
+ When /^Hago click en el boton de enviar$/ do
19
+ #BROWSER.div(:id,"popup-email").link(:class,'btn-send flights-send-button').click
20
+ sleep(1)
21
+ BROWSER.execute_script("javascript:void($('#popup-email .flights-send-button').click());")
22
+ sleep(2)
23
+ end
24
+
25
+ Then /^Verifico que el nombre del remitente sea un campo obligatorio$/ do
26
+ BROWSER.div(:id,"popup-email").input(:class,"input sender-name flights-input error").should visible
27
+ end
28
+
29
+ Then /^Verifico que el mail del remitente sea un campo obligatorio$/ do
30
+ BROWSER.div(:id,"popup-email").input(:class,"input sender flights-input error").should visible
31
+ end
32
+
33
+ Then /^Verifico que el mail del destinatario sea un campo obligatorio$/ do
34
+ BROWSER.div(:id,"popup-email").input(:class,"input receiver flights-input error").should visible
35
+ end
36
+
37
+ Then /^Verifico que el mail del remitente tenga un formato valido$/ do
38
+ BROWSER.input(:class,"input sender flights-input error").present?.should be_true
39
+ end
40
+
41
+ Then /^Verifico que el mail del destinatario tenga un formato valido$/ do
42
+ BROWSER.input(:class,"input receiver flights-input error").present?.should be_true
43
+ end
44
+
45
+ Then /^Verifico que el asunto sea correcto "(.*)"$/ do |text|
46
+ BROWSER.input(:class,"input subject placeholder").placeholder.strip.should match(text)
47
+ end
48
+
49
+ Then /^Verifico que el comentario por default sea correcto "(.*)"$/ do |text|
50
+ BROWSER.textarea(:class,"input message flights-input").value.strip.match(text).should be_true
51
+ end
52
+
53
+ When /^Completo el nombre del remitente "(.*)"$/ do |text|
54
+ BROWSER.text_field(:id,"sender-name").set(text)
55
+ end
56
+
57
+ When /^Completo el mail del remitente "(.*)"$/ do |text|
58
+ BROWSER.text_field(:id,"sender").set(text)
59
+ end
60
+
61
+ When /^Completo el mail del destinatario "(.*)"$/ do |text|
62
+ BROWSER.text_field(:id,"receiver").set(text)
63
+ end
64
+
65
+ Then /^Verifico que se haya enviado correctamente el email$/ do
66
+ Watir::Wait.until{BROWSER.p(:class,"email-feedback").present?}
67
+ end
68
+
69
+ Then /^Verifico que el texto de feedback este bien formado "(.*)"$/ do |text|
70
+ BROWSER.p(:class,"email-feedback").text.strip.should match(text)
71
+ end
72
+
73
+ When /^Recorro el resto de los clusters$/ do
74
+ doc = Hpricot.parse(BROWSER.html)
75
+ (doc/"div.cluster").each do |cluster|
76
+ (!(cluster/"span[@class='main-sprite icon-mail icon cluster-actions-icon']").empty?).should be_true
77
+ end
78
+ end