superbara 0.14.4 → 0.14.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95990cc0684843f5edd33b96945657863607ee82fc971ce4ac13251f74978511
4
- data.tar.gz: a1f545a1109de95513fa07946c5e7b4d9062c43b45622f1c31679a413feeb4d6
3
+ metadata.gz: 0e20f482b6b307cc7597d7affd3ff907e02ca945442b0633d9e7c3d6fcc39573
4
+ data.tar.gz: '08cd1d74b997fe51ee782cf1ce8748bdc4cc862986fc4e792556856b6064e09b'
5
5
  SHA512:
6
- metadata.gz: 20c49287eecd1ab2b58639348c8d6a5e62774323bd20d7a886db50835a41fade35dcd48e92caa0b8857a22ed0e232db1df75a7c9506a5fdc5ad8f71150f35e0a
7
- data.tar.gz: d2cdda48f8c21eb381694f31624bf0b0bd26864fabf1719328f1763b48cc644523e7111a627c139489953c7ecd0a359695ecfd9473811bb525b96bfd22f80917
6
+ metadata.gz: d0689ef350aa56f15e9da0d23e8c8c618098a777f83637cd83484791029e4a45203ebc5b09570b47e46e283d9fafb028fc4e180e115a100a5128fc52979548bd
7
+ data.tar.gz: 7883de5ab4df621dcd45e773b3063b8d0f1e8ec163c3bdf60172f4c98587f9e40e415914a882907e71df469fb3163e9d2395a470300c3add3c1428fa0c8e15f8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- superbara (0.14.4)
4
+ superbara (0.14.5)
5
5
  astrolabe (~> 1.3, >= 1.3.1)
6
6
  binding_of_caller (~> 0.8, >= 0.8.0)
7
7
  capybara (~> 3.1, >= 3.1.0)
@@ -28,13 +28,14 @@ GEM
28
28
  binding_of_caller (0.8.0)
29
29
  debug_inspector (>= 0.0.1)
30
30
  byebug (10.0.2)
31
- capybara (3.2.1)
31
+ capybara (3.10.0)
32
32
  addressable
33
33
  mini_mime (>= 0.1.3)
34
34
  nokogiri (~> 1.8)
35
35
  rack (>= 1.6.0)
36
36
  rack-test (>= 0.6.3)
37
- xpath (~> 3.1)
37
+ regexp_parser (~> 1.2)
38
+ xpath (~> 3.2)
38
39
  childprocess (0.9.0)
39
40
  ffi (~> 1.0, >= 1.0.11)
40
41
  coderay (1.1.2)
@@ -42,20 +43,20 @@ GEM
42
43
  concurrent-ruby (1.0.5)
43
44
  debug_inspector (0.0.3)
44
45
  diff-lcs (1.3)
45
- faker (1.8.7)
46
+ faker (1.9.1)
46
47
  i18n (>= 0.7)
47
48
  ffi (1.9.25)
48
- i18n (1.0.1)
49
+ i18n (1.1.1)
49
50
  concurrent-ruby (~> 1.0)
50
51
  interception (0.5)
51
52
  kommando (0.1.2)
52
53
  method_source (0.9.0)
53
- mini_mime (1.0.0)
54
+ mini_mime (1.0.1)
54
55
  mini_portile2 (2.3.0)
55
- mustermann (1.0.2)
56
- nokogiri (1.8.3)
56
+ mustermann (1.0.3)
57
+ nokogiri (1.8.5)
57
58
  mini_portile2 (~> 2.3.0)
58
- parser (2.5.1.0)
59
+ parser (2.5.3.0)
59
60
  ast (~> 2.4.0)
60
61
  pry (0.11.3)
61
62
  coderay (~> 1.1.0)
@@ -69,38 +70,39 @@ GEM
69
70
  pry-stack_explorer (0.4.9.2)
70
71
  binding_of_caller (>= 0.7)
71
72
  pry (>= 0.9.11)
72
- public_suffix (3.0.2)
73
+ public_suffix (3.0.3)
73
74
  rack (2.0.5)
74
- rack-protection (2.0.3)
75
+ rack-protection (2.0.4)
75
76
  rack
76
- rack-test (1.0.0)
77
+ rack-test (1.1.0)
77
78
  rack (>= 1.0, < 3)
78
79
  rake (12.3.0)
79
80
  rb-readline (0.5.5)
