skeleton-ui 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/html/index.html +1 -1
- data/html/template.html.erb +6 -4
- data/lib/skeleton/android.rb +22 -2
- data/lib/skeleton/ios.rb +15 -1
- data/lib/skeleton/root.rb +3 -3
- data/lib/skeleton/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8418b975757fca5b7c940051ff2d5577f3e65daa691bb58890b48c2730bdb542
|
4
|
+
data.tar.gz: e291af0a193239deee80a3983f375b2a7301fafdf0a4f3a551d09df9ab884d0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d52e6993e5d2ac528c43a9e0525f66f548d4a55e0d80a737c544186e0fe66e35ab20e5b6d88e966b5ca801285b2dcb55cce1e37e369d5360ec2024745e7686a
|
7
|
+
data.tar.gz: 67ca713d562701c9fffe0d11e8a2f860a0733f80be334b19a2a02d899933ba08328ed9f5ae582c8175c5f50077d7ba11ef511af887520b3a0eadddda13fa0f63
|
data/html/index.html
CHANGED
data/html/template.html.erb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
8
8
|
<link rel="stylesheet" type="text/css" href="/index.css"/>
|
9
9
|
</head>
|
10
|
-
<body class="bg-light">
|
10
|
+
<body class="bg-light" style="background: linear-gradient(white, lightblue);">
|
11
11
|
<div class="container-fluid">
|
12
12
|
<div class="py-5 text-center">
|
13
13
|
<h2>Skeleton</h2>
|
@@ -24,9 +24,11 @@
|
|
24
24
|
<pre><code><%= @pageobject %></code></pre>
|
25
25
|
</div>
|
26
26
|
</div>
|
27
|
-
<
|
28
|
-
|
29
|
-
<
|
27
|
+
<div class="col-md-12">
|
28
|
+
<h4 class="mb-3">Elements Tree:</h4>
|
29
|
+
<div class="content" id="content">
|
30
|
+
<pre><code><%= @elements_tree %></code></pre>
|
31
|
+
</div>
|
30
32
|
</div>
|
31
33
|
</div>
|
32
34
|
<footer class="my-5 pt-5 text-muted text-center text-small">
|
data/lib/skeleton/android.rb
CHANGED
@@ -45,7 +45,17 @@ class Android < Base
|
|
45
45
|
def create_locator_by_content_desc(line)
|
46
46
|
method_name = "#{line[CLASS]}#{increment_locator_id}"
|
47
47
|
method_name.slice!(/.*\./)
|
48
|
-
|
48
|
+
content_desc = line[CONTENT_DESC]
|
49
|
+
i = 0
|
50
|
+
content_desc.each_char do |char|
|
51
|
+
if char =~ /(\"|\')/
|
52
|
+
new_value = "\\#{char}"
|
53
|
+
content_desc[i] = new_value
|
54
|
+
i += new_value.length - 1
|
55
|
+
end
|
56
|
+
i += 1
|
57
|
+
end
|
58
|
+
locator = "//#{line[CLASS]}[@#{CONTENT_DESC}='#{line[CONTENT_DESC]}]']"
|
49
59
|
code_generation(method_name: method_name,
|
50
60
|
locator_type: XPATH,
|
51
61
|
locator_value: locator)
|
@@ -54,7 +64,17 @@ class Android < Base
|
|
54
64
|
def create_locator_by_text(line)
|
55
65
|
method_name = "#{line[CLASS]}#{increment_locator_id}"
|
56
66
|
method_name.slice!(/.*\./)
|
57
|
-
|
67
|
+
text = line[TEXT]
|
68
|
+
i = 0
|
69
|
+
text.each_char do |char|
|
70
|
+
if char =~ /(\"|\')/
|
71
|
+
new_value = "\\#{char}"
|
72
|
+
text[i] = new_value
|
73
|
+
i += new_value.length - 1
|
74
|
+
end
|
75
|
+
i += 1
|
76
|
+
end
|
77
|
+
locator = "//#{line[CLASS]}[@#{TEXT}='#{text}]'"
|
58
78
|
code_generation(method_name: method_name,
|
59
79
|
locator_type: XPATH,
|
60
80
|
locator_value: locator)
|
data/lib/skeleton/ios.rb
CHANGED
@@ -85,7 +85,21 @@ class IOS < Base
|
|
85
85
|
|
86
86
|
def locator_by_label(line)
|
87
87
|
locator = /#{LABEL}: '(.*?)'/.match(line)
|
88
|
-
locator.nil?
|
88
|
+
if locator.nil?
|
89
|
+
''
|
90
|
+
else
|
91
|
+
label = locator[1]
|
92
|
+
i = 0
|
93
|
+
label.each_char do |char|
|
94
|
+
if char =~ /(\"|\')/
|
95
|
+
new_value = "\\#{char}"
|
96
|
+
label[i] = new_value
|
97
|
+
i += new_value.length - 1
|
98
|
+
end
|
99
|
+
i += 1
|
100
|
+
end
|
101
|
+
label
|
102
|
+
end
|
89
103
|
end
|
90
104
|
|
91
105
|
def code_generation(method_name:, locator_type:, locator_value:)
|
data/lib/skeleton/root.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative 'version'
|
2
2
|
|
3
3
|
class Base
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
# ROOT_DIR = File.expand_path('..', Dir.pwd)
|
5
|
+
ROOT_DIR = "#{`gem environment gemdir`.strip}" \
|
6
|
+
"/gems/#{Skeleton::GEM_NAME}-#{Skeleton::VERSION}"
|
7
7
|
end
|
data/lib/skeleton/version.rb
CHANGED