flights_gui_tests 0.0.21 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/step_definitions/results/filters_steps.rb +8 -8
- data/features/support/classes/clusters/results/landing_cluster.rb +80 -24
- data/features/support/matchers.rb +24 -0
- data/features/support/modules/results/recommendation.rb +1 -1
- data/features/tests/landing/tags.feature +0 -1
- data/flights_gui_tests.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68739b581bef6b6f640825b7defe727235cd905a
|
4
|
+
data.tar.gz: 3449d13c2535bd4a1aeb1793a9371e34318b25c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17e9a5196a7a4a1fc9294e00554096cb08575bf26518ce8706d8c976c1da61cdb7afae70aa6d546d9c15b92701e1b24171ac24e6b9f57457d18b1ba2a2e3239f
|
7
|
+
data.tar.gz: 1afaf370a32d8219ff8eb84f356a775d0336db69da76c20b9daa632488c5ea0826a490f2aeaa4f9c0ab6748a43c099042bd58766d6e6b1f7965ca4b0534c251d
|
@@ -262,14 +262,14 @@ end
|
|
262
262
|
Entonces(/^filtro por precio mayor$/) do
|
263
263
|
@page.execute_script("javascript:void($('.price-max').val(''))")
|
264
264
|
@page.filtro_precio_mayor_element.set(@price_up+3)
|
265
|
-
@page.aplicar_filtro_precio_element.click
|
266
|
-
step "espero que termine de cargar la pagina de resultados"
|
267
265
|
price=@page.filtro_precio_mayor_element.value.to_i
|
268
266
|
while(price>@price_up)
|
269
267
|
@page.slider_precio_mayor_element.send_keys :left
|
270
268
|
price=@page.filtro_precio_mayor_element.value.to_i
|
271
269
|
end
|
272
270
|
@price_up=price
|
271
|
+
@page.aplicar_filtro_precio_element.click
|
272
|
+
step "espero que termine de cargar la pagina de resultados"
|
273
273
|
end
|
274
274
|
|
275
275
|
Entonces(/^verifico que la primer pagina muestre correctamente los filtros de precio$/) do
|
@@ -277,11 +277,11 @@ Entonces(/^verifico que la primer pagina muestre correctamente los filtros de pr
|
|
277
277
|
@page.cargar_itinerarios
|
278
278
|
@page.datos_de_itinerarios.each do |itinerario|
|
279
279
|
if AllPages.site.match("MX|UY|PE|BR|CR|PA")
|
280
|
-
|
281
|
-
|
280
|
+
itinerario.tarifas['tarifa_adulto'].value.should es_mayor_igual_que(@price_down)
|
281
|
+
itinerario.tarifas['tarifa_adulto'].value.should es_menor_igual_que(@price_up)
|
282
282
|
else
|
283
|
-
|
284
|
-
|
283
|
+
itinerario.tarifas['total'].value.should es_mayor_igual_que(@price_down)
|
284
|
+
itinerario.tarifas['total'].value.should es_menor_igual_que(@price_up)
|
285
285
|
end
|
286
286
|
end
|
287
287
|
end
|
@@ -289,14 +289,14 @@ end
|
|
289
289
|
Entonces(/^filtro por precio menor$/) do
|
290
290
|
@page.execute_script("javascript:void($('.price-min').val(''))")
|
291
291
|
@page.filtro_precio_menor_element.set(@price_down-2)
|
292
|
-
@page.aplicar_filtro_precio_element.click
|
293
|
-
step "espero que termine de cargar la pagina de resultados"
|
294
292
|
price=@page.filtro_precio_menor_element.value.to_i
|
295
293
|
while(price<@price_down)
|
296
294
|
@page.slider_precio_menor_element.send_keys :right
|
297
295
|
price=@page.filtro_precio_menor_element.value.to_i
|
298
296
|
end
|
299
297
|
@price_down=price
|
298
|
+
@page.aplicar_filtro_precio_element.click
|
299
|
+
step "espero que termine de cargar la pagina de resultados"
|
300
300
|
end
|
301
301
|
|
302
302
|
Cuando(/^limpio el filtro de precio$/) do
|
@@ -1,29 +1,85 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
class LandingCluster < ResultsCluster
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
4
|
+
|
5
|
+
def load_data_from(div_datos)
|
6
|
+
@idas = Array.new
|
7
|
+
(div_datos/"li.itinerary").each do |div_datos_ida|
|
8
|
+
duracion = (div_datos_ida/"li.time").inner_text.strip
|
9
|
+
origen = (div_datos/"span.city-departure").first.inner_text.gsub(/,/,'').strip.no_accents
|
10
|
+
destino= (div_datos/"span.city-arrival").first.inner_text.gsub(/,/,'').strip.no_accents
|
11
|
+
origen_iata = (div_datos/"a")[0].inner_text.strip
|
12
|
+
destino_iata = (div_datos/"a")[1].inner_text.strip
|
13
|
+
fecha = (div_datos_ida/"li.date").first.inner_text.strip.no_accents
|
14
|
+
escala = (div_datos_ida/"li.stops/a").inner_text.strip.empty? ? "Sin escalas" : (div_datos_ida/"li.stops/a").inner_text.to_i
|
15
|
+
aerolinea = Array.new
|
16
|
+
i = 0
|
17
|
+
(div_datos_ida/"li.airlinesShort//img").each do |aer|
|
18
|
+
aerolinea << aer.attributes['src'].match(/(..).png/)[1].upcase
|
19
|
+
i = i + 1
|
20
|
+
end
|
21
|
+
(div_datos_ida/"li.airlines//img").each do |aer|
|
22
|
+
aerolinea << aer.attributes['src'].match(/(..).png/)[1].upcase
|
23
|
+
i = i + 1
|
24
|
+
end
|
25
|
+
hou_sal_ida = Time.parse((div_datos_ida/"li.leave span.hour").inner_text.strip)
|
26
|
+
hou_lle_ida = Time.parse((div_datos_ida/"li.arrive span.hour").inner_text.strip)
|
27
|
+
@idas << DataCluster.new(origen,destino,fecha, aerolinea, escala_to_i(escala),origen_iata,destino_iata,hou_sal_ida,hou_lle_ida,duracion)
|
28
|
+
end
|
29
|
+
@nro_vuelo_ida = 0
|
30
|
+
@ida = @idas[@nro_vuelo_ida]
|
31
|
+
end
|
32
|
+
def load_data_to(div_datos)
|
33
|
+
@vueltas = Array.new
|
34
|
+
(div_datos/"li.itinerary").each do |div_datos_vuelta|
|
35
|
+
duracion = (div_datos_vuelta/"li.time").inner_text.strip
|
36
|
+
origen = (div_datos/"span.city-departure").first.inner_text.gsub(/,/,'').strip.no_accents
|
37
|
+
destino= (div_datos/"span.city-arrival").first.inner_text.gsub(/,/,'').strip.no_accents
|
38
|
+
origen_iata = (div_datos/"a")[0].inner_text.strip
|
39
|
+
destino_iata = (div_datos/"a")[1].inner_text.strip
|
40
|
+
fecha = (div_datos_vuelta/"li.date").last.inner_text.strip.no_accents
|
41
|
+
escala = (div_datos_vuelta/"li.stops/a").inner_text.strip.empty? ? "Sin escalas" : (div_datos_vuelta/"li.stops/a").inner_text.to_i
|
42
|
+
aerolinea = Array.new
|
43
|
+
i = 0
|
44
|
+
(div_datos_vuelta/"li.airlinesShort//img").each do |aer|
|
45
|
+
aerolinea << aer.attributes['src'].match(/(..).png/)[1].upcase
|
46
|
+
i = i + 1
|
47
|
+
end
|
48
|
+
(div_datos_vuelta/"li.airlines//img").each do |aer|
|
49
|
+
aerolinea << aer.attributes['src'].match(/(..).png/)[1].upcase
|
50
|
+
i = i + 1
|
51
|
+
end
|
52
|
+
hou_sal_ida = Time.parse((div_datos_vuelta/"li.leave span.hour").inner_text.strip)
|
53
|
+
hou_lle_ida = Time.parse((div_datos_vuelta/"li.arrive span.hour").inner_text.strip)
|
54
|
+
@vueltas << DataCluster.new(origen,destino,fecha, aerolinea, escala_to_i(escala),origen_iata,destino_iata,hou_sal_ida,hou_lle_ida,duracion)
|
55
|
+
end
|
56
|
+
@nro_vuelo_vuelta = 0
|
57
|
+
@vuelta = @vueltas[@nro_vuelo_vuelta]
|
58
|
+
end
|
59
|
+
|
60
|
+
def load_prices(p_html)
|
61
|
+
|
62
|
+
@tarifas = Hash.new
|
63
|
+
@tarifas['tarifa_adulto'] = Price.new((p_html/"span.price-currency span.currency").first.inner_text.strip + " " + (p_html/"span.price-currency span.amount").first.inner_text.strip)
|
64
|
+
@tarifas['tarifa_adulto_dolar'] = Price.new((p_html/"span.price-currency span.currency").last.inner_text.strip + " " + (p_html/"span.price-currency span.amount").last.inner_text.strip)
|
65
|
+
@tarifas['adt'] = (p_html/"ul.fare-detail//li").empty? ? Price.new("$ 0",true) : Price.new(((p_html/"ul.fare-detail//li").select{|li| li.inner_text.no_accents.downcase =~ /adulto/}.first/"span[@class='price-currency ARS']").inner_text.strip)
|
66
|
+
|
67
|
+
adt = (p_html/"li").select{|li| li.inner_text.no_accents.downcase =~ /adulto/}.first
|
68
|
+
@tarifas['adt'] = adt ? Price.new((adt/"span.currency").first.inner_text.strip + " " + (adt/"span.amount").first.inner_text.strip) : Price.new("$ 0",true)
|
69
|
+
|
70
|
+
tasas = (p_html/"li.taxes-price").empty? ? (p_html/"li[@class='taxDetail.OTHER-price']").first : (p_html/"li.taxes-price").first
|
71
|
+
@tarifas['tasas'] = tasas ? Price.new((tasas/"span.currency").first.inner_text.strip + " " + (tasas/"span.amount").first.inner_text.strip,true) : Price.new("$ 0",true)
|
72
|
+
|
73
|
+
cargos = (p_html/"li.charges-price").first
|
74
|
+
@tarifas['cargos'] = cargos ? Price.new((cargos/"span.currency").first.inner_text.strip + " " + (cargos/"span.amount").first.inner_text.strip,true) : Price.new("$ 0",true)
|
75
|
+
|
76
|
+
afip = (p_html/"li[@class='taxDetail.ZK-price']").first
|
77
|
+
@tarifas['afip'] = afip ? Price.new((afip/"span.currency").first.inner_text.strip + " " + (afip/"span.amount").first.inner_text.strip,true) : Price.new("$ 0",true)
|
78
|
+
|
79
|
+
@tarifas['encargos'] = Price.new("$ 0",true)
|
80
|
+
|
81
|
+
campo = (p_html/"li").empty? ? "total" : "fare"
|
82
|
+
@tarifas['total'] = (p_html/"li.#{campo}-price span.currency").empty? ? Price.new("$ 0",true) : Price.new((p_html/"li.#{campo}-price span.currency").first.inner_text.strip + " " + (p_html/"li.#{campo}-price span.amount").first.inner_text.strip)
|
83
|
+
end
|
28
84
|
|
29
85
|
end
|
@@ -105,4 +105,28 @@ RSpec::Matchers.define :es_mayor_que do |min|
|
|
105
105
|
failure_message_for_should_not do |actual|
|
106
106
|
"se esperaba que el valor #{actual} no sea mayor a #{min}"
|
107
107
|
end
|
108
|
+
end
|
109
|
+
|
110
|
+
RSpec::Matchers.define :es_mayor_igual_que do |min|
|
111
|
+
match do |actual|
|
112
|
+
actual.to_i >= min
|
113
|
+
end
|
114
|
+
failure_message_for_should do |actual|
|
115
|
+
"se esperaba que el valor #{actual} sea mayor igual a #{min}"
|
116
|
+
end
|
117
|
+
failure_message_for_should_not do |actual|
|
118
|
+
"se esperaba que el valor #{actual} no sea mayor igual a #{min}"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
RSpec::Matchers.define :es_menor_igual_que do |min|
|
123
|
+
match do |actual|
|
124
|
+
actual.to_i <= min
|
125
|
+
end
|
126
|
+
failure_message_for_should do |actual|
|
127
|
+
"se esperaba que el valor #{actual} sea menor igual a #{min}"
|
128
|
+
end
|
129
|
+
failure_message_for_should_not do |actual|
|
130
|
+
"se esperaba que el valor #{actual} no sea menor igual a #{min}"
|
131
|
+
end
|
108
132
|
end
|
@@ -14,7 +14,6 @@ Característica: landing.tags
|
|
14
14
|
Entonces verifico que traiga resultados de landing
|
15
15
|
Y verifico que la url sea la correcta
|
16
16
|
Y verifico el tag de remarketing de facebook
|
17
|
-
Y verifico el tag de facebook
|
18
17
|
Y verifico el pixel de e-planning
|
19
18
|
Y verifico el primer tag de google en resultado
|
20
19
|
Y verifico el segundo tag de google en resultado de landing
|
data/flights_gui_tests.gemspec
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
gem.require_paths = ["lib"] #Usualmente es solo lib -> ["lib"]
|
17
17
|
|
18
|
-
gem.version = '0.0.
|
18
|
+
gem.version = '0.0.23' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
|
19
19
|
|
20
20
|
gem.add_dependency('henry-container', '>= 0.1.39')
|
21
21
|
gem.add_dependency('page-object')
|