flights_gui_tests 2.3.61 → 2.3.62

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 993fb1ad1b4708b8e4cd5a50131f616bb42a06b8
4
- data.tar.gz: b7bf58a2e38678c1cc8f698301660efd22925d06
3
+ metadata.gz: d3e1016f225ba89bbaf906a099e39b940883c3fa
4
+ data.tar.gz: 7266e8874d0d7f59f1d7a13f917a877d17c33364
5
5
  SHA512:
6
- metadata.gz: ee969e923ee301ed58786d55de29c4e5380c9370679a9b495033cf7486ccafe71dc4389e8a8b72ad8f4338519841e589737c66b3cce30500a6a9706a1ab8d48c
7
- data.tar.gz: a456453b53bef2334ab6e14e6546dae6f409d5aae9e775431474727695a6a1364c72b09c2511966865d40ed2ed3480737fee610a367b53091301e373770b74db
6
+ metadata.gz: e44011e3dcf1872ab3ea36fc411cb38e3742dd7e3dce1c88fccda73a9e428a69cd1dc017178fe109354d49f17da357afbafbe0ca52cb0d7da59dcf0a6c10fd0a
7
+ data.tar.gz: f9bcba4efb3aad4bd1a5033547d90c1a0bb63ead6b75002cafb43064ae0f7ef6ead2f0c576c0c718a84117b0cc08c5a6a34c121f4f9aa84eaf2c69458a5ebfff
@@ -13,7 +13,7 @@ Y(/^comparo los datos de cluster contra los detalles$/) do
13
13
  (item.tramos.first["hora_origen"].strftime("%d%m")).should match(@page.datos_de_itinerarios[i].idas[j].hou_sal_ida.strftime("%d%m"))
14
14
  item.duracion.to_s.should match((@page.datos_de_itinerarios[i].idas[j].duracion).to_s)
15
15
  item.tramos.last["ciudad_destino"].should match(@page.datos_de_itinerarios[i].idas[j].destino.no_accents.strip)
16
- (item.tramos.last["hora_destino"].strftime("%d%m")).should match(@page.datos_de_itinerarios[i].idas[j].hou_lle_ida.strftime("%d%m"))
16
+ (item.tramos.last["hora_destino"].strftime("%d%m")).should match(@page.datos_de_itinerarios[i].idas[j].hou_lle_ida.strftime("%d%m"))
17
17
  end
18
18
  detail["vueltas"].each_with_index do |item,j|
19
19
  item.tramos.first["clase"].should be_true
@@ -1,85 +1,19 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  class LandingCluster < Results::NewCluster
3
-
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
3
 
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
4
+ def cargar_tramo(info_ruta,segmento)
5
+ aerolineas = (segmento/"li.airlines img").collect{|aerolinea| aerolinea.attributes['src'].match(/(..).png/)[1].upcase}
6
+ return DataCluster.new( (info_ruta/"span.city-departure").inner_text.strip.no_accents.gsub(/,/,''), #nombre ciudad salida
7
+ (info_ruta/"span.city-arrival").inner_text.strip.no_accents.gsub(/,/,''), #nombre ciudad llegada
8
+ (segmento/"li.date").inner_text.strip.gsub(/\n/,' '), #fecha
9
+ aerolineas, #aerolineas
10
+ escala_to_i((segmento/"span.stops-text").inner_text.strip), #escalas
11
+ (info_ruta/"span.airport").first.inner_text.strip.no_accents, #iata ciudad salida
12
+ (info_ruta/"span.airport").last.inner_text.strip.no_accents, #iata ciudad llegada
13
+ Time.parse((segmento/"span.hour").first.inner_text.strip), #horario salida
14
+ Time.parse((segmento/"span.hour").last.inner_text.strip), #horario llegada
15
+ (segmento/"li.time").inner_text.strip #duracion
16
+ )
17
+ end
84
18
 
85
19
  end
@@ -112,21 +112,24 @@ module Landing
112
112
  (cluster/"div.outbound li.cluster-item").each_with_index do |item,j|
113
113
  itinerarios_elements[i].div(:class,'sub-cluster outbound').span(:class,'showMoreItineraries').click if itinerarios_elements[i].div(:class,'sub-cluster outbound').span(:class,'showMoreItineraries').present?
114
114
  itinerarios_elements[i].div(:class,'sub-cluster outbound').lis(:class,'detail')[j].links[0].span(:class,'text').click
115
- new_popup_detail_elements[k].when_visible(timeout=20)
115
+ sleep(0.5)
116
+ new_popup_detail_elements[k].when_visible(timeout=20)
116
117
  _cluster["idas"] << NewDetailsCluster.new(Hpricot.parse(new_popup_detail_elements[k].html))
117
118
  itinerarios_elements[i].div(:class,'sub-cluster outbound').lis(:class,'detail')[j].span(:class,'itinerary-detail-hide').click
118
- sleep(0.25)
119
+ sleep(0.5)
119
120
  k = k + 1
121
+ break if k > 1
120
122
  end
121
123
  (cluster/"div.inbound li.cluster-item").each_with_index do |item,j|
122
124
  itinerarios_elements[i].div(:class,'sub-cluster inbound').span(:class,'showMoreItineraries').click if itinerarios_elements[i].div(:class,'sub-cluster inbound').span(:class,'showMoreItineraries').present?
123
125
  itinerarios_elements[i].div(:class,'sub-cluster inbound').lis(:class,'detail')[j].links[0].span(:class,'text').click
124
- sleep(0.50)
126
+ sleep(0.5)
125
127
  new_popup_detail_elements[k].when_visible(timeout=20)
126
128
  _cluster["vueltas"] << NewDetailsCluster.new(Hpricot.parse(new_popup_detail_elements[k].html))
127
129
  itinerarios_elements[i].div(:class,'sub-cluster inbound').lis(:class,'detail')[j].span(:class,'itinerary-detail-hide').click
128
- sleep(0.25)
130
+ sleep(0.5)
129
131
  k = k + 1
132
+ break if k > 1
130
133
  end
131
134
  clusters << _cluster
132
135
  break
@@ -1,3 +1,3 @@
1
1
  module FlightsGui
2
- VERSION = "2.3.61"
2
+ VERSION = "2.3.62"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flights_gui_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.61
4
+ version: 2.3.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - lgonzalez