angular_webdriver 1.0.2 → 1.0.3
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.
- checksums.yaml +4 -4
- data/lib/angular_webdriver/protractor/protractor.rb +46 -14
- data/lib/angular_webdriver/version.rb +1 -1
- data/release_notes.md +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 129723933393935ba3f51f00d55c00170701b4c1
|
4
|
+
data.tar.gz: 0f0458f8424f2010c459206d9d2d6ec26800fe71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d6e619430ed609bbe8cd6ca53591acd93c02a23413195c129bbb11d9242df64e77ebf159d188eded115110b61a9f3cf86793257731cb8546e7678cedff5366e
|
7
|
+
data.tar.gz: 16233f787ff5ca1603df8668587e455b4aa9941ce08cb5edbe7cd825741e16d84824cef770440af574f71239c9244d89fd1a0b14f21d590ceee8c2e07955714e
|
@@ -49,7 +49,27 @@ class Protractor
|
|
49
49
|
#
|
50
50
|
# @return [String] Default nil.
|
51
51
|
#
|
52
|
-
|
52
|
+
attr_reader :base_url
|
53
|
+
|
54
|
+
# Sets the base url.
|
55
|
+
#
|
56
|
+
# Expected format:
|
57
|
+
# scheme://host
|
58
|
+
#
|
59
|
+
# Example:
|
60
|
+
# http://localhost
|
61
|
+
#
|
62
|
+
# @param url [String] the url to use as a base
|
63
|
+
#
|
64
|
+
# @return [String] url
|
65
|
+
def base_url= url
|
66
|
+
# Allow resetting base_url with falsey value
|
67
|
+
return @base_url = nil unless url
|
68
|
+
|
69
|
+
uri = URI.parse(url) rescue false
|
70
|
+
raise "Invalid URL #{url.inspect}. Must contain scheme and host." unless uri && uri.scheme && uri.host
|
71
|
+
@base_url = url
|
72
|
+
end
|
53
73
|
|
54
74
|
# All scripts to be run on the client via executeAsyncScript or
|
55
75
|
# executeScript should be put here.
|
@@ -97,19 +117,31 @@ class Protractor
|
|
97
117
|
raise "Invalid destination #{destination}"
|
98
118
|
end
|
99
119
|
|
100
|
-
#
|
101
|
-
|
102
|
-
|
103
|
-
#
|
104
|
-
#
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
120
|
+
# http://about:blank doesn't work. it must be exactly about:blank
|
121
|
+
about_url = destination.start_with?('about:')
|
122
|
+
|
123
|
+
# data urls must be preserved and not have http:// prepended.
|
124
|
+
# data:<blah>
|
125
|
+
data_url = destination.start_with?('data:')
|
126
|
+
|
127
|
+
unless about_url || data_url
|
128
|
+
# URI.join doesn't allow for http://localhost:8081/#/ as a base_url
|
129
|
+
# so this departs from the Protractor behavior and favors File.join instead.
|
130
|
+
#
|
131
|
+
# In protractor: url.resolve('http://localhost:8081/#/', 'async')
|
132
|
+
# => http://localhost:8081/async
|
133
|
+
# In Ruby: File.join('http://localhost:8081/#/', 'async')
|
134
|
+
# => http://localhost:8081/#/async
|
135
|
+
#
|
136
|
+
base_url_exists = base_url && !base_url.empty?
|
137
|
+
tmp_uri = URI.parse(destination) rescue URI.parse('')
|
138
|
+
relative_url = !tmp_uri.scheme || !tmp_uri.host
|
139
|
+
|
140
|
+
if base_url_exists && relative_url
|
141
|
+
destination = File.join(base_url, destination.to_s)
|
142
|
+
elsif relative_url # prepend 'http://' to urls such as localhost
|
143
|
+
destination = "http://#{destination}"
|
144
|
+
end
|
113
145
|
end
|
114
146
|
|
115
147
|
msg = lambda { |str| 'Protractor.get(' + destination + ') - ' + str }
|
data/release_notes.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
#### v1.0.3 2015-06-07
|
2
|
+
|
3
|
+
- [97d5f18](https://github.com/bootstraponline/angular_webdriver/commit/97d5f18e187d56bc8616fb65ec1e5b9bafa8c289) Release 1.0.3
|
4
|
+
- [42b527e](https://github.com/bootstraponline/angular_webdriver/commit/42b527e81045c03b051bf14494189da8276cf754) Fix about and data url handling
|
5
|
+
- [8022a5c](https://github.com/bootstraponline/angular_webdriver/commit/8022a5c04e46f0f007d2b9bd394b914127cc610a) Fix set_max_page_wait spec
|
6
|
+
- [6000137](https://github.com/bootstraponline/angular_webdriver/commit/60001379d283d289247b8a2f9adad9469a8921bd) Fix loading urls without scheme
|
7
|
+
|
8
|
+
|
1
9
|
#### v1.0.2 2015-06-07
|
2
10
|
|
3
11
|
- [9b9cc12](https://github.com/bootstraponline/angular_webdriver/commit/9b9cc12e778d4230cd5ea6382bb9e31de4506b0a) Release 1.0.2
|