skeleton-ui 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c61822adcde99dd0dafee9f319f32e6fca287f21828f107f72397dace1fd9fa9
4
- data.tar.gz: 8d128eaa42755df0ca0e1350b4968607e60152eea74eb5faa56fcd01615178b9
3
+ metadata.gz: d327f051ce08a8b54de5154544b9204b196f132cd3383c0a40d0a0576294fadd
4
+ data.tar.gz: 5af318dbb05d21de9519fc1ca0127a68ed01f299a2a0d499d7acd7f69fb35b89
5
5
  SHA512:
6
- metadata.gz: 30127746a98bacdaf1fbde004ad3dde942e89165e5029fd671771168e9568a6daa215d312ad3035e173536feae0ab6f6e0970035c24a303001226bcfc72ec828
7
- data.tar.gz: ec5daea8898e03da127a206aa88f272adf43e64d6fecf33587f1f5b1ea9415e28ae4c975dfdeb958a14397fc727bbe2afdc1b6ede8395001ee6a1fe40f8bac08
6
+ metadata.gz: 3dc4568e47c23add94d82ea95a2afa6babee5db570222d6bb0471e3e1e0fbac889a740b5a150a239f1ce19ca234f1e75bb96156c2df96a27e027f571bc755cb6
7
+ data.tar.gz: f23c839cac2dd2d9d21f54fae4e7c02602cabc34401c793e158bf9a3ac64887a17872916b9c446b244de97c44e1ace2f5cdde41f188ffa100bc5f3323e65f303
data/.gitignore CHANGED
@@ -9,5 +9,5 @@
9
9
  *.xcuserdatad
10
10
  *.png
11
11
  *.html
12
- !index.html
12
+ !skeleton.html
13
13
  port
data/README.md CHANGED
@@ -67,6 +67,9 @@ Usage:
67
67
 
68
68
  -b, --bundle BUNDLE
69
69
  Set Bundle ID for your app [required for iOS]
70
+
71
+ --[no-]browser
72
+ Not open the browser at the end of skeleton's work
70
73
 
71
74
  $ skeleton clear --help
72
75
 
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
- send_file "#{Base::ROOT_DIR}/html/#{params[:file]}"
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
- send_file "#{Base::ROOT_DIR}/html/#{params[:file]}"
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.html">Ruby</a></li>
19
- <li><a href="java.html">Java</a></li>
20
- <li><a href="python.html">Python</a></li>
21
- <li><a href="javascript.html">Javascript</a></li>
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/forqa">forqa</a></p>
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>
@@ -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">&#8592 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">Page Objects:</h4>
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><%= @pageobject %></code></pre>
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/forqa">forqa</a></p>
36
- <p class="mb-1 text-center"><a href="https://github.com/alter-al">alter-al</a></p>
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
- @pageobject = File.read(Dir["#{folder}/*.#{type}"].first)
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}/index.html"
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 #{XCODEPROJ_FOLDER}.\n" \
142
- 'For more info read: https://github.com/forqa/skeleton/' \
143
- 'blob/master/docs/real-ios-device-config.md')
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
@@ -1,4 +1,4 @@
1
1
  module Skeleton
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  GEM_NAME = 'skeleton-ui'
4
4
  end
@@ -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.8
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-18 00:00:00.000000000 Z
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