flights_gui_tests 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e574dba604d4ac94bd0265bf976688d0f5e120ba
|
4
|
+
data.tar.gz: 7e1558216be3aafd69be09895bf4bdd10736cecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 367eab5b48e79e6e47ed9f6aa09d66e5d1bbffbf0fb9228a0c278a295013914d859c62491ddbdb77d322702bb0f553d3367c2027e39e17a4dc6bf82cd491a343
|
7
|
+
data.tar.gz: f26f6cc2f47b2bd050ac22695aa9cd49f7fc9da120cc322ed48a5f2a6968e74b99869d7134ca38866c427d4c1eb4f6f9029d9162c23e8b5b80939273f059cc45
|
data/features/data/miles.yml
CHANGED
@@ -45,10 +45,10 @@ US:
|
|
45
45
|
- You can earn Victoria unit
|
46
46
|
DL:
|
47
47
|
- with SkyMiles reward program
|
48
|
-
- You can earn unit
|
48
|
+
- You can earn SkyMiles unit
|
49
49
|
AM:
|
50
50
|
- with Club Premier reward program
|
51
|
-
- You can earn
|
51
|
+
- You can earn Club Premier unit
|
52
52
|
AC:
|
53
53
|
- with Altitude reward program
|
54
54
|
- You can earn Altitude unit
|
@@ -57,13 +57,13 @@ US:
|
|
57
57
|
- You can earn Skywards unit
|
58
58
|
AV:
|
59
59
|
- with LifeMiles reward program
|
60
|
-
- You can earn unit
|
60
|
+
- You can earn LifeMiles unit
|
61
61
|
TA:
|
62
62
|
- with LifeMiles reward program
|
63
|
-
- You can earn unit
|
63
|
+
- You can earn LifeMiles unit
|
64
64
|
LR:
|
65
65
|
- with LifeMiles reward program
|
66
|
-
- You can earn unit
|
66
|
+
- You can earn LifeMiles unit
|
67
67
|
AD:
|
68
68
|
- with TudoAzul reward program
|
69
69
|
- You can earn TudoAzul unit
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
Entonces(/^completo el formulario de deposito$/) do
|
3
|
+
@page.deposito_element.set
|
4
|
+
@page.nombre_completo_contacto_element.set("Diego Qa Romero") if @page.nombre_completo_contacto_element.present?
|
5
|
+
end
|
6
|
+
|
7
|
+
Entonces(/^verifico los texto del formulario de deposito$/) do
|
8
|
+
texto_fecha = "El deposito debera realizarse hoy, antes del cierre del banco, por caja de una sucursal del Banco Santander Rio"
|
9
|
+
texto_pasos = "Simplemente utilizando tu numero de solicitud de compra, e informando que es para Despegar.com podras realizar el deposito por caja en la sucursal mas cercana del Banco Santander Rio"
|
10
|
+
@page.desc_fecha_deposito_element.text.strip.no_accents.should equal(texto_fecha)
|
11
|
+
@page.desc_pasos_deposito_element.text.strip.no_accents.should equal(texto_pasos)
|
12
|
+
@page.warning_deposito_element.should visible("warning en deposito por caja")
|
13
|
+
@page.cobertura_deshabilitada_element.should visible("asistencia al viajero desactivada")
|
14
|
+
end
|
15
|
+
|
16
|
+
Cuando(/^aparece el popup de confirmacion de pago$/) do
|
17
|
+
@page.popup_confirmacion_pago_element.when_visible(timeout=20)
|
18
|
+
@page.popup_confirmacion_pago_element.should visible("popup de confirmacion de pago")
|
19
|
+
end
|
20
|
+
|
21
|
+
Entonces(/^elijo la opcion otro metodo$/) do
|
22
|
+
@page.opcion_no_deposito_element.click
|
23
|
+
sleep(1)
|
24
|
+
end
|
25
|
+
|
26
|
+
Entonces(/^verifico que vuelva al checkout correctamente$/) do
|
27
|
+
@page.set_autocomplete("ciudad_facturacion_custom","buenos aires") if @page.ciudad_facturacion_custom_element.present?
|
28
|
+
end
|
29
|
+
|
30
|
+
Entonces(/^verifico los pasos para hacer el pago online$/) do
|
31
|
+
@page.mensaje_alerta_element.text.no_accents.should equal("Recuerde que el pago debera ser realizado antes de las 20hs, de lo contrario su reserva sera cancelada.")
|
32
|
+
@page.checkout_id_cash_element.should visible("numero de reserva")
|
33
|
+
@page.pasos_pago_online_elements.length.should equal(8)
|
34
|
+
@page.checkout_id_cash_element.text.should match(@id_reserva)
|
35
|
+
@page.precio_pago_online_element.text.gsub(/\D+/,'').should match(@monto_total)
|
36
|
+
end
|
37
|
+
|
38
|
+
Entonces(/^completo el formulario de pago online$/) do
|
39
|
+
@page.pago_online_element.set
|
40
|
+
@page.nombre_completo_contacto_element.set("Diego Qa Romero") if @page.nombre_completo_contacto_element.present?
|
41
|
+
end
|
42
|
+
|
43
|
+
Entonces(/^elijo la opcion confirmar pago$/) do
|
44
|
+
@page.opcion_si_deposito_element.click
|
45
|
+
end
|
46
|
+
|
47
|
+
Entonces(/^verifico los pasos para hacer el deposito$/) do
|
48
|
+
@page.mensaje_alerta_element.text.no_accents.should equal("El deposito debera ser realizado en el dia de hoy, antes del cierre del banco, de lo contrario su reserva sera cancelada.\nTenga en cuenta que las tarifas pueden modificarse hasta el momento en que se concreta el pago.")
|
49
|
+
@page.checkout_id_cash_element.should visible("numero de reserva")
|
50
|
+
@page.datos_deposito_element.should visible("datos de deposito")
|
51
|
+
@page.pasos_deposito_elements[0].text.should equal("Despegar.com.ar")
|
52
|
+
@page.pasos_deposito_elements[1].text.should equal("30-70130711-5")
|
53
|
+
@page.pasos_deposito_elements[2].text.should equal("001")
|
54
|
+
@page.pasos_deposito_elements[3].text.should equal("01")
|
55
|
+
@page.pasos_deposito_elements[4].text.gsub(/\D+/,'').should match(@monto_total)
|
56
|
+
@page.imprimir_datos_deposito_element.should visible("link de impresion")
|
57
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
Cuando(/^aparece el popup de no disponibilidad$/) do
|
3
3
|
@page.popup_nuevo_vuelo_element.should visible
|
4
|
-
@popup_no_disponibilidad_page = Checkout::PopupResultsPage.new($browser)
|
4
|
+
@popup_no_disponibilidad_page = @popup_no_disponibilidad_page || Checkout::PopupResultsPage.new($browser)
|
5
5
|
@popup_no_disponibilidad_page.iniciar_apariciones
|
6
6
|
end
|
7
7
|
|
8
8
|
Entonces(/^elijo un itinerario del popup de no disponibilidad$/) do
|
9
9
|
@popup_no_disponibilidad_page.sumar_aparicion
|
10
|
-
pending("La cantidad de compras supero las #{@popup_no_disponibilidad_page.apariciones} apariciones") if @popup_no_disponibilidad_page.apariciones >
|
11
|
-
@popup_no_disponibilidad_page.itinerario_element.when_visible(timeout=
|
10
|
+
pending("La cantidad de compras supero las #{@popup_no_disponibilidad_page.apariciones} apariciones") if @popup_no_disponibilidad_page.apariciones > 4
|
11
|
+
@popup_no_disponibilidad_page.itinerario_element.when_visible(timeout=60)
|
12
12
|
@popup_no_disponibilidad_page.cargar_itinerarios
|
13
|
-
@
|
13
|
+
@itinerario_checkout = @popup_no_disponibilidad_page.elegir_itinerario(0)
|
14
14
|
step "verifico que ingrese al checkout"
|
15
15
|
step "verifico que la pagina no rompa"
|
16
16
|
step "cargo los pasajeros"
|
@@ -21,4 +21,47 @@ Entonces(/^elijo un itinerario del popup de no disponibilidad$/) do
|
|
21
21
|
step "espero que termine el pedido de compra"
|
22
22
|
step "verifico si no trae errores"
|
23
23
|
step "si aparece el popup de no disponibilidad, elijo un itinerario del popup de no disponibilidad"
|
24
|
-
end
|
24
|
+
end
|
25
|
+
|
26
|
+
Entonces(/^elijo un itinerario para reserva CAC del popup de no disponibilidad$/) do
|
27
|
+
@popup_no_disponibilidad_page.sumar_aparicion
|
28
|
+
pending("La cantidad de compras supero las #{@popup_no_disponibilidad_page.apariciones} apariciones") if @popup_no_disponibilidad_page.apariciones > 4
|
29
|
+
@popup_no_disponibilidad_page.itinerario_element.when_visible(timeout=60)
|
30
|
+
@popup_no_disponibilidad_page.cargar_itinerarios
|
31
|
+
@itinerario_checkout = @popup_no_disponibilidad_page.elegir_itinerario(0)
|
32
|
+
step "verifico que ingrese al checkout"
|
33
|
+
step "verifico que la pagina no rompa"
|
34
|
+
step "cargo los pasajeros"
|
35
|
+
step "completo los datos para reservas CAC"
|
36
|
+
step "cargo los datos de contacto"
|
37
|
+
step "acepto y compro"
|
38
|
+
step "espero que termine el pedido de compra"
|
39
|
+
step "verifico si no trae errores"
|
40
|
+
step "si aparece el popup de no disponibilidad, elijo un itinerario para reserva CAC del popup de no disponibilidad"
|
41
|
+
end
|
42
|
+
|
43
|
+
Entonces(/^verifico los datos de agencia afiliada$/) do
|
44
|
+
@page.agencia_afiliada_element.should visible
|
45
|
+
@page.agencia_afiliada_element.text.should match("AG14073")
|
46
|
+
@page.elegir_otro_vuelo_element.should_not visible
|
47
|
+
end
|
48
|
+
|
49
|
+
Entonces(/^completo los datos para reservas CAC$/) do
|
50
|
+
@page.browser.execute_script("javascript:void(function(){ShowButtonCAC();})();")
|
51
|
+
@page.opcion_cac_element.set
|
52
|
+
if @page.documento_offline_element.present?
|
53
|
+
number = case AllPages.site
|
54
|
+
when "CL" then "7028168-6"
|
55
|
+
when "BR" then "22233366638"
|
56
|
+
else "32456734"
|
57
|
+
end
|
58
|
+
@page.documento_offline_element.set(number)
|
59
|
+
end
|
60
|
+
@page.sexo_offline_element.select_value("MALE") if @page.sexo_offline_element.present?
|
61
|
+
@page.nombre_completo_contacto_element.set("Diego Qa Romero") if @page.nombre_contacto_cac_element.present?
|
62
|
+
end
|
63
|
+
|
64
|
+
Entonces(/^el checkout me pide mas datos de tarjeta$/) do
|
65
|
+
text = @page.notificacion_warning_element.text if @page.notificacion_warning_element.present?
|
66
|
+
@page.notificacion_warning_element.should visible(text)
|
67
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
Entonces(/^vuelvo a la pagina de resultados original$/) do
|
3
|
+
@page.ir(@page.manage_data.generate_url_results_search)
|
4
|
+
@page = Results::SearchPage.new($browser)
|
5
|
+
end
|
6
|
+
|
7
|
+
Cuando(/^verifico que se muestre el popup de compra duplicada$/) do
|
8
|
+
@page = Checkout::CheckoutPage.new($browser)
|
9
|
+
@page.popup_compra_duplicada_element.when_visible(timeout=60)
|
10
|
+
@page.popup_compra_duplicada_element.should visible("popup de compras duplicadas")
|
11
|
+
@page.opcion_si_compra_duplicada_element.should visible("boton yes")
|
12
|
+
@page.opcion_no_compra_duplicada_element.should visible("boton no")
|
13
|
+
@page.popup_compra_duplicada_element.link(:title,AllPages.site=="BR" ? 'Meu Decolar' : 'Mi Despegar').should visible("link a mi despegar")
|
14
|
+
@page.id_reserva_compra_duplicada_element.text.should match(@id_reserva)
|
15
|
+
end
|
16
|
+
|
17
|
+
Cuando(/^elijo comprar el vuelo$/) do
|
18
|
+
@page.opcion_si_compra_duplicada_element.click
|
19
|
+
end
|
20
|
+
|
21
|
+
Entonces(/^elijo no comprar el vuelo$/) do
|
22
|
+
@page.opcion_no_compra_duplicada_element.click
|
23
|
+
end
|
24
|
+
|
25
|
+
Entonces(/^verifico que dirija a la home$/) do
|
26
|
+
Watir::Wait.until(timeout=60){@page.url == "#{@page.manage_data.host}/"}
|
27
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
Y(/^permite cupon de descuento$/) do
|
3
|
+
(AllPages.site=="AR" and $ENV.match("produccion|beta")).should be_true
|
4
|
+
end
|
5
|
+
|
6
|
+
Y(/^completo con un cupon de descuento con numero "(.*)"$/) do |num|
|
7
|
+
if @page.popup_chat_element.present?
|
8
|
+
@page.cerrar_popup_chat_element.click
|
9
|
+
sleep(1)
|
10
|
+
end
|
11
|
+
@page.cupones_element.set(true)
|
12
|
+
@page.cupon_email_element.set("bookingvuelos@despegar.com")
|
13
|
+
@page.cupon_voucher_element.set(num)
|
14
|
+
@page.cupon_validar_element.click
|
15
|
+
end
|
16
|
+
|
17
|
+
Y(/^verifico el mensaje de cupon invalido$/) do
|
18
|
+
begin
|
19
|
+
@page.cupon_error_element.when_visible(timeout=30)
|
20
|
+
rescue Timeout::Error
|
21
|
+
|
22
|
+
end
|
23
|
+
@page.cupon_error_element.should visible("error de cupon invalido")
|
24
|
+
@page.cupon_error_element.text.no_accents.should match("El codigo ingresado no existe|That is not a valid code|O codigo inserido nao existe")
|
25
|
+
end
|
26
|
+
|
27
|
+
Y(/^verifico el mensaje de cupon valido$/) do
|
28
|
+
begin
|
29
|
+
@page.cupon_exito_element.when_visible(timeout=30)
|
30
|
+
rescue Timeout::Error
|
31
|
+
|
32
|
+
end
|
33
|
+
@page.cupon_error_element.should_not visible("error de cupon invalido")
|
34
|
+
@page.cupon_exito_element.text.no_accents.should match('Su descuento de (.*) se valido correctamente.|That is not a valid code|O codigo inserido nao existe')
|
35
|
+
end
|
@@ -0,0 +1,245 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
Entonces(/^verifico las nacionalidades de los pasajeros$/) do
|
3
|
+
@page.browser.execute_script("javascript:void($('.other-passenger-inputs').css('display','block'));")
|
4
|
+
if AllPages.site=~/AR|VE/
|
5
|
+
@page.nombre_elements[0].focus
|
6
|
+
@page.nacionalidad_elements[0].select_value(AllPages.site)
|
7
|
+
@page.error_nacionalidad_invalida_element.should_not visible("error en la nacionalidad")
|
8
|
+
@page.nacionalidad_elements[0].select_value("BR")
|
9
|
+
@page.error_nacionalidad_invalida_element.should visible("error en la nacionalidad")
|
10
|
+
@page.error_nacionalidad_invalida_element.text.no_accents.should match("En cumplimiento de la resolucion 5499, solo podran comprar en este sitio residentes de la Republica Argentina.|Pasajes aereos internacionales solo para la venta de residentes de la Republica Bolivariana de Venezuela conformes al Art 2 de la providencia 124 de Cadivi.")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
Entonces(/^verifico que se desplieguen las alertas de campos vacios$/) do
|
15
|
+
@page.comprar_element.click
|
16
|
+
(@page.manage_data.adt+@page.manage_data.cnn+@page.manage_data.inf).times do |time|
|
17
|
+
@page.error_primer_nombre_vacio_elements[time].should visible
|
18
|
+
end
|
19
|
+
@page.error_numero_tarjeta_vacio_element.should visible
|
20
|
+
@page.error_fecha_tarjeta_vacio_element.should visible
|
21
|
+
@page.error_codigo_seguridad_vacio_element.should visible
|
22
|
+
@page.error_usuario_tarjeta_vacio_element.should visible
|
23
|
+
@page.error_mail_vacio_element.should visible
|
24
|
+
@page.error_repetir_mail_vacio_element.should visible
|
25
|
+
@page.error_telefono_vacio_element.should visible
|
26
|
+
end
|
27
|
+
|
28
|
+
Entonces(/^verifico intentos de compra con datos invalidos$/) do
|
29
|
+
plus_name=["A","B","C","D","E","F","G","H","I","J","k"]
|
30
|
+
(@page.manage_data.adt+@page.manage_data.cnn+@page.manage_data.inf).times do |time|
|
31
|
+
@page.nombre_elements[time].set("123")
|
32
|
+
@page.comprar_element.click
|
33
|
+
@page.popup_transicion_compra_element.should_not visible
|
34
|
+
@page.nombre_elements[time].set("@%")
|
35
|
+
@page.comprar_element.click
|
36
|
+
@page.popup_transicion_compra_element.should_not visible
|
37
|
+
@page.nombre_elements[time].set(nil)
|
38
|
+
@page.comprar_element.click
|
39
|
+
@page.popup_transicion_compra_element.should_not visible
|
40
|
+
@page.nombre_elements[time].set("Martin QA" + plus_name[time])
|
41
|
+
end
|
42
|
+
(@page.manage_data.adt+@page.manage_data.cnn+@page.manage_data.inf).times do |time|
|
43
|
+
@page.apellido_elements[time].set("123")
|
44
|
+
@page.comprar_element.click
|
45
|
+
@page.popup_transicion_compra_element.should_not visible
|
46
|
+
@page.nombre_elements[time].set("@%")
|
47
|
+
@page.comprar_element.click
|
48
|
+
@page.popup_transicion_compra_element.should_not visible
|
49
|
+
@page.nombre_elements[time].set(nil)
|
50
|
+
@page.comprar_element.click
|
51
|
+
@page.popup_transicion_compra_element.should_not visible
|
52
|
+
@page.nombre_elements[time].set("Diez" + plus_name[time])
|
53
|
+
end
|
54
|
+
@page.codigo_seguridad_tarjeta_element.set("052545454")
|
55
|
+
@page.comprar_element.click
|
56
|
+
@page.popup_transicion_compra_element.should_not visible
|
57
|
+
@page.codigo_seguridad_tarjeta_element.set(nil)
|
58
|
+
@page.comprar_element.click
|
59
|
+
@page.popup_transicion_compra_element.should_not visible
|
60
|
+
@page.tarjeta_element.select "Visa" #Se puede hacer un select con regexp?
|
61
|
+
@page.numero_tarjeta_element.set("32454532532")
|
62
|
+
@page.comprar_element.click
|
63
|
+
@page.popup_transicion_compra_element.should_not visible
|
64
|
+
@page.numero_tarjeta_element.set(nil)
|
65
|
+
@page.comprar_element.click
|
66
|
+
@page.popup_transicion_compra_element.should_not visible
|
67
|
+
@page.numero_tarjeta_element.set("4242424242424242") #Parametrizar
|
68
|
+
@page.codigo_seguridad_tarjeta_element.set("123") #Parametrizar
|
69
|
+
@page.mes_vencimiento_tarjeta_element.select (Date.today.month).to_s
|
70
|
+
@page.ano_vencimiento_tarjeta_element.select (Date.today.year).to_s
|
71
|
+
@page.comprar_element.click
|
72
|
+
@page.popup_transicion_compra_element.should_not visible
|
73
|
+
@page.mes_vencimiento_tarjeta_element.select (Date.today.month).to_s
|
74
|
+
@page.ano_vencimiento_tarjeta_element.select (Date.today.year).to_s
|
75
|
+
@page.nombre_titular_tarjeta_element.set(nil)
|
76
|
+
@page.comprar_element.click
|
77
|
+
@page.popup_transicion_compra_element.should_not visible
|
78
|
+
@page.nombre_titular_tarjeta_element.set("diegoqaromero")
|
79
|
+
@page.comprar_element.click
|
80
|
+
@page.popup_transicion_compra_element.should_not visible
|
81
|
+
@page.nombre_titular_tarjeta_element.set "Diego qa romero"
|
82
|
+
@page.mail_contacto_element.set("123")
|
83
|
+
@page.comprar_element.click
|
84
|
+
@page.popup_transicion_compra_element.should_not visible
|
85
|
+
@page.mail_contacto_element.set(nil)
|
86
|
+
@page.comprar_element.click
|
87
|
+
@page.popup_transicion_compra_element.should_not visible
|
88
|
+
@page.mail_contacto_element.set("testvuelos@despegar.com")
|
89
|
+
@page.mail_contacto_confimacion_element.set("123")
|
90
|
+
@page.comprar_element.click
|
91
|
+
@page.popup_transicion_compra_element.should_not visible
|
92
|
+
@page.mail_contacto_confimacion_element.set(nil)
|
93
|
+
@page.comprar_element.click
|
94
|
+
@page.popup_transicion_compra_element.should_not visible
|
95
|
+
@page.mail_contacto_confimacion_element.set("testvuelos@despegar.com")
|
96
|
+
@page.numero_contacto_element.set ("#{}")
|
97
|
+
@page.comprar_element.click
|
98
|
+
@page.popup_transicion_compra_element.should_not visible
|
99
|
+
@page.numero_contacto_element.set (nil)
|
100
|
+
@page.comprar_element.click
|
101
|
+
@page.popup_transicion_compra_element.should_not visible
|
102
|
+
@page.numero_contacto_element.set("2345679")
|
103
|
+
@page.condiciones_de_compra_element.set(true)
|
104
|
+
@page.comprar_element.click
|
105
|
+
@page.popup_transicion_compra_element.should_not visible
|
106
|
+
end
|
107
|
+
|
108
|
+
Entonces(/^verifico que sean visibles los campos obligatorios$/) do
|
109
|
+
index = 0
|
110
|
+
@page.browser.execute_script("javascript:void($('.other-passenger-inputs').css('display','block'));")
|
111
|
+
@page.manage_data.adt.times do |adulto|
|
112
|
+
@page.nombre_elements[index].should visible
|
113
|
+
@page.apellido_elements[index].should visible
|
114
|
+
@page.nacionalidad_elements[index].select_value(AllPages.site) if @page.nacionalidad_elements[index].present?
|
115
|
+
index += 1
|
116
|
+
end
|
117
|
+
@page.manage_data.cnn.times do |adulto|
|
118
|
+
@page.nombre_elements[index].should visible
|
119
|
+
@page.apellido_elements[index].should visible
|
120
|
+
@page.dia_nacimiento_elements[index].should visible
|
121
|
+
@page.mes_nacimiento_elements[index].should visible
|
122
|
+
@page.ano_nacimiento_elements[index].should visible
|
123
|
+
@page.nacionalidad_elements[index].select_value(AllPages.site) if @page.nacionalidad_elements[index].present?
|
124
|
+
index += 1
|
125
|
+
end
|
126
|
+
@page.manage_data.inf.times do |adulto|
|
127
|
+
@page.nombre_elements[index].should visible
|
128
|
+
@page.apellido_elements[index].should visible
|
129
|
+
@page.dia_nacimiento_elements[index].should visible
|
130
|
+
@page.mes_nacimiento_elements[index].should visible
|
131
|
+
@page.ano_nacimiento_elements[index].should visible
|
132
|
+
@page.nacionalidad_elements[index].select_value(AllPages.site) if @page.nacionalidad_elements[index].present?
|
133
|
+
index += 1
|
134
|
+
end
|
135
|
+
if AllPages.site=="AR"
|
136
|
+
@page.un_pago_argentina_element.should visible
|
137
|
+
else
|
138
|
+
@page.un_pago_element.should visible
|
139
|
+
end
|
140
|
+
@page.tarjeta_element.should visible
|
141
|
+
@page.numero_tarjeta_element.should visible
|
142
|
+
@page.mes_vencimiento_tarjeta_element.should visible
|
143
|
+
@page.ano_vencimiento_tarjeta_element.should visible
|
144
|
+
@page.codigo_seguridad_tarjeta_element.should visible
|
145
|
+
end
|
146
|
+
|
147
|
+
Entonces(/^verifico que se desplieguen las alertas de campos con datos invalidos$/) do
|
148
|
+
@page.comprar_element.click
|
149
|
+
(@page.manage_data.adt+@page.manage_data.cnn+@page.manage_data.inf).times do |time|
|
150
|
+
@page.nombre_elements[time].set("123#{time}")
|
151
|
+
@page.apellido_elements[time].set("123#{time}")
|
152
|
+
@page.comprar_element.click
|
153
|
+
@page.error_primer_nombre_erroneo_elements[time].should visible
|
154
|
+
@page.error_apellido_erroneo_elements[time].should visible
|
155
|
+
@page.nombre_elements[time].set("@%$$$#{time}")
|
156
|
+
@page.apellido_elements[time].set("@%&&&#{time}")
|
157
|
+
@page.comprar_element.click
|
158
|
+
@page.error_primer_nombre_erroneo_elements[time].should visible
|
159
|
+
@page.error_apellido_erroneo_elements[time].should visible
|
160
|
+
end
|
161
|
+
@page.codigo_seguridad_tarjeta_element.set("052545454")
|
162
|
+
@page.comprar_element.click
|
163
|
+
@page.error_codigo_seguridad_invalido_element.should visible
|
164
|
+
@page.mes_vencimiento_tarjeta_element.select "1"
|
165
|
+
@page.ano_vencimiento_tarjeta_element.select (Date.today.year).to_s
|
166
|
+
@page.comprar_element.click
|
167
|
+
@page.nombre_titular_tarjeta_element.set("diegoqaromero")
|
168
|
+
@page.comprar_element.click
|
169
|
+
@page.error_usuario_tarjeta_invalido_element.should visible
|
170
|
+
@page.mail_contacto_element.set("123")
|
171
|
+
@page.comprar_element.click
|
172
|
+
@page.error_mail_erroneo_element.should visible
|
173
|
+
@page.mail_contacto_confimacion_element.set("123")
|
174
|
+
@page.comprar_element.click
|
175
|
+
@page.error_repetir_mail_erroneo_element.should visible
|
176
|
+
end
|
177
|
+
|
178
|
+
Entonces(/^verifico que se muestre el combo de codigo de telefono de pais$/) do
|
179
|
+
@page.pais_contacto_element.should visible
|
180
|
+
@page.pais_contacto_element.set("XX")
|
181
|
+
@page.pais_contacto_element.send_keys :tab
|
182
|
+
@page.pais_contacto_element.value.should equal("XX")
|
183
|
+
@page.pais_contacto_element.set("Argentina (54)")
|
184
|
+
@page.pais_contacto_element.send_keys :enter
|
185
|
+
end
|
186
|
+
|
187
|
+
Entonces(/^verifico que se muestren los campos de factura$/) do
|
188
|
+
if AllPages.site=="AR"
|
189
|
+
option = ["FINAL","INSCR","EXENT","MONOTRIBUTO"][rand(3)]
|
190
|
+
@page.situacion_fiscal_element.select_value(option)
|
191
|
+
@page.formulario_facturacion_element.should visible("formulario de factura")
|
192
|
+
@page.cuil_element.should visible
|
193
|
+
@page.situacion_fiscal_element.should visible
|
194
|
+
if option!="FINAL"
|
195
|
+
@page.provincia_facturacion_element.should visible
|
196
|
+
@page.ciudad_facturacion_custom_element.should visible
|
197
|
+
@page.calle_facturacion_element.should visible
|
198
|
+
@page.codigo_postal_facturacion_element.should visible
|
199
|
+
@page.numero_facturacion_element.should visible
|
200
|
+
@page.piso_facturacion_element.should visible
|
201
|
+
@page.departamento_facturacion_element.should visible
|
202
|
+
end
|
203
|
+
else
|
204
|
+
@page.invoice_check_element.should visible
|
205
|
+
@page.invoice_check_element.set(true)
|
206
|
+
@page.cuil_element.should visible
|
207
|
+
@page.nombre_facturacion_element.should visible
|
208
|
+
@page.estado_entrega_tarjeta_element.should visible
|
209
|
+
@page.ciudad_facturacion_custom_element.should visible
|
210
|
+
@page.calle_entrega_tarjeta_element.should visible
|
211
|
+
if AllPages.site.match("MX")
|
212
|
+
@page.mail_facturacion_element.should_not visible
|
213
|
+
@page.codigo_postal_facturacion_element.should visible
|
214
|
+
@page.numero_facturacion_element.should visible
|
215
|
+
@page.piso_facturacion_element.should visible
|
216
|
+
@page.departamento_facturacion_element.should visible
|
217
|
+
@page.buscar_codigo_postal_element.should visible
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
Entonces(/^verifico texto de error de campos de factura vacio$/) do
|
223
|
+
@page.comprar_element.click
|
224
|
+
@page.error_cuit_vacio_element.text.no_accents.should match("Por favor, ingrese el RFC de la razon social informada|Por favor, ingrese un numero de RUC|Por favor, ingrese el CUI")
|
225
|
+
if AllPages.site=="MX"
|
226
|
+
@page.error_razon_social_vacio_element.text.no_accents.should match("Por favor, ingrese el nombre o razon social")
|
227
|
+
@page.error_mail_facturacion_vacio_element.text.no_accents.should match("Por favor, ingrese el e-mail donde desea recibir la factura fiscal")
|
228
|
+
@page.error_ciudad_facturacion_vacio_element.text.no_accents.should match("Por favor, ingrese la colonia del domicilio fiscal")
|
229
|
+
@page.error_codigo_postal_facturacion_vacio_element.text.no_accents.should match("Por favor, ingrese el codigo postal del domicilio fiscal")
|
230
|
+
@page.error_direccion_facturacion_vacio_element.text.no_accents.should match("Por favor, complete la direccion")
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
Entonces(/^verifico texto de error de campos de factura con datos erroneos$/) do
|
235
|
+
@page.cuil_element.set("##%#}")
|
236
|
+
@page.comprar_element.click
|
237
|
+
if AllPages.site=="MX"
|
238
|
+
@page.error_cuit_erroneo_element.text.no_accents.should match("Por favor, ingrese un RFC valido")
|
239
|
+
@page.mail_facturacion_element.set("qwerty")
|
240
|
+
@page.comprar_element.click
|
241
|
+
@page.error_mail_facturacion_element.text.no_accents.should match("El e-mail ingresado posee caracteres invalidos. Por favor verifique la direccion ingresada")
|
242
|
+
elsif AllPages.site=="PE"
|
243
|
+
@page.error_ruc_erroneo_element.text.no_accents.should match("Por favor, verifique que el RUC contenga exactamente 11 digitos")
|
244
|
+
end
|
245
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
Cuando(/^me logueo como usuario "(.*?)" y pass "(.*?)"$/) do |arg1, arg2|
|
3
|
+
@page.checkout_login_element.should visible("login de usuario")
|
4
|
+
if @page.log_out_checkout_element.present?
|
5
|
+
@page.log_out_checkout_element.click
|
6
|
+
step "verifico que ingrese al checkout"
|
7
|
+
end
|
8
|
+
@page.log_in_checkout_element.click
|
9
|
+
step "me logueo con usuario \"#{arg1}\" y pass \"#{arg2}\""
|
10
|
+
end
|
11
|
+
|
12
|
+
Entonces(/^verifico que se haya logueado correctamente$/) do
|
13
|
+
@page.usuario_logueado_checkout_element.text.no_accents.should match('Hola, Diego QA ROmero|Ola, Diego QA ROmero|Hello, Diego QA ROmero')
|
14
|
+
@page.log_out_checkout_element.should visible("link de deslogueo")
|
15
|
+
end
|
16
|
+
|
17
|
+
Entonces(/^verifico que se muestren las tarjetas guardadas$/) do
|
18
|
+
@page.tarjetas_guardadas_element.should visible("store de tarjetas guardadas")
|
19
|
+
@page.browser.execute_script("javascript:void($('#stored-cards .display-cards').click())") if @page.mostrar_cartas_guardadas_element.text.no_accents.downcase.match("mas|mais|more")
|
20
|
+
sleep(1)
|
21
|
+
index = 0
|
22
|
+
@page.container_tarjetas_elements.each do |ul|
|
23
|
+
ul.radio(:class,'radio').click
|
24
|
+
sleep(0.5)
|
25
|
+
ul.text_field(:id,"stored-card-#{index}-security-code").should visible("codigo de seguridad")
|
26
|
+
index = index + 1
|
27
|
+
end
|
28
|
+
@page.nueva_tarjeta_element.should visible("opcion nueva tarjeta")
|
29
|
+
end
|
30
|
+
|
31
|
+
Entonces(/^elijo una tarjeta ya guardada$/) do
|
32
|
+
if AllPages.site=="BR"
|
33
|
+
@page.browser.execute_script("javascript:void($('#stored-cards .display-cards').click())") if @page.mostrar_cartas_guardadas_element.text.no_accents.downcase.match("mas|mais|more")
|
34
|
+
ul = @page.container_tarjetas_elements.to_a.select{|ul| ul.li(:class,'item owner-name').text.match(/BR/)}.first
|
35
|
+
pending("no se encontro usuario de tarjeta para brasil") unless ul
|
36
|
+
ul.radio(:class,'radio').click
|
37
|
+
ul.text_fields[0].set("123")
|
38
|
+
else
|
39
|
+
@page.opcion_tarjeta_guardada_element.click
|
40
|
+
@page.codigo_seguridad_tarjeta_guardada_element.set("123")
|
41
|
+
end
|
42
|
+
if @page.datos_tarjeta_guardada_element.present?
|
43
|
+
@page.ciudad_entrega_tarjeta_element.set("Ciudad") if @page.ciudad_entrega_tarjeta_element.present?
|
44
|
+
@page.calle_entrega_tarjeta_element.set("Calle") if @page.calle_entrega_tarjeta_element.present?
|
45
|
+
@page.estado_entrega_tarjeta_element.select(@page.estado_entrega_tarjeta_options[3]) if @page.estado_entrega_tarjeta_element.present?
|
46
|
+
@page.cp_entrega_tarjeta_element.set "1182" if @page.cp_entrega_tarjeta_element.present?
|
47
|
+
@page.numero_entrega_tarjeta_element.set "1234" if @page.numero_entrega_tarjeta_element.present?
|
48
|
+
@page.piso_entrega_tarjeta_element.set "3" if @page.piso_entrega_tarjeta_element.present?
|
49
|
+
@page.depto_entrega_tarjeta_element.set "A" if @page.depto_entrega_tarjeta_element.present?
|
50
|
+
end
|
51
|
+
end
|
@@ -1,4 +1,17 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
Cuando(/^ingreso a la pagina de checkout de agencia en "(.*?)" para una busqueda "(.*?)" del tipo "(.*?)"$/) do |arg1, arg2, arg3|
|
3
|
+
Helpers.set_date_language(arg1)
|
4
|
+
@page = Checkout::CheckoutPage.new($browser)
|
5
|
+
begin
|
6
|
+
@page.load_page(arg2,arg1,$ENV,arg3)
|
7
|
+
rescue
|
8
|
+
pending("No se encontraron resultados para la busqueda #{@page.manage_data.generate_url_results_search}")
|
9
|
+
end
|
10
|
+
@page.set_cookies
|
11
|
+
@page.elegir_idioma
|
12
|
+
@page.pasajeros_element.when_visible(timeout=120)
|
13
|
+
end
|
14
|
+
|
2
15
|
Cuando(/^espero que termine de cargar la pagina de checkout$/) do
|
3
16
|
@page = Checkout::CheckoutPage.new($browser)
|
4
17
|
@page.pasajeros_element.when_visible(timeout=120)
|
@@ -10,7 +23,7 @@ end
|
|
10
23
|
|
11
24
|
Entonces(/^espero que termine el pedido de compra$/) do
|
12
25
|
@page.popup_transicion_compra_element.when_not_visible(timeout=200)
|
13
|
-
Watir::Wait.until(timeout=200){@page.checkout_id_element.present? or @page.popup_nuevo_vuelo_element.present? or @page.popup_nuevo_precio_element.present? or @page.error_datos_element.present? or @page.notificacion_error_element.present? or @page.notificacion_warning_element.present? or @page.notificacion_error_ux_element.present?}
|
26
|
+
Watir::Wait.until(timeout=200){@page.checkout_id_cash_element.present? or @page.checkout_id_element.present? or @page.popup_nuevo_vuelo_element.present? or @page.popup_nuevo_precio_element.present? or @page.error_datos_element.present? or @page.notificacion_error_element.present? or @page.notificacion_warning_element.present? or @page.notificacion_error_ux_element.present?}
|
14
27
|
end
|
15
28
|
|
16
29
|
Y(/^verifico si no trae errores$/) do
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
Entonces( /^completo el mail de contacto para forzar cambio de precio$/) do
|
3
|
+
@itinerario_checkout = @page.datos_itinerario
|
4
|
+
price = (@itinerario_checkout.tarifas["total"].valor * 0.1).to_i
|
5
|
+
@page.mail_contacto_element.set("mockedbooking_priceDifference_#{price}_#{price}@despegar.com")
|
6
|
+
@page.mail_contacto_confimacion_element.set("mockedbooking_priceDifference_#{price}_#{price}@despegar.com")
|
7
|
+
end
|
8
|
+
|
9
|
+
Entonces( /^verifico el popup de cambio de precio$/) do
|
10
|
+
@page.opcion_si_price_jump_element.should visible("boton aceptar cambio de precio")
|
11
|
+
@page.link_price_jump_element.should visible("boton ver otros vuelos")
|
12
|
+
doc = Hpricot.parse(@page.popup_price_jump_element.html)
|
13
|
+
@itinerario_checkout = @page.datos_itinerario
|
14
|
+
@precio_inicial = Price.new((doc/"p.paragraph span.currency").first.inner_text.strip + " " + (doc/"p.paragraph span.amount").first.inner_text.strip)
|
15
|
+
@itinerario_checkout.tarifas['total'].value.should be_within(2).of(@precio_inicial.value)
|
16
|
+
@precio_final = Price.new((doc/"p.paragraph span.currency").last.inner_text.strip + " " + (doc/"p.paragraph span.amount").last.inner_text.strip)
|
17
|
+
end
|
18
|
+
|
19
|
+
Cuando(/^espero que cargue el popup de cambio de precio$/) do
|
20
|
+
begin
|
21
|
+
@page.popup_price_jump_element.when_visible(timeout=60)
|
22
|
+
rescue Watir::Wait::TimeoutError
|
23
|
+
pending("No se mostro el popup de cambio de precio")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
Y(/^elijo el mismo vuelo que cambio de precio$/) do
|
28
|
+
@page.opcion_si_price_jump_element.click
|
29
|
+
end
|
30
|
+
|
31
|
+
Y(/^verifico que el nuevo precio final sea el correcto$/) do
|
32
|
+
@precio_final.value.should be_within(3).of(@monto_total)
|
33
|
+
end
|
34
|
+
|
35
|
+
Y(/^espero que cargue las preguntas de riesgo$/) do
|
36
|
+
Watir::Wait.until(timeout=300){(@page.seccion_preguntas_riesgo_element.present?) or @page.checkout_id_element.present?}
|
37
|
+
sleep(1)
|
38
|
+
end
|
39
|
+
|
40
|
+
Y(/^se muestran las preguntas de riesgo$/) do
|
41
|
+
@page.seccion_preguntas_riesgo_element.should visible
|
42
|
+
end
|
43
|
+
|
44
|
+
Y(/^completo las preguntas de riesgo$/) do
|
45
|
+
@page.secciones_preguntas_riesgo_elements.to_a.each do |section|
|
46
|
+
section.radio(:class,'radio checkout-radio').set()
|
47
|
+
end
|
48
|
+
@page.enviar_preguntas_riesgo_element.click
|
49
|
+
end
|
50
|
+
|
51
|
+
Y(/^elijo otro vuelo por el que cambio de vuelo$/) do
|
52
|
+
@page.link_price_jump_element.links[0].click
|
53
|
+
end
|
54
|
+
|
55
|
+
Y(/^elijo mas de una cuota con intereses$/) do
|
56
|
+
@page.pago_con_intereses_element.set if @page.con_intereses_element.radio(:value,/VI/).present?
|
57
|
+
end
|
58
|
+
|
59
|
+
Entonces(/^elijo otro itinerario$/) do
|
60
|
+
@popup_no_disponibilidad_page.sumar_aparicion
|
61
|
+
pending("La cantidad de compras supero las #{@popup_no_disponibilidad_page.apariciones} apariciones") if @popup_no_disponibilidad_page.apariciones > 5
|
62
|
+
@popup_no_disponibilidad_page.itinerario_element.when_visible(timeout=30)
|
63
|
+
@popup_no_disponibilidad_page.cargar_itinerarios
|
64
|
+
@itinerario_checkout = @popup_no_disponibilidad_page.elegir_itinerario(0)
|
65
|
+
step "verifico que ingrese al checkout"
|
66
|
+
step "verifico que la pagina no rompa"
|
67
|
+
end
|