Skip to content

Auto test iOS

Auto test iOS #27

name: Auto test iOS
on:
# schedule:
# - cron: '0 19 * * *'
workflow_dispatch:
# push:
# branches:
# - develop
jobs:
build:
runs-on: [self-hosted, macOS, ARM, auto-ios]
steps:
# Checkout code and get packages.
- name: Checkout code
uses: actions/checkout@v3
# Set build number
- name: Set env
run: |
echo "FLUTTER_VERSION_NAME=0.100.0" >> $GITHUB_ENV
echo "FLUTTER_VERSION_CODE=10" >> $GITHUB_ENV
echo "BRANCH_KEY=${{ secrets.BRANCH_KEY }}" >> $GITHUB_ENV
echo "BRANCH_KEY_TEST=${{ secrets.BRANCH_KEY_TEST }}" >> $GITHUB_ENV
- name: SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.KEY_VAULT_DEPLOYMENT_KEY }}
${{ secrets.SSH_ASSETS_KEY }}
${{ secrets.SUBMODULE_AUTOTEST }}
- name: Create env file
run: |
touch .env
echo AUTO_TEST_PLATFORM=ios >> .env
echo AUTO_TEST_PROFILE=XsmaxBitmark >> .env
echo FASTLAN_ENV=test >> $GITHUB_ENV
echo AUTOTEST_ENV= "${{ secrets.AUTOTEST_ENV }}" | sed 's/\\n/\n/g' >> .env
cat .env
- name: Submoudles update
run: git submodule update --init --recursive
- run: flutter pub cache repair
- run: flutter pub get
# Build app
- name: Build and deploy with Fastlane
env:
ENTERPRISE_CERTIFICATE_PASSWORD: ${{ secrets.ENTERPRISE_CERTIFICATE_PASSWORD }}
APPSTORE_CERTIFICATE_PASSWORD: ${{ secrets.APPSTORE_CERTIFICATE_PASSWORD }}
JSON_FILE: ${{ secrets.JSON_FILE }}
SENTRY_AUTH: ${{ secrets.SENTRY_AUTH }}
APPCENTER_API_TOKEN: ${{ secrets.APPCENTER_API_TOKEN }}
APP_VERSION: ${{ inputs.version }}
BRANCH_KEY: ${{ secrets.BRANCH_KEY }}
RELEASE_NOTES: ${{ inputs.message }}
run: |
git clone [email protected]:bitmark-inc/mobile-signing-key-vault.git --depth 1
echo $JSON_FILE >> key.json
bundle exec fastlane install_plugins
echo "APP_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
bundle exec fastlane ciappcenter env:${{ env.FASTLAN_ENV }}
working-directory: ios
# - name: Build to IPA inhouse app
# run: flutter build ipa --flavor inhouse --export-options-plist ios/ExportOptions-Inhouse.plist
- name: CD to auto-test folder
run: |
cd auto-test
npm install
appium-webdriveragent % xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=00008020-00095D1C2230003A' test
# Run testing in Cucumber
- name: Run auto tests for Suite "Import accounts from seeds"
if: success() || failure()
run: |
cd auto-test
npx cucumber-js ./src/features/*.feature --format ./reporter.js
# Run integration test
# - name: Run Flutter Driver tests for Suite "Link account from MetaMask app"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_app/linkaccountbyMetamaskapp_test.dart
# - name: Run Flutter Driver tests for Suite "Import accounts from seeds"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/import_fullaccount_kukai_temple_test.dart
# - name: Run Flutter Driver tests for Suite "Connect wallet to NFT exchanges"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/connectWalletToExchanges_test.dart
# - name: Run Flutter Driver tests for Suite "Link Ethereum Wallet"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/linkEthereumAccountWallet_test.dart
# - name: Run Flutter Driver tests for Suite "Link Ethereum Wallet" without finishing Onboarding
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/linkEthereumAccountWalletOnboarding_test.dart
# - name: Run Flutter Driver tests for Suite "Purchase Tez NFT"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/purchase_tez_nft_test.dart
# - name: Run auto tests for Suite "Purchase Feral File NFT"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/purchaseFeralFileEthereumToken_test.dart
# - name: Run Flutter Driver tests for Suite "Send/transfer artworks"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/send_artwork_test.dart
# - name: Run Flutter Driver tests for Suite "Check static pages, build"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/setting_footer_test.dart
# - name: Run Flutter Driver tests for Suite "Check artwork details"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/check_artwork_detail_test.dart
# - name: Run Flutter Driver tests for Suite "Create new account"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/create_new_account_test.dart
# - name: Run Flutter Driver tests for Suite "Customer support"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/customer_support_test.dart
# - name: Run Flutter Driver tests for Suite "Check deposit testcases"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/send_xtz_test.dart
# - name: Run auto tests for Suite "Check deposit ETH testcases"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/send_eth_test.dart
- name: Generate report
run: |
allure generate allure-results --clean -o allure-report
- name: Show report
if: always()
uses: actions/upload-artifact@v3
with:
name: Test result
path: ${{ github.workspace }}/auto-test/allure-report/index.html
- name: Report Status
if: always()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure,success,warnings"
notification_title: Auto test execution-"{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}@{branch}> on commit <{commit_url}|{commit_sha}>"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}@{branch}> on commit <{commit_url}|{commit_sha}>"
footer: "<{run_url}|View Run>"
mention_users: "U03NZ7JU8KC"
mention_users_when: "failure,warnings"
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_LOCAL_BITMARKVN_CI_SLACK }}