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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b40d3fd6bd334a9a4122b1632dbde1fe9deaab262f5f89189744c29e84df8010
4
- data.tar.gz: 966ed8720ab46d1e76cb1ed72c548de2c6e241a955538ea7eb3042de4de0cf31
3
+ metadata.gz: 8418b975757fca5b7c940051ff2d5577f3e65daa691bb58890b48c2730bdb542
4
+ data.tar.gz: e291af0a193239deee80a3983f375b2a7301fafdf0a4f3a551d09df9ab884d0c
5
5
  SHA512:
6
- metadata.gz: 4a496ede310c6100a334f6c84966bfa4af6717bd7a240c52ab2f20d35c4ba5dc1d0a11dd3808b25929259c00709c03a150d2c4dcde34cc04242299915127c967
7
- data.tar.gz: 7b216425c45e74fcd8b342210a25fb8435b317d4f856201e623ffdd98ce1379d7c0426d30bd0bc6f6c6481d1f7f024b4973f7adb11ca6c8aee1eb8e022685663
6
+ metadata.gz: 7d52e6993e5d2ac528c43a9e0525f66f548d4a55e0d80a737c544186e0fe66e35ab20e5b6d88e966b5ca801285b2dcb55cce1e37e369d5360ec2024745e7686a
7
+ data.tar.gz: 67ca713d562701c9fffe0d11e8a2f860a0733f80be334b19a2a02d899933ba08328ed9f5ae582c8175c5f50077d7ba11ef511af887520b3a0eadddda13fa0f63
data/html/index.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <div class="py-5 text-center">
13
13
  <h2>Skeleton</h2>
14
14
  </div>
15
- <div class="row" style="min-height: 300px;">
15
+ <div class="row" style="min-height: 333px;">
16
16
  <div class="col-md-8">
17
17
  <h2>Get it:</h2>
18
18
  <li><a href="ruby.html">Ruby</a></li>
@@ -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
- <h4 class="mb-3">Elements Tree:</h4>
28
- <div class="content" id="content">
29
- <pre><code><%= @elements_tree %></code></pre>
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">
@@ -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
- locator = "//#{line[CLASS]}[@#{CONTENT_DESC}='#{line[CONTENT_DESC]}']"
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
- locator = "//#{line[CLASS]}[@#{TEXT}='#{line[TEXT]}'"
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? ? '' : locator[1]
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
- ROOT_DIR = File.expand_path('..', Dir.pwd)
5
- #ROOT_DIR = "#{`gem environment gemdir`.strip}" \
6
- # "/gems/#{Skeleton::GEM_NAME}-#{Skeleton::VERSION}"
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
@@ -1,4 +1,4 @@
1
1
  module Skeleton
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  GEM_NAME = 'skeleton-ui'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skeleton-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - a.alterpesotskiy