ds-gui-automation 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,3 +14,28 @@ Then(/^I should see the result clusters for the specified provider$/) do
14
14
  puts @browser.url
15
15
  end
16
16
 
17
+ Then(/^I should see the results page with the search result$/) do
18
+
19
+ puts " URL: #{@browser.url} "
20
+
21
+ Watir::Wait.until(timeout = 300){@browser.div(:class, 'ux-common-results-main').present?}
22
+
23
+ sleep(45)
24
+
25
+ binding.pry
26
+
27
+ puts " Results => #{DestinationServicesGUI::Results.get_search_results(IS_MODULAR).size}"
28
+
29
+ (DestinationServicesGUI::Results.get_search_results(IS_MODULAR).size > 0).should be_true
30
+
31
+ # @browser.div(:id, 'ux-destination-services-filters').should be_visible
32
+ # @browser.div(:class, 'seo-texts').should be_visible
33
+ # @browser.select_list(:id, 'ux-select-order').should be_visible
34
+ # @browser.div(:class, 'pdt-activities').should be_visible
35
+ # @browser.div(:class, 'ux-common-breadcrumbs').should be_visible
36
+ # @browser.div(:class, 'ux-common-results-title').should be_visible
37
+ # results_quantity = @browser.div(:class, 'ux-common-results-title').text.split.first.to_i
38
+ # @browser.div(:class, 'cp-pager ng-isolate-scope').should be_visible if results_quantity > 20
39
+
40
+
41
+ end
@@ -10,26 +10,3 @@ When(/^I set the parameters on the search box and click the search button$/) do
10
10
  DestinationServicesGUI::Search.perform_search
11
11
  end
12
12
 
13
- Then(/^I should see the results page with the search result$/) do
14
-
15
- puts " URL: #{@browser.url} "
16
-
17
- Watir::Wait.until(timeout = 300){@browser.div(:class, 'ux-common-results-main').present?}
18
-
19
- sleep(45)
20
-
21
- puts " Results => #{@browser.divs(:class, 'ux-destination-services-cluster').size}"
22
-
23
- (@browser.divs(:class, 'ux-destination-services-cluster').size > 0 ).should be_true
24
-
25
- @browser.div(:id, 'ux-destination-services-filters').should be_visible
26
- @browser.div(:class, 'seo-texts').should be_visible
27
- @browser.select_list(:id, 'ux-select-order').should be_visible
28
- @browser.div(:class, 'pdt-activities').should be_visible
29
- @browser.div(:class, 'ux-common-breadcrumbs').should be_visible
30
- @browser.div(:class, 'ux-common-results-title').should be_visible
31
- results_quantity = @browser.div(:class, 'ux-common-results-title').text.split.first.to_i
32
- @browser.div(:class, 'cp-pager ng-isolate-scope').should be_visible if results_quantity > 20
33
-
34
-
35
- end
data/lib/ds/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DestinationServicesGUI
2
- VERSION = "0.1.18"
2
+ VERSION = "0.1.19"
3
3
  end
@@ -3,7 +3,7 @@ require_relative './commons.rb'
3
3
  module Results
4
4
 
5
5
 
6
- def get_results_by_provider_code(providerCode, isModular = false)
6
+ def get_results_by_provider_code(providerCode, isModular = true)
7
7
 
8
8
  ## Se selecciona el tipo de vista
9
9
 
@@ -13,7 +13,7 @@ module Results
13
13
 
14
14
  isModular ? modular_view.click : cluster_view.click
15
15
 
16
- clusters = get_results(providerCode, isModular)
16
+ clusters = get_provider_results(providerCode, isModular)
17
17
 
18
18
  while clusters.empty? and next_page?
19
19
 
@@ -30,7 +30,7 @@ module Results
30
30
 
31
31
  show_results_tracking_id
32
32
 
33
- clusters = get_results(providerCode, isModular)
33
+ clusters = get_provider_results(providerCode, isModular)
34
34
 
35
35
  end
36
36
 
@@ -38,7 +38,7 @@ module Results
38
38
 
39
39
  end
40
40
 
41
- def get_results(providerCode, isModular = false)
41
+ def get_provider_results(providerCode, isModular = true)
42
42
 
43
43
  if isModular
44
44
  clusters = browser.divs(:class, 'ux-destination-services-cluster-grid').to_a
@@ -52,5 +52,52 @@ module Results
52
52
 
53
53
  end
54
54
 
55
+ def get_search_results(isModular = true)
56
+
57
+ ## Se selecciona el tipo de vista
58
+
59
+ cluster_view = browser.span(:class, 'ux-common-icon-cluster-view')
60
+
61
+ modular_view = browser.span(:class, 'ux-common-icon-modular-view')
62
+
63
+ isModular ? modular_view.click : cluster_view.click
64
+
65
+ clusters = get_results(isModular)
66
+
67
+ while clusters.empty? and next_page?
68
+
69
+ timeout = 0
70
+
71
+ next_page
72
+
73
+ while browser.div(:class, 'modal').visible? and timeout < 40
74
+ sleep 3
75
+ timeout += 3
76
+ end
77
+
78
+ wait_for_results
79
+
80
+ show_results_tracking_id
81
+
82
+ clusters = get_results(isModular)
83
+
84
+ end
85
+
86
+ clusters
87
+
88
+ end
89
+
90
+ def get_results(isModular = true)
91
+
92
+ if isModular
93
+ clusters = browser.divs(:class, 'ux-destination-services-cluster-grid').to_a
94
+ else
95
+ clusters = browser.divs(:class, 'ux-destination-services-cluster').to_a
96
+ end
97
+
98
+ clusters
99
+
100
+ end
101
+
55
102
 
56
103
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ds-gui-automation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-17 00:00:00.000000000 Z
12
+ date: 2014-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: henry-container