snapshot 1.5.0 → 1.6.0

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
  SHA1:
3
- metadata.gz: 465b8c37379a1a9a76a3ba13cadb954806c6e7bf
4
- data.tar.gz: 73b36f1256f379ee0ff430d5054b92cf9f74adf1
3
+ metadata.gz: 6ad2e98962df5f2e97ec3c33bede4babdce30168
4
+ data.tar.gz: bc9ac35cf07d90461d297c20aa3977f5c137e7dc
5
5
  SHA512:
6
- metadata.gz: 1dbd182b3e65ed03cc67d4aaa841804d8c066c05dbfd2acadc36ad329aeef01565895f07cecddd77f36c0a060e97bd61ccfed54aa780df913bf70f1609208463
7
- data.tar.gz: 19451dc63532cc4d2ffaadf9db19c3b36484fb398440fcd8a9230ee5601d85fa557fbb6af65ca0d29c11704689162e0a4d923ed297ab67f5105e051f44883f63
6
+ metadata.gz: 756b6e5a499083e7dee9a325fb41e7b3820311e18b3f7de6bc61c6be325ccef38a406d3f749e073b5bdc26768a259c8240db630e688348e3af8097466c9082a1
7
+ data.tar.gz: 9cd8d9b921a58da4bd3333f9be6c40b966c00b2285adb178e9d1eea96c6449aeaf44aed345e6f4ab9a0e8eaa0979d039232a341dad80eac73b99f83cc0dbe15a
data/README.md CHANGED
@@ -350,8 +350,6 @@ ALL_LANGUAGES = ["da", "de-DE", "el", "en-AU", "en-CA", "en-GB", "en-US", "es-ES
350
350
  ## Use a clean status bar
351
351
  You can use [SimulatorStatusMagic](https://github.com/shinydevelopment/SimulatorStatusMagic) to clean up the status bar.
352
352
 
353
- If you enable a clean status bar, you have to remove the `waitForLoadingIndicatorToDisappear` from the `SnapshotHelper.swift` code, as it doesn't detect when the loading indicator disappears.
354
-
355
353
  ## Editing the `Snapfile`
356
354
  Change syntax highlighting to *Ruby*.
357
355
 
@@ -373,6 +371,9 @@ You can access the language using the `deviceLanguage` variable.
373
371
  # Need help?
374
372
  Please submit an issue on GitHub and provide information about your setup
375
373
 
374
+ # Code of Conduct
375
+ Help us keep `snapshot` open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/code-of-conduct).
376
+
376
377
  # License
377
378
  This project is licensed under the terms of the MIT license. See the LICENSE file.
378
379
 
@@ -16,7 +16,7 @@ languages([
16
16
  "it-IT"
17
17
  ])
18
18
 
19
- # Arguments to pass to the app on launch. See https://github.com/fastlane/snapshot#launch_arguments
19
+ # Arguments to pass to the app on launch. See https://github.com/fastlane/snapshot#launch-arguments
20
20
  # launch_arguments("-favColor red")
21
21
 
22
22
  # The name of the scheme which contains the UI Tests
@@ -20,7 +20,7 @@ func setupSnapshot(app: XCUIApplication) {
20
20
  Snapshot.setupSnapshot(app)
21
21
  }
22
22
 
23
- func snapshot(name: String, waitForLoadingIndicator: Bool = false) {
23
+ func snapshot(name: String, waitForLoadingIndicator: Bool = true) {
24
24
  Snapshot.snapshot(name, waitForLoadingIndicator: waitForLoadingIndicator)
25
25
  }
26
26
 
@@ -61,7 +61,7 @@ class Snapshot: NSObject {
61
61
  }
62
62
  }
63
63
 
64
- class func snapshot(name: String, waitForLoadingIndicator: Bool = false) {
64
+ class func snapshot(name: String, waitForLoadingIndicator: Bool = true) {
65
65
  if waitForLoadingIndicator {
66
66
  waitForLoadingIndicatorToDisappear()
67
67
  }
@@ -75,15 +75,19 @@ class Snapshot: NSObject {
75
75
  class func waitForLoadingIndicatorToDisappear() {
76
76
  let query = XCUIApplication().statusBars.childrenMatchingType(.Other).elementBoundByIndex(1).childrenMatchingType(.Other)
77
77
 
78
- let expectedCount = ((UIDevice.currentDevice().userInterfaceIdiom == .Pad) ? 5 : 4)
79
-
80
- while (query.count > UInt(expectedCount)) {
78
+ while (0..<query.count).map({ query.elementBoundByIndex($0) }).contains({ $0.isLoadingIndicator }) {
81
79
  sleep(1)
82
- print("Number of Elements in Status Bar: \(query.count)... waiting for status bar to disappear")
80
+ print("Waiting for loading indicator to disappear...")
83
81
  }
84
82
  }
85
83
  }
86
84
 
85
+ extension XCUIElement {
86
+ var isLoadingIndicator: Bool {
87
+ return self.frame.size == CGSize(width: 10, height: 20)
88
+ }
89
+ }
90
+
87
91
  // Please don't remove the lines below
88
92
  // They are used to detect outdated configuration files
89
93
  // SnapshotHelperVersion [[1.0]]
@@ -16,7 +16,7 @@ module Snapshot
16
16
  config.load_configuration_file(Snapshot.snapfile_name)
17
17
  end
18
18
 
19
- Snapshot.project.select_scheme
19
+ Snapshot.project.select_scheme(preferred_to_include: "UITests")
20
20
 
21
21
  # Devices
22
22
  unless config[:devices]
@@ -17,6 +17,8 @@ module Snapshot
17
17
  case output
18
18
  when /com\.apple\.CoreSimulator\.SimError/
19
19
  print "The simulator failed to launch - retrying..."
20
+ when /is not configured for Running/
21
+ raise TestsFailedException.new, "Scheme is not properly configured, make sure to check out the snapshot README"
20
22
  end
21
23
  end
22
24
 
@@ -60,6 +60,7 @@ module Snapshot
60
60
  default_value: output_directory),
61
61
  FastlaneCore::ConfigItem.new(key: :ios_version,
62
62
  description: "By default, the latest version should be used automatically. If you want to change it, do it here",
63
+ short_option: "-i",
63
64
  default_value: Snapshot::LatestIosVersion.version),
64
65
  FastlaneCore::ConfigItem.new(key: :stop_after_first_error,
65
66
  env_name: 'SNAPSHOT_BREAK_ON_FIRST_ERROR',
@@ -17,7 +17,7 @@ module Snapshot
17
17
 
18
18
  puts "-------------------------------------------------------".yellow
19
19
  puts "Open your Xcode project and make sure to do the following:".yellow
20
- puts "1) Add the ./SnapshotHelper.swift to your UI Test target".yellow
20
+ puts "1) Add the ./fastlane/SnapshotHelper.swift to your UI Test target".yellow
21
21
  puts " You can move the file anywhere you want".yellow
22
22
  puts "2) Call `setupSnapshot(app)` when launching your app".yellow
23
23
  puts ""
@@ -1,4 +1,4 @@
1
1
  module Snapshot
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.0"
3
3
  DESCRIPTION = "Automate taking localized screenshots of your iOS app on every device"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastimage