angular_webdriver 0.0.7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.gitmodules +3 -0
- data/.rspec +2 -0
- data/.travis.yml +32 -0
- data/Gemfile +2 -0
- data/Thorfile +33 -1
- data/angular_webdriver.gemspec +10 -3
- data/docs/overview.md +101 -0
- data/docs/sync.md +53 -0
- data/lib/angular_webdriver/protractor/by.rb +331 -0
- data/lib/angular_webdriver/protractor/by_repeater_inner.rb +106 -0
- data/lib/angular_webdriver/protractor/client_side_scripts.rb +1035 -0
- data/lib/angular_webdriver/protractor/protractor.rb +396 -77
- data/lib/angular_webdriver/protractor/protractor_element.rb +33 -0
- data/lib/angular_webdriver/protractor/rspec_helpers.rb +19 -0
- data/lib/angular_webdriver/protractor/watir_patch.rb +209 -0
- data/lib/angular_webdriver/protractor/webdriver_patch.rb +246 -0
- data/lib/angular_webdriver/version.rb +2 -2
- data/lib/angular_webdriver.rb +14 -1
- data/{LICENSE → license/angular_webdriver/LICENSE.txt} +0 -0
- data/{lib/angular_webdriver → license}/protractor/LICENSE.txt +0 -0
- data/{lib/angular_webdriver/protractor/get_url_trace.rb → notes/bootstrap_notes.md} +13 -0
- data/notes/element_by_id/element_by_id_sync_off.txt +12 -0
- data/notes/element_by_id/element_by_id_sync_on.txt +74 -0
- data/notes/element_chaining_debug.txt +94 -0
- data/notes/evaluate/js_evaluate_sync_on.txt +60 -0
- data/notes/evaluate/ruby_evaluate_sync_on.txt +35 -0
- data/notes/get_title/browser_get_title_sync_off.txt +11 -0
- data/notes/get_title/browser_get_title_sync_on.txt +54 -0
- data/notes/phantomjs.md +23 -0
- data/notes/protractor_cli_bugs.txt +39 -0
- data/notes/protractor_get/protractor_get.rb +102 -0
- data/notes/protractor_get/protractor_get_website_sync_off.txt +11 -0
- data/notes/protractor_get/protractor_get_website_sync_on.txt +86 -0
- data/notes/repeater/findAllRepeaterRows_annotated.txt +150 -0
- data/notes/repeater/findAllRepeaterRows_raw.txt +145 -0
- data/notes/repeater/findRepeaterColumn_annotated.txt +317 -0
- data/notes/repeater/findRepeaterColumn_raw.txt +310 -0
- data/notes/repeater/findRepeaterElement_annotated.txt +152 -0
- data/notes/repeater/findRepeaterElement_raw.txt +146 -0
- data/notes/repeater/findRepeaterRows_annotated.txt +156 -0
- data/notes/repeater/findRepeaterRows_raw.txt +152 -0
- data/notes/sync_after.md +46 -0
- data/notes/sync_notes.md +137 -0
- data/notes/synchronize_spec/status_gettext.txt +121 -0
- data/notes/synchronize_spec/status_gettext_x3.txt +451 -0
- data/notes/synchronize_spec/synchronize_spec.js.txt +74 -0
- data/notes/synchronize_spec/watir_gettext.txt +73 -0
- data/readme.md +52 -12
- data/release_notes.md +127 -0
- data/selenium_server/lib/logs.rb +50 -0
- data/selenium_server/lib/selenium_server.rb +21 -0
- data/selenium_server/readme.md +3 -0
- data/selenium_server/spec/logs_spec.rb +18 -0
- data/selenium_server/spec/nodejs_sync_spec_waithttp_annotated.txt +54 -0
- data/selenium_server/spec/nodejs_sync_spec_waithttp_raw.txt +367 -0
- data/selenium_server/spec/nodejs_sync_spec_waithttp_raw_processed.txt +43 -0
- data/selenium_server/spec/ruby_sync_spec_waithttp_annotated.txt +59 -0
- data/selenium_server/spec/ruby_sync_spec_waithttp_raw.txt +267 -0
- data/selenium_server/spec/ruby_sync_spec_waithttp_raw_processed.txt +39 -0
- data/selenium_server/spec/spec_helper.rb +6 -0
- data/selenium_server/spec/status_gettext_x3.txt +429 -0
- data/selenium_server/spec/status_gettext_x3_annotated.txt +86 -0
- metadata +91 -18
- data/lib/angular_webdriver/protractor/clientSideScripts.json +0 -19
- data/lib/angular_webdriver/protractor/clientsidescripts.js +0 -671
- data/lib/angular_webdriver/protractor/scripts.rb +0 -7
- data/lib/angular_webdriver/protractor/scripts_to_json.js +0 -11
- data/spec/protractor_spec.rb +0 -40
- data/spec/spec_helper.rb +0 -5
@@ -0,0 +1,106 @@
|
|
1
|
+
module AngularWebdriver
|
2
|
+
class ByRepeaterInner
|
3
|
+
attr_reader :exact, :repeat_descriptor, :row_index, :column_binding
|
4
|
+
|
5
|
+
# Takes args and returns wrapped repeater if the first arg is a repeater
|
6
|
+
#
|
7
|
+
# @param args [Array] args to wrap
|
8
|
+
def self.wrap_repeater args
|
9
|
+
if args && args.first.is_a?(self)
|
10
|
+
[repeater: args.first.process] # watir requires an array containing a hash
|
11
|
+
else
|
12
|
+
args
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# Generate either by.repeater or by.exactRepeater
|
17
|
+
# @option opts [Boolean] :exact exact matching
|
18
|
+
# @option opts [String] :repeat_descriptor repeat description
|
19
|
+
def initialize opts={}
|
20
|
+
exact = opts.fetch(:exact)
|
21
|
+
raise "#{exact} is not a valid value" unless [true, false].include?(exact)
|
22
|
+
repeat_descriptor = opts.fetch(:repeat_descriptor)
|
23
|
+
raise "#{repeat_descriptor} is not a valid repeat_descriptor" unless repeat_descriptor.is_a?(String)
|
24
|
+
|
25
|
+
@exact = exact
|
26
|
+
@repeat_descriptor = repeat_descriptor
|
27
|
+
self
|
28
|
+
end
|
29
|
+
|
30
|
+
def row row_index
|
31
|
+
raise "#{row_index} is not a valid row index" unless row_index.is_a?(Integer)
|
32
|
+
@row_index = row_index
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
36
|
+
def column column_binding
|
37
|
+
raise "#{column_binding} is not a valid column binding" unless column_binding.is_a?(String)
|
38
|
+
@column_binding = column_binding
|
39
|
+
self
|
40
|
+
end
|
41
|
+
|
42
|
+
# Return JSON representation of the correct repeater method and args
|
43
|
+
def process
|
44
|
+
# findRepeaterElement - (repeater, exact, index, binding, using, rootSelector) - by.repeater('baz in days').row(0).column('b') - [baz in days, false, 0, b, null, body]
|
45
|
+
# findRepeaterRows - (repeater, exact, index, using) - by.repeater('baz in days').row(0) - [baz in days, false, 0, null, body]
|
46
|
+
# findRepeaterColumn - (repeater, exact, binding, using, rootSelector) - by.repeater('baz in days').column('b') - [baz in days, false, b, null, body]
|
47
|
+
# findAllRepeaterRows - (repeater, exact, using) - by.repeater('baz in days') - [baz in days, false, null, body]
|
48
|
+
#
|
49
|
+
#
|
50
|
+
# using - parent element
|
51
|
+
# rootSelector - selector for finding angular js
|
52
|
+
# exact - true if by.exactRepeater false when by.repeater
|
53
|
+
#
|
54
|
+
#
|
55
|
+
# repeater (repeat_descriptor), binding (column_binding), index (row_index)
|
56
|
+
#
|
57
|
+
# findRepeaterElement - (repeat_descriptor, row_index, column_binding)
|
58
|
+
# findRepeaterRows - (repeat_descriptor, row_index)
|
59
|
+
# findRepeaterColumn - (repeat_descriptor, column_binding)
|
60
|
+
# findAllRepeaterRows - (repeat_descriptor)
|
61
|
+
|
62
|
+
result = if repeat_descriptor && row_index && column_binding
|
63
|
+
{
|
64
|
+
script: :findRepeaterElement,
|
65
|
+
args: {
|
66
|
+
repeat_descriptor: repeat_descriptor,
|
67
|
+
exact: exact,
|
68
|
+
row_index: row_index,
|
69
|
+
column_binding: column_binding,
|
70
|
+
|
71
|
+
}
|
72
|
+
}
|
73
|
+
elsif repeat_descriptor && row_index
|
74
|
+
{
|
75
|
+
script: :findRepeaterRows,
|
76
|
+
args: {
|
77
|
+
repeat_descriptor: repeat_descriptor,
|
78
|
+
exact: exact,
|
79
|
+
row_index: row_index
|
80
|
+
}
|
81
|
+
}
|
82
|
+
elsif repeat_descriptor && column_binding
|
83
|
+
{
|
84
|
+
script: :findRepeaterColumn,
|
85
|
+
args: {
|
86
|
+
repeat_descriptor: repeat_descriptor,
|
87
|
+
exact: exact,
|
88
|
+
column_binding: column_binding
|
89
|
+
}
|
90
|
+
}
|
91
|
+
elsif repeat_descriptor
|
92
|
+
{
|
93
|
+
script: :findAllRepeaterRows,
|
94
|
+
args: {
|
95
|
+
repeat_descriptor: repeat_descriptor,
|
96
|
+
exact: exact
|
97
|
+
}
|
98
|
+
}
|
99
|
+
else
|
100
|
+
raise 'Invalid repeater'
|
101
|
+
end
|
102
|
+
|
103
|
+
result.to_json
|
104
|
+
end # def process
|
105
|
+
end # class ByRepeaterInner
|
106
|
+
end # module AngularWebdriver
|