skeleton-ui 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/README.md +3 -0
- data/bin/skeleton +2 -0
- data/docs/permissions_error.md +8 -0
- data/html/server.rb +10 -2
- data/html/{index.html → skeleton.html} +5 -6
- data/html/template.html.erb +5 -5
- data/lib/skeleton.rb +7 -5
- data/lib/skeleton/base.rb +5 -0
- data/lib/skeleton/ios.rb +5 -4
- data/lib/skeleton/version.rb +1 -1
- data/xcodeproj/Skeleton.xcodeproj/project.pbxproj +4 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d327f051ce08a8b54de5154544b9204b196f132cd3383c0a40d0a0576294fadd
|
4
|
+
data.tar.gz: 5af318dbb05d21de9519fc1ca0127a68ed01f299a2a0d499d7acd7f69fb35b89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dc4568e47c23add94d82ea95a2afa6babee5db570222d6bb0471e3e1e0fbac889a740b5a150a239f1ce19ca234f1e75bb96156c2df96a27e027f571bc755cb6
|
7
|
+
data.tar.gz: f23c839cac2dd2d9d21f54fae4e7c02602cabc34401c793e158bf9a3ac64887a17872916b9c446b244de97c44e1ace2f5cdde41f188ffa100bc5f3323e65f303
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/bin/skeleton
CHANGED
@@ -15,7 +15,9 @@ module Skeleton
|
|
15
15
|
c.option '-p', '--platform PLATFORM', String, 'Set device platform: android or ios'
|
16
16
|
c.option '-u', '--udid UDID', String, 'Set device UDID'
|
17
17
|
c.option '-b', '--bundle BUNDLE', String, 'Set Bundle ID for your app [required for iOS]'
|
18
|
+
c.option '--[no-]browser', "Not open the browser at the end of skeleton's work"
|
18
19
|
c.action do |_args, options|
|
20
|
+
options.default(browser: true)
|
19
21
|
Skeleton.new(options).run
|
20
22
|
end
|
21
23
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
## Setting up Ruby Version Manager for deciding permissions problems
|
2
|
+
|
3
|
+
1. Install rvm (\curl -sSL https://get.rvm.io | bash -s stable).
|
4
|
+
2. Check that rvm is available from terminal (which rvm). If not, set it in your .bash_profile.
|
5
|
+
3. Install latest ruby via rvm (rvm install ruby).
|
6
|
+
4. Set default ruby from rvm, instead of system ruby (rvm --default <version>).
|
7
|
+
5. Make sure, that you use latest ruby from rvm (ruby -v).
|
8
|
+
6. Reinstall skeleton without sudo (gem install skeleton-ui).
|
data/html/server.rb
CHANGED
@@ -6,10 +6,18 @@ set :port, server_port
|
|
6
6
|
|
7
7
|
File.open("#{Base::ROOT_DIR}/html/port", 'w+') { |f| f.write(server_port) }
|
8
8
|
|
9
|
+
get '/' do
|
10
|
+
redirect "skeleton"
|
11
|
+
end
|
12
|
+
|
9
13
|
get '/:file' do
|
10
|
-
|
14
|
+
domain = params[:file].split('.').last
|
15
|
+
file = domain == params[:file] ? "#{domain}.html" : params[:file]
|
16
|
+
send_file "#{Base::ROOT_DIR}/html/#{file}"
|
11
17
|
end
|
12
18
|
|
13
19
|
post '/:file' do
|
14
|
-
|
20
|
+
domain = params[:file].split('.').last
|
21
|
+
file = domain == params[:file] ? "#{domain}.html" : params[:file]
|
22
|
+
send_file "#{Base::ROOT_DIR}/html/#{file}"
|
15
23
|
end
|
@@ -15,15 +15,14 @@
|
|
15
15
|
<div class="row" style="min-height: 333px;">
|
16
16
|
<div class="col-md-8">
|
17
17
|
<h2>Get it:</h2>
|
18
|
-
<li><a href="ruby
|
19
|
-
<li><a href="java
|
20
|
-
<li><a href="python
|
21
|
-
<li><a href="javascript
|
18
|
+
<li><a href="ruby">Ruby</a></li>
|
19
|
+
<li><a href="java">Java</a></li>
|
20
|
+
<li><a href="python">Python</a></li>
|
21
|
+
<li><a href="javascript">Javascript</a></li>
|
22
22
|
</div>
|
23
23
|
</div>
|
24
24
|
<footer class="my-5 pt-5 text-muted text-center text-small">
|
25
|
-
<p class="mb-1">© 2018 <a href="https://github.com/
|
26
|
-
<p class="mb-1"><a href="https://github.com/alter-al">alter-al</a></p>
|
25
|
+
<p class="mb-1">© 2018 <a href="https://github.com/alter-al">alter-al</a></p>
|
27
26
|
<ul class="list-inline"></ul>
|
28
27
|
</footer>
|
29
28
|
</div>
|
data/html/template.html.erb
CHANGED
@@ -7,6 +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
|
+
<a href="skeleton">← home</a>
|
10
11
|
<body class="bg-light" style="background: linear-gradient(white, lightblue);">
|
11
12
|
<div class="container-fluid">
|
12
13
|
<div class="py-5 text-center">
|
@@ -19,9 +20,9 @@
|
|
19
20
|
</div>
|
20
21
|
</div>
|
21
22
|
<div class="col-md-8">
|
22
|
-
<h4 class="mb-3">
|
23
|
+
<h4 class="mb-3">Screen Objects:</h4>
|
23
24
|
<div class="content" id="content" style="max-height: 670px; overflow-y: auto;">
|
24
|
-
<pre><code><%= @
|
25
|
+
<pre><code><%= @screen_objects %></code></pre>
|
25
26
|
</div>
|
26
27
|
</div>
|
27
28
|
<div class="col-md-12">
|
@@ -32,9 +33,8 @@
|
|
32
33
|
</div>
|
33
34
|
</div>
|
34
35
|
<footer class="my-2 pt-5 text-muted text-small">
|
35
|
-
<p class="mb-1 text-center">© 2018 <a href="https://github.com/
|
36
|
-
<p class="mb-1 text-
|
37
|
-
<p class="mb-1 text-right"><a href="https://github.com/forqa/skeleton/releases/tag/<%= @build_version %>"><%= @build_version %></a></p>
|
36
|
+
<p class="mb-1 text-center">© 2018 <a href="https://github.com/alter-al">alter-al</a></p>
|
37
|
+
<p class="mb-1 text-right"><a href="https://github.com/alter-al/skeleton/releases/tag/<%= @build_version %>"><%= @build_version %></a></p>
|
38
38
|
</footer>
|
39
39
|
</div>
|
40
40
|
</body>
|
data/lib/skeleton.rb
CHANGED
@@ -13,12 +13,13 @@ require_relative 'skeleton/android'
|
|
13
13
|
|
14
14
|
module Skeleton
|
15
15
|
class Skeleton
|
16
|
-
attr_accessor :platform, :udid, :bundle_id
|
16
|
+
attr_accessor :platform, :udid, :bundle_id, :browser
|
17
17
|
|
18
18
|
def initialize(options)
|
19
19
|
self.platform = options.platform
|
20
20
|
self.udid = options.udid
|
21
21
|
self.bundle_id = options.bundle
|
22
|
+
self.browser = options.browser
|
22
23
|
@driver = ios? ? IOS.new(options) : Android.new(options)
|
23
24
|
end
|
24
25
|
|
@@ -54,7 +55,7 @@ module Skeleton
|
|
54
55
|
attach_image
|
55
56
|
type = language.type(lang)
|
56
57
|
folder = Base::PAGE_OBJECTS_FOLDER
|
57
|
-
@
|
58
|
+
@screen_objects = File.read(Dir["#{folder}/*.#{type}"].first)
|
58
59
|
@elements_tree = File.read(Dir["#{folder}/*.xml"].first)
|
59
60
|
@build_version = "v#{VERSION}"
|
60
61
|
if @driver.class == Android
|
@@ -72,15 +73,16 @@ module Skeleton
|
|
72
73
|
screenshot = Dir["#{Base::ATTACHMENTS_FOLDER}/*.png"].first
|
73
74
|
image = MiniMagick::Image.new(screenshot)
|
74
75
|
image.rotate(90) if image.width > image.height
|
75
|
-
FileUtils.cp_r(screenshot, "#{Base::ROOT_DIR}/html/screenshot.png")
|
76
76
|
rescue MiniMagick::Error => e
|
77
77
|
@driver.log.error(e)
|
78
|
+
ensure
|
79
|
+
FileUtils.cp_r(screenshot, "#{Base::ROOT_DIR}/html/screenshot.png")
|
78
80
|
end
|
79
81
|
|
80
82
|
def open_url
|
81
83
|
port = File.read("#{Base::ROOT_DIR}/html/port")
|
82
|
-
url = "http://localhost:#{port}/
|
83
|
-
`open #{url}`
|
84
|
+
url = "http://localhost:#{port}/skeleton"
|
85
|
+
`open #{url}` if @browser
|
84
86
|
@driver.log.info("Look at your pretty page objects: \n#{url} 😍")
|
85
87
|
rescue Errno::ENOENT => err
|
86
88
|
@driver.log.error("Something went wrong with skeleton server 💩\n#{err}")
|
data/lib/skeleton/base.rb
CHANGED
@@ -9,6 +9,11 @@ class Base
|
|
9
9
|
FileUtils.rm_rf("#{ROOT_DIR}/html/screenshot.png")
|
10
10
|
FileUtils.mkdir_p(PAGE_OBJECTS_FOLDER)
|
11
11
|
FileUtils.mkdir_p(ATTACHMENTS_FOLDER)
|
12
|
+
rescue
|
13
|
+
log.fatal("Advice you to use not system ruby \n" \
|
14
|
+
'For more info read: https://github.com/alter-al/' \
|
15
|
+
'skeleton/blob/master/docs/permissions_error.md')
|
16
|
+
raise
|
12
17
|
end
|
13
18
|
|
14
19
|
def log
|
data/lib/skeleton/ios.rb
CHANGED
@@ -138,9 +138,10 @@ class IOS < Base
|
|
138
138
|
@page_source.slice!(start_grep)
|
139
139
|
@page_source.slice!(end_grep)
|
140
140
|
if @page_source.empty?
|
141
|
-
log.fatal("Try to sign Skeleton in
|
142
|
-
|
143
|
-
'
|
141
|
+
log.fatal("Try to sign Skeleton and SkeletonUI targets in " \
|
142
|
+
"#{XCODEPROJ_FOLDER}/Skeleton.xcodeproj \n" \
|
143
|
+
'For more info read: https://github.com/alter-al/' \
|
144
|
+
'skeleton/blob/master/docs/real-ios-device-config.md')
|
144
145
|
raise
|
145
146
|
end
|
146
147
|
log.info('Successfully getting Screen Source Tree 🔥')
|
@@ -164,7 +165,7 @@ class IOS < Base
|
|
164
165
|
.include?("CFBundleName")
|
165
166
|
else
|
166
167
|
return if `ideviceinstaller -u #{@udid} -l`
|
167
|
-
.include?(@bundle_id)
|
168
|
+
.include?("#{@bundle_id},")
|
168
169
|
end
|
169
170
|
log.fatal("No such apps with bundle_id: #{@bundle_id}")
|
170
171
|
raise
|
data/lib/skeleton/version.rb
CHANGED
@@ -354,7 +354,7 @@
|
|
354
354
|
buildSettings = {
|
355
355
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
356
356
|
CODE_SIGN_STYLE = Automatic;
|
357
|
-
DEVELOPMENT_TEAM =
|
357
|
+
DEVELOPMENT_TEAM = 4D6LA585PP;
|
358
358
|
INFOPLIST_FILE = Skeleton/Info.plist;
|
359
359
|
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
360
360
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
@@ -370,7 +370,7 @@
|
|
370
370
|
buildSettings = {
|
371
371
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
372
372
|
CODE_SIGN_STYLE = Automatic;
|
373
|
-
DEVELOPMENT_TEAM =
|
373
|
+
DEVELOPMENT_TEAM = 4D6LA585PP;
|
374
374
|
INFOPLIST_FILE = Skeleton/Info.plist;
|
375
375
|
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
376
376
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
@@ -386,7 +386,7 @@
|
|
386
386
|
buildSettings = {
|
387
387
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
388
388
|
CODE_SIGN_STYLE = Automatic;
|
389
|
-
DEVELOPMENT_TEAM =
|
389
|
+
DEVELOPMENT_TEAM = 4D6LA585PP;
|
390
390
|
INFOPLIST_FILE = SkeletonUITests/Info.plist;
|
391
391
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
392
392
|
PRODUCT_BUNDLE_IDENTIFIER = ru.forqa.SkeletonUITests;
|
@@ -402,7 +402,7 @@
|
|
402
402
|
buildSettings = {
|
403
403
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
404
404
|
CODE_SIGN_STYLE = Automatic;
|
405
|
-
DEVELOPMENT_TEAM =
|
405
|
+
DEVELOPMENT_TEAM = 4D6LA585PP;
|
406
406
|
INFOPLIST_FILE = SkeletonUITests/Info.plist;
|
407
407
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
408
408
|
PRODUCT_BUNDLE_IDENTIFIER = ru.forqa.SkeletonUITests;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skeleton-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- a.alterpesotskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -157,12 +157,13 @@ files:
|
|
157
157
|
- bin/console
|
158
158
|
- bin/setup
|
159
159
|
- bin/skeleton
|
160
|
+
- docs/permissions_error.md
|
160
161
|
- docs/real-ios-device-config.md
|
161
162
|
- docs/sign_xcproj.png
|
162
163
|
- docs/untrusted-dev.png
|
163
164
|
- html/index.css
|
164
|
-
- html/index.html
|
165
165
|
- html/server.rb
|
166
|
+
- html/skeleton.html
|
166
167
|
- html/template.html.erb
|
167
168
|
- lib/skeleton.rb
|
168
169
|
- lib/skeleton/android.rb
|