flights_gui_tests 0.0.1 → 0.0.2
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 +4 -4
- data/features/data/miles.yml +5 -5
- data/features/step_definitions/checkout/cash_payment_steps.rb +57 -0
- data/features/step_definitions/checkout/checkout_steps.rb +48 -5
- data/features/step_definitions/checkout/compra_duplicada_steps.rb +27 -0
- data/features/step_definitions/checkout/cupones_steps.rb +35 -0
- data/features/step_definitions/checkout/error_messages_steps.rb +245 -0
- data/features/step_definitions/checkout/fast_checkout_steps.rb +51 -0
- data/features/step_definitions/checkout/form_steps.rb +1 -1
- data/features/step_definitions/checkout/load_steps.rb +14 -1
- data/features/step_definitions/checkout/price_jump_steps.rb +67 -0
- data/features/step_definitions/checkout/upselling_steps.rb +55 -0
- data/features/step_definitions/checkout/verifications_steps.rb +36 -0
- data/features/step_definitions/{results/desambiguation_steps.rb → desambiguation_steps.rb} +10 -8
- data/features/step_definitions/landing/landing_steps.rb +51 -4
- data/features/step_definitions/landing/load_steps.rb +8 -0
- data/features/step_definitions/landing/long_tail_steps.rb +48 -0
- data/features/step_definitions/landing/negative_steps.rb +109 -0
- data/features/step_definitions/page_steps.rb +4 -0
- data/features/step_definitions/results/filters_steps.rb +15 -7
- data/features/step_definitions/results/load_steps.rb +14 -0
- data/features/step_definitions/results/matrix_steps.rb +22 -0
- data/features/step_definitions/results/results_steps.rb +1 -1
- data/features/step_definitions/{results/tags_steps.rb → tags_steps.rb} +93 -1
- data/features/step_definitions/thanks/load_steps.rb +9 -2
- data/features/step_definitions/thanks/thanks_steps.rb +44 -7
- data/features/support/classes/clusters/checkout_cluster.rb +9 -4
- data/features/support/env.rb +2 -0
- data/features/support/modules/checkout/datos_de_facturacion.rb +13 -17
- data/features/support/modules/checkout/errores.rb +35 -0
- data/features/support/modules/checkout/fast_checkout.rb +31 -0
- data/features/support/modules/checkout/pasajeros.rb +1 -0
- data/features/support/modules/checkout/tarjeta.rb +83 -0
- data/features/support/modules/results/filters.rb +1 -1
- data/features/support/modules/results/matrix/matrix_airline.rb +4 -0
- data/features/support/pages/all_pages.rb +20 -14
- data/features/support/pages/checkout/checkout_page.rb +59 -4
- data/features/support/pages/checkout/popup_results_page.rb +5 -3
- data/features/support/pages/landing/search_page.rb +21 -2
- data/features/support/pages/results/desambiguation_airports_page.rb +8 -2
- data/features/support/pages/results/search_page.rb +8 -3
- data/features/support/pages/thanks/thanks_page.rb +28 -0
- data/features/tests/checkout/agency.feature +35 -0
- data/features/tests/checkout/book_ok.feature +9 -1
- data/features/tests/checkout/cac.feature +56 -0
- data/features/tests/checkout/cash_payment.feature +55 -0
- data/features/tests/checkout/compras_duplicadas.feature +97 -0
- data/features/tests/checkout/cupones.feature +37 -0
- data/features/tests/checkout/error_messages.feature +84 -0
- data/features/tests/checkout/fast_checkout.feature +80 -0
- data/features/tests/checkout/low_cost.feature +52 -0
- data/features/tests/checkout/online_payment.feature +55 -0
- data/features/tests/checkout/price_jump.feature +107 -0
- data/features/tests/checkout/providers.feature +59 -0
- data/features/tests/checkout/seguros.feature +46 -0
- data/features/tests/flights_tracker/search.feature +1 -1
- data/features/tests/landing/disambiguation_airports.feature +88 -0
- data/features/tests/landing/filters.feature +88 -0
- data/features/tests/landing/integration.feature +148 -0
- data/features/tests/landing/long_tail.feature +171 -0
- data/features/tests/landing/matrix.feature +154 -0
- data/features/tests/landing/negative.feature +152 -0
- data/features/tests/landing/orders.feature +81 -0
- data/features/tests/landing/pagination.feature +142 -0
- data/features/tests/landing/reviews.feature +137 -0
- data/features/tests/landing/search.feature +2 -2
- data/features/tests/landing/sort.feature +142 -0
- data/features/tests/landing/tags.feature +144 -0
- data/features/tests/results/errors.feature +1 -1
- data/features/tests/results/matrix/matrix_price.feature +1 -1
- data/features/tests/results/recommendation.feature +2 -2
- data/features/tests/results/reviews_airlines.feature +1 -1
- data/features/tests/results/search.feature +1 -1
- data/flights_gui_tests.gemspec +1 -1
- data/henry-context.yml +7828 -191
- metadata +39 -4
@@ -0,0 +1,55 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
Entonces(/^existe la opcion de cobertura$/) do
|
3
|
+
@page.cobertura_element.should visible
|
4
|
+
end
|
5
|
+
|
6
|
+
Y(/^elijo "(.*)" si quiero cobertura$/) do |option|
|
7
|
+
@page.opcion_seguros_element.set((option=="chequear") ? true : false)
|
8
|
+
@page.carga_element.when_not_visible(timeout=60)
|
9
|
+
sleep(1)
|
10
|
+
end
|
11
|
+
|
12
|
+
Entonces(/^verifico que se muestre correctamente la caja de seguro sin chequear$/) do
|
13
|
+
@page.cobertura_element.should visible("caja de seguros")
|
14
|
+
@page.opcion_seguros_element.should visible("checkbox en la caja de seguro")
|
15
|
+
@page.cobertura_element.should visible("link de cobertura en la caja de seguro")
|
16
|
+
@page.desprotegido_element.should visible("texto de no estoy protegido en la caja de seguro")
|
17
|
+
@page.desprotegido_element.text.should match("No estoy protegido")
|
18
|
+
end
|
19
|
+
|
20
|
+
Entonces(/^verifico que el precio del seguro no se muestre en el desglose$/) do
|
21
|
+
@page.precio_seguro_desglose_element.should_not visible
|
22
|
+
end
|
23
|
+
|
24
|
+
Entonces(/^verifico que se muestre correctamente la caja de seguro chequeada$/) do
|
25
|
+
@page.cobertura_element.should visible("caja de seguros")
|
26
|
+
@page.opcion_seguros_element.should visible("checkbox en la caja de seguro")
|
27
|
+
@page.cobertura_element.should visible("link de cobertura en la caja de seguro")
|
28
|
+
@page.protegido_element.should visible("texto de estoy protegido en la caja de seguro")
|
29
|
+
@page.protegido_element.text.should match("Estoy protegido")
|
30
|
+
end
|
31
|
+
|
32
|
+
Entonces(/^verifico que el precio del seguro se muestre correctamente en el desglose$/) do
|
33
|
+
@page.precio_seguro_desglose_element.should visible
|
34
|
+
price_detail=@page.precio_seguro_desglose_element.span(:class,'amount').text
|
35
|
+
price_assistance=@page.precio_seguro_element.text.gsub(/\./,'').match(/(.+)(\D)(\d+) (por persona)/)[3]
|
36
|
+
price_detail.gsub(/\./,'').to_i.should be_within(4).of(price_assistance.to_i*(@page.manage_data.adt+@page.manage_data.cnn+@page.manage_data.inf)) unless AllPages.site == "AR"
|
37
|
+
end
|
38
|
+
|
39
|
+
Cuando(/^muestro el popup de la cobertura completa$/) do
|
40
|
+
@page.link_cobertura_element.click
|
41
|
+
@page.popup_cobertura_element.when_visible(timeout=20)
|
42
|
+
end
|
43
|
+
|
44
|
+
Entonces(/^verifico que se muestre correctamente el popup de la cobertura completa para destino "(.*?)"$/) do |destino|
|
45
|
+
popup = @page.popup_cobertura_element
|
46
|
+
popup.div(:class,'coverage').should visible("Contenido del popup")
|
47
|
+
popup.text.should match_sensitive("ASSIST CARD")
|
48
|
+
popup.div(:class,'coverage').span(:class,'upselling-coverage-cell upselling-coverage-code').should visible("Contenido del popup Codigos")
|
49
|
+
popup.div(:class,'coverage').span(:class,'upselling-coverage-cell upselling-coverage-title').should visible("Contenido del popup Descripcion")
|
50
|
+
popup.div(:class,'coverage').span(:class,'upselling-coverage-cell upselling-coverage-value').should visible("Contenido del popup Values")
|
51
|
+
popup.div(:class,'coverage').div(:class,/odd/).span(:class,'upselling-coverage-cell upselling-coverage-value').text.strip.should match(destino.match("MIA") ? 'U\$S' : "€")
|
52
|
+
popup.div(:class,'coverage').text.should_not is_empty?
|
53
|
+
@page.cerrar_popup_cobertura_element.click
|
54
|
+
@page.popup_cobertura_element.when_not_visible(timeout=20)
|
55
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
Entonces(/^valido los valores del desglose del checkout$/) do
|
3
|
+
@itinerario_checkout = @page.datos_itinerario
|
4
|
+
@itinerario_checkout.validarSumaDesgloce.should be_within(4).of(@itinerario_checkout.tarifas['total'].value)
|
5
|
+
unless @itinerario_checkout.tarifas['adt'].valor.zero?
|
6
|
+
@itinerario_checkout.tarifas['adt'].valor.should be_within(4).of(@itinerario_checkout.tarifas['tarifa_adulto'].valor * @page.manage_data.adt)
|
7
|
+
end
|
8
|
+
@itinerario_resultados.tarifas.each_pair do |key,value|
|
9
|
+
if @itinerario_checkout.tarifas[key] and !value.zero? and value.currency == @itinerario_checkout.tarifas[key].currency
|
10
|
+
value.value.should be_within(4).of(@itinerario_checkout.tarifas[key].value)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Y(/^verifico que se muestren la caja de clientes felices$/) do
|
16
|
+
if AllPages.site=="US"
|
17
|
+
@page.clientes_felices_element.should_not visible("Se muestra la caja de comentarios en usa")
|
18
|
+
end
|
19
|
+
if @page.clientes_felices_element.present?
|
20
|
+
happy_clients = @page.clientes_felices_element
|
21
|
+
happy_clients.should visible
|
22
|
+
happy_clients.div(:class,'ux-common-comment').should visible
|
23
|
+
happy_clients.div(:class,'ux-common-comment').text.should match('[A-Z]|[a-z]')
|
24
|
+
happy_clients.div(:class,'ux-common-comment-description').should visible
|
25
|
+
happy_clients.div(:class,'ux-common-comment-description').span(:class,'flights-comment-description').should visible
|
26
|
+
happy_clients.div(:class,'ux-common-comment-description').span(:class,'flights-comment-description').text.no_accents.should match('[A-Z]|[a-z]')
|
27
|
+
happy_clients.div(:class,'ux-common-comment-profile').span(:class,'ux-common-comment-name').should visible
|
28
|
+
happy_clients.div(:class,'ux-common-comment-profile').span(:class,'ux-common-comment-name').text.no_accents.should match('[A-Z]|[a-z]')
|
29
|
+
happy_clients.span(:class,'description').should visible
|
30
|
+
happy_clients.span(:class,'description').text.no_accents.should match('Por que \d+ millones de viajeros nos eligen|Why \d+ million travelers choose us|Por que \d+ milhoes de viajantes nos escolhem')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
Cuando(/^verifico que los precios de las cuotas se muestran correctamente$/) do
|
35
|
+
@page.verificar_tipos_de_pago
|
36
|
+
end
|
@@ -1,10 +1,4 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
Dado(/^una pagina de resultados en "(.*?)" para una busqueda "(.*?)" que desambigue por "(.*?)"$/) do |arg1, arg2, arg3|
|
3
|
-
Helpers.set_date_language(arg1)
|
4
|
-
@page = Results::DesambiguationAirportsPage.new($browser)
|
5
|
-
@page.load_page(arg2,arg1,$ENV,arg3,"true")
|
6
|
-
end
|
7
|
-
|
8
2
|
Cuando(/^espero que termine de cargar la pagina de desambiguacion$/) do
|
9
3
|
@page.mensaje_desambiguacion_element.when_visible(timeout=100)
|
10
4
|
end
|
@@ -64,7 +58,6 @@ Entonces(/^verifico cada opcion de aeropuerto "(.*?)" en "(.*?)"$/) do |type,cit
|
|
64
58
|
@iata = (tramo/"ul.airports//p.description")[option+aux].inner_text[-4,3]
|
65
59
|
end
|
66
60
|
end
|
67
|
-
puts @iata
|
68
61
|
@page.browser.li(:class=>"strech",:index=>i).radio(:class=>'radio',:index=>option+aux).click if @page.browser.li(:class=>"strech",:index=>i).radio(:class=>'radio',:index=>option+aux).exists?
|
69
62
|
i += 1
|
70
63
|
end
|
@@ -137,8 +130,17 @@ Cuando(/^realizo una nueva busqueda desde desambiguacion de ciudades$/) do
|
|
137
130
|
end
|
138
131
|
|
139
132
|
Cuando(/^verifico que las ciudades elegidas sean las correctas$/) do
|
140
|
-
puts @cities
|
141
133
|
@cities.each do |city|
|
142
134
|
@page.url.should match(city)
|
143
135
|
end
|
144
136
|
end
|
137
|
+
|
138
|
+
Entonces(/^paso a landing$/) do
|
139
|
+
@page.boton_busqueda_element.click
|
140
|
+
@page = Landing::SearchPage.new($browser)
|
141
|
+
end
|
142
|
+
|
143
|
+
Entonces(/^verifico que el aeropuerto elegido sea el buscado en landing$/) do
|
144
|
+
airports = {"GIG"=>"RIO","SDU"=>"RIO","JDF"=>"JDF","IZA"=>"JDF","CFB"=>"CFB","CAW"=>"CAW","MEA"=>"MEA","CUN"=>"CUN","CZM"=>"CZM"}
|
145
|
+
@page.url.downcase.should match("#{airports[@iata].downcase}")
|
146
|
+
end
|
@@ -15,12 +15,12 @@ Y(/^verifico que la ciudad destino sea la que se eligio$/) do
|
|
15
15
|
@page.ciudad_elegida.should equal(ciudad_destino) unless @page.ciudad_elegida.match(/Guarullos/)
|
16
16
|
end
|
17
17
|
|
18
|
-
Entonces(/^valido el sorting de landing
|
18
|
+
Entonces(/^valido el sorting de landing$/) do
|
19
19
|
doc = Hpricot.parse(@page.orden_element.html)
|
20
20
|
options = (doc/"option").collect{|option| option.attributes['value']}
|
21
|
-
if
|
21
|
+
if AllPages.site=="BR"
|
22
22
|
@page.orden_element.value.should match("FARE_ASCENDING")
|
23
|
-
elsif
|
23
|
+
elsif AllPages.site != "MX"
|
24
24
|
@page.orden_element.value.should match("TOTALFARE_ASCENDING")
|
25
25
|
end
|
26
26
|
options.should include?("FARE_ASCENDING")
|
@@ -56,4 +56,51 @@ end
|
|
56
56
|
Y(/^verifico que el valor elejido en landing se encuentre en la lista de resultados$/) do
|
57
57
|
doc = Hpricot.parse(@page.html)
|
58
58
|
matchs = (doc/"div#clusters div.cluster span[@class='price-currency USD'] span.amount").select{|span| (span.inner_text.to_i - @page.datos_de_itinerarios.first.tarifa.valor).abs < 2 }
|
59
|
-
end
|
59
|
+
end
|
60
|
+
|
61
|
+
Cuando(/^verifico que funcione el paginado correctamente en landing$/) do
|
62
|
+
iterator = 2
|
63
|
+
while(@page.pagina_siguiente_element.present? and iterator < 5)do
|
64
|
+
before_url = @page.url
|
65
|
+
@page.pagina_siguiente_element.links[0].click
|
66
|
+
Watir::Wait.until(timeout = 5){before_url != @page.url}
|
67
|
+
@page.url.should match("(.+)\?pageIndex\=#{iterator}")
|
68
|
+
iterator += 1
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
Y(/^verifico que el paginado mantenga los filtros en landing$/) do
|
73
|
+
@page.filtros_salidas_elements[0].click
|
74
|
+
sleep(0.5)
|
75
|
+
if @page.pagina_siguiente_element.present?
|
76
|
+
url_with_filter = @page.url
|
77
|
+
@page.pagina_siguiente_element.links[0].click
|
78
|
+
Watir::Wait.until(timeout = 5){url_with_filter != @page.url}
|
79
|
+
@page.url.strip.should equal(url_with_filter.strip.gsub(/\/1\//,"/2/"))
|
80
|
+
end
|
81
|
+
reset_filter
|
82
|
+
end
|
83
|
+
|
84
|
+
Entonces(/^vuelvo a la primer pagina de landing$/) do
|
85
|
+
@page.pagina_previa_element.links[0].click while @page.pagina_previa_element.present?
|
86
|
+
end
|
87
|
+
|
88
|
+
Cuando(/^verifico que el paginado no rompa en la ultima paginas de landing$/) do
|
89
|
+
doc = Hpricot.parse(@page.html)
|
90
|
+
unless (doc/"div.flights-pagination li.page a").length==1
|
91
|
+
url_with_filter = @page.url
|
92
|
+
iterator = @page.paginas_elements[-1].text
|
93
|
+
@page.paginas_elements[-1].links[0].click
|
94
|
+
Watir::Wait.until(timeout = 5){url_with_filter != @page.url}
|
95
|
+
@page.url.should match("(.+)\?pageIndex\=#{iterator}")
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
Entonces(/^verifico que se muestre correctamente la review de pasajero$/) do
|
100
|
+
pending("No se muestra la review de pasajeros") unless @page.reviews_pasajeros_element.present?
|
101
|
+
@page.reviews_pasajeros_element.should visible
|
102
|
+
@page.reviews_pasajeros_title_element.text.no_accents.should match("Puntuacion general de vuelos a #{@ciudad_elegida}|Pontuacao geral de voos #{@ciudad_elegida}|Overall rating for flights to #{@ciudad_elegida}")
|
103
|
+
if $SITE != "US"
|
104
|
+
@page.reviews_pasajeros_title_element.text.no_accents.should match("Ya compraron vuelos a #{@ciudad_elegida}|Ja compraram voos a #{@ciudad_elegida}|")
|
105
|
+
end
|
106
|
+
end
|
@@ -7,8 +7,16 @@ Cuando(/^una pagina de landing en "(.*)" del tipo "(.*)"$/) do |pais,tipo|
|
|
7
7
|
@page.elegir_idioma
|
8
8
|
end
|
9
9
|
|
10
|
+
Dado(/^una pagina de landing en "(.*?)" para una busqueda "(.*?)" que desambigue por "(.*?)"$/) do |arg1, arg2, arg3|
|
11
|
+
Helpers.set_date_language(arg1)
|
12
|
+
@page = Results::DesambiguationAirportsPage.new($browser)
|
13
|
+
@page.load_page_landing(arg2,arg1,$ENV,arg3,"true")
|
14
|
+
end
|
15
|
+
|
16
|
+
|
10
17
|
Entonces(/^espero que termine de cargar la pagina de landing$/) do
|
11
18
|
@page.titulo_element.when_visible(timeout=30)
|
19
|
+
sleep(5)
|
12
20
|
end
|
13
21
|
|
14
22
|
Y(/^verifico que traiga resultados de landing$/) do
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
Entonces(/^verifico las nuevas urls de vuelos a destino por aerolinea$/) do
|
3
|
+
doc = Hpricot.parse(@page.html)
|
4
|
+
options = (doc/"div.ux-flights-filter-airlines")[0]
|
5
|
+
options = (options/"ul.items label").reject{|option| option.attributes["class"].match(/selected|disabled|enabled/)}
|
6
|
+
@airline = options[rand(options.length)]
|
7
|
+
code = (@airline/"img").first.attributes['src'].match(/\/(..)\.png/)[1].strip
|
8
|
+
@arrival = @page.url.match(/#{@page.manage_data.host()}\/(vuelos|passagens-aereas|flights)\/(\D{3})\/(\D{3})\/(vuelos|passagens-aereas)-(a|para)-(.+)-(desde|saindo-de)-(.+)/)[3]
|
9
|
+
@page.ir(@page.manage_data.generate_url_landing_airline(code,@arrival))
|
10
|
+
end
|
11
|
+
|
12
|
+
Entonces(/^verifico que aparezcan los links propuestos de vuelos a destino por aerolinea$/) do
|
13
|
+
doc = Hpricot.parse(@page.html)
|
14
|
+
if (doc/"div#seo-links div.category h4.category-title").inner_text.match(/Vuelos a destino por aerolinea|Passagens para destino com Cia A.{1,2}rea|Flights to destination on airline/)
|
15
|
+
links = (doc/"div#seo-links ul.list li.item a").select{|a| a.attributes['href'].match(/#{@page.manage_data.host()}\/(vuelos|passagens-aereas|fligths)\/(aerolinea|companhiasaerea)\/(\D{3})\/(..)\/(vuelos|passagens-aereas)-(a|da)-(.+)-(por|para)-(.+)/)}
|
16
|
+
links.should_not is_empty?
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Y(/^verifico que aparezcan los links propuestos de vuelos a destino por aeropuerto de llegada$/) do
|
21
|
+
doc = Hpricot.parse(@page.html)
|
22
|
+
if (doc/"div#seo-links div.category h4.category-title").inner_text.match(/Vuelos a aeropuertos|Passagens para o Aeroporto|Flights to airport/)
|
23
|
+
links = (doc/"div#seo-links ul.list li.item a").select{|a| a.attributes['href'].match(/#{@page.manage_data.host()}\/(vuelos|passagens-aereas|fligths)\/(aeropuerto|aeroporto|airport)\/(\D{3})\/(voos-para-aeroporto|vuelos-a)(.+)/)}
|
24
|
+
links.should_not is_empty?
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Entonces(/^verifico las nuevas urls de vuelos a destino por aeropuerto de llegada$/) do
|
29
|
+
doc = Hpricot.parse(@page.html)
|
30
|
+
options = (doc/"div.ux-flights-filter-destinyairports label").reject{|option| option.attributes["class"].match(/selected|disabled/) or option.attributes["for"].match(/unique-airport/)}
|
31
|
+
@airport = options[rand(options.length)]
|
32
|
+
@page.ir(@page.manage_data.generate_url_landing_arrival_airport((@airport/"input").first.attributes['value']))
|
33
|
+
end
|
34
|
+
|
35
|
+
Cuando(/^verifico las nuevas urls de vuelos a destino por aeropuerto de salida$/) do
|
36
|
+
doc = Hpricot.parse(@page.html)
|
37
|
+
options = (doc/"div.ux-flights-filter-originairports label").reject{|option| option.attributes["class"].match(/selected|disabled/) or option.attributes["for"].match(/unique-airport/)}
|
38
|
+
@airport = options[rand(options.length)]
|
39
|
+
@page.ir(@page.manage_data.generate_url_landing_origin_airport((@airport/"input").first.attributes['value'],@arrival))
|
40
|
+
end
|
41
|
+
|
42
|
+
Entonces(/^verifico que aparezcan los links propuestos de vuelos a destino por aeropuerto de salida$/) do
|
43
|
+
doc = Hpricot.parse(@page.html)
|
44
|
+
if (doc/"div#seo-links div.category h4.category-title").inner_text.match(/Vuelos a destino desde aeropuerto origen|Passagens para destino saindo do Aeroporto de Origem|Flights to destination from departure airport/)
|
45
|
+
links = (doc/"div#seo-links ul.list li.item a").select{|a| a.attributes['href'].match(/#{@page.manage_data.host()}\/(vuelos|passagens-aereas|fligths)\/(aeropuerto|aeroporto|airport)\/(\D{3})\/(\D{3})\/(passagens-aereas-para|vuelos-a|flights-to)-(.+)-(desde|from|saindo-de)-(.+)/)}
|
46
|
+
links.should_not is_empty?
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
Entonces(/^verifico que el mensaje de error en el cluster sea correcto$/) do
|
3
|
+
@page.cargar_itinerarios
|
4
|
+
clusters=@page.datos_de_itinerarios
|
5
|
+
clusters.each_with_index do |cluster,i|
|
6
|
+
if (cluster.idas.length>1 or (cluster.vueltas and cluster.vueltas.length>1))
|
7
|
+
@page.buscar_elements[i].click
|
8
|
+
@page.itinerarios_elements[i].li(:class=>'item error-message',:index=>((cluster.idas.length>1) ? 0 : 1)).text.no_accents.should match("Choose a (return|departure) flight|Por favor, seleccione un vuelo de|Por favor, selecione um voo de")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Entonces(/^verifico que ciudades iguales de error$/) do
|
14
|
+
@path_landing = @page.url.match(/(.+)(vuelos-a|passagens\-aereas\-para)(.+)/)
|
15
|
+
@page.ir(@path_landing[1].gsub(/\/...\/...\//,"/bue/bue/"))
|
16
|
+
@page.simbolo_error_element.when_visible(timeout=10)
|
17
|
+
@page.mensaje_element.text.should match("The destination city is the same as the departure city|La ciudad de destino es la misma que la ciudad de origen|A cidade de destino .{1,2} a mesma que a cidade de origem")
|
18
|
+
end
|
19
|
+
|
20
|
+
Entonces(/^verifico que si paso tres ciudades en la url de error$/) do
|
21
|
+
@page.ir(@path_landing[1] + "#{@page.manage_data.city_to_1.code.downcase}/" + @path_landing[2] + @path_landing[3])
|
22
|
+
@page.simbolo_error_element.when_visible(timeout=10)
|
23
|
+
@page.mensaje_element.text.no_accents.should match("La pagina solicitada no es valida|A pagina que voce solicitou nao e valido|The page you requested is not valid")
|
24
|
+
end
|
25
|
+
|
26
|
+
Entonces(/^verifico que fechas iguales no de error$/) do
|
27
|
+
@page.ir(@path_landing[1] + "1/2014-12-05/2014-12-05/" + @path_landing[2] + @path_landing[3])
|
28
|
+
@page.simbolo_error_element.when_visible(timeout=10)
|
29
|
+
@page.mensaje_element.text.should match("No flights were found for your search|No encontramos vuelos para su b.{1,2}squeda|N.{1,2}o foi possivel encontrar assentos disponiveis nos v.{1,2}os buscados")
|
30
|
+
end
|
31
|
+
|
32
|
+
Entonces(/^verifico que la ciudad "(.*?)" de error$/) do |arg1|
|
33
|
+
@page.ir(@path_landing[1].gsub(/\/...\/...\//,"/bue/xxx/"))
|
34
|
+
@page.simbolo_error_element.when_visible(timeout=10)
|
35
|
+
@page.mensaje_element.text.should match("We couldnt understand the city you want to fly|No hemos podido interpretar la ciudad a la que quiere volar|N.{1,2}o encontramos a cidade solicitada")
|
36
|
+
end
|
37
|
+
|
38
|
+
Entonces(/^verifico que paginado negativo de error$/) do
|
39
|
+
@page.ir(@path_landing[1] + "-1/" + @path_landing[2] + @path_landing[3])
|
40
|
+
@page.simbolo_error_element.when_visible(timeout=10)
|
41
|
+
@page.mensaje_element.text.should match("The page you requested is not valid|La pagina solicitada no es valida|A p.{1,2}gina que voc.{1,2} solicitou n.{1,2}o .{1,2} v.{1,2}lido")
|
42
|
+
end
|
43
|
+
|
44
|
+
Entonces(/^verifico que si la fecha de ida ingresada es posterior a la fecha de vuelta de error$/) do
|
45
|
+
@page.ir(@path_landing[1] + "1/2014-09-05/2014-09-04/" + @path_landing[2] + @path_landing[3])
|
46
|
+
@page.simbolo_error_element.when_visible(timeout=10)
|
47
|
+
@page.mensaje_element.text.should match("The departure date entered is later than the return date|La fecha de ida ingresada es posterior a la fecha de vuelta|A data de partida digitada .{1,2} posterior a data de retorno")
|
48
|
+
end
|
49
|
+
|
50
|
+
Entonces(/^verifico que si la url no tiene el seoPath, se redirige a la pagina que si lo tiene$/) do
|
51
|
+
@page.ir(@path_landing[1])
|
52
|
+
sleep(0.5)
|
53
|
+
@page.url.strip.should equal(@path_landing.to_s.gsub(/\?(.+)/,'').strip)
|
54
|
+
end
|
55
|
+
|
56
|
+
Entonces(/^verifico que si el seoPath esta mal escrito, se redirige a la pagina con el seoPath correcto$/) do
|
57
|
+
@page.ir(@path_landing[1]+"qwerty")
|
58
|
+
sleep(0.5)
|
59
|
+
@page.url.strip.should equal(@path_landing.to_s.strip.to_s.gsub(/\?(.+)/,'').strip)
|
60
|
+
end
|
61
|
+
|
62
|
+
Entonces(/^verifico que si se pone un codigo de aeropuerto en vez de uno de cuidad, se redirige a la ciudad del aeropuerto$/) do
|
63
|
+
@page.ir(@path_landing[1].gsub(/\/...\/...\//,"/ccs/eze/"))
|
64
|
+
sleep(0.5)
|
65
|
+
if AllPages.site=="BR"
|
66
|
+
@page.url.strip.should equal(@path_landing[1].to_s.gsub(/\/...\/...\//,"/ccs/bue/")+@path_landing[2]+"-buenos+aires-saindo-de-caracas")
|
67
|
+
else
|
68
|
+
@page.url.strip.should equal(@path_landing[1].to_s.gsub(/\/...\/...\//,"/ccs/bue/")+@path_landing[2]+"-buenos+aires-desde-caracas")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
Entonces(/^verifico que si se pone algun caracter en mayuscula, se redirige a todo minuscula$/) do
|
73
|
+
@page.ir(@path_landing[1] + @path_landing[2].upcase + @path_landing[3])
|
74
|
+
sleep(0.5)
|
75
|
+
@page.url.strip.should equal(@path_landing.to_s.strip)
|
76
|
+
end
|
77
|
+
|
78
|
+
Entonces(/^verifico que si la url tiene parametros, se deben conservar en la redireccion$/) do
|
79
|
+
@page.ir(@path_landing[1] + "qwerty?param=value")
|
80
|
+
sleep(0.5)
|
81
|
+
@page.url.strip.should equal("#{@path_landing.to_s.strip.to_s.gsub(/\?(.+)/,'').strip}?param=value")
|
82
|
+
end
|
83
|
+
|
84
|
+
Entonces(/^verifico que la url para sem funcione correctamente con un ciudad con resultados sin seoPath$/) do
|
85
|
+
match = @path_landing[1].match(/(.+)(vuelos|passagens-aereas)\/(...)\/(...)\//)
|
86
|
+
@page.ir("#{match[1]}#{match[2]}/handler/#{match[3]}/#{match[4]}")
|
87
|
+
sleep(0.5)
|
88
|
+
@page.url.strip.should equal(@path_landing.to_s.strip.gsub(/\?(.+)/,''))
|
89
|
+
end
|
90
|
+
|
91
|
+
Entonces(/^verifico que la url para sem funcione correctamente con un ciudad sin resultados sin seoPath$/) do
|
92
|
+
match = @path_landing[1].match(/(.+)(vuelos|passagens-aereas)\/(...)\/(...)\//)
|
93
|
+
@page.ir("#{match[1]}#{match[2]}/handler/#{match[3]}/KLP")
|
94
|
+
sleep(0.5)
|
95
|
+
@page.url.strip.should equal("#{match[1]}#{match[2].to_s.gsub(/\?(.+)/,'').strip}/")
|
96
|
+
end
|
97
|
+
|
98
|
+
Entonces(/^verifico que la url de landing para el destino "(.*?)" no rompa$/) do |to_city|
|
99
|
+
match = @path_landing[1].match(/(.+)(vuelos|passagens-aereas)\/(...)\/(...)\//)
|
100
|
+
respond = HTTParty.get("#{match[1]}#{match[2]}/css/#{to_city}")
|
101
|
+
respond.code.to_s.should match("200|404")
|
102
|
+
end
|
103
|
+
|
104
|
+
Entonces(/^verifico que redirija a la home de vuelos si no hay oficinas en la ciudad de origen$/) do
|
105
|
+
@page.ir(@page.manage_data.generate_url_landing_home + "/tyo")
|
106
|
+
@page.url.should equal(@page.manage_data.generate_url_landing_home + "/")
|
107
|
+
@page.ir(@page.manage_data.generate_url_landing_home + "/#{@page.manage_data.city_from_1.code}")
|
108
|
+
@page.url.should equal(@page.manage_data.generate_url_landing_home + "/#{@page.manage_data.city_from_1.code.downcase}")
|
109
|
+
end
|
@@ -15,4 +15,8 @@ Entonces(/^seteo el proveedor "(.*)"$/) do |provider|
|
|
15
15
|
@page.browser.execute_script("javascript:void(document.cookie='XDESP-FDBS-PROVIDER=#{provider};path=/');")
|
16
16
|
@page.manage_data.set_header_json({"XDESP-FDBS-PROVIDER"=>provider})
|
17
17
|
@page.refresh
|
18
|
+
end
|
19
|
+
|
20
|
+
Entonces(/^es ida y vuelta$/) do
|
21
|
+
@page.manage_data.description.downcase=="roundtrip"
|
18
22
|
end
|
@@ -32,18 +32,22 @@ Entonces(/^verifico que la primer pagina muestre correctamente los filtros de ae
|
|
32
32
|
group_airlines = [["UA","CM","AM","US","AA","DL"],["LA","4M","XL","4C","JJ","PZ"],["AV","TA","LR"]]
|
33
33
|
doc = Hpricot.parse(@page.html)
|
34
34
|
airlines = []
|
35
|
-
airline = (@airline/"img").first.attributes['src'].match(/\/(
|
35
|
+
airline = (@airline/"img").first.attributes['src'].match(/\/(.{1,7})\.png/)[1].strip
|
36
36
|
(doc/"div#clusters div.cluster ul.itineraries-group").each do |itineraries|
|
37
|
-
airlines += (itineraries/"li.logo img").collect{|img| img.attributes['src'].match(/\/(
|
38
|
-
airlines += (itineraries/"li.airlines img").collect{|img| img.attributes['src'].match(/\/(
|
39
|
-
airlines += (itineraries/"li.airlinesShort img").collect{|img| img.attributes['src'].match(/\/(
|
37
|
+
airlines += (itineraries/"li.logo img").collect{|img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1]}
|
38
|
+
airlines += (itineraries/"li.airlines img").collect{|img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1]}
|
39
|
+
airlines += (itineraries/"li.airlinesShort img").collect{|img| img.attributes['src'].match(/\/(.{1,7})\.png/)[1]}
|
40
40
|
group_airlines.each{|airlines_tmp| airlines.concat(airlines_tmp) if airlines_tmp.include?(airline)}
|
41
41
|
end
|
42
42
|
airlines.should include?(airline)
|
43
43
|
end
|
44
44
|
|
45
45
|
Cuando(/^limpio el filtro de aerolineas$/) do
|
46
|
-
|
46
|
+
begin
|
47
|
+
@page.limpiar_filtro_aerolinea_element.set
|
48
|
+
rescue Watir::Exception::ObjectDisabledException
|
49
|
+
@page.cantidad_items_aeropuerto_salida_element.text.to_i.should equal(@total)
|
50
|
+
end
|
47
51
|
end
|
48
52
|
|
49
53
|
Cuando(/^elijo un aeropuerto (outbound|inbound) a aplicar$/) do |_class|
|
@@ -112,7 +116,11 @@ Entonces(/^verifico que la primer pagina muestre correctamente los filtros de es
|
|
112
116
|
end
|
113
117
|
|
114
118
|
Cuando(/^limpio el filtro de escalas$/) do
|
115
|
-
|
119
|
+
begin
|
120
|
+
@page.limpiar_filtro_escalas_element.set if @page.limpiar_filtro_escalas_element.present?
|
121
|
+
rescue Watir::Exception::ObjectDisabledException
|
122
|
+
@page.cantidad_items_aeropuerto_salida_element.text.to_i.should equal(@total)
|
123
|
+
end
|
116
124
|
end
|
117
125
|
|
118
126
|
Cuando(/^elijo un horario (outbound|inbound) a aplicar$/) do |_class|
|
@@ -176,7 +184,7 @@ end
|
|
176
184
|
|
177
185
|
Cuando(/^limpio el filtro de horario (outbound|inbound)$/) do |_class|
|
178
186
|
box=@page.browser.div(:class,"ux-common-filter-section ux-common-filter-slider ux-flights-filter-hours-slider ux-flights-filter-#{_class}hours-slider")
|
179
|
-
box.link(:class,'ux-common-filter-reset').click
|
187
|
+
box.link(:class,'ux-common-filter-reset').click if box.link(:class,'ux-common-filter-reset').present?
|
180
188
|
end
|
181
189
|
|
182
190
|
Cuando(/^elijo una duracion (outbound|inbound) a aplicar$/) do |_class|
|
@@ -7,6 +7,20 @@ Dado(/^una pagina de resultados en "(.*)" para una busqueda "(.*)" del tipo "(.*
|
|
7
7
|
@page.elegir_idioma
|
8
8
|
end
|
9
9
|
|
10
|
+
Dado(/^una pagina de resultados en "(.*?)" para una busqueda "(.*?)" con origen "(.*?)" y destino "(.*?)" de tipo "(.*?)"$/) do |pais,tipo,ida,vuelta,cabotaje|
|
11
|
+
Helpers.set_date_language(pais)
|
12
|
+
@page = Results::SearchPage.new($browser)
|
13
|
+
@page.load_page(tipo,pais,$ENV,cabotaje,{"from"=>ida.upcase,"to"=>vuelta.upcase})
|
14
|
+
@page.set_cookies
|
15
|
+
@page.elegir_idioma
|
16
|
+
end
|
17
|
+
|
18
|
+
Dado(/^una pagina de resultados en "(.*?)" para una busqueda "(.*?)" que desambigue por "(.*?)"$/) do |arg1, arg2, arg3|
|
19
|
+
Helpers.set_date_language(arg1)
|
20
|
+
@page = Results::DesambiguationAirportsPage.new($browser)
|
21
|
+
@page.load_page_results(arg2,arg1,$ENV,arg3,"true")
|
22
|
+
end
|
23
|
+
|
10
24
|
Cuando(/^espero que termine de cargar la pagina de resultados$/) do
|
11
25
|
@page.carga_element.when_not_visible(timeout=60)
|
12
26
|
@page.actualizar_filtro_element.when_not_visible(timeout=60)
|
@@ -1,4 +1,26 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
+
Cuando(/^elijo en la matriz una escala a aplicar$/) do
|
3
|
+
doc = Hpricot.parse(@page.html)
|
4
|
+
@stop = (doc/"ul.matrix-scales li.scale")[rand((doc/"ul.matrix-scales li.scale").length)]
|
5
|
+
@cant = @stop.inner_text.gsub(/\D/,'').strip.to_i
|
6
|
+
end
|
7
|
+
|
8
|
+
Entonces(/^filtro por matriz una escala$/) do
|
9
|
+
@page.elegir_escala(@stop.inner_text.strip).click
|
10
|
+
end
|
11
|
+
|
12
|
+
Entonces(/^verifico que la primer pagina muestre correctamente los filtros de escalas en matriz$/) do
|
13
|
+
end
|
14
|
+
|
15
|
+
Entonces(/^verifico el mensaje del filtro por escala$/) do
|
16
|
+
scale = case AllPages.site
|
17
|
+
when "BR" then {"1 escala"=>"com uma escala","direto"=>"diretos","2 escalas ou mais"=>"com duas ou mais escalas"}
|
18
|
+
when "US" then {"1 stop"=>"with 1 stop","non-stop"=>"Non-stop","2 stops or more"=>"with two or more stops"}
|
19
|
+
else {"1 escala"=>"con una escala","directo"=>"directos","2 escalas o mas"=>"con dos o mas escalas"}
|
20
|
+
end
|
21
|
+
@page.filtro_matriz_element.text.no_accents.strip.should match("Currently viewing: #{scale[@stop.inner_text.no_accents.downcase.strip]} flights|Currently viewing: Flights #{scale[@stop.inner_text.no_accents.downcase.strip]}|Actualmente visualizando: Vuelos #{scale[@stop.inner_text.no_accents.downcase.strip]}|Atualmente visualizando: Voos #{scale[@stop.inner_text.no_accents.downcase.strip]}")
|
22
|
+
end
|
23
|
+
|
2
24
|
Cuando(/^elijo en la matriz una aerolinea a aplicar$/) do
|
3
25
|
doc = Hpricot.parse(@page.html)
|
4
26
|
@airline = (doc/"div.matrix-airlines div.airline-description")[rand((doc/"div.matrix-airlines div.airline-description").length)]
|
@@ -21,7 +21,7 @@ Cuando(/^elijo un itinerario y paso a checkout$/) do
|
|
21
21
|
@page.cargar_itinerarios
|
22
22
|
@index, permitida = @page.sanear_itinerarios(["DL"])
|
23
23
|
pending("Se encontraron solo vuelos de delta") unless permitida
|
24
|
-
@
|
24
|
+
@itinerario_resultados = @page.elegir_itinerario(@index)
|
25
25
|
end
|
26
26
|
|
27
27
|
Entonces(/^recorro y verifico cada itinerario$/) do
|
@@ -99,4 +99,96 @@ Y(/^verifico el pixel de e-planning$/) do
|
|
99
99
|
tag_planning = @page.buscar_script_con_texto("planning")
|
100
100
|
tag_planning.first.inner_html.empty?.should_not be_true
|
101
101
|
(tag_planning.length >= 1).should be_true
|
102
|
-
end
|
102
|
+
end
|
103
|
+
|
104
|
+
Y(/^verifico el segundo tag de google en resultado de landing$/) do
|
105
|
+
tag_script = @page.buscar_script_con_texto("google_custom_params")
|
106
|
+
tag_script.first.should be_true
|
107
|
+
(tag_script.length == 1).should be_true
|
108
|
+
vars = tag_script.first.inner_text.split(";")
|
109
|
+
vars.delete_at(-1)
|
110
|
+
tmp = Hash.new
|
111
|
+
vars.each do |option|
|
112
|
+
(tmp[option.strip.match(/var (.+) \= (.+)/)[1]]=option.gsub(/"|\n/,'').match(/var (.+) \= (.+)/)[2].to_s) unless option.strip.match("document.write")
|
113
|
+
end
|
114
|
+
tmp['google_conversion_id'].should match("\\d")
|
115
|
+
tmp['google_conversion_label'].should match("(.+)")
|
116
|
+
match = @page.url.match(/\/(...)\/(...)\//)
|
117
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{AllPages.site}',CustomB: 'D',CustomC: '6',CustomD: '1',CustomCD: '6-1',CustomE: '#{match[1].upcase}',CustomF: '#{match[2].upcase}'}")
|
118
|
+
tmp['google_remarketing_only'].should match("true")
|
119
|
+
end
|
120
|
+
|
121
|
+
Cuando(/^levanto los tag que deben mostrarse segun la ciudad buscada para landing$/) do
|
122
|
+
cities = YAML.load(File.open("features/data/tag_microsoft.yml"))
|
123
|
+
iata = @page.url.match(/\/(...)\/(...)\//)[2].upcase
|
124
|
+
@temp = cities[AllPages.site].select{|city| city['City']==iata}
|
125
|
+
if @temp.empty?
|
126
|
+
@temp = cities[AllPages.site].select{|city| city['City']=="DEF"}
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
Y(/^verifico el pixel de Efrontier$/) do
|
131
|
+
doc = Hpricot.parse(@page.html)
|
132
|
+
doc.inner_html.should match("INITIAL_PIXELS")
|
133
|
+
doc.inner_html.should match("ASYNC_PIXELS")
|
134
|
+
end
|
135
|
+
|
136
|
+
Y(/^verifico el pixel de trackeame en checkout$/) do
|
137
|
+
pixel_trackeame = @page.buscar_elemento_html("img#PixelTrackeame").first
|
138
|
+
pixel_trackeame.nil?.should_not be_true
|
139
|
+
pixel_trackeame.attributes['src'].should match("fl=checkout&pr=flights&cc=#{AllPages.site}&exch=(.+)&pri=(.+)&cur=(#{Helpers.currency(AllPages.site)}|USD)&dn=Despegar")
|
140
|
+
end
|
141
|
+
|
142
|
+
Entonces(/^verifico el tag de datalayer$/) do
|
143
|
+
script = @page.buscar_script_con_texto("^dataLayer")
|
144
|
+
script.should_not is_empty?
|
145
|
+
text = script.first.inner_text.strip.gsub(/\/\/(.*)\n/,'').gsub(/\n/,'').match(/dataLayer \= \[(.*)\]\;/)[1]
|
146
|
+
json = JSON.parse(text.gsub(/\'/,"\""))
|
147
|
+
json["transactionId"].should equal(@id_reserva)
|
148
|
+
json["transactionTotal"].to_s.should_not is_empty?
|
149
|
+
json["transactionProducts"].should_not is_empty?
|
150
|
+
end
|
151
|
+
|
152
|
+
Y(/^verifico el pixel de trackeame en gracias$/) do
|
153
|
+
pixel_trackeame = @page.buscar_elemento_html("img#PixelTrackeame").first
|
154
|
+
pixel_trackeame.nil?.should_not be_true
|
155
|
+
pixel_trackeame.attributes['src'].should match("idcro=#{@id_reserva}&pr=flights&cc=#{AllPages.site}&exch=(.+)&pri=(.+)&cur=(#{Helpers.currency(AllPages.site)}|USD)&dn=Despegar")
|
156
|
+
end
|
157
|
+
|
158
|
+
Y(/^verifico el segundo tag de google en resultado de checkout$/) do
|
159
|
+
tag_script = @page.buscar_script_con_texto("google_custom_params")
|
160
|
+
tag_script.first.should be_true
|
161
|
+
(tag_script.length == 1).should be_true
|
162
|
+
vars = tag_script.first.inner_text.split(";")
|
163
|
+
vars.delete_at(-1)
|
164
|
+
tmp = Hash.new
|
165
|
+
vars.each do |option|
|
166
|
+
(tmp[option.strip.match(/var (.+) \= (.+)/)[1]]=option.gsub(/"|\n/,'').match(/var (.+) \= (.+)/)[2].to_s) unless option.strip.match("document.write")
|
167
|
+
end
|
168
|
+
tmp['google_conversion_id'].should match("\\d")
|
169
|
+
tmp['google_conversion_label'].should match("(.+)")
|
170
|
+
if @page.tipo_de_busqueda.downcase == "oneway"
|
171
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{AllPages.site}',CustomB: 'D',CustomC: '4',CustomD: '1',CustomCD: '4-1',CustomE: '#{@page.manage_data.city_from_1.code}',CustomF: '#{@page.manage_data.city_to_1.code}',CustomG: '.',CustomH: '.',CustomI: '.',CustomJ: '#{@page.manage_data.date_from_1}',CustomO: '..'}")
|
172
|
+
elsif @page.tipo_de_busqueda.downcase == "roundtrip"
|
173
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{AllPages.site}',CustomB: 'D',CustomC: '4',CustomD: '1',CustomCD: '4-1',CustomE: '#{@page.manage_data.city_from_1.code}',CustomF: '#{@page.manage_data.city_to_1.code}',CustomG: '.',CustomH: '.',CustomI: '.',CustomJ: '#{@page.manage_data.date_from_1}',CustomK: '....\-..\-..',CustomO: '..'}")
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
Y(/^verifico el segundo tag de google en resultado de gracias$/) do
|
178
|
+
tag_script = @page.buscar_script_con_texto("google_custom_params")
|
179
|
+
tag_script.first.should be_true
|
180
|
+
(tag_script.length == 1).should be_true
|
181
|
+
vars = tag_script.first.inner_text.split(";")
|
182
|
+
vars.delete_at(-1)
|
183
|
+
tmp = Hash.new
|
184
|
+
vars.each do |option|
|
185
|
+
(tmp[option.strip.match(/var (.+) \= (.+)/)[1]]=option.gsub(/"|\n/,'').match(/var (.+) \= (.+)/)[2].to_s) unless option.strip.match("document.write")
|
186
|
+
end
|
187
|
+
tmp['google_conversion_id'].should match("\\d")
|
188
|
+
tmp['google_conversion_label'].should match("(.+)")
|
189
|
+
if @page.tipo_de_busqueda.downcase == "oneway"
|
190
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{AllPages.site}',CustomB: 'D',CustomC: '5',CustomD: '1',CustomCD: '5-1',CustomE: '#{@page.manage_data.city_from_1.code}',CustomF: '#{@page.manage_data.city_to_1.code}',CustomG: '.',CustomH: '.',CustomI: '.',CustomJ: '#{@page.manage_data.date_from_1}',CustomO: '..'}")
|
191
|
+
elsif @page.tipo_de_busqueda.downcase == "roundtrip"
|
192
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{AllPages.site}',CustomB: 'D',CustomC: '5',CustomD: '1',CustomCD: '5-1',CustomE: '#{@page.manage_data.city_from_1.code}',CustomF: '#{@page.manage_data.city_to_1.code}',CustomG: '.',CustomH: '.',CustomI: '.',CustomJ: '#{@page.manage_data.date_from_1}',CustomK: '....\-..\-..',CustomO: '..'}")
|
193
|
+
end
|
194
|
+
end
|
@@ -1,10 +1,17 @@
|
|
1
|
-
#
|
1
|
+
# encoding: utf-8
|
2
2
|
Cuando(/^espero que termine de cargar la pagina de gracias$/) do
|
3
3
|
@page = Thanks::ThanksPage.new($browser)
|
4
|
-
|
4
|
+
Watir::Wait.until(timeout=60){@page.checkout_id_element.present? or @page.checkout_id_cash_element.present?}
|
5
5
|
end
|
6
6
|
|
7
7
|
Entonces(/^verifico que ingrese a la pagina de gracias$/) do
|
8
8
|
@page.checkout_id_element.should visible("Checkout ID")
|
9
9
|
puts @page.checkout_id_element.text
|
10
|
+
@id_reserva = @page.checkout_id_element.text
|
11
|
+
end
|
12
|
+
|
13
|
+
Entonces(/^verifico que ingrese a la pagina de gracias para pago cash$/) do
|
14
|
+
@page.checkout_id_cash_element.should visible("Checkout ID")
|
15
|
+
puts @page.checkout_id_cash_element.text
|
16
|
+
@id_reserva = @page.checkout_id_cash_element.text
|
10
17
|
end
|