gridium 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -0
- data/lib/element.rb +21 -0
- data/lib/element_extensions.rb +9 -1
- data/lib/gridium/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5b97b15990a724513d715ccb5e84c83078bee0b
|
4
|
+
data.tar.gz: e49dc32244857906d0f321a04d254eacc96887d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23e6df5a7e7e18bf49181af7fcde59a19420c1d75bc96f29b3bff1847c70745d8d9f56fa4b13b3cdeecd0caf69d901f3de37cb3fecc859c0c05c5c03f38f8f38
|
7
|
+
data.tar.gz: fdfc5ad5f910a07a4395707db65d4f165fef6667f660894098595869c0d99638f828bd4bd11b1b870fc426587583f3c030ed3d6bc684c3680be9fb48887abdbb
|
data/README.md
CHANGED
@@ -146,7 +146,33 @@ $errors_total = 0
|
|
146
146
|
Spec_data.load_suite_state
|
147
147
|
Spec_data.load_spec_state
|
148
148
|
```
|
149
|
+
##Saving screenshots to S3
|
149
150
|
|
151
|
+
S3 support is available for persisting screenshots online. This is especially helpful when running tests in CI and/or Docker environments.
|
152
|
+
|
153
|
+
#### 1. Setup environment variables
|
154
|
+
```
|
155
|
+
export S3_ACCESS_KEY_ID="your access key"
|
156
|
+
export S3_SECRET_ACCESS_KEY="your secret access key"
|
157
|
+
export S3_DEFAULT_REGION="your region"
|
158
|
+
export S3_ROOT_BUCKET="your root bucket"
|
159
|
+
```
|
160
|
+
#### 2. Setup spec_helper file
|
161
|
+
|
162
|
+
```
|
163
|
+
#inside Gridium.configure do |config|
|
164
|
+
config.screenshots_to_s3 = true
|
165
|
+
config.project_name_for_s3 = 'name the folder below the root bucket'
|
166
|
+
config.subdirectory_name_for_s3 = 'name for folder just below that, probably dynamic to mitigate ginormous directories'
|
167
|
+
|
168
|
+
```
|
169
|
+
|
170
|
+
#### 3. Integrate into a test
|
171
|
+
```
|
172
|
+
Driver.visit('https://the-internet.herokuapp.com/')
|
173
|
+
driver.save_screenshot()
|
174
|
+
#based on your needs, choose how to publish this screenshot to your interested parties
|
175
|
+
```
|
150
176
|
## Page Objects
|
151
177
|
|
152
178
|
Page objects are required for Gridium. Page objects abstract the functionality of the page away from the test. There's a million reasons why page objects are the way to go. Not the least of all is that it helps you maintain your tests.
|
data/lib/element.rb
CHANGED
@@ -151,6 +151,17 @@ class Element
|
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
|
+
# Raw webdriver mouse over
|
155
|
+
def mouse_over
|
156
|
+
Log.debug("Triggering mouse over for (#{self.to_s})...")
|
157
|
+
if element.enabled?
|
158
|
+
$verification_passes += 1
|
159
|
+
ElementExtensions.mouse_over(self)
|
160
|
+
else
|
161
|
+
Log.error('Cannot mouse over. Element is not present.')
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
154
165
|
def scroll_into_view
|
155
166
|
if element.enabled?
|
156
167
|
$verification_passes += 1
|
@@ -160,6 +171,16 @@ class Element
|
|
160
171
|
end
|
161
172
|
end
|
162
173
|
|
174
|
+
def trigger_onblur
|
175
|
+
Log.debug("Triggering onblur for (#{self.to_s})...")
|
176
|
+
if element.enabled?
|
177
|
+
$verification_passes += 1
|
178
|
+
ElementExtensions.trigger_onblur(self)
|
179
|
+
else
|
180
|
+
Log.error('Cannot trigger onblur. Element is not present.')
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
163
184
|
def size
|
164
185
|
element.size
|
165
186
|
end
|
data/lib/element_extensions.rb
CHANGED
@@ -27,4 +27,12 @@ class Gridium::ElementExtensions
|
|
27
27
|
Driver.execute_script("var evObj = document.createEvent('MouseEvents'); evObj.initMouseEvent(\"mouseout\",true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); arguments[0].dispatchEvent(evObj);", element.element)
|
28
28
|
sleep 1
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
|
+
def self.mouse_over(element)
|
32
|
+
Driver.driver.mouse.move_to(element.element)
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.trigger_onblur(element)
|
36
|
+
Driver.execute_script("arguments[0].focus(); arguments[0].blur(); return true", element.element)
|
37
|
+
end
|
38
|
+
end
|
data/lib/gridium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gridium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Urban
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|