fastlane: Snapshot: Looks like the number of screenshots (3) doesn't match the number of names (6)

New Issue Checklist

Issue Description

When I run snapshot it executes the UI test successfully but somehow thinks it should have double the screenshots.

snapfile is the default one. UI test is setup in the most basic way.

override func setUp() {
    super.setUp()

    continueAfterFailure = false
    XCUIDevice.sharedDevice().orientation = .Portrait

    let app = XCUIApplication()
    setupSnapshot(app)
    app.launch()
}

func testMenubar() {
    let app = XCUIApplication()

    app.buttons["MenuBar Chat"].tap()
    snapshot("0ChatScreen")
    app.buttons["MenuBar Browse"].tap()
    snapshot("0MatchScreen")
    app.buttons["MenuBar Stats"].tap()
    snapshot("0Stats")
}

The test itself runs perfectly fine inside XCode and also executes with snapshot, however, for whatever reason snapshot thinks there should be twice the amount of snapshots at the first try. Interestingly it succeeds on the second try (number_of_retries 1), but the first one ALWAYS fails.

any idea?

Complete output when running fastlane, including the stack trace and command used
    Looks like the number of screenshots (3) doesn't match the number of names (6)
    Copying '/Users/markus/..../screenshots/en-US/iPhone6Plus-FDataSnapshot, _ key: String, _ defaultValue: String) -> String.png'...
    Copying '/Users/markus/..../screenshots/en-US/iPhone6Plus-FDataSnapshot, _ key: String, _ defaultValue: Int) -> Int.png'...
    Copying '/Users/markus/..../screenshots/en-US/iPhone6Plus-FDataSnapshot) -> FirebaseAPI.ConversationData.png'...
    no implicit conversion of nil into String

when it tries to process the list then it obviously runs into an error processing a nil value.

    /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/collector.rb:32:in `join': [!] no implicit conversion of nil into String (TypeError)
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/collector.rb:32:in `block in fetch_screenshots'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/collector.rb:21:in `each'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/collector.rb:21:in `each_with_index'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/collector.rb:21:in `fetch_screenshots'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:190:in `launch'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:66:in `run_for_device_and_language'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:45:in `block (3 levels) in work'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:37:in `each'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:37:in `block (2 levels) in work'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:36:in `each'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:36:in `block in work'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:35:in `each'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/lib/snapshot/runner.rb:35:in `work'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/bin/snapshot:36:in `block (2 levels) in run'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/fastlane_core-0.43.2/lib/fastlane_core/ui/fastlane_runner.rb:26:in `run!'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/bin/snapshot:96:in `run'
    from /Users/markus/.rvm/gems/ruby-2.2.3/gems/snapshot-1.12.2/bin/snapshot:110:in `<top (required)>'
    from /Users/markus/.rvm/gems/ruby-2.2.3/bin/snapshot:23:in `load'
    from /Users/markus/.rvm/gems/ruby-2.2.3/bin/snapshot:23:in `<main>'
    from /Users/markus/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
    from /Users/markus/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'

Configuration Files

default snapfile

Environment

fastlane version (run fastlane -v): snapshot 1.12.2

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)? No

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? yes

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (4 by maintainers)

Most upvoted comments

@TKBurner Thank you! I really appreciate it, especially since it seems to be such an odd problem. Wish you a great weekend too!