flights_gui_henry_tests 2.8.5 → 2.8.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba175124837964fa56cd231530ba4b52542b083c
4
- data.tar.gz: c8a7f0a9ecf42246fe7e046a976a9374d91969a3
3
+ metadata.gz: 99b702434e50a83b42e318237b8c75c15a203e25
4
+ data.tar.gz: a47b34cf9db4799a62695f3dc453a38043ee0f91
5
5
  SHA512:
6
- metadata.gz: 84b2eccca6197a3f02ce14c0f0d61f24fbf562abf0e02f923fa60c779b42bd5db0b7508687c576350a4266faa7c1eaa2903c35d3af042b6b9aaae8ce37311fbb
7
- data.tar.gz: 01a2a222ff4edb61f950f778b4a4dd222828bdda17a95ca021dcbfaee157f27612bad51268263b43d0afcba7ac7a758a14eee9e497783b561f84a51bb97da710
6
+ metadata.gz: e6982047e8abe8babe662991790a2ac567325a34506c58ec1938b78706c8a6ea4433ee2bba6669e844a875bcdb10b9acecec098ae0c0d285e7cdc0ca3568f738
7
+ data.tar.gz: 8cf5b570e6d6248d25999bdd4913ec1d57890a39d157ff825a4ee55c66b7706a068b9a111b89740e7d1cfac78f17efda0414289e34596253354c5985b8531fef
@@ -1,14 +1,39 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  Before do |scenario|
3
3
  @@name = scenario.source_tag_names.collect{|tag| tag.gsub(/\@/,'')}.join(".")
4
- @validaciones = Array.new
4
+ $trees = []
5
+ reintentos = 3
6
+
7
+ if $henry_params['browser']
8
+ begin
9
+ BROWSER = Watir::Browser.new init_browser($henry_params['browser'])
10
+ screen_width = BROWSER.execute_script("return screen.width;")
11
+ screen_height = BROWSER.execute_script("return screen.height;")
12
+ BROWSER.window.resize_to(screen_width, screen_height)
13
+ rescue Net::ReadTimeout, Selenium::WebDriver::Error::WebDriverError, ChildProcess::TimeoutError
14
+ BROWSER = nil
15
+ ProcessManager.kill_all_childs(Process.pid)
16
+ ProcessManager.chrome_zombies_collector
17
+ reintentos -= 1
18
+ sleep 5
19
+ if reintentos > 0
20
+ puts "Error Net::ReadTimeout - Reintentando abrir el browser..."
21
+ Henry::Environment.execution.set(:error_apertura_browser, "Net::ReadTimeout")
22
+ retry
23
+ else
24
+ BROWSER = Watir::Browser.new init_browser($henry_params['browser'])
25
+ screen_width = BROWSER.execute_script("return screen.width;")
26
+ screen_height = BROWSER.execute_script("return screen.height;")
27
+ BROWSER.window.resize_to(screen_width, screen_height)
28
+ end
29
+ end
30
+ end
5
31
  end
6
32
 
7
33
  After do |scenario|
8
34
  if $henry_params['browser']
9
- if BROWSER.div(:id,'errorInfo').present?
10
- puts BROWSER.div(:id,'errorInfo').html
11
- end
35
+ ProcessManager.kill_all_childs(Process.pid)
36
+ ProcessManager.chrome_zombies_collector
12
37
  if scenario.failed?
13
38
  FileUtils.mkdir_p(Henry::Environment.output_path+"/reports/html/screenshots/")
14
39
  name = "FAILED_#{scenario.name.gsub(' ','').gsub(/[^0-9A-Za-z]/, '')}.png"
@@ -20,7 +45,6 @@ After do |scenario|
20
45
  end
21
46
 
22
47
  at_exit do
23
- BROWSER.close if $henry_params['browser']
24
48
  ProcessManager.kill_all_childs(Process.pid)
25
49
  ProcessManager.chrome_zombies_collector
26
50
  end
@@ -136,10 +136,10 @@ And /^Verifico el pixel de trackeame en checkout$/ do
136
136
  end
137
137
 
138
138
  And /^Verifico el pixel de trackeame en gracias$/ do
139
- doc = Hpricot.parse(BROWSER.html)
140
- pixel_trackeame = (doc/"img#PixelTrackeame").first
141
- pixel_trackeame.nil?.should_not be_true
142
- pixel_trackeame.attributes['src'].should match("fl=thanks&idcro=#{@id_cro}&pr=flights&cc=#{$SITE}&exch=(.+)&pri=(.+)&cur=(#{currency($SITE)}|USD)&dn=Despegar")
139
+ # doc = Hpricot.parse(BROWSER.html)
140
+ # pixel_trackeame = (doc/"img#PixelTrackeame").first
141
+ # pixel_trackeame.nil?.should_not be_true
142
+ # pixel_trackeame.attributes['src'].should match("fl=thanks&idcro=#{@id_cro}&pr=flights&cc=#{$SITE}&exch=(.+)&pri=(.+)&cur=(#{currency($SITE)}|USD)&dn=Despegar")
143
143
  end
144
144
 
145
145
  And /^Verifico el pixel de e-planning$/ do
@@ -58,32 +58,4 @@ begin
58
58
  rescue
59
59
  $ENV = "produccion"
60
60
  browser = "firefox"
61
- end
62
-
63
- $trees = []
64
- reintentos = 3
65
-
66
- if browser
67
- begin
68
- BROWSER = Watir::Browser.new init_browser(browser)
69
- screen_width = BROWSER.execute_script("return screen.width;")
70
- screen_height = BROWSER.execute_script("return screen.height;")
71
- BROWSER.window.resize_to(screen_width, screen_height)
72
- rescue Net::ReadTimeout, Selenium::WebDriver::Error::WebDriverError, ChildProcess::TimeoutError
73
- BROWSER = nil
74
- ProcessManager.kill_all_childs(Process.pid)
75
- ProcessManager.chrome_zombies_collector
76
- reintentos -= 1
77
- sleep 5
78
- if reintentos > 0
79
- puts "Error Net::ReadTimeout - Reintentando abrir el browser..."
80
- Henry::Environment.execution.set(:error_apertura_browser, "Net::ReadTimeout")
81
- retry
82
- else
83
- BROWSER = Watir::Browser.new init_browser(browser)
84
- screen_width = BROWSER.execute_script("return screen.width;")
85
- screen_height = BROWSER.execute_script("return screen.height;")
86
- BROWSER.window.resize_to(screen_width, screen_height)
87
- end
88
- end
89
61
  end
@@ -14,7 +14,7 @@
14
14
  gem.name = "flights_gui_henry_tests" #Debe ser unico en el Gem Server, tratemos de utilizar nombre que identifiquen de forma inequivoca
15
15
 
16
16
  gem.require_paths = ["lib"] #Usualmente es solo lib -> ["lib"]5
17
- gem.version = '2.8.5' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
17
+ gem.version = '2.8.6' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
18
18
 
19
19
  gem.add_dependency('henry-container', '>= 0.1.82')
20
20
  gem.add_dependency('watir-webdriver')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flights_gui_henry_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.5
4
+ version: 2.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - lgonzalez