superbara 0.13.0 → 0.13.1
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/Gemfile.lock +1 -1
- data/bin/release +1 -1
- data/lib/capybara_monkey.rb +26 -0
- data/lib/superbara/dsl.rb +1 -0
- data/lib/superbara/version.rb +1 -1
- data/tests/common/main.rb +4 -0
- data/tests/svg/main.rb +12 -0
- data/web/public/highcharts.html +75 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f31bcba1fd4c6852c8a863311d7dadbb69aeed96beb7bdee389b0bcd370d6584
|
4
|
+
data.tar.gz: 8ac9d1a6265ba34c71d75bc0f104754f394cb4aa4bf4acd53d2f9be68c524eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b93137d586e4d50f2fe346870b2756c25a8273460cea27865ccaae02b5465849677edd66be2e21db134bbc3a7b2b16c21fe79c5b7d13df6fd842228a914f897
|
7
|
+
data.tar.gz: fde1367a69c7e0f024ea0ab1e2503c8f3075f6c15c7b961988eeee41b3b2f3b443de81aeeaf368a2a62f729330ab90406d3d7c8f08acf9d6d15621a87f1dcd0f
|
data/Gemfile.lock
CHANGED
data/bin/release
CHANGED
data/lib/capybara_monkey.rb
CHANGED
@@ -1,3 +1,29 @@
|
|
1
|
+
class Capybara::Selenium::Node < Capybara::Driver::Node
|
2
|
+
def path
|
3
|
+
path = find_xpath(XPath.ancestor_or_self).reverse
|
4
|
+
|
5
|
+
result = []
|
6
|
+
while (node = path.shift)
|
7
|
+
parent = path.first
|
8
|
+
selector = node.tag_name
|
9
|
+
if parent
|
10
|
+
siblings = parent.find_xpath(selector)
|
11
|
+
|
12
|
+
#MONKEY START https://github.com/teamcapybara/capybara/issues/2048
|
13
|
+
if selector == "svg" && siblings.size == 0
|
14
|
+
siblings = parent.find_xpath "//*[local-name() = 'svg']"
|
15
|
+
end
|
16
|
+
#MONKEY END
|
17
|
+
|
18
|
+
selector += "[#{siblings.index(node) + 1}]" unless siblings.size == 1
|
19
|
+
end
|
20
|
+
result.push selector
|
21
|
+
end
|
22
|
+
|
23
|
+
'/' + result.reverse.join('/')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
1
27
|
module Superbara
|
2
28
|
module CapybaraMonkey
|
3
29
|
module Node
|
data/lib/superbara/dsl.rb
CHANGED
data/lib/superbara/version.rb
CHANGED
data/tests/common/main.rb
CHANGED
data/tests/svg/main.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
<script src="https://code.highcharts.com/highcharts.js"></script>
|
2
|
+
<script src="https://code.highcharts.com/modules/boost.js"></script>
|
3
|
+
<script src="https://code.highcharts.com/modules/exporting.js"></script>
|
4
|
+
|
5
|
+
<div id="container" style="height: 400px; max-width: 800px; margin: 0 auto"></div>
|
6
|
+
|
7
|
+
<script>
|
8
|
+
|
9
|
+
|
10
|
+
function getData(n) {
|
11
|
+
var arr = [],
|
12
|
+
i,
|
13
|
+
a,
|
14
|
+
b,
|
15
|
+
c,
|
16
|
+
spike;
|
17
|
+
for (i = 0; i < n; i = i + 1) {
|
18
|
+
if (i % 100 === 0) {
|
19
|
+
a = 2 * Math.random();
|
20
|
+
}
|
21
|
+
if (i % 1000 === 0) {
|
22
|
+
b = 2 * Math.random();
|
23
|
+
}
|
24
|
+
if (i % 10000 === 0) {
|
25
|
+
c = 2 * Math.random();
|
26
|
+
}
|
27
|
+
if (i % 50000 === 0) {
|
28
|
+
spike = 10;
|
29
|
+
} else {
|
30
|
+
spike = 0;
|
31
|
+
}
|
32
|
+
arr.push([
|
33
|
+
i,
|
34
|
+
2 * Math.sin(i / 100) + a + b + c + spike + Math.random()
|
35
|
+
]);
|
36
|
+
}
|
37
|
+
return arr;
|
38
|
+
}
|
39
|
+
var n = 500000,
|
40
|
+
data = getData(n);
|
41
|
+
|
42
|
+
|
43
|
+
console.time('line');
|
44
|
+
Highcharts.chart('container', {
|
45
|
+
|
46
|
+
chart: {
|
47
|
+
zoomType: 'x',
|
48
|
+
panning: true,
|
49
|
+
panKey: 'shift'
|
50
|
+
},
|
51
|
+
|
52
|
+
boost: {
|
53
|
+
useGPUTranslations: true
|
54
|
+
},
|
55
|
+
|
56
|
+
title: {
|
57
|
+
text: 'Highcharts drawing ' + n + ' points'
|
58
|
+
},
|
59
|
+
|
60
|
+
subtitle: {
|
61
|
+
text: 'Using the Boost module'
|
62
|
+
},
|
63
|
+
|
64
|
+
tooltip: {
|
65
|
+
valueDecimals: 2
|
66
|
+
},
|
67
|
+
|
68
|
+
series: [{
|
69
|
+
data: data,
|
70
|
+
lineWidth: 0.5
|
71
|
+
}]
|
72
|
+
|
73
|
+
});
|
74
|
+
console.timeEnd('line');
|
75
|
+
</script>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matti Paksula
|
@@ -382,6 +382,7 @@ files:
|
|
382
382
|
- tests/run/main.rb
|
383
383
|
- tests/run/once.rb
|
384
384
|
- tests/run/value.rb
|
385
|
+
- tests/svg/main.rb
|
385
386
|
- tests/tags/block.rb
|
386
387
|
- tests/tags/fails.rb
|
387
388
|
- tests/tags/main.rb
|
@@ -397,6 +398,7 @@ files:
|
|
397
398
|
- web/public/2.html
|
398
399
|
- web/public/3.html
|
399
400
|
- web/public/another.html
|
401
|
+
- web/public/highcharts.html
|
400
402
|
- web/public/index.html
|
401
403
|
- web/views/layout.erb
|
402
404
|
- web/views/long.erb
|