flights_gui_tests 0.0.1
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 +7 -0
- data/Gemfile +3 -0
- data/features/data/host.yml +78 -0
- data/features/data/miles.yml +216 -0
- data/features/data/sites.yml +44 -0
- data/features/data/tag_microsoft.yml +68 -0
- data/features/step_definitions/checkout/checkout_steps.rb +24 -0
- data/features/step_definitions/checkout/form_steps.rb +20 -0
- data/features/step_definitions/checkout/load_steps.rb +36 -0
- data/features/step_definitions/conditional_steps.rb +12 -0
- data/features/step_definitions/cookies_steps.rb +8 -0
- data/features/step_definitions/flights_tracker/flights_tracker_steps.rb +30 -0
- data/features/step_definitions/landing/itineraries_steps.rb +75 -0
- data/features/step_definitions/landing/landing_steps.rb +59 -0
- data/features/step_definitions/landing/load_steps.rb +30 -0
- data/features/step_definitions/page_steps.rb +18 -0
- data/features/step_definitions/results/basefare_steps.rb +65 -0
- data/features/step_definitions/results/desambiguation_steps.rb +144 -0
- data/features/step_definitions/results/errors_steps.rb +23 -0
- data/features/step_definitions/results/filters_steps.rb +301 -0
- data/features/step_definitions/results/load_steps.rb +52 -0
- data/features/step_definitions/results/matrix_steps.rb +213 -0
- data/features/step_definitions/results/order_steps.rb +49 -0
- data/features/step_definitions/results/pagination_steps.rb +29 -0
- data/features/step_definitions/results/recommendation_steps.rb +75 -0
- data/features/step_definitions/results/results_steps.rb +40 -0
- data/features/step_definitions/results/reviews_steps.rb +16 -0
- data/features/step_definitions/results/tags_steps.rb +102 -0
- data/features/step_definitions/results/wish_list_steps.rb +114 -0
- data/features/step_definitions/thanks/load_steps.rb +10 -0
- data/features/step_definitions/thanks/thanks_steps.rb +12 -0
- data/features/support/classes/clusters/checkout_cluster.rb +117 -0
- data/features/support/classes/clusters/data/data.rb +33 -0
- data/features/support/classes/clusters/results/details_cluster.rb +36 -0
- data/features/support/classes/clusters/results/landing_cluster.rb +29 -0
- data/features/support/classes/clusters/results/render_cluster.rb +83 -0
- data/features/support/classes/clusters/results_cluster.rb +171 -0
- data/features/support/classes/date.rb +26 -0
- data/features/support/classes/element.rb +23 -0
- data/features/support/classes/price.rb +66 -0
- data/features/support/classes/process_manager.rb +104 -0
- data/features/support/classes/string.rb +16 -0
- data/features/support/env.rb +94 -0
- data/features/support/hooks.rb +20 -0
- data/features/support/matchers.rb +108 -0
- data/features/support/modules/accessor.rb +26 -0
- data/features/support/modules/browser.rb +80 -0
- data/features/support/modules/checkout/datos_de_facturacion.rb +64 -0
- data/features/support/modules/checkout/informacion_de_contacto.rb +30 -0
- data/features/support/modules/checkout/pasajeros.rb +71 -0
- data/features/support/modules/checkout/tarjeta.rb +71 -0
- data/features/support/modules/element.rb +12 -0
- data/features/support/modules/helpers.rb +64 -0
- data/features/support/modules/pages/cookies.rb +33 -0
- data/features/support/modules/pages/tags.rb +27 -0
- data/features/support/modules/results/filters.rb +37 -0
- data/features/support/modules/results/itineraries/bussines.rb +17 -0
- data/features/support/modules/results/itineraries/data.rb +25 -0
- data/features/support/modules/results/itineraries/details.rb +80 -0
- data/features/support/modules/results/itineraries/miles.rb +64 -0
- data/features/support/modules/results/itineraries/payments.rb +27 -0
- data/features/support/modules/results/matrix/matrix_airline.rb +52 -0
- data/features/support/modules/results/matrix/matrix_fare_chart.rb +21 -0
- data/features/support/modules/results/matrix/matrix_price.rb +18 -0
- data/features/support/modules/results/recommendation.rb +29 -0
- data/features/support/modules/results/search_params.rb +21 -0
- data/features/support/modules/results/wish_list.rb +33 -0
- data/features/support/pages/all_pages.rb +95 -0
- data/features/support/pages/checkout/checkout_page.rb +45 -0
- data/features/support/pages/checkout/popup_results_page.rb +39 -0
- data/features/support/pages/flights_tracker/search_page.rb +54 -0
- data/features/support/pages/landing/search_page.rb +94 -0
- data/features/support/pages/results/desambiguation_airports_page.rb +16 -0
- data/features/support/pages/results/desambiguation_city_page.rb +20 -0
- data/features/support/pages/results/search_page.rb +101 -0
- data/features/support/pages/thanks/thanks_page.rb +7 -0
- data/features/tests/checkout/book_ok.feature +209 -0
- data/features/tests/flights_tracker/search.feature +65 -0
- data/features/tests/landing/search.feature +152 -0
- data/features/tests/results/basefare.feature +90 -0
- data/features/tests/results/desambiguation/airports.feature +89 -0
- data/features/tests/results/desambiguation/city.feature +87 -0
- data/features/tests/results/errors.feature +198 -0
- data/features/tests/results/filters.feature +113 -0
- data/features/tests/results/itineraries.feature +93 -0
- data/features/tests/results/matrix/matrix_airlines.feature +46 -0
- data/features/tests/results/matrix/matrix_fare_chart.feature +41 -0
- data/features/tests/results/matrix/matrix_price.feature +41 -0
- data/features/tests/results/orders.feature +89 -0
- data/features/tests/results/pagination.feature +74 -0
- data/features/tests/results/recommendation.feature +111 -0
- data/features/tests/results/reviews_airlines.feature +84 -0
- data/features/tests/results/search.feature +209 -0
- data/features/tests/results/wish_list.feature +55 -0
- data/flights_gui_tests.gemspec +34 -0
- data/henry-context.yml +4938 -0
- metadata +306 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
Entonces(/^verifico el ordenamiento premium economy$/) do
|
|
3
|
+
value=@page.recuperar_valor_abtesting("defaultSortingStrategy")
|
|
4
|
+
itin=@page.itinerarios_elements[2]
|
|
5
|
+
if value.to_i > 60 and @page.cluster_bussines_element.present?
|
|
6
|
+
puts itin.class_name
|
|
7
|
+
itin.class_name.should equal("cluster newCluster not-economy-cluster")
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
Cuando(/^ordeno por "(.*)"$/) do |valor_orden|
|
|
12
|
+
@page.orden_element.select_value(valor_orden)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Entonces(/^levanto los datos de los clusters "(.*?)"$/) do |arg1|
|
|
16
|
+
@page.cargar_itinerarios
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
Entonces(/^verifico ordenamiento STOPSCOUNT_ASCENDING$/) do
|
|
20
|
+
after = @page.datos_de_itinerarios.first
|
|
21
|
+
@page.datos_de_itinerarios.each do |cluster|
|
|
22
|
+
after.total_escalas.last.should_not es_mayor_que(cluster.total_escalas.last)
|
|
23
|
+
after = cluster
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
Entonces(/^verifico ordenamiento TOTALFARE_ASCENDING$/) do
|
|
28
|
+
after = @page.datos_de_itinerarios.first.tarifas['total']
|
|
29
|
+
@page.datos_de_itinerarios.each do |cluster|
|
|
30
|
+
after.value.should_not es_mayor_que(cluster.tarifas['total'].value)
|
|
31
|
+
after = cluster.tarifas['total']
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
Entonces(/^verifico ordenamiento DURATION_ASCENDING$/) do
|
|
36
|
+
after = @page.datos_de_itinerarios.first.duracion
|
|
37
|
+
@page.datos_de_itinerarios.each do |cluster|
|
|
38
|
+
after.should_not es_mayor_que(cluster.duracion)
|
|
39
|
+
after = cluster.duracion
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Entonces(/^verifico ordenamiento FARE_ASCENDING$/) do
|
|
44
|
+
after = @page.datos_de_itinerarios.first.tarifas['tarifa_adulto']
|
|
45
|
+
@page.datos_de_itinerarios.each do |cluster|
|
|
46
|
+
after.value.should_not es_mayor_que(cluster.tarifas['tarifa_adulto'].value)
|
|
47
|
+
after = cluster.tarifas['tarifa_adulto']
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
Cuando(/^vuelvo a la primer pagina en resultados$/) do
|
|
3
|
+
@page.actualizar_informacion_element.when_not_visible(timeout=60)
|
|
4
|
+
while @page.pagina_previa_element.present?
|
|
5
|
+
@page.pagina_previa_element.links[0].click
|
|
6
|
+
begin
|
|
7
|
+
@page.actualizar_informacion_element.when_not_visible(timeout=60)
|
|
8
|
+
rescue Timeout::Error, Watir::Wait::TimeoutError
|
|
9
|
+
pending("Timeout al volver a la primer pagina")
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
sleep(1)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Entonces(/^verifico que funcione el paginado correctamente en resultados$/) do
|
|
16
|
+
iterator = 2
|
|
17
|
+
while(@page.pagina_previa_element.present? and iterator < 7)do
|
|
18
|
+
@page.pagina_previa_element.links[0].click
|
|
19
|
+
step "espero que termine de cargar la pagina de resultados"
|
|
20
|
+
iterator += 1
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
Entonces(/^verifico que el paginado no traiga mas de "(.*?)" paginas en resultados$/) do |arg1|
|
|
25
|
+
doc = Hpricot.parse(@page.html)
|
|
26
|
+
if (doc/"li.page ")[-2]
|
|
27
|
+
((doc/"li.page ")[-2].inner_text.to_i <= arg1.to_i).should be_true
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
Entonces(/^verifico que exista el icono de enviar recomendacion$/) do
|
|
3
|
+
@page.icono_mail_element.should visible
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
Cuando(/^hago click en el icono de enviar recomendacion$/) do
|
|
7
|
+
@page.primera_opcion_ida_element.click if @page.primera_opcion_ida_element.present?
|
|
8
|
+
@page.primera_opcion_vuelta_element.click if @page.primera_opcion_vuelta_element.present?
|
|
9
|
+
@page.icono_mail_element.click
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
Entonces(/^verifico que cargue el contenido del popup$/) do
|
|
13
|
+
@page.popup_vuelos_element.when_visible()
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
Entonces(/^verifico que el asunto sea correcto "(.*?)"$/) do |arg1|
|
|
17
|
+
@page.asunto_recomendacion_element.placeholder.strip.should match(arg1)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Entonces(/^verifico que el comentario por default sea correcto "(.*?)"$/) do |arg1|
|
|
21
|
+
@page.comentario_recomendacion_element.value.strip.match(arg1).should be_true
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
Cuando(/^hago click en el boton de enviar$/) do
|
|
25
|
+
sleep(1)
|
|
26
|
+
@page.browser.execute_script("javascript:void($('#popup-email .flights-send-button').click());")
|
|
27
|
+
sleep(2)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
Entonces(/^verifico que el nombre del remitente sea un campo obligatorio$/) do
|
|
31
|
+
@page.error_nombre_recomendacion_element.should visible
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
Entonces(/^verifico que el mail del remitente sea un campo obligatorio$/) do
|
|
35
|
+
@page.error_mail_remitente_recomendacion_element.should visible
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
Entonces(/^verifico que el mail del destinatario sea un campo obligatorio$/) do
|
|
39
|
+
@page.error_mail_destinatario_recomendacion_element.should visible
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
Cuando(/^completo el mail del remitente "(.*?)"$/) do |arg1|
|
|
43
|
+
@page.mail_remitente_recomendacion_element.set(arg1)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
Entonces(/^verifico que el mail del remitente tenga un formato valido$/) do
|
|
47
|
+
@page.error_mail_remitente_recomendacion_element.should visible
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
Cuando(/^completo el mail del destinatario "(.*?)"$/) do |arg1|
|
|
51
|
+
@page.mail_destinatario_recomendacion_element.set(arg1)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
Entonces(/^verifico que el mail del destinatario tenga un formato valido$/) do
|
|
55
|
+
@page.error_mail_destinatario_recomendacion_element.should visible
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
Cuando(/^completo el nombre del remitente "(.*?)"$/) do |arg1|
|
|
59
|
+
@page.nombre_recomendacion_element.set(arg1)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
Entonces(/^verifico que se haya enviado correctamente el email$/) do
|
|
63
|
+
@page.mail_recomendacion_enviado_element.when_visible(timeout=60)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
Entonces(/^verifico que el texto de feedback este bien formado "(.*?)"$/) do |arg1|
|
|
67
|
+
@page.mail_recomendacion_enviado_element.text.strip.should match(arg1)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
Cuando(/^recorro el resto de los clusters$/) do
|
|
71
|
+
doc = Hpricot.parse(@page.html)
|
|
72
|
+
(doc/"div.cluster").each do |cluster|
|
|
73
|
+
(!(cluster/"span[@class='main-sprite icon-mail icon cluster-actions-icon']").empty?).should be_true
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
Cuando(/^verifico que no se muestre la leyenda de mejor precio garantizado en resultados$/) do
|
|
3
|
+
if AllPages.site=="CO"
|
|
4
|
+
@page.link_mejor_precio_element.should_not visible("Link de garantia de mejor precio garantizado")
|
|
5
|
+
@page.header_mejor_precio_element.should_not visible("Header de garantia de mejor precio garantizado")
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
Cuando(/^verifico que las datos de la pagina sean consistente a la busqueda realizada$/) do
|
|
10
|
+
unless @page.tipo_de_busqueda=="multipledestinations"
|
|
11
|
+
html = Hpricot.parse(@page.html)
|
|
12
|
+
(html/"span.search-info").inner_text.no_accents.downcase.should match(@page.manage_data.city_from_1.name.downcase)
|
|
13
|
+
(html/"span.search-info").inner_text.no_accents.downcase.should match(@page.manage_data.city_to_1.name.downcase)
|
|
14
|
+
(!(html/"div.search").length.zero?).should be_true
|
|
15
|
+
(!(html/"div#flights-alerts").length.zero?).should be_true if @page.tipo_de_busqueda=="roundtrip"
|
|
16
|
+
(!(html/"div#filters").length.zero?).should be_true
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Cuando(/^elijo un itinerario y paso a checkout$/) do
|
|
21
|
+
@page.cargar_itinerarios
|
|
22
|
+
@index, permitida = @page.sanear_itinerarios(["DL"])
|
|
23
|
+
pending("Se encontraron solo vuelos de delta") unless permitida
|
|
24
|
+
@itinerario = @page.elegir_itinerario(@index)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
Entonces(/^recorro y verifico cada itinerario$/) do
|
|
28
|
+
json = @page.manage_data.get_results_search_service("TOTALFARE")
|
|
29
|
+
i=0
|
|
30
|
+
@page.itinerarios_elements.each do |itinerario|
|
|
31
|
+
_itinerario = ResultsCluster.new(@page.tipo_de_busqueda,Hpricot.parse(itinerario.html))
|
|
32
|
+
@page.validar_millas(json,i)
|
|
33
|
+
@page.validar_mas_detalles(json,i,_itinerario)
|
|
34
|
+
@page.validar_detalles_itinerario(i)
|
|
35
|
+
@page.validar_popup_cuotas(i)
|
|
36
|
+
@page.validar_vuelo_bussines(i)
|
|
37
|
+
i += 1
|
|
38
|
+
break if i == 2
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
Cuando(/^(?:verifico|valido) las reviews de aerolineas$/) do
|
|
3
|
+
@page.aerolineas_en_matriz.should_not is_empty?
|
|
4
|
+
@page.aerolineas_en_matriz.each_with_index do |aerolinea,index|
|
|
5
|
+
@page.siguiente_aerolinea_element.click until aerolinea.present?
|
|
6
|
+
aerolinea.when_visible(timeout=5)
|
|
7
|
+
aerolinea.click
|
|
8
|
+
@page.popup_reviews_aerolineas_element.when_visible(timeout=10)
|
|
9
|
+
doc = Hpricot.parse(@page.popup_reviews_aerolineas_element.html)
|
|
10
|
+
@page.logo_aerolinea_en_matriz(index).should match((doc/"span.logo/img").first.attributes['src'].strip.downcase)
|
|
11
|
+
@page.nombre_aerolinea_en_matriz(index).should equal((doc/"h4.name").inner_text.strip.downcase)
|
|
12
|
+
aerolinea.text.should match((doc/"span.popup-reviews-summary-points-container span").first.inner_text)
|
|
13
|
+
@page.close_popup_reviews_aerolineas_element.click
|
|
14
|
+
@page.popup_reviews_aerolineas_element.when_not_visible(timeout=10)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# encoding : utf-8
|
|
2
|
+
Cuando(/^levanto los tag que deben mostrarse segun la ciudad buscada para una busqueda "(.*)"$/) do |type|
|
|
3
|
+
cities = YAML.load(File.open("features/data/tag_microsoft.yml"))
|
|
4
|
+
if type == "multipledestinations"
|
|
5
|
+
to_city = @page.manage_data.city_to_3.code
|
|
6
|
+
else
|
|
7
|
+
to_city = @page.manage_data.city_to_1.code
|
|
8
|
+
end
|
|
9
|
+
@temp = cities[AllPages.site].select{|city| city['City']==to_city}
|
|
10
|
+
if @temp.empty?
|
|
11
|
+
@temp = cities[AllPages.site].select{|city| city['City']=="DEF"}
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Entonces(/^verifico que se muestre en el codigo fuente$/) do
|
|
16
|
+
@page.buscar_tag_por_src("view.atdmt.com").should_not is_empty?
|
|
17
|
+
@temp[0]["Tag"].match(@page.buscar_tag_por_src("view.atdmt.com").first.attributes['src']).should be_true
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Y(/^verifico el segundo tag de google en resultado$/) do
|
|
21
|
+
tag_script = @page.buscar_script_con_texto("google_custom_params")
|
|
22
|
+
tag_script.first.should be_true
|
|
23
|
+
(tag_script.length == 1).should be_true
|
|
24
|
+
vars = tag_script.first.inner_text.split(";")
|
|
25
|
+
vars.delete_at(-1)
|
|
26
|
+
tmp = Hash.new
|
|
27
|
+
vars.each do |option|
|
|
28
|
+
(tmp[option.strip.match(/var (.+) \= (.+)/)[1]]=option.gsub(/"|\n/,'').match(/var (.+) \= (.+)/)[2].to_s) unless option.strip.match("document.write")
|
|
29
|
+
end
|
|
30
|
+
tmp['google_conversion_id'].should match("\\d")
|
|
31
|
+
tmp['google_conversion_label'].should match("(.+)")
|
|
32
|
+
if @page.tipo_de_busqueda == "oneway"
|
|
33
|
+
match = @page.url.match(/\/(...)\/(...)\/(....\-..\-..)\//)
|
|
34
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{AllPages.site}',CustomB: 'D',CustomC: '2',CustomD: '1',CustomCD: '2-1',CustomE: '#{match[1].upcase}',CustomF: '#{match[2].upcase}',CustomH: '.',CustomI: '.',CustomJ: '#{match[3].upcase}'}")
|
|
35
|
+
elsif @page.tipo_de_busqueda == "roundtrip"
|
|
36
|
+
match = @page.url.match(/\/(...)\/(...)\/(....\-..\-..)\/(....\-..\-..)/)
|
|
37
|
+
tmp['google_custom_params'].should match("{ CustomA: '#{AllPages.site}',CustomB: 'D',CustomC: '2',CustomD: '1',CustomCD: '2-1',CustomE: '#{match[1].upcase}',CustomF: '#{match[2].upcase}',CustomH: '.',CustomI: '.',CustomJ: '#{match[3].upcase}',CustomK: '#{match[4].upcase}'}")
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
Y(/^verifico el primer tag de google en resultado$/) do
|
|
42
|
+
tag_script = @page.buscar_script_con_texto("google_conversion_language")
|
|
43
|
+
tag_script.first.should be_true
|
|
44
|
+
(tag_script.length == 1).should be_true
|
|
45
|
+
vars = tag_script.first.inner_text.split(";")
|
|
46
|
+
vars.delete_at(-1)
|
|
47
|
+
tmp = Hash.new
|
|
48
|
+
vars.each{|option| tmp[option.strip.match(/var (.+) \= (.+)/)[1]]=option.gsub(/"|\n/,'').match(/var (.+) \= (.+)/)[2].to_s }
|
|
49
|
+
tmp['google_conversion_id'].should match("\\d")
|
|
50
|
+
tmp['google_conversion_language'].should match("en")
|
|
51
|
+
tmp['google_conversion_format'].should match("3")
|
|
52
|
+
tmp['google_conversion_color'].should match("666666")
|
|
53
|
+
tmp['google_conversion_label'].should match(".+")
|
|
54
|
+
tmp['google_conversion_value'].should match(0)
|
|
55
|
+
tag_noscript = @page.buscar_noscript_con_html("googleadservices")[0]
|
|
56
|
+
tag_noscript.inner_html.gsub(/\n\r/,'').should match("(.+)\/\/www.googleadservices.com\/pagead\/conversion\/#{tmp['google_conversion_id']}\/(.+)")
|
|
57
|
+
@page.buscar_elemento_html("script[@src='http://www.googleadservices.com/pagead/conversion.js']").should_not is_empty?
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
Y(/^verifico el tag de groovinads/)do
|
|
61
|
+
@page.buscar_tag_por_src("groovinads").should_not is_empty?
|
|
62
|
+
@page.buscar_tag_por_src("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')
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
Y(/^verifico el logger en (resultado|home) de (landing|fgui)$/) do |page,product|
|
|
66
|
+
@page.buscar_tag_por_src("logger").should_not is_empty?
|
|
67
|
+
@page.buscar_tag_por_src("logger").first.attributes['src'].strip.no_accents.gsub(/\n\r/,'').should match("(.+)logger.asp.{1,3}pagina\=\/shop\/flights\/results\/#{@page.tipo_de_busqueda}\/#{@page.manage_data.path}(.+)")
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
Y(/^verifico el tag de canonical$/) do
|
|
71
|
+
if @page.tipo_de_busqueda == "roundtrip"
|
|
72
|
+
tag_canonical = @page.buscar_elemento_html("link[@rel='canonical']")
|
|
73
|
+
tag_canonical.should_not is_empty?
|
|
74
|
+
tag_canonical.first.attributes['href'].should match("#{@page.manage_data.generate_url_landing_search(@page.manage_data.city_from_1.code.downcase,@page.manage_data.city_to_1.code.downcase)}/")
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
Y(/^verifico el tag de remarketing de facebook$/) do
|
|
79
|
+
tag_script = @page.buscar_script_con_texto("fb_param")
|
|
80
|
+
tag_script.first.should be_true
|
|
81
|
+
(tag_script.length == 1).should be_true
|
|
82
|
+
tag_script.first.inner_text.should match("connect.facebook.net\/en\_US\/fp.js")
|
|
83
|
+
tag_noscript = @page.buscar_noscript_con_html("facebook")[0]
|
|
84
|
+
tag_noscript.should be_true
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
Y(/^verifico el tag de facebook$/) do
|
|
88
|
+
tag_script = @page.buscar_script_con_texto("fb_param")
|
|
89
|
+
tag_script.first.should be_true
|
|
90
|
+
(tag_script.length == 1).should be_true
|
|
91
|
+
tag_noscript = @page.buscar_noscript_con_html("facebook")[0]
|
|
92
|
+
tag_noscript.inner_html.gsub(/\n\r/,'').should match('(.+)www.facebook.com\/offsite_event.php\?id\=(.+)')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
Y(/^verifico el pixel de e-planning$/) do
|
|
96
|
+
tag_script = @page.buscar_elemento_html("script[@language='JavaScript']")
|
|
97
|
+
tag_script.first.inner_html.empty?.should_not be_true
|
|
98
|
+
(tag_script.length == 1).should be_true
|
|
99
|
+
tag_planning = @page.buscar_script_con_texto("planning")
|
|
100
|
+
tag_planning.first.inner_html.empty?.should_not be_true
|
|
101
|
+
(tag_planning.length >= 1).should be_true
|
|
102
|
+
end
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
Cuando(/^me deslogueo como usuario$/) do
|
|
3
|
+
@page.item_usuario_nibbler_element.click
|
|
4
|
+
@page.popup_usuario_nibbler_element.when_visible
|
|
5
|
+
@page.cerrar_sesion_usuario_nibbler_element.click if @page.cerrar_sesion_usuario_nibbler_element.present?
|
|
6
|
+
@page.cerrar_popup_usuario_nibbler_element.click if @page.cerrar_popup_usuario_nibbler_element.present?
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
Cuando(/^abro el popup de registro$/) do
|
|
10
|
+
@page.icono_favoritos_element.click
|
|
11
|
+
@page.login_usuario_nibbler_element.when_visible
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Entonces(/^verifico links y textos del popup de registro$/) do
|
|
15
|
+
popup=@page.login_usuario_nibbler_element
|
|
16
|
+
data_popup = Hpricot.parse(popup.html)
|
|
17
|
+
(data_popup/"div.nibbler-common-overlay-header").length.should equal(1)
|
|
18
|
+
(data_popup/"div.nibbler-common-overlay-body").length.should equal(1)
|
|
19
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row").length.should equal(2)
|
|
20
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div.nibbler-common-grid-col6").length.should equal(2)
|
|
21
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div.nibbler-common-grid-col6 a.nibbler-common-icon-facebook").length.should equal(1)
|
|
22
|
+
#(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div.nibbler-common-grid-col6 span.nibbler-common-icon-google").length.should equal(1)
|
|
23
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div.nibbler-common-grid-col6 div.nibbler-selfservices-tabs li.nibbler-tab").length.should equal(2)
|
|
24
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div#nibbler-selfservice-sign-in-despegar form#nibbler-login-form input#signin-email").length.should equal(1)
|
|
25
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div#nibbler-selfservice-sign-in-despegar form#nibbler-login-form input#signin-pass").length.should equal(1)
|
|
26
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div#nibbler-selfservice-sign-in-despegar button.nibbler-selfservice-pass-button").length.should equal(2)
|
|
27
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div#nibbler-selfservice-sign-in-despegar form#nibbler-register-form input#signup-email").length.should equal(1)
|
|
28
|
+
(data_popup/"div.nibbler-common-overlay-body div.nibbler-common-grid-row div#nibbler-selfservice-sign-in-despegar form#nibbler-register-form input#signup-pass").length.should equal(1)
|
|
29
|
+
popup.li(:class=>'nibbler-tab',:index=>0).click
|
|
30
|
+
sleep(0.5)
|
|
31
|
+
popup.form(:id,'nibbler-login-form').should visible("formulario de login")
|
|
32
|
+
popup.li(:class=>'nibbler-tab',:index=>1).click
|
|
33
|
+
sleep(0.5)
|
|
34
|
+
popup.form(:id,'nibbler-register-form').should visible("formulario de registro")
|
|
35
|
+
popup.li(:class=>'nibbler-tab',:index=>0).click
|
|
36
|
+
sleep(0.5)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
Cuando(/^me logueo con usuario "(.*?)" y pass "(.*?)"$/) do |arg1, arg2|
|
|
40
|
+
@page.mail_usuario_nibbler_element.set(arg1)
|
|
41
|
+
@page.pass_usuario_nibbler_element.set(arg2)
|
|
42
|
+
@page.boton_usuario_nibbler_element.click
|
|
43
|
+
sleep(1)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
Cuando(/^limpio la lista de deseos$/) do
|
|
47
|
+
sleep(1)
|
|
48
|
+
@page.browser.execute_script("javascript:void($('.nibbler-common-last-searches-footer-clear-all').click());")
|
|
49
|
+
sleep(2)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
Cuando(/^cierro la lista de deseos$/) do
|
|
53
|
+
@page.browser.execute_script("javascript:void($('.nibbler-common-overlay-close').click())")
|
|
54
|
+
sleep(1)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
Cuando(/^abro la lista de deseos$/) do
|
|
58
|
+
@page.icono_favoritos_element.click
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
Entonces(/^verifico textos y que no se muestren opciones en la lista de deseos$/) do
|
|
62
|
+
@page.itinerario_favorito_element.should_not visible("lista con deseos")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
Cuando(/^elijo un itinerario como deseado$/) do
|
|
66
|
+
@page.primera_opcion_ida_element.click if @page.primera_opcion_ida_element.present?
|
|
67
|
+
@page.primera_opcion_vuelta_element.click if @page.primera_opcion_vuelta_element.present?
|
|
68
|
+
@page.icono_favoritos_cluster_element.should visible("icono de deseado")
|
|
69
|
+
@page.icono_favoritos_cluster_element.click
|
|
70
|
+
cluster = ResultsCluster.new(@page.tipo_de_busqueda,Hpricot.parse(@page.itinerarios_elements.first.html))
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
Entonces(/^verifico que el itinerario deseado quede marcado$/) do
|
|
74
|
+
sleep(1)
|
|
75
|
+
@page.icono_favoritos_cluster_marcado_element.should visible("icono de deseado seleccionado")
|
|
76
|
+
sleep(1)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
Entonces(/^verifico que el itinerario deseado quede en la lista de deseos$/) do
|
|
80
|
+
sleep(1)
|
|
81
|
+
@page.itinerario_favorito_element.should visible("lista con deseos")
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
Cuando(/^elijo el itinerario de la lista de deseos$/) do
|
|
85
|
+
@url = @page.url
|
|
86
|
+
@page.browser.execute_script("javascript:void($('.nibbler-common-header-favorites-popup .nibbler-common-last-searches-body-content-title').click())")
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
Entonces(/^verifico que dirija correctamente a la pagina de resultados$/) do
|
|
90
|
+
@url.downcase.should match("#{@page.url.gsub(/\?(.*)/,'').downcase}")
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
Entonces(/^verifico que el itinerario deseado este marcado correctamente$/) do
|
|
94
|
+
sleep(2)
|
|
95
|
+
unless @page.error_favoritos_element.present?
|
|
96
|
+
@page.primera_opcion_ida_element.set?.should be_true if@page.primera_opcion_ida_element.present?
|
|
97
|
+
@page.primera_opcion_vuelta_element.set?.should be_true if @page.primera_opcion_vuelta_element.present?
|
|
98
|
+
@page.icono_favoritos_cluster_marcado_element.should visible("icono de deseado seleccionado")
|
|
99
|
+
@page.corazon_lista_precios_element.should visible("icono de deseado en lista de precios")
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
Cuando(/^elimino el itinerario de la lista de deseos$/) do
|
|
104
|
+
sleep(1)
|
|
105
|
+
@page.browser.execute_script("javascript:void($('.nibbler-common-last-searches-footer-clear-all').click());")
|
|
106
|
+
sleep(2)
|
|
107
|
+
@page.browser.execute_script("javascript:void($('.nibbler-common-last-searches-footer-clear-all').click());")
|
|
108
|
+
sleep(2)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
Entonces(/^verifico que no se muestre en el header el usuario logueado$/) do
|
|
112
|
+
@page.usuario_logueado_element.should_not visible("usuario logueado")
|
|
113
|
+
@page.corazon_usuario_nibbler_element.should_not visible("corazon rojo en el header")
|
|
114
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# encodign: utf-8
|
|
2
|
+
Cuando(/^espero que termine de cargar la pagina de gracias$/) do
|
|
3
|
+
@page = Thanks::ThanksPage.new($browser)
|
|
4
|
+
@page.checkout_id_element.when_visible(timeout=60)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
Entonces(/^verifico que ingrese a la pagina de gracias$/) do
|
|
8
|
+
@page.checkout_id_element.should visible("Checkout ID")
|
|
9
|
+
puts @page.checkout_id_element.text
|
|
10
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
Entonces(/^verifico el link de mi despegar$/) do
|
|
3
|
+
# express the regexp above with the code you wish you had
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
Entonces(/^verifico los datos del vuelo comprado$/) do
|
|
7
|
+
# express the regexp above with the code you wish you had
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
Entonces(/^verifico el tag de datalayer$/) do
|
|
11
|
+
# express the regexp above with the code you wish you had
|
|
12
|
+
end
|