touch_action 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/README.md +2 -3
- data/lib/touch_action.rb +1 -0
- data/lib/touch_action/capybara_element.rb +15 -0
- data/lib/touch_action/version.rb +1 -1
- data/spec/unit/capybara/element_spec.rb +13 -0
- metadata +29 -44
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ca07e308a04e38c699f18cca62b1ecf8fd26c0cd
|
4
|
+
data.tar.gz: 5b90c9ae982196fa53adfbc325df99944fde4508
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ad9283a72c9fc9cb9d0a465a32f918ff1fc271d2a194ec72cd99aa322832f7e8493831083c9c1252455141ae57ce8d90a261687a7de97770d03525d661150e60
|
7
|
+
data.tar.gz: 84d5eaec967426c942923df46a73560a5eb46cad866c1ce5b35523b43da525358e14c5d8e73b25620f4035e8d157e675498a48b5fd45d313dd7ae44fd6e39288
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.2.2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
[![Build Status](https://travis-ci.org/Ricardonacif/touch_action.svg?branch=master)](https://travis-ci.org/Ricardonacif/touch_action)
|
3
3
|
[![Code Climate](https://codeclimate.com/github/Ricardonacif/touch_action/badges/gpa.svg)](https://codeclimate.com/github/Ricardonacif/touch_action)
|
4
4
|
|
5
|
-
Touch Action is a Ruby Gem used to add touch gestures simulation to the Watir-WebDriver, Selenium-WebDriver
|
5
|
+
Touch Action is a Ruby Gem used to add touch gestures simulation to the Watir-WebDriver, Selenium-WebDriver and Capybara in order to perform automated tests on (mobile and desktops) websites that requires those type of actions. It encapsulates the touch action library of [YUI JS](http://yuilibrary.com/yui/docs/event/simulate.html#simulating-touch-gestures). Very useful for example when testing mobile websites using [Appium](http://appium.io).
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -19,9 +19,8 @@ And then execute:
|
|
19
19
|
And then add `require 'touch_action'` to your spec_helper.rb or wherever you want to use it.
|
20
20
|
|
21
21
|
## Usage
|
22
|
-
|
22
|
+
On the element you want to perform the action, just call touch_action(:name_of_gesture). It currently supports Selenium, Watir-Webdriver and Capybara elements. Here's the example using a Watir element.
|
23
23
|
```ruby
|
24
|
-
#on the element you want to perform the action, call touch_action(:name_of_action)
|
25
24
|
element = @driver.div(:id, 'hit')
|
26
25
|
element.touch_action(:swipe)
|
27
26
|
```
|
data/lib/touch_action.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'capybara'
|
2
|
+
require "touch_action/script_generator"
|
3
|
+
|
4
|
+
module TouchAction
|
5
|
+
module CapybaraElement
|
6
|
+
|
7
|
+
def touch_action *args
|
8
|
+
final_script = TouchAction::ScriptGenerator.generate_javascript(*args)
|
9
|
+
driver.browser.execute_script(final_script, base.native)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Capybara::Node::Element.class_eval { include TouchAction::CapybaraElement }
|
data/lib/touch_action/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe TouchAction::CapybaraElement, type: :feature do
|
4
|
+
it 'should respond to the method touch_action', js: true, use_webdriver: :capybara do
|
5
|
+
visit('http://localhost:9292')
|
6
|
+
element = find('#hit')
|
7
|
+
expect(element).to respond_to(:touch_action)
|
8
|
+
element.touch_action :move
|
9
|
+
sleep(5)
|
10
|
+
expect(find('#distance_x').text).to include('70')
|
11
|
+
expect(find('#distance_y').text).to include('-50')
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,142 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: touch_action
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ricardo Nacif
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: watir-webdriver
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: capybara
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: bundler
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '1.7'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '1.7'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rake
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '10.0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '10.0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: pry
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: rack
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: rspec
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- - ~>
|
101
|
+
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: 3.1.0
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- - ~>
|
108
|
+
- - "~>"
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: 3.1.0
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: thin
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - ">="
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: '0'
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - ">="
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: '0'
|
142
125
|
description: Adds touch gestures simulation to Watir, Selenium and Capybara using
|
@@ -147,9 +130,9 @@ executables: []
|
|
147
130
|
extensions: []
|
148
131
|
extra_rdoc_files: []
|
149
132
|
files:
|
150
|
-
- .gitignore
|
151
|
-
- .ruby-version
|
152
|
-
- .travis.yml
|
133
|
+
- ".gitignore"
|
134
|
+
- ".ruby-version"
|
135
|
+
- ".travis.yml"
|
153
136
|
- CHANGELOG.md
|
154
137
|
- Gemfile
|
155
138
|
- LICENSE.txt
|
@@ -157,6 +140,7 @@ files:
|
|
157
140
|
- README.md
|
158
141
|
- Rakefile
|
159
142
|
- lib/touch_action.rb
|
143
|
+
- lib/touch_action/capybara_element.rb
|
160
144
|
- lib/touch_action/capybara_rspec_helper.rb
|
161
145
|
- lib/touch_action/javascripts/touch_action.js.erb
|
162
146
|
- lib/touch_action/script_generator.rb
|
@@ -183,6 +167,7 @@ files:
|
|
183
167
|
- spec/support/static_website/public/pinch.html
|
184
168
|
- spec/support/static_website/public/tap.html
|
185
169
|
- spec/support/static_website/rack_app.rb
|
170
|
+
- spec/unit/capybara/element_spec.rb
|
186
171
|
- spec/unit/capybara/rspec_helper_spec.rb
|
187
172
|
- spec/unit/selenium-webdriver/element_spec.rb
|
188
173
|
- spec/unit/watir-webdriver/element_spec.rb
|
@@ -190,27 +175,26 @@ files:
|
|
190
175
|
homepage: https://github.com/Ricardonacif/touch_action
|
191
176
|
licenses:
|
192
177
|
- MIT
|
178
|
+
metadata: {}
|
193
179
|
post_install_message:
|
194
180
|
rdoc_options: []
|
195
181
|
require_paths:
|
196
182
|
- lib
|
197
183
|
required_ruby_version: !ruby/object:Gem::Requirement
|
198
|
-
none: false
|
199
184
|
requirements:
|
200
|
-
- -
|
185
|
+
- - ">="
|
201
186
|
- !ruby/object:Gem::Version
|
202
187
|
version: '0'
|
203
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
|
-
none: false
|
205
189
|
requirements:
|
206
|
-
- -
|
190
|
+
- - ">="
|
207
191
|
- !ruby/object:Gem::Version
|
208
192
|
version: '0'
|
209
193
|
requirements: []
|
210
194
|
rubyforge_project:
|
211
|
-
rubygems_version:
|
195
|
+
rubygems_version: 2.4.5
|
212
196
|
signing_key:
|
213
|
-
specification_version:
|
197
|
+
specification_version: 4
|
214
198
|
summary: Adds touch gestures simulation to Watir-WebDriver, Selenium-WebDriver and
|
215
199
|
Capybara using YUI JS.
|
216
200
|
test_files:
|
@@ -234,6 +218,7 @@ test_files:
|
|
234
218
|
- spec/support/static_website/public/pinch.html
|
235
219
|
- spec/support/static_website/public/tap.html
|
236
220
|
- spec/support/static_website/rack_app.rb
|
221
|
+
- spec/unit/capybara/element_spec.rb
|
237
222
|
- spec/unit/capybara/rspec_helper_spec.rb
|
238
223
|
- spec/unit/selenium-webdriver/element_spec.rb
|
239
224
|
- spec/unit/watir-webdriver/element_spec.rb
|