Suprnovae / cockpit-app-abctotaal

1 stars 0 forks source link

fix Snapshot errors in iOS CI pipeline (branched from #3) #4

Open vidbina opened 7 years ago

vidbina commented 7 years ago

fix in new branch fix/ios-fastlane-screenshots from setup/sigh-cert-fastlane-ios (see PR #3)

Problem

Currently an attempt is in progress to utilise UI Snapshot test to automate the grabbing of screenshots for the app store for different languages.

screen shot 2017-04-04 at 01 34 35

The test suite breaks because of a timeout in detecting the presence of the NavigationBar.

Possible fixes

The full log of the error may be found on Bitrise

References

vidbina commented 7 years ago

Hey @zirconias, just as some background I am using the following Bitrise workflow, I annotate it for simplicities sake just to safe you some time.

Preamble

---
format_version: 1.2.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

Trigger map

Trigger on any push to a branch that matches *ios* or any PR into dev (all PR's into dev have to run through the iOS and Android workflows)

trigger_map:
- push_branch: "*ios*"
  workflow: beta
- pull_request_source_branch: "*"
  workflow: beta
  pull_request_target_branch: dev

Workflows

workflows:
  beta:
    steps:
    - activate-ssh-key@3.1.1: # setup SSH private key to pickup rep
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@3.4.2: {} # clone git rep
    - script@1.1.3: # just run npm install and npm install flow-bin -g
        title: Install dependencies from package.json
        inputs:
        - content: |-
            #!/bin/bash
            npm install && npm install flow-bin -g
    - install-react-native@0.9.1: {}
# The following part is commented out because I basically copy a test API backend
# into the application to just run tests against a mock API in order to control the screencapture
# process. Somehow capturing screenshots is causing some trouble so I've commented this section
# out, but the objective is to get this section functional.
#    - script@1.1.3:
#        title: Prep test assets
#        inputs:
#        - content: |-
#            #!/bin/bash
#            make clean-api && make test
#        - is_debug: 'yes'
#    - react-native-bundle@1.0.3: {}
#    - fastlane@2.3.9:
#        title: "Screenshots \U0001F4F8"
#        inputs:
#        - lane: ios screenshot
#    - script@1.1.3:
#        title: "Zip screenshots \U0001F4F8"
#        inputs:
#        - content: |-
#            #!/bin/bash
#            zip -r $IOS_BUILD_DIR/screenshots.zip screenshots
#    - amazon-s3-upload@3.1.3:
#        inputs:
#        - access_key_id: "$AWS_S3_ACCESS_KEY"
#        - secret_access_key: "$AWS_S3_SECRET_ACCESS_KEY"
#        - upload_bucket: "$AWS_S3_BUCKET"
#        - upload_local_path: "$IOS_BUILD_DIR/screenshots"
#        - acl_control: public-read
#        - aws_region: eu-central-1
    - script@1.1.3: # install the real API for the release-able build
        title: Copy real api
        inputs:
        - content: |-
            #!/bin/bash
            make clean-api && make production
    - react-native-bundle@1.0.3: {}
    - certificate-and-profile-installer@1.8.4: {}
    - fastlane@2.3.9:
        inputs:
        - lane: ios beta
    - deploy-to-bitrise-io@1.2.9:
        inputs:
        - deploy_path: "$IOS_BUILD_DIR"
        - is_compress: 'true'
    - script@1.1.3:
        title: Zip everything
        is_always_run: true
        inputs:
        - content: |-
            #!/bin/bash
            zip -r $IOS_BUILD_DIR $BITRISE_DEPLOY_DIR/artifacts.zip
    - slack@2.3.0:
        inputs:
        - webhook_url: "$SLACK_BITRISE_WEBHOOK_URL"
        - channel: "#dev"
        - message: |-
            *$BITRISE_APP_TITLE* :ios: build <$BITRISE_BUILD_URL|passed> :satisfied:
            <https://github.com/Suprnovae/cockpit-app-abctotaal/commit/$GIT_CLONE_COMMIT_HASH|`$GIT_CLONE_COMMIT_HASH` :octocat:> $GIT_CLONE_COMMIT_MESSAGE_SUBJECT
        - message_on_error: |-
            *$BITRISE_APP_TITLE* :ios: build <$BITRISE_BUILD_URL|failed> :sweat:
            <https://github.com/Suprnovae/cockpit-app-abctotaal/commit/$GIT_CLONE_COMMIT_HASH|`$GIT_CLONE_COMMIT_HASH` :octocat:> $GIT_CLONE_COMMIT_MESSAGE_SUBJECT
        - emoji: ''
        - emoji_on_error: ''
        - icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
        - icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
app:
  envs:
  - opts:
      is_expand: false
    BITRISE_PROJECT_PATH: ios/WinAdmCockpit.xcodeproj
  - opts:
      is_expand: false
    BITRISE_SCHEME: WinAdmCockpit
  - opts:
      is_expand: true
    SLACK_BITRISE_WEBHOOK_URL: "$SLACK_URL"
  - opts:
      is_expand: true
    IOS_BUILD_DIR: "$BITRISE_SOURCE_DIR/ios/build"
  - opts:
      is_expand: true
    FASTLANE_EXPLICIT_OPEN_SIMULATOR: 1
zirconias commented 7 years ago

alright @vidbina , didn't get my invite yet.

vidbina commented 7 years ago

@zirconias the invite went to the e-mail address you set up for Github