flights_gui_henry_tests 1.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/Gemfile +3 -0
- data/features/data/home-offers-config.csv +883 -0
- data/features/data/host.yml +72 -0
- data/features/data/miles.yml +216 -0
- data/features/data/search.yml +27 -0
- data/features/data/sites.yml +39 -0
- data/features/data/tag_microsoft.yml +68 -0
- data/features/step_definitions/checkout/agencia_steps.rb +6 -0
- data/features/step_definitions/checkout/chat_steps.rb +43 -0
- data/features/step_definitions/checkout/checkout_steps.rb +144 -0
- data/features/step_definitions/checkout/cupones_steps.rb +26 -0
- data/features/step_definitions/checkout/error_messages.rb +251 -0
- data/features/step_definitions/checkout/seguros_steps.rb +78 -0
- data/features/step_definitions/checkout/thanks_steps.rb +75 -0
- data/features/step_definitions/content/contents_steps.rb +140 -0
- data/features/step_definitions/desambiguation/disambiguation_airports_steps.rb +73 -0
- data/features/step_definitions/desambiguation/disambiguation_city_steps.rb +43 -0
- data/features/step_definitions/filter/filters_airlines.rb +38 -0
- data/features/step_definitions/filter/filters_airports_steps.rb +31 -0
- data/features/step_definitions/filter/filters_price_steps.rb +87 -0
- data/features/step_definitions/filter/filters_stops_steps.rb +44 -0
- data/features/step_definitions/filter/filters_time_steps.rb +143 -0
- data/features/step_definitions/filter/matrix_steps.rb +249 -0
- data/features/step_definitions/landing/landing_checkout_steps.rb +45 -0
- data/features/step_definitions/landing/landing_filters_steps.rb +17 -0
- data/features/step_definitions/landing/landing_home_alerts_steps.rb +21 -0
- data/features/step_definitions/landing/landing_home_steps.rb +82 -0
- data/features/step_definitions/landing/landing_long_tail.rb +58 -0
- data/features/step_definitions/landing/landing_negative_steps.rb +127 -0
- data/features/step_definitions/landing/landing_passenger_review_steps.rb +8 -0
- data/features/step_definitions/landing/landing_steps.rb +325 -0
- data/features/step_definitions/orders/orders.rb +67 -0
- data/features/step_definitions/others/advancedgui_steps.rb +28 -0
- data/features/step_definitions/others/advancednogui_steps.rb +34 -0
- data/features/step_definitions/others/anticipatedsearch_steps.rb +13 -0
- data/features/step_definitions/others/flights_tracker_steps.rb +73 -0
- data/features/step_definitions/others/generic_steps.rb +35 -0
- data/features/step_definitions/others/newsletter_steps.rb +50 -0
- data/features/step_definitions/others/one_day_search.rb +58 -0
- data/features/step_definitions/others/print_steps.rb +26 -0
- data/features/step_definitions/others/querystringparameters_steps.rb +6 -0
- data/features/step_definitions/others/recommendation_steps.rb +80 -0
- data/features/step_definitions/others/render_steps.rb +70 -0
- data/features/step_definitions/others/tag_steps.rb +157 -0
- data/features/step_definitions/others/upgrade_bussines_steps.rb +27 -0
- data/features/step_definitions/results/load_steps.rb +69 -0
- data/features/step_definitions/results/results_steps.rb +21 -0
- data/features/step_definitions/results/search_steps.rb +82 -0
- data/features/step_definitions/search/alerts_steps.rb +132 -0
- data/features/step_definitions/search/basefare_steps.rb +64 -0
- data/features/step_definitions/search/bestprices_steps.rb +70 -0
- data/features/step_definitions/search/cross_sell_row_hoteles.rb +78 -0
- data/features/step_definitions/search/cross_sell_steps.rb +15 -0
- data/features/step_definitions/search/delays_steps.rb +67 -0
- data/features/step_definitions/search/details_steps.rb +9 -0
- data/features/step_definitions/search/ecoflights_steps.rb +9 -0
- data/features/step_definitions/search/fenix_steps.rb +119 -0
- data/features/step_definitions/search/flight_gui_steps.rb +312 -0
- data/features/step_definitions/search/miles_step.rb +13 -0
- data/features/step_definitions/search/pagination_steps.rb +41 -0
- data/features/step_definitions/search/reviews_step.rb +56 -0
- data/features/step_definitions/search/search_no_gui_steps.rb +185 -0
- data/features/step_definitions/search/wish_list_steps.rb +123 -0
- data/features/support/env.rb +61 -0
- data/features/support/lib/clusters/data/datos_new.rb +33 -0
- data/features/support/lib/clusters/details/details_cluster.rb +30 -0
- data/features/support/lib/clusters/results/landing_cluster.rb +29 -0
- data/features/support/lib/clusters/results/render_cluster.rb +43 -0
- data/features/support/lib/clusters/results_cluster.rb +140 -0
- data/features/support/lib/clusters.rb +5 -0
- data/features/support/lib/helpers/browser.rb +212 -0
- data/features/support/lib/helpers/checkout.rb +31 -0
- data/features/support/lib/helpers/clusters.rb +234 -0
- data/features/support/lib/helpers/landing.rb +117 -0
- data/features/support/lib/helpers/render.rb +135 -0
- data/features/support/lib/helpers.rb +5 -0
- data/features/support/lib/price.rb +66 -0
- data/features/support/lib/services/fenix.rb +14 -0
- data/features/support/lib/services/landing.rb +18 -0
- data/features/support/lib/services/results.rb +62 -0
- data/features/support/lib/services.rb +4 -0
- data/features/support/matchers.rb +120 -0
- data/features/support/redefinitions.rb +42 -0
- data/features/tests/checkout/agency.feature +33 -0
- data/features/tests/checkout/button_cac.feature +52 -0
- data/features/tests/checkout/chat.feature +20 -0
- data/features/tests/checkout/cupones.feature +54 -0
- data/features/tests/checkout/error_messages.feature +64 -0
- data/features/tests/checkout/integration.feature +215 -0
- data/features/tests/checkout/low_cost.feature +55 -0
- data/features/tests/checkout/seguros.feature +37 -0
- data/features/tests/contents/costs.feature +29 -0
- data/features/tests/contents/rules.feature +58 -0
- data/features/tests/contents/webcheckin.feature +26 -0
- data/features/tests/desambiguation/airports.feature +89 -0
- data/features/tests/desambiguation/city.feature +86 -0
- data/features/tests/filters/filters.feature +160 -0
- data/features/tests/fixes/advancedgui.feature +171 -0
- data/features/tests/fixes/advancednogui.feature +60 -0
- data/features/tests/fixes/book_no_gui.feature +21 -0
- data/features/tests/fixes/cross_sell_row_hoteles.feature +70 -0
- data/features/tests/fixes/facebook.feature +31 -0
- data/features/tests/fixes/landing_home_alerts.feature +82 -0
- data/features/tests/fixes/matrix_stops.feature +104 -0
- data/features/tests/fixes/one_day_search.feature +63 -0
- data/features/tests/fixes/print.feature +87 -0
- data/features/tests/fixes/searches_no_gui.feature +85 -0
- data/features/tests/landing/landing_alerts.feature +93 -0
- data/features/tests/landing/landing_checkout.feature +286 -0
- data/features/tests/landing/landing_filters.feature +176 -0
- data/features/tests/landing/landing_home.feature +68 -0
- data/features/tests/landing/landing_integration.feature +153 -0
- data/features/tests/landing/landing_long_tail.feature +162 -0
- data/features/tests/landing/landing_matrix.feature +156 -0
- data/features/tests/landing/landing_negative.feature +157 -0
- data/features/tests/landing/landing_orders.feature +107 -0
- data/features/tests/landing/landing_pagination.feature +142 -0
- data/features/tests/landing/landing_passenger_review.feature +139 -0
- data/features/tests/landing/landing_positive.feature +155 -0
- data/features/tests/landing/landing_reviews.feature +139 -0
- data/features/tests/landing/landing_tags.feature +148 -0
- data/features/tests/matrix/matrix_airlines.feature +104 -0
- data/features/tests/matrix/matrix_fare_chart.feature +24 -0
- data/features/tests/matrix/matrix_price.feature +35 -0
- data/features/tests/others/alerts.feature +89 -0
- data/features/tests/others/anticipatedsearch.feature +82 -0
- data/features/tests/others/flights_tracker.feature +94 -0
- data/features/tests/others/newsletter.feature +131 -0
- data/features/tests/others/querystringparameters.feature +82 -0
- data/features/tests/others/recommendation.feature +170 -0
- data/features/tests/others/semaphore.feature +206 -0
- data/features/tests/others/upgrade_bussines.feature +100 -0
- data/features/tests/search/basefare.feature +88 -0
- data/features/tests/search/itineraries.feature +85 -0
- data/features/tests/search/orders.feature +100 -0
- data/features/tests/search/pagination.feature +70 -0
- data/features/tests/search/reviews.feature +84 -0
- data/features/tests/search/searches.feature +197 -0
- data/features/tests/search/wish_list.feature +102 -0
- data/flights_gui_henry_tests.gemspec +32 -0
- data/henry-context.yml +14733 -0
- metadata +324 -0
|
@@ -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,80 @@
|
|
|
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.div(:class,'actions').div(:class,'icons').span(:class,'main-sprite icon-mail icon').click
|
|
8
|
+
sleep(1)
|
|
9
|
+
if BROWSER.li(:class,"item itinerary cluster-item itinerary-required itinerary-error").present?
|
|
10
|
+
puts "Hay mas de un itinerario. Se selecciona el primero"
|
|
11
|
+
BROWSER.label(:for,"0-outbound-0").li(:class,'radio').click
|
|
12
|
+
if BROWSER.div(:class,"sub-cluster inbound").present?
|
|
13
|
+
BROWSER.label(:for,"0-inbound-0").li(:class,'radio').click
|
|
14
|
+
end
|
|
15
|
+
BROWSER.div(:class,'actions').div(:class,'icons').span(:class,'main-sprite icon-mail icon').click
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
Then /^Verifico que cargue el contenido del popup$/ do
|
|
20
|
+
Watir::Wait.until{BROWSER.div(:class,"flights-popup").present?}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
When /^Hago click en el boton de enviar$/ do
|
|
24
|
+
BROWSER.div(:id,"popup-email").link(:class,'btn-send flights-send-button').click
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
Then /^Verifico que el nombre del remitente sea un campo obligatorio$/ do
|
|
28
|
+
BROWSER.div(:id,"popup-email").input(:class,"input sender-name flights-input error").should visible
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
Then /^Verifico que el mail del remitente sea un campo obligatorio$/ do
|
|
32
|
+
BROWSER.div(:id,"popup-email").input(:class,"input sender flights-input error").should visible
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
Then /^Verifico que el mail del destinatario sea un campo obligatorio$/ do
|
|
36
|
+
BROWSER.div(:id,"popup-email").input(:class,"input receiver flights-input error").should visible
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
Then /^Verifico que el mail del remitente tenga un formato valido$/ do
|
|
40
|
+
BROWSER.input(:class,"input sender flights-input error").present?.should be_true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Then /^Verifico que el mail del destinatario tenga un formato valido$/ do
|
|
44
|
+
BROWSER.input(:class,"input receiver flights-input error").present?.should be_true
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
Then /^Verifico que el asunto sea correcto "(.*)"$/ do |text|
|
|
48
|
+
BROWSER.input(:class,"input subject placeholder").placeholder.strip.should match(text)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
Then /^Verifico que el comentario por default sea correcto "(.*)"$/ do |text|
|
|
52
|
+
BROWSER.textarea(:class,"input message flights-input").value.strip.match(text).should be_true
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
When /^Completo el nombre del remitente "(.*)"$/ do |text|
|
|
56
|
+
BROWSER.text_field(:id,"sender-name").set(text)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
When /^Completo el mail del remitente "(.*)"$/ do |text|
|
|
60
|
+
BROWSER.text_field(:id,"sender").set(text)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
When /^Completo el mail del destinatario "(.*)"$/ do |text|
|
|
64
|
+
BROWSER.text_field(:id,"receiver").set(text)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
Then /^Verifico que se haya enviado correctamente el email$/ do
|
|
68
|
+
Watir::Wait.until{BROWSER.p(:class,"email-feedback").present?}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
Then /^Verifico que el texto de feedback este bien formado "(.*)"$/ do |text|
|
|
72
|
+
BROWSER.p(:class,"email-feedback").text.strip.should match(text)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
When /^Recorro el resto de los clusters$/ do
|
|
76
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
77
|
+
(doc/"div.cluster").each do |cluster|
|
|
78
|
+
(!(cluster/"span[@class='main-sprite icon-mail icon']").empty?).should be_true
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
When /^Elijo un itinerario y levanto los datos para ingresar al popup del tipo "(.*)"$/ do |type|
|
|
3
|
+
json = @search.get_results_search_service
|
|
4
|
+
@session_expired = [true,false][rand(2)]
|
|
5
|
+
url = @search.host()
|
|
6
|
+
@popup_url = case type
|
|
7
|
+
when /roundtrip/ then url = url + "/shop/flights/test/render/roundtrip/#{@search.path}/#{json['result']['metadata']['ticket']['hash']}/#{@session_expired ? -1 : json['result']['metadata']['ticket']['version']}/#{json['result']['items'][0]['itinerariesBox']['matchingInfoMap']['_0_0']['id']}"
|
|
8
|
+
when /oneway/ then url = url + "/shop/flights/test/render/oneway/#{@search.path}/#{json['result']['metadata']['ticket']['hash']}/#{@session_expired ? -1 : json['result']['metadata']['ticket']['version']}/#{json['result']['items'][0]['itinerariesBox']['matchingInfoMap']['_0_-1']['id']}"
|
|
9
|
+
when /multipledestinations/ then url = url + "/shop/flights/test/render/multipledestinations/#{@search.path}/#{json['result']['metadata']['ticket']['hash']}/#{@session_expired ? -1 : json['result']['metadata']['ticket']['version']}/#{json['result']['items'][0]['itinerary']['itineraryInfo']['id']}"
|
|
10
|
+
end
|
|
11
|
+
puts @popup_url
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
When /^Fuerzo la aparicion del popup de no disponibilidad$/ do
|
|
15
|
+
BROWSER.goto(@popup_url)
|
|
16
|
+
sleep(2)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
Then /^Espero que cargue el popup de no disponibilidad$/ do
|
|
20
|
+
Watir::Wait.until(timeout = 120){(BROWSER.div(:id,'render').present? and BROWSER.div(:class, 'clusters').present?)}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
Then /^Valido render "(.*)"$/ do |type|
|
|
24
|
+
validate_render(@popup_url,type)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
And /^Valido los items de render$/ do
|
|
28
|
+
@results = []
|
|
29
|
+
num = 0
|
|
30
|
+
page = 0
|
|
31
|
+
while true
|
|
32
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
33
|
+
(doc/"div.clusters//div.cluster").each do |ticket_tmp|
|
|
34
|
+
ticket = RenderCluster.new(@search.type,ticket_tmp)
|
|
35
|
+
@results << ticket
|
|
36
|
+
cluster_info = JSON.parse(ticket_tmp.attributes['data-cluster-info'])
|
|
37
|
+
validar_fechas(ticket,@search)
|
|
38
|
+
validar_destinos(ticket,@search,ticket_tmp)
|
|
39
|
+
unless ticket.tarifas['total'].empty?
|
|
40
|
+
ticket.validarSumaDesgloce
|
|
41
|
+
ticket.validarEcuacionTarifasPorCantidadDePasajeros(@search.adt)
|
|
42
|
+
ticket.validarResolucionAFIP
|
|
43
|
+
end
|
|
44
|
+
@session_expired ? validate_prices_session_expired(ticket) : validate_prices_without_session_expired(ticket)
|
|
45
|
+
validar_button(ticket_tmp)
|
|
46
|
+
num = num + 1
|
|
47
|
+
end
|
|
48
|
+
break if other_page(page)
|
|
49
|
+
page += 1
|
|
50
|
+
sleep(2)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
And /^Valido el orden de los cluster de render$/ do
|
|
55
|
+
first = @results.first
|
|
56
|
+
@results.each do |ticket|
|
|
57
|
+
if first.tarifas['total'].valor > ticket.tarifas['total'].valor
|
|
58
|
+
puts "El orden esta incorrecto, #{first.tarifas['total'].valor} < #{ticket.tarifas['total'].valor}"
|
|
59
|
+
end
|
|
60
|
+
first = ticket
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
And /^Valido el popup de mas detalles del primer cluster de render$/ do
|
|
65
|
+
begin
|
|
66
|
+
mostrar_mas_detalles_nr(@search)
|
|
67
|
+
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
|
68
|
+
puts "Rompio arreglar"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# encoding : utf-8
|
|
2
|
+
|
|
3
|
+
When /^Levanto los tag que deben mostrarse segun la ciudad buscada para landing$/ do
|
|
4
|
+
cities = YAML.load(File.open("features/data/tag_microsoft.yml"))
|
|
5
|
+
iata = BROWSER.url.match(/\/(...)\/(...)\//)[2].upcase
|
|
6
|
+
puts iata
|
|
7
|
+
@temp = cities[$SITE].select{|city| city['City']==iata}
|
|
8
|
+
if @temp.empty?
|
|
9
|
+
@temp = cities[$SITE].select{|city| city['City']=="DEF"}
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
When /^Levanto los tag que deben mostrarse segun la ciudad buscada para una busqueda "(.*)"$/ do |type|
|
|
14
|
+
cities = YAML.load(File.open("features/data/tag_microsoft.yml"))
|
|
15
|
+
if type == "multipledestinations"
|
|
16
|
+
to_city = @search.city_to_3.code
|
|
17
|
+
else
|
|
18
|
+
to_city = @search.city_to_1.code
|
|
19
|
+
end
|
|
20
|
+
puts to_city
|
|
21
|
+
@temp = cities[$SITE].select{|city| city['City']==to_city}
|
|
22
|
+
if @temp.empty?
|
|
23
|
+
@temp = cities[$SITE].select{|city| city['City']=="DEF"}
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
Then /^Verifico que se muestre en el codigo fuente$/ do
|
|
28
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
29
|
+
tag = (doc/"img").select{|img| img.attributes['src'].match(/view.atdmt.com/)}
|
|
30
|
+
tag.first.should be_true
|
|
31
|
+
(tag.length == 1).should be_true
|
|
32
|
+
puts @temp[0]["Tag"]
|
|
33
|
+
puts tag.first.attributes['src']
|
|
34
|
+
@temp[0]["Tag"].match(tag.first.attributes['src']).should be_true
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
Then /^el site es "(.*)"$/ do |sites|
|
|
38
|
+
$SITE.should match(sites)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
And /^Verifico el segundo tag de google en (resultado|home) de (landing|fgui|checkout)$/ do |page,product|
|
|
42
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
43
|
+
tag_script = (doc/"script[@type='text/javascript']").select{|script| script.inner_text.match(/google_custom_params/)}
|
|
44
|
+
tag_script.first.should be_true
|
|
45
|
+
(tag_script.length == 1).should be_true
|
|
46
|
+
vars = tag_script.first.inner_text.split(";")
|
|
47
|
+
vars.delete_at(-1)
|
|
48
|
+
tmp = Hash.new
|
|
49
|
+
vars.each do |option|
|
|
50
|
+
(tmp[option.strip.match(/var (.+) \= (.+)/)[1]]=option.gsub(/"|\n/,'').match(/var (.+) \= (.+)/)[2].to_s) unless option.strip.match("document.write")
|
|
51
|
+
end
|
|
52
|
+
tmp['google_conversion_id'].should match("\\d")
|
|
53
|
+
tmp['google_conversion_label'].should match("(.+)")
|
|
54
|
+
if product=="landing"
|
|
55
|
+
match = BROWSER.url.match(/\/(...)\/(...)\//)
|
|
56
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{$SITE}',CustomB: 'D',CustomC: '6',CustomD: '1',CustomE: '#{match[1].upcase}',CustomF: '#{match[2].upcase}'}")
|
|
57
|
+
elsif product=="fgui"
|
|
58
|
+
if @search.description == "oneway"
|
|
59
|
+
match = BROWSER.url.match(/\/(...)\/(...)\/(....\-..\-..)\//)
|
|
60
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{$SITE}',CustomB: 'D',CustomC: '2',CustomD: '1',CustomE: '#{match[1].upcase}',CustomF: '#{match[2].upcase}',CustomH: '.',CustomI: '.',CustomJ: '#{match[3].upcase}'}")
|
|
61
|
+
elsif @search.description == "roundtrip"
|
|
62
|
+
match = BROWSER.url.match(/\/(...)\/(...)\/(....\-..\-..)\/(....\-..\-..)/)
|
|
63
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{$SITE}',CustomB: 'D',CustomC: '2',CustomD: '1',CustomE: '#{match[1].upcase}',CustomF: '#{match[2].upcase}',CustomH: '.',CustomI: '.',CustomJ: '#{match[3].upcase}',CustomK: '#{match[4].upcase}'}")
|
|
64
|
+
end
|
|
65
|
+
else
|
|
66
|
+
if @search.description == "oneWay"
|
|
67
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{$SITE}',CustomB: 'D',CustomC: '5',CustomD: '1',CustomE: '#{@search.city_from_1.code}',CustomF: '#{@search.city_to_1.code}',CustomG: '.',CustomH: '.',CustomI: '.',CustomJ: '#{@search.date_from_1}',CustomO: '..'}")
|
|
68
|
+
elsif @search.description == "roundTrip"
|
|
69
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{$SITE}',CustomB: 'D',CustomC: '5',CustomD: '1',CustomE: '#{@search.city_from_1.code}',CustomF: '#{@search.city_to_1.code}',CustomG: '.',CustomH: '.',CustomI: '.',CustomJ: '#{@search.date_from_1}',CustomK: '....\-..\-..',CustomO: '..'}")
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
unless product=="checkout"
|
|
73
|
+
tmp['google_remarketing_only'].should match("true")
|
|
74
|
+
tag_noscript = (doc/"noscript").select{|script| script.inner_html.match(/googleads/)}[1]
|
|
75
|
+
tag_noscript.inner_html.gsub(/\n\r/,'').should match("(.+)\/\/googleads.g.doubleclick.net\/pagead\/viewthroughconversion\/#{tmp['google_conversion_id']}\/(.+)")
|
|
76
|
+
(doc/"script[@src='http://www.googleadservices.com/pagead/conversion.js']").should_not is_empty
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
And /^Verifico el primer tag de google en (resultado|home) de (landing|fgui)$/ do |page,product|
|
|
81
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
82
|
+
tag_script = (doc/"script[@type='text/javascript']").select{|script| script.inner_text.match(/google_conversion_language/)}
|
|
83
|
+
tag_script.first.should be_true
|
|
84
|
+
(tag_script.length == 1).should be_true
|
|
85
|
+
vars = tag_script.first.inner_text.split(";")
|
|
86
|
+
vars.delete_at(-1)
|
|
87
|
+
tmp = Hash.new
|
|
88
|
+
vars.each{|option| tmp[option.strip.match(/var (.+) \= (.+)/)[1]]=option.gsub(/"|\n/,'').match(/var (.+) \= (.+)/)[2].to_s }
|
|
89
|
+
tmp['google_conversion_id'].should match("\\d")
|
|
90
|
+
tmp['google_conversion_language'].should match("en")
|
|
91
|
+
tmp['google_conversion_format'].should match("3")
|
|
92
|
+
tmp['google_conversion_color'].should match("666666")
|
|
93
|
+
tmp['google_conversion_label'].should match(".+")
|
|
94
|
+
tmp['google_conversion_value'].should match(0)
|
|
95
|
+
tag_noscript = (doc/"noscript").select{|script| script.inner_html.match(/googleadservices/)}[0]
|
|
96
|
+
tag_noscript.inner_html.gsub(/\n\r/,'').should match("(.+)\/\/www.googleadservices.com\/pagead\/conversion\/#{tmp['google_conversion_id']}\/(.+)")
|
|
97
|
+
(doc/"script[@src='http://www.googleadservices.com/pagead/conversion.js']").should_not is_empty
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
And /^Verifico el tag de facebook$/ do
|
|
101
|
+
if $SITE.match("MX|CO|BR")
|
|
102
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
103
|
+
tag_script = (doc/"script[@type='text/javascript']").select{|script| script.inner_text.match(/fb_param/)}
|
|
104
|
+
tag_script.first.should be_true
|
|
105
|
+
(tag_script.length == 1).should be_true
|
|
106
|
+
tag_noscript = (doc/"noscript").select{|script| script.inner_html.match(/facebook/)}[0]
|
|
107
|
+
tag_noscript.inner_html.gsub(/\n\r/,'').should match('(.+)www.facebook.com\/offsite_event.php\?id\=(.+)')
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
And /^Verifico el tag de groovinads/ do
|
|
112
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
113
|
+
tag_groovinads = (doc/"img").select{|img| img.attributes['src'].match(/groovinads.com/)}
|
|
114
|
+
tag_groovinads.nil?.should_not be_true
|
|
115
|
+
(tag_groovinads.length == 1).should be_true
|
|
116
|
+
tag_groovinads.first.attributes['src'].strip.no_accents.gsub(/\n\r/,'').should match('http:\/\/ads01.groovinads.com\/grv\/track\/bhpx.os\?idc\=81\&sku\=\{SKU\}\&idcategory\=\{IDCATEGORY\}|http:\/\/ads01.groovinads.com\/grv\/track\/bhpx.os\?idc\=81&sku\=%7BSKU%7D&idcategory\=%7BIDCATEGORY%7D')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
And /^Verifico el logger en (resultado|home) de (landing|fgui)$/ do |page,product|
|
|
120
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
121
|
+
img = (doc/"img").select{|img| img.attributes['src'].match(/logger.asp/)}
|
|
122
|
+
img.nil?.should_not be_true
|
|
123
|
+
(img.length == 1).should be_true
|
|
124
|
+
img.first.attributes['src'].strip.no_accents.gsub(/\n\r/,'').should match("(.+)logger.asp.{1,3}pagina\=\/shop\/flights\/results\/#{@search.description}\/#{@search.path}(.+)")
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
And /^Verifico el tag de canonical$/ do
|
|
128
|
+
if @search.description == "roundtrip"
|
|
129
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
130
|
+
link = (doc/"link").select{|link| link.attributes['rel']=="canonical"}
|
|
131
|
+
link.first.attributes['href'].should match("#{@search.generate_url_landing_search(@search.city_from_1.code.downcase,@search.city_to_1.code.downcase)}/")
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
And /^Verifico el pixel de trackeame en checkout$/ do
|
|
136
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
137
|
+
pixel_trackeame = (doc/"img#PixelTrackeame").first
|
|
138
|
+
pixel_trackeame.nil?.should_not be_true
|
|
139
|
+
pixel_trackeame.attributes['src'].should match("fl=checkout&pr=flights&cc=#{$SITE}&exch=(.+)&pri=(.+)&cur=(#{currency($SITE)}|USD)&dn=Despegar")
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
And /^Verifico el pixel de trackeame en gracias$/ do
|
|
143
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
144
|
+
pixel_trackeame = (doc/"img#PixelTrackeame").first
|
|
145
|
+
pixel_trackeame.nil?.should_not be_true
|
|
146
|
+
pixel_trackeame.attributes['src'].should match("fl=thanks&idcro=#{@id_cro}&pr=flights&cc=#{$SITE}&exch=(.+)&pri=(.+)&cur=(#{currency($SITE)}|USD)&dn=Despegar")
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
And /^Verifico el pixel de e-planning$/ do
|
|
150
|
+
doc = Hpricot.parse(BROWSER.html)
|
|
151
|
+
tag_script = (doc/"script[@language='JavaScript']")
|
|
152
|
+
tag_script.first.inner_html.empty?.should_not be_true
|
|
153
|
+
(tag_script.length == 1).should be_true
|
|
154
|
+
tag_planning = (doc/"script").select{|script| script.inner_text.match(/planning/)}
|
|
155
|
+
tag_planning.first.inner_html.empty?.should_not be_true
|
|
156
|
+
(tag_planning.length >= 1).should be_true
|
|
157
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
When /^elijo la opcion de bussines y busco$/ do
|
|
3
|
+
BROWSER.checkbox(:id,'searchBusinessOnlyChkBox').set(true)
|
|
4
|
+
BROWSER.link(:class,'buttonSprite ctn-searchbutton').click
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
When /^busco resultados con la opcion de bussines$/ do
|
|
8
|
+
BROWSER.goto(BROWSER.url + @search.get_advanced_bussinnes)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
And /^Verifico que exista el banner de upgrade bussines$/ do
|
|
12
|
+
unless BROWSER.div(:id,'best-price-alert').div(:class,'secondary-message betterUpsellPriceButton').present?
|
|
13
|
+
BROWSER.div(:id,'best-price-alert').link(:class,'flights-best-price-button betterUpsellPriceButton').should visible
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
And /^Verifico que el banner redirija a la url correcta$/ do
|
|
18
|
+
if BROWSER.div(:id,'best-price-alert').div(:class,'secondary-message betterUpsellPriceButton').present?
|
|
19
|
+
puts BROWSER.div(:id,'best-price-alert').div(:class,'secondary-message betterUpsellPriceButton').href
|
|
20
|
+
puts "#{BROWSER.url}#{@search.advanced_bussinnes}"
|
|
21
|
+
(BROWSER.url + "#{@search.advanced_bussinnes}").should match(BROWSER.div(:id,'best-price-alert').div(:class,'secondary-message betterUpsellPriceButton').href)
|
|
22
|
+
else
|
|
23
|
+
puts BROWSER.link(:class,'flights-best-price-button betterUpsellPriceButton').href
|
|
24
|
+
puts "#{BROWSER.url}#{@search.advanced_bussinnes}"
|
|
25
|
+
(BROWSER.url + "#{@search.advanced_bussinnes}").should match(BROWSER.link(:class,'flights-best-price-button betterUpsellPriceButton').href)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
When /^Verifico el nuevo loader$/ do
|
|
3
|
+
puts " URL: #{BROWSER.url} "
|
|
4
|
+
if BROWSER.div(:id,'results-loader').present? and !@search.description.match(/multipledestinations/)
|
|
5
|
+
begin
|
|
6
|
+
Watir::Wait.until(timeout=25){BROWSER.div(:id,'results-loader').span(:class,'nibbler-iterated-text-description').exists? and !BROWSER.div(:id,'results-loader').span(:class,'nibbler-iterated-text-description').text.empty?}
|
|
7
|
+
text = BROWSER.div(:id,'results-loader').span(:class,'nibbler-iterated-text-description').text
|
|
8
|
+
unless text.empty?
|
|
9
|
+
unless text.no_accents.downcase.match("searching flights to #{@search.city_to_1.name($SITE).downcase} by|buscando vuelos hacia #{@search.city_to_1.name($SITE).downcase} por|procurando voos a #{@search.city_to_1.name($SITE).downcase} por")
|
|
10
|
+
airlines=@search.get_indec_airlines($ENV)
|
|
11
|
+
airlines.should is_empty
|
|
12
|
+
end
|
|
13
|
+
else
|
|
14
|
+
puts "Fallo la validacion en el loader con el texto de aerolineas"
|
|
15
|
+
end
|
|
16
|
+
text_hotels = BROWSER.div(:id,'results-loader').div(:class,'nibbler-second-text').text
|
|
17
|
+
unless text_hotels.empty?
|
|
18
|
+
text_hotels.no_accents.downcase.should match("hoteles en #{@search.city_to_1.name($SITE).downcase}|hotels in #{@search.city_to_1.name($SITE).downcase} , best price guaranteed|hoteles en #{@search.city_to_1.name($SITE).downcase} con el mejor precio garantizado|hoteis em #{@search.city_to_1.name($SITE).downcase} com o melhor preco garantido")
|
|
19
|
+
hotels_count = BROWSER.div(:id,'results-loader').text.gsub(/\D/,'')
|
|
20
|
+
hotels_count.to_i.should is_greater_than(0)
|
|
21
|
+
else
|
|
22
|
+
puts "Fallo la validacion en el loader con el texto de hoteles"
|
|
23
|
+
end
|
|
24
|
+
rescue Watir::Wait::TimeoutError
|
|
25
|
+
puts "Timeout loader!"
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
When /^Espero que termine de cargar$/ do
|
|
31
|
+
step "Verifico que la pagina no rompa"
|
|
32
|
+
begin
|
|
33
|
+
puts " URL: #{BROWSER.url} "
|
|
34
|
+
Watir::Wait.until(timeout = 120){!BROWSER.div(:id,'results-loader').present? and !BROWSER.div(:id,'results-update').present? and !BROWSER.div(:class,'results-update').present? and !BROWSER.div(:class,'update-message').present?}
|
|
35
|
+
rescue Timeout::Error, Watir::Wait::TimeoutError
|
|
36
|
+
puts "Timeout de resultados"
|
|
37
|
+
end
|
|
38
|
+
sleep(1)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
Then /^Verifico que resultados cargue correctamente$/ do
|
|
42
|
+
puts " URL: #{BROWSER.url} "
|
|
43
|
+
(BROWSER.div(:id,'results-error').present? or BROWSER.div(:id,'clusters').div(:class,'cluster flights-cluster').present?).should be_true
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
Then /^Verifico que traiga resultados$/ do
|
|
47
|
+
unless brought_results?(BROWSER)
|
|
48
|
+
json = @search.get_results_search_service
|
|
49
|
+
if json["result"]["data"]["metadata"]["status"]["code"].match("NO_RESULTS|SUCCEEDED")
|
|
50
|
+
pending("No se encontraron resultados")
|
|
51
|
+
else
|
|
52
|
+
json["result"]["data"]["metadata"]["status"]["code"].should equal("NO_RESULTS")
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
Then /^Verifico si trajo resultados$/ do
|
|
58
|
+
unless brought_results?(BROWSER)
|
|
59
|
+
raise("No trajo resultados")
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
Then /^Vuelvo a la pagina anterior$/ do
|
|
64
|
+
BROWSER.back
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
Then /^Refresco la pagina$/ do
|
|
68
|
+
BROWSER.refresh
|
|
69
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
And /^Verifico si se muestran los beneficios en resultados$/ do
|
|
3
|
+
if BROWSER.div(:class,'benefit-alert').present?
|
|
4
|
+
@benefits = true
|
|
5
|
+
BROWSER.div(:class,'benefit-alert').span(:class,'smile icon-smile main-sprite').should visible("icono smile")
|
|
6
|
+
BROWSER.div(:class,'benefit-alert').p(:class,'text').should visible("texto de beneficio")
|
|
7
|
+
BROWSER.div(:class,'benefit-alert').p(:class,'text').text.should match("\¡Con su compra obtenga (.*)\!")
|
|
8
|
+
@text_benefits = BROWSER.div(:class,'benefit-alert').p(:class,'text').text
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
And /^Verifico si se muestran los beneficios en checkout$/ do
|
|
13
|
+
if @benefits
|
|
14
|
+
BROWSER.div(:class,'benefit-alert').should visible("beneficios en checkout")
|
|
15
|
+
BROWSER.div(:class,'benefit-alert').span(:class,'smile icon-smile main-sprite').should visible("icono smile en checkout")
|
|
16
|
+
BROWSER.div(:class,'benefit-alert').p(:class,'text').should visible("texto de beneficio en checkout")
|
|
17
|
+
BROWSER.div(:class,'benefit-alert').p(:class,'text').text.should equal(@text_benefits)
|
|
18
|
+
else
|
|
19
|
+
BROWSER.div(:class,'benefit-alert').should_not visible("beneficios en checkout")
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
When /^Ingreso a la pagina de resultados de "(.*)" para una busqueda "(.*)"$/ do |site,type|
|
|
3
|
+
set_site(site)
|
|
4
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,"nil")
|
|
5
|
+
BROWSER.goto(@search.generate_url_results_search)
|
|
6
|
+
set_language(site)
|
|
7
|
+
set_cookies(BROWSER)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
When /^Ingreso a resultados que pase por "(.*)" en "(.*)" para una busqueda "(.*)" de tipo "(.*)"$/ do |site_url,site,type,cabotage|
|
|
11
|
+
set_site(site)
|
|
12
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
|
|
13
|
+
BROWSER.goto(@search.generate_url_results_search("",site_url))
|
|
14
|
+
set_language(site)
|
|
15
|
+
set_cookies(BROWSER)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
When /^Ingreso a la pagina de resultados en "(.*)" para una busqueda "(.*)" del tipo "(.*)"$/ do |site,type,cabotage|
|
|
19
|
+
set_site(site)
|
|
20
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
|
|
21
|
+
begin
|
|
22
|
+
BROWSER.goto(@search.generate_url_results_search)
|
|
23
|
+
rescue Timeout::Error
|
|
24
|
+
stop_browser(BROWSER)
|
|
25
|
+
end
|
|
26
|
+
set_language(site)
|
|
27
|
+
set_cookies(BROWSER)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
When /^Ingreso a la pagina de resultados en "(.*)" para una busqueda "(.*)" con origen "(.*)" y destino "(.*)" de tipo "(.*)"$/ do |site,type,from,to,cabotage|
|
|
31
|
+
set_site(site)
|
|
32
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage,{"from"=>from.upcase,"to"=>to.upcase})
|
|
33
|
+
begin
|
|
34
|
+
BROWSER.goto(@search.generate_url_results_search)
|
|
35
|
+
rescue Timeout::Error
|
|
36
|
+
stop_browser(BROWSER)
|
|
37
|
+
end
|
|
38
|
+
set_language(site)
|
|
39
|
+
set_cookies(BROWSER)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
When /^Ingreso a la pagina de resultados en "(.*)" para una busqueda "(.*)" que desambigue por "(.*)"$/ do |site,type,city|
|
|
43
|
+
set_site(site)
|
|
44
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,"true")
|
|
45
|
+
puts @search.generate_url_disambiguation_airports(city)
|
|
46
|
+
BROWSER.goto(@search.generate_url_disambiguation_airports(city))
|
|
47
|
+
set_language(site)
|
|
48
|
+
set_cookies(BROWSER)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
When /^Ingreso a la pagina de resultados en "(.*)" para una busqueda "(.*)" del tipo "(.*)" sin gui$/ do |site,type,cabotage|
|
|
52
|
+
set_site(site)
|
|
53
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
|
|
54
|
+
puts @search.generate_url_results_search
|
|
55
|
+
@get = HTTParty.get(@search.generate_url_results_search,:headers=>{"x-uow"=>"ROBOT"})
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
When /^Ingreso a la pagina de checkout de agencia en "(.*)" para una busqueda "(.*)" del tipo "(.*)"$/ do |site,type,cabotage|
|
|
59
|
+
set_site(site)
|
|
60
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
|
|
61
|
+
begin
|
|
62
|
+
puts @search.generate_url_checkout + "?agency=AG10560"
|
|
63
|
+
BROWSER.goto(@search.generate_url_checkout + "?agency=AG10560")
|
|
64
|
+
rescue
|
|
65
|
+
pending("No se encontraron resultados para la busqueda #{@search.generate_url_results_search}")
|
|
66
|
+
end
|
|
67
|
+
set_language(site)
|
|
68
|
+
set_cookies(BROWSER)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
When /^Ingreso a la pagina de checkout en "(.*)" para una busqueda "(.*)" del tipo "(.*)"$/ do |site,type,cabotage|
|
|
72
|
+
set_site(site)
|
|
73
|
+
@search = Class.const_get("MockSearch#{type.capitalize}").new(site,$ENV,cabotage)
|
|
74
|
+
begin
|
|
75
|
+
puts @search.generate_url_checkout
|
|
76
|
+
BROWSER.goto(@search.generate_url_checkout)
|
|
77
|
+
rescue
|
|
78
|
+
pending("No se encontraron resultados para la busqueda #{@search.generate_url_results_search}")
|
|
79
|
+
end
|
|
80
|
+
set_language(site)
|
|
81
|
+
set_cookies(BROWSER)
|
|
82
|
+
end
|