80
- rspec (3.7.0)
81
- rspec-core (~> 3.7.0)
82
- rspec-expectations (~> 3.7.0)
83
- rspec-mocks (~> 3.7.0)
84
- rspec-core (3.7.1)
85
- rspec-support (~> 3.7.0)
86
- rspec-expectations (3.7.0)
81
+ regexp_parser (1.2.0)
82
+ rspec (3.8.0)
83
+ rspec-core (~> 3.8.0)
84
+ rspec-expectations (~> 3.8.0)
85
+ rspec-mocks (~> 3.8.0)
86
+ rspec-core (3.8.0)
87
+ rspec-support (~> 3.8.0)
88
+ rspec-expectations (3.8.2)
87
89
  diff-lcs (>= 1.2.0, < 2.0)
88
- rspec-support (~> 3.7.0)
89
- rspec-mocks (3.7.0)
90
+ rspec-support (~> 3.8.0)
91
+ rspec-mocks (3.8.0)
90
92
  diff-lcs (>= 1.2.0, < 2.0)
91
- rspec-support (~> 3.7.0)
92
- rspec-support (3.7.1)
93
- rubyzip (1.2.1)
94
- selenium-webdriver (3.12.0)
93
+ rspec-support (~> 3.8.0)
94
+ rspec-support (3.8.0)
95
+ rubyzip (1.2.2)
96
+ selenium-webdriver (3.14.1)
95
97
  childprocess (~> 0.5)
96
- rubyzip (~> 1.2)
97
- sinatra (2.0.3)
98
+ rubyzip (~> 1.2, >= 1.2.2)
99
+ sinatra (2.0.4)
98
100
  mustermann (~> 1.0)
99
101
  rack (~> 2.0)
100
- rack-protection (= 2.0.3)
102
+ rack-protection (= 2.0.4)
101
103
  tilt (~> 2.0)
102
104
  tilt (2.0.8)
103
- xpath (3.1.0)
105
+ xpath (3.2.0)
104
106
  nokogiri (~> 1.8)
105
107
 
106
108
  PLATFORMS
@@ -112,4 +114,4 @@ DEPENDENCIES
112
114
  superbara!
113
115
 
114
116
  BUNDLED WITH
115
- 1.16.1
117
+ 1.17.1
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Superbara
2
2
 
3
- Web app test scripting that does not hurt.
3
+ ## Web app test scripting that does not hurt.
4
4
 
5
5
  ![Demo of Superbara](demo.gif)
6
6
 
@@ -46,6 +46,10 @@ module Superbara
46
46
  self
47
47
  end
48
48
 
49
+ def location
50
+ Capybara.evaluate_script "arguments[0].getBoundingClientRect()", self.native
51
+ end
52
+
49
53
  def type(*inputs)
50
54
  self.native.type(*inputs)
51
55
  end
data/lib/superbara/dsl.rb CHANGED
@@ -103,6 +103,16 @@ return Array.from(
103
103
  e.click
104
104
  end
105
105
 
106
+ def klik(selector, options={})
107
+ Superbara.output "clicking '#{selector}' with #{options.inspect}"
108
+ el = find selector, options
109
+ coords = el.location
110
+ klikX = coords["x"] + coords["width"] / 2
111
+ klikY = coords["y"] + coords["height"] / 2
112
+ `xdotool mousemove #{klikX} #{klikY} click 1`
113
+ return el
114
+ end
115
+
106
116
  @@once_runs = []
107
117
  def run(what, params={}, args={}, &block)
108
118
  Superbara.last_context_return_value = nil
@@ -384,4 +394,13 @@ return Array.from(
384
394
  Superbara.start_did_open_debug=true
385
395
  Pry.start(binding.of_caller(1))
386
396
  end
397
+
398
+ def fullscreen(full=true)
399
+ if full
400
+ page.driver.fullscreen_window current_window.handle
401
+ else
402
+ page.driver.maximize_window current_window.handle
403
+ end
404
+ end
405
+
387
406
  end; end
@@ -1,3 +1,3 @@
1
1
  module Superbara
2
- VERSION = "0.14.4"
2
+ VERSION = "0.14.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superbara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.4
4
+ version: 0.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matti Paksula
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-20 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -464,6 +464,7 @@ files:
464
464
  - tests/tags/notags.rb
465
465
  - tests/tags/simple.rb
466
466
  - vendor/chromedriver/linux64/.gitkeep
467
+ - vendor/chromedriver/linux64/btw chromedriver manually copy-pasted here
467
468
  - vendor/chromedriver/linux64/chromedriver
468
469
  - vendor/chromedriver/mac64/.gitkeep
469
470
  - vendor/chromedriver/mac64/chromedriver