flights_gui_henry_tests_ds 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/features/data/home-offers-config.csv +883 -0
- data/features/data/host.yml +78 -0
- data/features/data/miles.yml +216 -0
- data/features/data/search.yml +27 -0
- data/features/data/sites.yml +49 -0
- data/features/data/sites.yml.orig +54 -0
- data/features/data/tag_microsoft.yml +68 -0
- data/features/step_definitions/checkout/agencia_steps.rb +6 -0
- data/features/step_definitions/checkout/cash_payment_steps.rb +70 -0
- data/features/step_definitions/checkout/chat_steps.rb +57 -0
- data/features/step_definitions/checkout/checkout_steps.rb +265 -0
- data/features/step_definitions/checkout/cupones_steps.rb +36 -0
- data/features/step_definitions/checkout/error_messages.rb +291 -0
- data/features/step_definitions/checkout/fast_checkout.rb +55 -0
- data/features/step_definitions/checkout/price_jump_steps.rb +70 -0
- data/features/step_definitions/checkout/seguros_steps.rb +79 -0
- data/features/step_definitions/checkout/thanks_steps.rb +81 -0
- data/features/step_definitions/content/contents_steps.rb +140 -0
- data/features/step_definitions/desambiguation/disambiguation_airports_steps.rb +82 -0
- data/features/step_definitions/desambiguation/disambiguation_city_steps.rb +53 -0
- data/features/step_definitions/filter/filters_airlines.rb +37 -0
- data/features/step_definitions/filter/filters_airports_steps.rb +31 -0
- data/features/step_definitions/filter/filters_price_steps.rb +91 -0
- data/features/step_definitions/filter/filters_stops_steps.rb +44 -0
- data/features/step_definitions/filter/filters_time_steps.rb +146 -0
- data/features/step_definitions/filter/matrix_steps.rb +276 -0
- data/features/step_definitions/landing/landing_checkout_steps.rb +49 -0
- data/features/step_definitions/landing/landing_filters_steps.rb +17 -0
- data/features/step_definitions/landing/landing_home_alerts_steps.rb +21 -0
- data/features/step_definitions/landing/landing_home_steps.rb +82 -0
- data/features/step_definitions/landing/landing_long_tail.rb +58 -0
- data/features/step_definitions/landing/landing_negative_steps.rb +128 -0
- data/features/step_definitions/landing/landing_passenger_review_steps.rb +8 -0
- data/features/step_definitions/landing/landing_steps.rb +348 -0
- data/features/step_definitions/orders/orders.rb +83 -0
- data/features/step_definitions/others/advancedgui_steps.rb +28 -0
- data/features/step_definitions/others/advancednogui_steps.rb +34 -0
- data/features/step_definitions/others/anticipatedsearch_steps.rb +13 -0
- data/features/step_definitions/others/cookies_steps.rb +40 -0
- data/features/step_definitions/others/flights_tracker_steps.rb +74 -0
- data/features/step_definitions/others/generic_steps.rb +33 -0
- data/features/step_definitions/others/newsletter_steps.rb +29 -0
- data/features/step_definitions/others/one_day_search.rb +58 -0
- data/features/step_definitions/others/print_steps.rb +26 -0
- data/features/step_definitions/others/querystringparameters_steps.rb +6 -0
- data/features/step_definitions/others/recommendation_steps.rb +78 -0
- data/features/step_definitions/others/render_steps.rb +70 -0
- data/features/step_definitions/others/tag_steps.rb +164 -0
- data/features/step_definitions/others/upgrade_bussines_steps.rb +27 -0
- data/features/step_definitions/results/devtools_steps.rb +10 -0
- data/features/step_definitions/results/itineraries_steps.rb +43 -0
- data/features/step_definitions/results/load_steps.rb +73 -0
- data/features/step_definitions/results/results_steps.rb +79 -0
- data/features/step_definitions/results/search_steps.rb +115 -0
- data/features/step_definitions/search/alerts_steps.rb +132 -0
- data/features/step_definitions/search/basefare_steps.rb +88 -0
- data/features/step_definitions/search/bestprices_steps.rb +70 -0
- data/features/step_definitions/search/cross_sell_row_hoteles.rb +52 -0
- data/features/step_definitions/search/cross_sell_steps.rb +15 -0
- data/features/step_definitions/search/delays_steps.rb +67 -0
- data/features/step_definitions/search/details_steps.rb +9 -0
- data/features/step_definitions/search/ecoflights_steps.rb +9 -0
- data/features/step_definitions/search/errors_steps.rb +24 -0
- data/features/step_definitions/search/fenix_steps.rb +99 -0
- data/features/step_definitions/search/flight_gui_steps.rb +376 -0
- data/features/step_definitions/search/miles_step.rb +13 -0
- data/features/step_definitions/search/pagination_steps.rb +29 -0
- data/features/step_definitions/search/reviews_step.rb +58 -0
- data/features/step_definitions/search/search_no_gui_steps.rb +185 -0
- data/features/step_definitions/search/wish_list_steps.rb +128 -0
- data/features/support/env.rb +86 -0
- data/features/support/lib/clusters.rb +6 -0
- data/features/support/lib/clusters/checkout_cluster.rb +111 -0
- data/features/support/lib/clusters/data/data.rb +33 -0
- data/features/support/lib/clusters/details/details_cluster.rb +36 -0
- data/features/support/lib/clusters/results/landing_cluster.rb +87 -0
- data/features/support/lib/clusters/results/render_cluster.rb +86 -0
- data/features/support/lib/clusters/results_cluster.rb +168 -0
- data/features/support/lib/helpers.rb +5 -0
- data/features/support/lib/helpers/browser.rb +235 -0
- data/features/support/lib/helpers/checkout.rb +29 -0
- data/features/support/lib/helpers/clusters.rb +166 -0
- data/features/support/lib/helpers/landing.rb +121 -0
- data/features/support/lib/helpers/render.rb +135 -0
- data/features/support/lib/price.rb +66 -0
- data/features/support/lib/process_manager.rb +104 -0
- data/features/support/lib/services.rb +4 -0
- data/features/support/lib/services/fenix.rb +14 -0
- data/features/support/lib/services/landing.rb +18 -0
- data/features/support/lib/services/results.rb +62 -0
- data/features/support/matchers.rb +120 -0
- data/features/support/redefinitions.rb +42 -0
- data/features/tests/checkout/agency.feature +27 -0
- data/features/tests/checkout/button_cac.feature +53 -0
- data/features/tests/checkout/cash_payment.feature +50 -0
- data/features/tests/checkout/compras_duplicadas.feature +95 -0
- data/features/tests/checkout/cupones.feature +34 -0
- data/features/tests/checkout/error_messages.feature +80 -0
- data/features/tests/checkout/fast_checkout.feature +82 -0
- data/features/tests/checkout/integration.feature +235 -0
- data/features/tests/checkout/low_cost.feature +62 -0
- data/features/tests/checkout/online_payment.feature +50 -0
- data/features/tests/checkout/price_jump.feature +103 -0
- data/features/tests/checkout/providers.feature +76 -0
- data/features/tests/checkout/seguros.feature +42 -0
- data/features/tests/contents/costs.feature +29 -0
- data/features/tests/contents/rules.feature +58 -0
- data/features/tests/contents/webcheckin.feature +26 -0
- data/features/tests/desambiguation/airports.feature +89 -0
- data/features/tests/desambiguation/airports_landing.feature +88 -0
- data/features/tests/desambiguation/city.feature +86 -0
- data/features/tests/filters/filters.feature +113 -0
- data/features/tests/fixes/advancedgui.feature +171 -0
- data/features/tests/fixes/advancednogui.feature +60 -0
- data/features/tests/fixes/book_no_gui.feature +21 -0
- data/features/tests/fixes/cross_sell_row_hoteles.feature +70 -0
- data/features/tests/fixes/facebook.feature +31 -0
- data/features/tests/fixes/landing_checkout.feature +286 -0
- data/features/tests/fixes/landing_home_alerts.feature +82 -0
- data/features/tests/fixes/matrix_stops.feature +104 -0
- data/features/tests/fixes/one_day_search.feature +63 -0
- data/features/tests/fixes/print.feature +87 -0
- data/features/tests/fixes/searches_no_gui.feature +85 -0
- data/features/tests/fixes/upgrade_bussines.feature +100 -0
- data/features/tests/landing/landing_alerts.feature +93 -0
- data/features/tests/landing/landing_filters.feature +171 -0
- data/features/tests/landing/landing_home.feature +68 -0
- data/features/tests/landing/landing_integration.feature +149 -0
- data/features/tests/landing/landing_long_tail.feature +169 -0
- data/features/tests/landing/landing_matrix.feature +152 -0
- data/features/tests/landing/landing_negative.feature +151 -0
- data/features/tests/landing/landing_orders.feature +79 -0
- data/features/tests/landing/landing_pagination.feature +141 -0
- data/features/tests/landing/landing_passenger_review.feature +135 -0
- data/features/tests/landing/landing_positive.feature +151 -0
- data/features/tests/landing/landing_reviews.feature +135 -0
- data/features/tests/landing/landing_sort.feature +140 -0
- data/features/tests/landing/landing_tags.feature +142 -0
- data/features/tests/matrix/matrix_airlines.feature +80 -0
- data/features/tests/matrix/matrix_fare_chart.feature +40 -0
- data/features/tests/matrix/matrix_price.feature +40 -0
- data/features/tests/others/alerts.feature +89 -0
- data/features/tests/others/anticipatedsearch.feature +82 -0
- data/features/tests/others/chat.feature +23 -0
- data/features/tests/others/flights_tracker.feature +94 -0
- data/features/tests/others/newsletter.feature +118 -0
- data/features/tests/others/querystringparameters.feature +82 -0
- data/features/tests/others/recommendation.feature +107 -0
- data/features/tests/others/semaphore.feature +206 -0
- data/features/tests/search/basefare.feature +89 -0
- data/features/tests/search/errors.feature +198 -0
- data/features/tests/search/itineraries.feature +92 -0
- data/features/tests/search/orders.feature +88 -0
- data/features/tests/search/pagination.feature +73 -0
- data/features/tests/search/reviews.feature +83 -0
- data/features/tests/search/searches.feature +214 -0
- data/features/tests/search/wish_list.feature +58 -0
- data/flights_gui_henry_tests.gemspec +32 -0
- data/henry-context.yml +17262 -0
- metadata +382 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
Entonces(/^Completo el formulario de deposito$/) do
|
3
|
+
BROWSER.li(:id,'cash-installment').radio(:class,'radio main-radio').set
|
4
|
+
BROWSER.text_field(:id,'contact-contact-full-name').set("Diego Qa Romero") if BROWSER.text_field(:id,'contact-contact-full-name').present?
|
5
|
+
end
|
6
|
+
|
7
|
+
Entonces(/^verifico los texto del formulario de deposito$/) do
|
8
|
+
if $SITE=="US"
|
9
|
+
texto_fecha = ""
|
10
|
+
texto_pasos = ""
|
11
|
+
elsif $SITE=="BR"
|
12
|
+
texto_fecha = ""
|
13
|
+
texto_pasos = ""
|
14
|
+
else
|
15
|
+
texto_fecha = "El deposito debera realizarse hoy, antes del cierre del banco, por caja de una sucursal del Banco Santander Rio"
|
16
|
+
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"
|
17
|
+
end
|
18
|
+
BROWSER.li(:id,'cash-installment').span(:class,'installment-description-info').text.strip.no_accents.should equal(texto_fecha)
|
19
|
+
BROWSER.li(:id,'cash-installment').span(:class,'installment-detail-text').text.strip.no_accents.should equal(texto_pasos)
|
20
|
+
BROWSER.li(:id,'cash-installment').div(:class,'ux-common-message ux-common-message-warning installment-detail-warning ux-common-message-small').should visible("warning en deposito por caja")
|
21
|
+
BROWSER.div(:class,'upselling upselling-disabled').should visible("asistencia al viajero desactivada")
|
22
|
+
end
|
23
|
+
|
24
|
+
Cuando(/^aparece el popup de confirmacion de pago$/) do
|
25
|
+
begin
|
26
|
+
Watir::Wait.until(timeout=20){BROWSER.div(:id,'confirm-payment-popup').present?}
|
27
|
+
rescue Watir::Wait::TimeoutError
|
28
|
+
end
|
29
|
+
BROWSER.div(:id,'confirm-payment-popup').should visible("popup de confirmacion de pago")
|
30
|
+
end
|
31
|
+
|
32
|
+
Entonces(/^elijo la opcion otro metodo$/) do
|
33
|
+
BROWSER.div(:id,'confirm-payment-popup').div(:class,'flights-button-no').click
|
34
|
+
end
|
35
|
+
|
36
|
+
Entonces(/^Verifico que vuelva al checkout correctamente$/) do
|
37
|
+
sleep(1)
|
38
|
+
BROWSER.fieldset(:id,'invoice').text_field(:id,'invoice-city-custom').set("buenos aires") if BROWSER.fieldset(:id,'invoice').text_field(:id,'invoice-city-custom').present?
|
39
|
+
sleep(1)
|
40
|
+
BROWSER.send_keys :enter
|
41
|
+
end
|
42
|
+
|
43
|
+
Entonces(/^Verifico los pasos para hacer el pago online$/) do
|
44
|
+
BROWSER.div(:class,'ux-common-message ux-common-message-warning ').text.no_accents.should equal("Recuerde que el pago debera ser realizado antes de las 20hs, de lo contrario su reserva sera cancelada.")
|
45
|
+
BROWSER.span(:class,'checkout-id').should visible("numero de reserva")
|
46
|
+
BROWSER.divs(:class,'thanks-reservation-homebanking-step').length.should equal(8)
|
47
|
+
BROWSER.span(:class,'thanks-reservation-homebanking-ticket-number').text.should match(@id_cro)
|
48
|
+
BROWSER.span(:class,'thanks-reservation-homebanking-price').text.gsub(/\D+/,'').should match(@monto_total)
|
49
|
+
end
|
50
|
+
|
51
|
+
Entonces(/^Completo el formulario de pago online$/) do
|
52
|
+
BROWSER.li(:id,'homebanking-installment').radio(:class,'radio main-radio').set
|
53
|
+
BROWSER.text_field(:id,'contact-contact-full-name').set("Diego Qa Romero") if BROWSER.text_field(:id,'contact-contact-full-name').present?
|
54
|
+
end
|
55
|
+
|
56
|
+
Entonces(/^elijo la opcion confirmar pago$/) do
|
57
|
+
BROWSER.div(:id,'confirm-payment-popup').div(:class,'flights-button-yes').click
|
58
|
+
end
|
59
|
+
|
60
|
+
Entonces(/^Verifico los pasos para hacer el deposito$/) do
|
61
|
+
BROWSER.div(:class,'ux-common-message ux-common-message-warning ').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.")
|
62
|
+
BROWSER.span(:class,'checkout-id').should visible("numero de reserva")
|
63
|
+
BROWSER.div(:class,'thanks-reservation-info').should visible("datos de deposito")
|
64
|
+
BROWSER.div(:class,'thanks-reservation-info').spans(:class,"thanks-reservation-info-data")[0].text.should equal("Despegar.com.ar")
|
65
|
+
BROWSER.div(:class,'thanks-reservation-info').spans(:class,"thanks-reservation-info-data")[1].text.should equal("30-70130711-5")
|
66
|
+
BROWSER.div(:class,'thanks-reservation-info').spans(:class,"thanks-reservation-info-data")[2].text.should equal("001")
|
67
|
+
BROWSER.div(:class,'thanks-reservation-info').spans(:class,"thanks-reservation-info-data")[3].text.should equal("01")
|
68
|
+
BROWSER.div(:class,'thanks-reservation-info').spans(:class,"thanks-reservation-info-data")[4].text.gsub(/\D+/,'').should match(@monto_total)
|
69
|
+
BROWSER.link(:id,'thanks-reservation-cash-print').should visible("link de impresion")
|
70
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
When /^aplico el js del chat$/ do
|
3
|
+
BROWSER.link(:id,'submit').click
|
4
|
+
#BROWSER.execute_script("javascript:void(function(){showChat();})();")
|
5
|
+
end
|
6
|
+
|
7
|
+
When /^espero que se muestre la caja del chat$/ do
|
8
|
+
value = get_abtesting("showChat")
|
9
|
+
if value < 50
|
10
|
+
Watir::Wait.until(timeout = 100){BROWSER.div(:id,'dtalk-container').div(:id,'openChat').present?}
|
11
|
+
BROWSER.div(:id,'dtalk-container').div(:id,'openChat').should visible
|
12
|
+
sleep(1)
|
13
|
+
BROWSER.div(:id,'dtalk-container').div(:id,'openChat').click
|
14
|
+
else
|
15
|
+
step 'Fuerzo la cookie de abztesting el valor "showChat" al "10"'
|
16
|
+
BROWSER.refresh
|
17
|
+
step 'aplico el js del chat'
|
18
|
+
step 'espero que se muestre la caja del chat'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /^me logueo al chat$/ do
|
23
|
+
Watir::Wait.until(timeout = 100){BROWSER.div(:id,'chatContainer').div(:class,'dtalk-brand').present?}
|
24
|
+
BROWSER.div(:id,'chatContainer').div(:class,'dtalk-brand').should visible
|
25
|
+
BROWSER.div(:id,'chatContainer').div(:class,'dtalk-brand').div(:class,'dtalk-comands').should visible
|
26
|
+
BROWSER.div(:id,'chatContainer').div(:class,'dtalk-brand').div(:class,'dtalk-comands').link(:id,'dtalk-icon-chevron-down').should visible
|
27
|
+
BROWSER.div(:id,'chatContainer').div(:class,'dtalk-brand').div(:class,'dtalk-comands').link(:id,'dtalk-icon-chevron-up').should visible
|
28
|
+
BROWSER.div(:id,'chatContainer').div(:class,'dtalk-brand').div(:class,'dtalk-comands').link(:id,'dtalk-icon-remove').should visible
|
29
|
+
Watir::Wait.until(timeout = 100){BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').present?}
|
30
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').should visible
|
31
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'credentials').should visible
|
32
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'credentials').div(:id,'dtalk-form-login').should visible
|
33
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'credentials').div(:id,'dtalk-form-login').text_field(:id,'dtalk-email').should visible
|
34
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'credentials').div(:id,'dtalk-form-login').text_field(:id,'dtalk-nickname').should visible
|
35
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'credentials').link(:id,'dtalk-login').should visible
|
36
|
+
|
37
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'credentials').div(:id,'dtalk-form-login').text_field(:id,'dtalk-email').set("testvuelos@despegar.com")
|
38
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'credentials').div(:id,'dtalk-form-login').text_field(:id,'dtalk-nickname').set("testing")
|
39
|
+
BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'credentials').link(:id,'dtalk-login').click
|
40
|
+
end
|
41
|
+
|
42
|
+
Then /^verifico que se muestre todo correctamente$/ do
|
43
|
+
Watir::Wait.until(timeout = 45){BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'loading').present?}
|
44
|
+
Watir::Wait.until(timeout = 600){BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').link(:id,'retry_connection').present? or !BROWSER.div(:id,'chatContainer').div(:id,'dtalk-content').div(:id,'loading').present?}
|
45
|
+
end
|
46
|
+
|
47
|
+
And /^Cierro el chat$/ do
|
48
|
+
BROWSER.div(:id,'chatContainer').div(:class,'dtalk-brand').div(:class,'dtalk-comands').link(:id,'dtalk-icon-remove').click
|
49
|
+
Watir::Wait.until(timeout = 30){BROWSER.div(:id,'dtalk-container').span(:class,'close-round-section').present?}
|
50
|
+
Watir::Wait.until(timeout = 30){BROWSER.div(:id,'popup-survey').present?}
|
51
|
+
BROWSER.div(:id,'popup-survey').radio(:value,'11').click
|
52
|
+
BROWSER.div(:id,'popup-survey').radio(:value,'22').click
|
53
|
+
BROWSER.div(:id,'popup-survey').radio(:value,'23').click
|
54
|
+
BROWSER.div(:id,'popup-survey').button(:id,"send-survey").click
|
55
|
+
sleep(1)
|
56
|
+
BROWSER.div(:id,'dtalk-container').span(:class,'close-round-section').click
|
57
|
+
end
|
@@ -0,0 +1,265 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
When /^verifico que los precios de las cuotas se muestran correctamente$/ do
|
3
|
+
interes = nil
|
4
|
+
doc=Hpricot.parse(BROWSER.span(:id,'total-price').html)
|
5
|
+
total_1 = doc.inner_text.gsub(/\D/,'').to_i
|
6
|
+
radios = BROWSER.div(:id,'paymentDefinition').radios
|
7
|
+
i=0
|
8
|
+
radios.each do |radio|
|
9
|
+
if radio.present?
|
10
|
+
radio.click
|
11
|
+
sleep(0.5)
|
12
|
+
doc=Hpricot.parse(BROWSER.span(:id,'total-price').html)
|
13
|
+
total_2 = doc.inner_text.gsub(/\D/,'').to_i
|
14
|
+
unless radio.attribute_value("data-regular-expressions").nil?
|
15
|
+
keys = JSON.parse(radio.attribute_value("data-regular-expressions")).keys
|
16
|
+
if interes or radio.attribute_value("class").match(/radio-with-interest/)
|
17
|
+
validar_cuota_con_intereses(total_1,total_2)
|
18
|
+
else
|
19
|
+
case keys.first
|
20
|
+
when /1(.*)CREDIT(.*)null$/ then validar_cuota_un_pago()
|
21
|
+
when /(.*)CREDIT(.*)null$/ then validar_cuota_con_intereses(total_1,total_2)
|
22
|
+
when /(.*)CREDIT(.*)$/ then validar_cuota_sin_intereses(total_1,total_2)
|
23
|
+
end
|
24
|
+
keys.uniq.length.should equal(keys.length)
|
25
|
+
# doc=Hpricot.parse(BROWSER.div(:id,'card-group').html)
|
26
|
+
# (doc/'select#card-brand option').collect{|option| option.attributes['value']}.sort.should equal(keys.sort)
|
27
|
+
end
|
28
|
+
else
|
29
|
+
interes = true
|
30
|
+
end
|
31
|
+
end
|
32
|
+
if i > 17
|
33
|
+
break
|
34
|
+
end
|
35
|
+
i = i + 1
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
And /^Verifico que se muestren la caja de clientes felices$/ do
|
40
|
+
if $SITE=="US"
|
41
|
+
BROWSER.div(:id,'happy-clients').should_not visible("Se muestra la caja de comentarios en usa")
|
42
|
+
end
|
43
|
+
if BROWSER.div(:id,'happy-clients').present?
|
44
|
+
happy_clients = BROWSER.div(:id,'happy-clients')
|
45
|
+
happy_clients.should visible
|
46
|
+
happy_clients.div(:class,'ux-common-comment').should visible
|
47
|
+
happy_clients.div(:class,'ux-common-comment').text.should match('[A-Z]|[a-z]')
|
48
|
+
happy_clients.div(:class,'ux-common-comment-description').should visible
|
49
|
+
happy_clients.div(:class,'ux-common-comment-description').span(:class,'flights-comment-description').should visible
|
50
|
+
happy_clients.div(:class,'ux-common-comment-description').span(:class,'flights-comment-description').text.no_accents.should match('[A-Z]|[a-z]')
|
51
|
+
happy_clients.div(:class,'ux-common-comment-profile').span(:class,'ux-common-comment-name').should visible
|
52
|
+
happy_clients.div(:class,'ux-common-comment-profile').span(:class,'ux-common-comment-name').text.no_accents.should match('[A-Z]|[a-z]')
|
53
|
+
happy_clients.span(:class,'description').should visible
|
54
|
+
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')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
And /^Verifico que el popup de detalle de compra$/ do
|
59
|
+
BROWSER.div(:id,'ticket').link(:class,'ux-shared-checkout-thanks-more').should visible("Link para popup de detalle de vuelo")
|
60
|
+
BROWSER.div(:id,'ticket').link(:class,'ux-shared-checkout-thanks-more').click
|
61
|
+
Watir::Wait.until(timeout = 20){BROWSER.div(:id,'popup-booking-details').present?}
|
62
|
+
popup_detalle_vuelo = Hpricot.parse(BROWSER.div(:id,'popup-booking-details').html)
|
63
|
+
popup_detalle_vuelo.inner_text.empty?.should_not be_true
|
64
|
+
BROWSER.div(:id,'popup-booking-details').span(:class,'popup-close-button popup-close').click
|
65
|
+
end
|
66
|
+
|
67
|
+
And /^Verifico el pixel de trackeame$/ do
|
68
|
+
doc = Hpricot.parse(BROWSER.html)
|
69
|
+
pixel_trackeame = (doc/"img#PixelTrackeame").first
|
70
|
+
pixel_trackeame.nil?.should_not be_true
|
71
|
+
pixel_trackeame.attributes['src'].should match("idcro=#{@id_cro}&pr=flights&cc=#{$SITE}&exch=(.+)&pri=(.+)&cur=(#{currency($SITE)}|USD)&dn=Despegar")
|
72
|
+
end
|
73
|
+
|
74
|
+
And /^Verifico el pixel de Efrontier$/ do
|
75
|
+
doc = Hpricot.parse(BROWSER.html)
|
76
|
+
doc.inner_html.should match("INITIAL_PIXELS")
|
77
|
+
doc.inner_html.should match("ASYNC_PIXELS")
|
78
|
+
end
|
79
|
+
|
80
|
+
And /^Verifico que se muestre las ofertas de cross selling$/ do
|
81
|
+
BROWSER.div(:class,'ux-common-crossselling').should visible("Cross selling en gracias")
|
82
|
+
end
|
83
|
+
|
84
|
+
And /^Verifico el tag de remarketing de facebook$/ do
|
85
|
+
if $SITE.upcase=="AR"
|
86
|
+
doc = Hpricot.parse(BROWSER.html)
|
87
|
+
tag_script = (doc/"script").select{|script| script.inner_text.match(/fb_param/)}
|
88
|
+
tag_script.first.should be_true
|
89
|
+
(tag_script.length == 1).should be_true
|
90
|
+
tag_script.first.inner_text.should match("connect.facebook.net\/en\_US\/fp.js")
|
91
|
+
tag_noscript = (doc/"noscript").select{|script| script.inner_html.match(/facebook/)}[0]
|
92
|
+
tag_noscript.should be_true
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
And /^Verifico que no se muestre la leyenda de mejor precio garantizado en resultados$/ do
|
97
|
+
if $SITE=="CO"
|
98
|
+
BROWSER.link(:id,'best-price').should_not visible("Link de garantia de mejor precio garantizado")
|
99
|
+
BROWSER.link(:class,'Mejor precio garantizado').should_not visible("Header de garantia de mejor precio garantizado")
|
100
|
+
BROWSER.div(:class,'nibbler-common-footer-sitemap').span(:text,'Mejor precio garantizado').should_not visible("Footer de garantia de mejor precio garantizado")
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
And /^Completo los datos para reservas CAC$/ do
|
105
|
+
BROWSER.execute_script("javascript:void(function(){ShowButtonCAC();})();")
|
106
|
+
BROWSER.li(:id,'cac-installment').radio(:class,'radio main-radio').set
|
107
|
+
if $SITE=="AR"
|
108
|
+
if [true,false][rand(2)]
|
109
|
+
BROWSER.div(:id,'offlinePaymentDefinition').select_list(:id,'owner-type').select_value("COMPANY")
|
110
|
+
BROWSER.div(:id,'offlinePaymentDefinition').text_field(:id,"owner-fiscal-document-number").set(30643063936)
|
111
|
+
else
|
112
|
+
BROWSER.div(:id,'offlinePaymentDefinition').select_list(:id,'owner-type').select_value("PERSON")
|
113
|
+
BROWSER.div(:id,'offlinePaymentDefinition').text_field(:id,'owner-document-number').set(32456734)
|
114
|
+
BROWSER.div(:id,'offlinePaymentDefinition').select_list(:id,'owner-gender').select_value("MALE")
|
115
|
+
end
|
116
|
+
end
|
117
|
+
if BROWSER.text_field(:id,"offline-owner-document-number").present?
|
118
|
+
number = case $SITE
|
119
|
+
when "CL" then "7028168-6"
|
120
|
+
when "BR" then "22233366638"
|
121
|
+
else "32456734"
|
122
|
+
end
|
123
|
+
BROWSER.text_field(:id,"offline-owner-document-number").set(number)
|
124
|
+
end
|
125
|
+
BROWSER.select_list(:id,'offline-owner-gender').select_value("MALE") if BROWSER.select_list(:id,'offline-owner-gender').present?
|
126
|
+
BROWSER.text_field(:id,'contact-contact-full-name').set("Diego Qa Romero") if BROWSER.text_field(:id,'contact-contact-full-name').present?
|
127
|
+
end
|
128
|
+
|
129
|
+
Then /^no se elijio otro vuelo$/ do
|
130
|
+
@pop_up.should_not be_true
|
131
|
+
end
|
132
|
+
|
133
|
+
Then /^se elijio otro vuelo$/ do
|
134
|
+
@pop_up.should be_true
|
135
|
+
end
|
136
|
+
|
137
|
+
Then /^Valido los valores del desglose del checkout$/ do
|
138
|
+
@itinerario_checkout = CheckoutCluster.new(@search.description,Hpricot.parse(BROWSER.div(:id,'detail').html))
|
139
|
+
@itinerario_checkout.validarSumaDesgloce.should be_within(4).of(@itinerario_checkout.tarifas['total'].value)
|
140
|
+
unless @itinerario_checkout.tarifas['adt'].valor.zero?
|
141
|
+
@itinerario_checkout.tarifas['adt'].valor.should be_within(4).of(@itinerario_checkout.tarifas['tarifa_adulto'].valor * @search.adt)
|
142
|
+
end
|
143
|
+
@itinerario.tarifas.each_pair do |key,value|
|
144
|
+
if @itinerario_checkout.tarifas[key] and !value.zero? and value.currency == @itinerario_checkout.tarifas[key].currency
|
145
|
+
value.value.should be_within(4).of(@itinerario_checkout.tarifas[key].value)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
And /^Levanto los datos del vuelo$/ do
|
151
|
+
@cluster_json = @search.get_results_search_service
|
152
|
+
BROWSER.link(:class,'ux-shared-checkout-thanks-more').should visible("Link para popup de detalle de vuelo")
|
153
|
+
BROWSER.link(:class,'ux-shared-checkout-thanks-more').click
|
154
|
+
Watir::Wait.until(timeout = 20){BROWSER.div(:id,'popup-booking-details').present?}
|
155
|
+
popup_detalle_vuelo = Hpricot.parse(BROWSER.div(:id,'popup-booking-details').html)
|
156
|
+
popup_detalle_vuelo.inner_text.empty?.should_not be_true
|
157
|
+
@monto_total=(popup_detalle_vuelo/"span#total-price span.amount").inner_text.gsub(/\.|\,/,'').to_i
|
158
|
+
BROWSER.div(:id,'popup-booking-details').links(:class,'number').each do |a|
|
159
|
+
a.click
|
160
|
+
Watir::Wait.until(timeout=20){BROWSER.div(:class,"flights-popup popup-detail").present?}
|
161
|
+
doc = Hpricot.parse(BROWSER.div(:class,"flights-popup popup-detail").html)
|
162
|
+
detail = DetailsCluster.new(doc)
|
163
|
+
BROWSER.div(:class,"flights-popup popup-detail").span(:class,'popup-close-button popup-close').click
|
164
|
+
Watir::Wait.until(timeout=20){!BROWSER.div(:class,"flights-popup popup-detail").present?}
|
165
|
+
sleep(1)
|
166
|
+
end
|
167
|
+
begin
|
168
|
+
BROWSER.div(:id,'popup-booking-details').span(:class,'popup-close-button popup-close').click
|
169
|
+
@popup_detalle_vuelo = CheckoutCluster.new(@search.description,popup_detalle_vuelo)
|
170
|
+
unless @pop_up
|
171
|
+
puts @popup_detalle_vuelo.tarifas
|
172
|
+
@popup_detalle_vuelo.validarSumaDesgloce.should be_within(4).of(@popup_detalle_vuelo.tarifas['total'].value)
|
173
|
+
unless @popup_detalle_vuelo.tarifas['adt'].valor.zero?
|
174
|
+
@popup_detalle_vuelo.tarifas['adt'].valor.should equal(@popup_detalle_vuelo.tarifas['tarifa_adulto'].valor * @search.adt)
|
175
|
+
end
|
176
|
+
@itinerario_checkout.tarifas.each_pair do |key,value|
|
177
|
+
if @popup_detalle_vuelo.tarifas[key] and !value.zero? and value.currency == @popup_detalle_vuelo.tarifas[key].currency
|
178
|
+
value.should equal(@popup_detalle_vuelo.tarifas[key])
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
rescue Selenium::WebDriver::Error::UnknownError,Selenium::WebDriver::Error::ElementNotVisibleError
|
183
|
+
puts "No se pudo cerrar el popup"
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
When /^Verifico que se muestre el banner de cancelacion$/ do
|
188
|
+
value = get_abtesting "showFreeCancelMessage"
|
189
|
+
data = @search.get_results_search_service
|
190
|
+
provider = @item_json ? @item_json["provider"] : data["result"]["data"]["items"][0]["provider"]
|
191
|
+
if $SITE=="EC" and value < 0
|
192
|
+
BROWSER.div(:id,'cancellation-advice').should visible("banner de cancelacion")
|
193
|
+
BROWSER.div(:id,'cancellation-advice').div(:class,'ux-common-message-content').p(:index,0).text.strip.should equal("¡Compre tranquilo!")
|
194
|
+
BROWSER.div(:id,'cancellation-advice').div(:class,'ux-common-message-content').p(:index,1).text.no_accents.strip.should equal("Si necesita cancelar su compra puede hacerlo gratis desde Mi Despegar hasta las 22 hs. del dia de hoy.")
|
195
|
+
elsif $SITE=="BR" and value < 0 and provider=="TAM"
|
196
|
+
BROWSER.div(:id,'cancellation-advice').should visible("banner de cancelacion")
|
197
|
+
BROWSER.div(:id,'cancellation-advice').div(:class,'ux-common-message-content').p(:index,0).text.strip.should equal("Compre tranquilo! Cancele no mesmo dia sem custo*!")
|
198
|
+
BROWSER.div(:id,'cancellation-advice').div(:class,'ux-common-message-content').p(:index,1).text.no_accents.strip.should equal("* Caso necessite cancelar sua compra, voce podera cancelar sem nenhum custo desde MeuDecolar ate as 20 hrs do mesmo dia da compra.")
|
199
|
+
else
|
200
|
+
BROWSER.div(:id,'cancellation-advice').should_not visible("banner de cancelacion")
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
When /^Verifico que se muestre el popup de compra duplicada$/ do
|
205
|
+
Watir::Wait.until(timeout=60){BROWSER.div(:id,'popup-duplicated-transaction').present?}
|
206
|
+
BROWSER.div(:id,'popup-duplicated-transaction').should visible("popup de compras duplicadas")
|
207
|
+
BROWSER.div(:id,'popup-duplicated-transaction').div(:class,'popup-button button-yes').should visible("boton yes")
|
208
|
+
BROWSER.div(:id,'popup-duplicated-transaction').div(:class,'popup-button button-no').should visible("boton no")
|
209
|
+
BROWSER.div(:id,'popup-duplicated-transaction').link(:title,$SITE=="BR" ? 'Meu Decolar' : 'Mi Despegar').should visible("link a mi despegar")
|
210
|
+
BROWSER.div(:id,'popup-duplicated-transaction').p(:class,'paragraph').text.should match(@id_cro)
|
211
|
+
end
|
212
|
+
|
213
|
+
When /^Elijo comprar el vuelo$/ do
|
214
|
+
BROWSER.div(:id,'popup-duplicated-transaction').div(:class,'popup-button button-yes').click
|
215
|
+
end
|
216
|
+
|
217
|
+
When /^Elijo no comprar el vuelo$/ do
|
218
|
+
BROWSER.div(:id,'popup-duplicated-transaction').div(:class,'popup-button button-no').click
|
219
|
+
end
|
220
|
+
|
221
|
+
When /^Vuelvo a la pagina de resultados original$/ do
|
222
|
+
BROWSER.goto(@search.generate_url_results_search)
|
223
|
+
end
|
224
|
+
|
225
|
+
When /^Verifico que dirija a la home$/ do
|
226
|
+
Watir::Wait.until(timeout=60){BROWSER.url == "#{@search.host}/"}
|
227
|
+
end
|
228
|
+
|
229
|
+
When /^pide factura fiscal$/ do
|
230
|
+
(BROWSER.checkbox(:id,'invoice-check').present? or BROWSER.fieldset(:id,'invoice').present?).should be_true
|
231
|
+
end
|
232
|
+
|
233
|
+
And /^Completo los campos de factura fiscal$/ do
|
234
|
+
container = BROWSER.fieldset(:id,'invoice')
|
235
|
+
if $SITE.upcase.match("AR")
|
236
|
+
option = ["FINAL","INSCR","EXENT","MONOTRIBUTO"][rand(3)]
|
237
|
+
BROWSER.fieldset(:id,'invoice').should visible("formulario de factura")
|
238
|
+
container.select_list(:id,'invoice-fiscal-status').select_value(option)
|
239
|
+
container.text_field(:id,'invoice-fiscal-id').set("30643063936")
|
240
|
+
container.text_field(:id,'invoice-card-holder-name').set("diego qa romero") if container.text_field(:id,'invoice-card-holder-name').present?
|
241
|
+
container.select_list(:id,'invoice-state').select_value("C")
|
242
|
+
container.text_field(:id,'invoice-city-custom').set("buenos aires")
|
243
|
+
sleep(1)
|
244
|
+
BROWSER.send_keys :enter
|
245
|
+
container.text_field(:id,'invoice-street').set("corrientes")
|
246
|
+
container.text_field(:id,'invoice-postal-code').set("7111")
|
247
|
+
container.text_field(:id,'invoice-address-number').set("123")
|
248
|
+
container.text_field(:id,'invoice-address-floor').set("1")
|
249
|
+
container.text_field(:id,'invoice-address-deparment').set("1")
|
250
|
+
else
|
251
|
+
container.checkbox(:id,'invoice-check').set(true) if container.checkbox(:id,'invoice-check').present?
|
252
|
+
container.text_field(:id,'invoice-fiscal-id').set("3334445556")
|
253
|
+
container.text_field(:id,'invoice-card-holder-name').set("diego qa romero")
|
254
|
+
container.select_list(:id,'invoice-state').options[2].select
|
255
|
+
container.text_field(:id,'invoice-city').set("Rosario")
|
256
|
+
container.text_field(:id,'invoice-street').set("corrientes")
|
257
|
+
if $SITE.upcase.match("MX")
|
258
|
+
container.text_field(:id,'invoice-other-state').set("Chiapas") if container.text_field(:id,'invoice-other-state').present?
|
259
|
+
container.text_field(:id,'invoice-postal-code').set("7111")
|
260
|
+
container.text_field(:id,'invoice-address-number').set("123")
|
261
|
+
container.text_field(:id,'invoice-address-floor').set("1")
|
262
|
+
container.text_field(:id,'invoice-address-deparment').set("1")
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
And /^permite cupon de descuento$/ do
|
3
|
+
($SITE=="AR" and $ENV.match("produccion|beta")).should be_true
|
4
|
+
end
|
5
|
+
|
6
|
+
And /^Completo con un cupon de descuento con numero "(.*)"$/ do |num|
|
7
|
+
if BROWSER.div(:id,'dtalk-container').present?
|
8
|
+
BROWSER.div(:id,'dtalk-container').span(:class,'close-round-section').click
|
9
|
+
sleep(1)
|
10
|
+
end
|
11
|
+
container = BROWSER.fieldset(:id,'additionals')
|
12
|
+
container.checkbox(:id,'vouchers').set(true)
|
13
|
+
container.text_field(:id,'voucher-email').set("bookingvuelos@despegar.com")
|
14
|
+
container.text_field(:id,'voucher-code-0').set(num)
|
15
|
+
container.link(:id,'validate-voucher').click
|
16
|
+
end
|
17
|
+
|
18
|
+
And /^Verifico el mensaje de cupon invalido$/ do
|
19
|
+
begin
|
20
|
+
Watir::Wait.until(timeout = 30){BROWSER.div(:id,'coupon-error').present?}
|
21
|
+
rescue Timeout::Error
|
22
|
+
|
23
|
+
end
|
24
|
+
BROWSER.div(:id,'coupon-error').should visible("error de cupon invalido")
|
25
|
+
BROWSER.div(:id,'coupon-error').text.no_accents.should match("El codigo ingresado no existe|That is not a valid code|O codigo inserido nao existe")
|
26
|
+
end
|
27
|
+
|
28
|
+
And /^Verifico el mensaje de cupon valido$/ do
|
29
|
+
begin
|
30
|
+
Watir::Wait.until(timeout = 30){BROWSER.div(:id,'voucher-success').present?}
|
31
|
+
rescue Timeout::Error
|
32
|
+
|
33
|
+
end
|
34
|
+
BROWSER.div(:id,'coupon-error').should_not visible("error de cupon invalido")
|
35
|
+
BROWSER.div(:id,'voucher-success').text.no_accents.should match('Su descuento de (.*) se valido correctamente.|That is not a valid code|O codigo inserido nao existe')
|
36
|
+
end
|
@@ -0,0 +1,291 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
When /^Verifico que sean visibles los campos obligatorios$/ do
|
3
|
+
container = BROWSER.fieldset(:id,'passengers')
|
4
|
+
index = 0
|
5
|
+
BROWSER.execute_script("javascript:void($('.other-passenger-inputs').css('display','block'));")
|
6
|
+
@search.adt.times do |adulto|
|
7
|
+
container.text_field(:id,"passenger-first-name-#{index}").should visible
|
8
|
+
container.text_field(:id,"passenger-last-name-#{index}").should visible
|
9
|
+
container.select_list(:id,"nationality-#{index}").select_value($SITE) if container.select_list(:id,"nationality-#{index}").present?
|
10
|
+
index += 1
|
11
|
+
end
|
12
|
+
@search.cnn.times do |adulto|
|
13
|
+
container.text_field(:id,"passenger-first-name-#{index}").should visible
|
14
|
+
container.text_field(:id,"passenger-last-name-#{index}").should visible
|
15
|
+
container.select_list(:id,"passenger-birthday-day-#{index}").should visible
|
16
|
+
container.select_list(:id,"passenger-birthday-month-#{index}").should visible
|
17
|
+
container.select_list(:id,"passenger-birthday-year-#{index}").should visible
|
18
|
+
container.select_list(:id,"nationality-#{index}").select_value($SITE) if container.select_list(:id,"nationality-#{index}").present?
|
19
|
+
index += 1
|
20
|
+
end
|
21
|
+
@search.inf.times do |adulto|
|
22
|
+
container.text_field(:id,"passenger-first-name-#{index}").should visible
|
23
|
+
container.text_field(:id,"passenger-last-name-#{index}").should visible
|
24
|
+
container.select_list(:id,"passenger-birthday-day-#{index}").should visible
|
25
|
+
container.select_list(:id,"passenger-birthday-month-#{index}").should visible
|
26
|
+
container.select_list(:id,"passenger-birthday-year-#{index}").should visible
|
27
|
+
container.select_list(:id,"nationality-#{index}").select_value($SITE) if container.select_list(:id,"nationality-#{index}").present?
|
28
|
+
index += 1
|
29
|
+
end
|
30
|
+
container = BROWSER.fieldset(:id,'payment')
|
31
|
+
if $SITE=="AR"
|
32
|
+
container.radio(:id,"installment-2").should visible
|
33
|
+
else
|
34
|
+
container.radio(:id,"installment-0").should visible
|
35
|
+
end
|
36
|
+
container.select_list(:id,'card-brand').should visible
|
37
|
+
container.text_field(:id,'card-number').should visible
|
38
|
+
container.select_list(:id,'card-expiration-month').should visible
|
39
|
+
container.select_list(:id,'card-expiration-year').should visible
|
40
|
+
container.text_field(:id,'security-code').should visible
|
41
|
+
end
|
42
|
+
|
43
|
+
When /^Verifico que se desplieguen las alertas de campos vacios$/ do
|
44
|
+
container = BROWSER.fieldset(:id,'passengers')
|
45
|
+
BROWSER.link(:id,'submit').click
|
46
|
+
(@search.adt+@search.cnn+@search.inf).times do |time|
|
47
|
+
container.span(:id,"passenger-first-name-#{time}-missing_field").should visible
|
48
|
+
end
|
49
|
+
container = BROWSER.fieldset(:id,'payment')
|
50
|
+
container.span(:id,"card-number-missing_field").should visible
|
51
|
+
container.span(:id,"expiration-date-missing_field").should visible
|
52
|
+
container.span(:id,"security-code-missing_field").should visible
|
53
|
+
container.span(:id,"owner-name-missing_field").should visible
|
54
|
+
container = BROWSER.fieldset(:id,'contact')
|
55
|
+
container.span(:id,"contact-email-missing_field").should visible
|
56
|
+
container.span(:id,"contact-email-repeat-missing_field").should visible
|
57
|
+
container.span(:id,"phone-0-missing_field").should visible
|
58
|
+
end
|
59
|
+
|
60
|
+
When /^Verifico que se desplieguen las alertas de campos con datos invalidos$/ do
|
61
|
+
container = BROWSER.fieldset(:id,'passengers')
|
62
|
+
(@search.adt+@search.cnn+@search.inf).times do |time|
|
63
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("123#{time}")
|
64
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("123#{time}")
|
65
|
+
BROWSER.link(:id,'submit').click
|
66
|
+
container.span(:id,"passenger-first-name-#{time}-invalid_name").should visible
|
67
|
+
container.span(:id,"passenger-last-name-#{time}-invalid_name").should visible
|
68
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("@%$$$#{time}")
|
69
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("@%&&&#{time}")
|
70
|
+
BROWSER.link(:id,'submit').click
|
71
|
+
begin
|
72
|
+
container.span(:id,"passenger-first-name-#{time}-invalid_name").should visible
|
73
|
+
container.span(:id,"passenger-last-name-#{time}-invalid_name").should visible
|
74
|
+
rescue RSpec::Expectations::ExpectationNotMetError
|
75
|
+
sleep(200)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
container = BROWSER.fieldset(:id,'payment')
|
79
|
+
container.text_field(:id,'security-code').set("052545454")
|
80
|
+
BROWSER.link(:id,'submit').click
|
81
|
+
container.span(:id,"security-code-invalid_card_security_code").should visible
|
82
|
+
container.select_list(:id,'card-expiration-month').select "1"
|
83
|
+
container.select_list(:id,'card-expiration-year').select (Date.today.year).to_s
|
84
|
+
BROWSER.link(:id,'submit').click
|
85
|
+
container.text_field(:id,'owner-name').set("diegoqaromero")
|
86
|
+
BROWSER.link(:id,'submit').click
|
87
|
+
container.span(:id,"owner-name-invalid_card_owner_name").should visible
|
88
|
+
container = BROWSER.fieldset(:id,'contact')
|
89
|
+
container.text_field(:id,'contact-email').set("123")
|
90
|
+
BROWSER.link(:id,'submit').click
|
91
|
+
container.span(:id,"contact-email-invalid_email").should visible
|
92
|
+
container.text_field(:id,'contact-email-repeat').set("123")
|
93
|
+
BROWSER.link(:id,'submit').click
|
94
|
+
container.span(:id,"contact-email-repeat-invalid_email").should visible
|
95
|
+
end
|
96
|
+
|
97
|
+
When /^Verifico intentos de compra con datos invalidos$/ do
|
98
|
+
container = BROWSER.fieldset(:id,'passengers')
|
99
|
+
plus_name=["A","B","C","D","E","F","G","H","I","J","k"]
|
100
|
+
(@search.adt+@search.cnn+@search.inf).times do |time|
|
101
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("123")
|
102
|
+
BROWSER.link(:id,'submit').click
|
103
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
104
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("@%")
|
105
|
+
BROWSER.link(:id,'submit').click
|
106
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
107
|
+
container.text_field(:id,"passenger-first-name-#{time}").set(nil)
|
108
|
+
BROWSER.link(:id,'submit').click
|
109
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
110
|
+
container.text_field(:id,"passenger-first-name-#{time}").set("Martin QA" + plus_name[time])
|
111
|
+
end
|
112
|
+
(@search.adt+@search.cnn+@search.inf).times do |time|
|
113
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("123")
|
114
|
+
BROWSER.link(:id,'submit').click
|
115
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
116
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("@%")
|
117
|
+
BROWSER.link(:id,'submit').click
|
118
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
119
|
+
container.text_field(:id,"passenger-last-name-#{time}").set(nil)
|
120
|
+
BROWSER.link(:id,'submit').click
|
121
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
122
|
+
container.text_field(:id,"passenger-last-name-#{time}").set("Diez" + plus_name[time])
|
123
|
+
end
|
124
|
+
container = BROWSER.fieldset(:id,'payment')
|
125
|
+
container.text_field(:id,'security-code').set("052545454")
|
126
|
+
BROWSER.link(:id,'submit').click
|
127
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
128
|
+
container.text_field(:id,'security-code').set(nil)
|
129
|
+
BROWSER.link(:id,'submit').click
|
130
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
131
|
+
container.select_list(:id,'card-brand').select "Visa" #Se puede hacer un select con regexp?
|
132
|
+
container.text_field(:id,'card-number').set("32454532532")
|
133
|
+
BROWSER.link(:id,'submit').click
|
134
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
135
|
+
container.text_field(:id,'card-number').set(nil)
|
136
|
+
BROWSER.link(:id,'submit').click
|
137
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
138
|
+
container.text_field(:id,'card-number').set("4242424242424242") #Parametrizar
|
139
|
+
container.text_field(:id,'security-code').set("123") #Parametrizar
|
140
|
+
container.select_list(:id,'card-expiration-month').select (Date.today.month).to_s
|
141
|
+
container.select_list(:id,'card-expiration-year').select (Date.today.year).to_s
|
142
|
+
BROWSER.link(:id,'submit').click
|
143
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
144
|
+
container.select_list(:id,'card-expiration-month').select (Date.today.month).to_s
|
145
|
+
container.select_list(:id,'card-expiration-year').select (Date.today.year).to_s
|
146
|
+
container.text_field(:id,"owner-name").set(nil)
|
147
|
+
BROWSER.link(:id,'submit').click
|
148
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
149
|
+
container.text_field(:id,"owner-name").set("diegoqaromero")
|
150
|
+
BROWSER.link(:id,'submit').click
|
151
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
152
|
+
container.text_field(:id,"owner-name").set "Diego qa romero"
|
153
|
+
container = BROWSER.fieldset(:id,'contact')
|
154
|
+
container.text_field(:id,"contact-email").set("123")
|
155
|
+
BROWSER.link(:id,'submit').click
|
156
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
157
|
+
container.text_field(:id,"contact-email").set(nil)
|
158
|
+
BROWSER.link(:id,'submit').click
|
159
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
160
|
+
container.text_field(:id,"contact-email").set("testvuelos@despegar.com")
|
161
|
+
container.text_field(:id,"contact-email-repeat").set("123")
|
162
|
+
BROWSER.link(:id,'submit').click
|
163
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
164
|
+
container.text_field(:id,"contact-email-repeat").set(nil)
|
165
|
+
BROWSER.link(:id,'submit').click
|
166
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
167
|
+
container.text_field(:id,"contact-email-repeat").set("testvuelos@despegar.com")
|
168
|
+
container.text_field(:id,"phone-number-0").set ("#{}")
|
169
|
+
BROWSER.link(:id,'submit').click
|
170
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
171
|
+
container.text_field(:id,"phone-number-0").set (nil)
|
172
|
+
BROWSER.link(:id,'submit').click
|
173
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
174
|
+
container.text_field(:id,"phone-number-0").set("2345679")
|
175
|
+
BROWSER.checkbox(:id=>'read-agreement').set(true)
|
176
|
+
BROWSER.link(:id,'submit').click
|
177
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
178
|
+
end
|
179
|
+
|
180
|
+
When /^Verifico texto de error de banco vacio$/ do
|
181
|
+
BROWSER.empty_other_bank_name_error.should be_visible
|
182
|
+
end
|
183
|
+
|
184
|
+
When /^Verifico que se muestre el combo de codigo de telefono de pais$/ do
|
185
|
+
doc = Hpricot.parse(BROWSER.html)
|
186
|
+
BROWSER.text_field(:id,'country-code-0').should visible
|
187
|
+
BROWSER.text_field(:id,'country-code-0').set("XX")
|
188
|
+
BROWSER.text_field(:id,'country-code-0').send_keys :tab
|
189
|
+
BROWSER.text_field(:id,'country-code-0').value.should equal("XX")
|
190
|
+
#BROWSER.span(:id,'phone-0-invalid').should visible
|
191
|
+
BROWSER.text_field(:id,'country-code-0').set("Argentina (54)")
|
192
|
+
BROWSER.text_field(:id,'country-code-0').send_keys :enter
|
193
|
+
end
|
194
|
+
|
195
|
+
When /^Verifico que se muestren los campos de factura$/ do
|
196
|
+
container = BROWSER.fieldset(:id,'invoice')
|
197
|
+
if $SITE.match("AR")
|
198
|
+
option = ["FINAL","INSCR","EXENT","MONOTRIBUTO"][rand(3)]
|
199
|
+
puts option
|
200
|
+
container.select_list(:id,'invoice-fiscal-status').select_value(option)
|
201
|
+
BROWSER.fieldset(:id,'invoice').should visible("formulario de factura")
|
202
|
+
container.select_list(:id,'invoice-fiscal-status').should visible
|
203
|
+
container.text_field(:id,'invoice-fiscal-id').should visible
|
204
|
+
if option!="FINAL"
|
205
|
+
sleep(60)
|
206
|
+
container.select_list(:id,'invoice-state').should visible
|
207
|
+
container.text_field(:id,'invoice-city-custom').should visible
|
208
|
+
container.text_field(:id,'invoice-street').should visible
|
209
|
+
container.text_field(:id,'invoice-postal-code').should visible
|
210
|
+
container.text_field(:id,'invoice-address-number').should visible
|
211
|
+
container.text_field(:id,'invoice-address-floor').should visible
|
212
|
+
container.text_field(:id,'invoice-address-deparment').should visible
|
213
|
+
end
|
214
|
+
else
|
215
|
+
container.div(:id,'invoiceDefinition.selected.value').should visible
|
216
|
+
container.div(:id,'invoiceDefinition.invoiceDataDefinition').should_not visible
|
217
|
+
container.checkbox(:id,'invoice-check').should visible
|
218
|
+
container.checkbox(:id,'invoice-check').set(true)
|
219
|
+
container.text_field(:id,'invoice-fiscal-id').should visible
|
220
|
+
container.text_field(:id,'invoice-card-holder-name').should visible
|
221
|
+
container.select_list(:id,'invoice-country').should visible
|
222
|
+
container.select_list(:id,'invoice-state').should visible
|
223
|
+
container.text_field(:id,'invoice-city-custom').should visible
|
224
|
+
container.text_field(:id,'invoice-street').should visible
|
225
|
+
if $SITE.match("MX")
|
226
|
+
container.text_field(:id,'invoice-email').should_not visible
|
227
|
+
container.text_field(:id,'invoice-postal-code').should visible
|
228
|
+
container.text_field(:id,'invoice-address-number').should visible
|
229
|
+
container.text_field(:id,'invoice-address-floor').should visible
|
230
|
+
container.text_field(:id,'invoice-address-deparment').should visible
|
231
|
+
container.link(:class,'search-postal-code').should visible
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
When /^Verifico texto de error de campos de factura vacio$/ do
|
237
|
+
container = BROWSER.fieldset(:id,'invoice')
|
238
|
+
BROWSER.link(:id,'submit').click
|
239
|
+
container.span(:id,'invoice-fiscal-id-missing_field').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")
|
240
|
+
if $SITE.match("MX")
|
241
|
+
container.span(:id,'invoice-card-holder-name-missing_field').text.no_accents.should match("Por favor, ingrese el nombre o razon social")
|
242
|
+
container.span(:id,'invoice-email-missing_field').text.no_accents.should match("Por favor, ingrese el e-mail donde desea recibir la factura fiscal")
|
243
|
+
container.span(:id,'invoice-city-missing_field').text.no_accents.should match("Por favor, ingrese la colonia del domicilio fiscal")
|
244
|
+
container.span(:id,'invoice-postal-code-missing_field').text.no_accents.should match("Por favor, ingrese el codigo postal del domicilio fiscal")
|
245
|
+
container.span(:id,'invoice-address-missing_field').text.no_accents.should match("Por favor, complete la direccion")
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
When /^Verifico texto de error de campos de factura con datos erroneos$/ do
|
250
|
+
container = BROWSER.fieldset(:id,'invoice')
|
251
|
+
container.text_field(:id,'invoice-fiscal-id').set("##%#}")
|
252
|
+
BROWSER.link(:id,'submit').click
|
253
|
+
if $SITE.match("MX")
|
254
|
+
container.span(:id,'invoice-fiscal-id-invalid_cuit').text.no_accents.should match("Por favor, ingrese un RFC valido")
|
255
|
+
container.text_field(:id,'invoice-email').set("qwerty")
|
256
|
+
BROWSER.link(:id,'submit').click
|
257
|
+
container.span(:id,'invoice-email-invalid_email').text.no_accents.should match("El e-mail ingresado posee caracteres invalidos. Por favor verifique la direccion ingresada")
|
258
|
+
elsif $SITE.match("PE")
|
259
|
+
container.span(:id,'invoice-fiscal-id-invalid_ruc').text.no_accents.should match("Por favor, verifique que el RUC contenga exactamente 11 digitos")
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
And /^Verifico los campos de cupones de descuento$/ do
|
264
|
+
if BROWSER.checkbox(:id,'vouchers').present?
|
265
|
+
BROWSER.checkbox(:id,'vouchers').set(true)
|
266
|
+
BROWSER.text_field(:id,'voucher-code-0').should visible("caja de texto de codigo de referencia")
|
267
|
+
BROWSER.link(:class,'add-voucher').should_not visible("link de agregar otro codigo de referencia")
|
268
|
+
BROWSER.text_field(:id,'voucher-code-0').set("233332223332223a")
|
269
|
+
BROWSER.checkbox(:id,"invoice-check").set(false) if BROWSER.checkbox(:id,"invoice-check").present?
|
270
|
+
BROWSER.checkbox(:id=>'read-agreement').set(true)
|
271
|
+
BROWSER.link(:id,'submit').click
|
272
|
+
sleep(1)
|
273
|
+
BROWSER.div(:id,'popup-checkout-transition-template').should_not visible
|
274
|
+
Watir::Wait.until(){BROWSER.span(:id,'voucher-code-0-invalid_id').should visible}
|
275
|
+
BROWSER.div(:class,'ux-common-warning ux-common-error').should visible
|
276
|
+
BROWSER.div(:class,'ux-common-warning ux-common-error').text.no_accents.downcase.should match("ocurrio un error con el codigo de referencia")
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
280
|
+
And /^Verifico las nacionalidades de los pasajeros$/ do
|
281
|
+
BROWSER.execute_script("javascript:void($('.other-passenger-inputs').css('display','block'));")
|
282
|
+
if $SITE=~/AR|VE/
|
283
|
+
container = BROWSER.fieldset(:id,'passengers')
|
284
|
+
container.text_field(:id,"passenger-first-name-0").focus
|
285
|
+
container.select_list(:id,'nationality-0').select_value($SITE)
|
286
|
+
container.span(:id,'nationality-0-invalid_custom_nationality').should_not visible("error en la nacionalidad")
|
287
|
+
container.select_list(:id,'nationality-0').select_value("BR")
|
288
|
+
container.span(:id,'nationality-0-invalid_custom_nationality').should visible("error en la nacionalidad")
|
289
|
+
container.span(:id,'nationality-0-invalid_custom_nationality').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.")
|
290
|
+
end
|
291
|
+
end
|