Skip to content

Auto test Android

Auto test Android #444

name: Auto test Android
on:
schedule:
- cron: "0 17 * * *"
workflow_dispatch:
# push:
# branches:
# - update_autotest
jobs:
build:
runs-on: [self-hosted, macOS]
steps:
# Checkout code and get packages.
- name: Checkout code
uses: actions/checkout@v3
# Set build number
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.1"
channel: stable
- 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: Create env file
run: |
touch .env
# echo INDEXER_MAINNET_API_URL=${{ secrets.INDEXER_MAINNET_API_URL }} >> .env
# echo INDEXER_TESTNET_API_URL=${{ secrets.INDEXER_TESTNET_API_URL }} >> .env
# echo WEB3_RPC_MAINNET_URL=${{ secrets.WEB3_RPC_TESTNET_URL }} >> .env
# echo WEB3_RPC_TESTNET_URL=${{ secrets.WEB3_RPC_TESTNET_URL }} >> .env
# echo TEZOS_NODE_CLIENT_MAINNET_URL=${{ secrets.TEZOS_NODE_CLIENT_MAINNET_URL }} >> .env
# echo TEZOS_NODE_CLIENT_TESTNET_URL=${{ secrets.TEZOS_NODE_CLIENT_TESTNET_URL }} >> .env
# echo BITMARK_API_MAINNET_URL=${{ secrets.BITMARK_API_MAINNET_URL }} >> .env
# echo BITMARK_API_TESTNET_URL=${{ secrets.BITMARK_API_TESTNET_URL }} >> .env
# echo FERAL_FILE_API_MAINNET_URL=${{ secrets.FERAL_FILE_API_MAINNET_URL }} >> .env
# echo FERAL_FILE_API_TESTNET_URL=${{ secrets.FERAL_FILE_API_TESTNET_URL }} >> .env
# echo FERAL_FILE_SECRET_KEY_TESTNET=${{ secrets.FERAL_FILE_SECRET_KEY_TESTNET }} >> .env
# echo FERAL_FILE_SECRET_KEY_MAINNET=${{ secrets.FERAL_FILE_SECRET_KEY_MAINNET }} >> .env
# echo FERAL_FILE_ASSET_URL_TESTNET=${{ secrets.FERAL_FILE_ASSET_URL_TESTNET }} >> .env
# echo FERAL_FILE_ASSET_URL_MAINNET=${{ secrets.FERAL_FILE_ASSET_URL_MAINNET }} >> .env
# echo EXTENSION_SUPPORT_MAINNET_URL=${{ secrets.EXTENSION_SUPPORT_MAINNET_URL }} >> .env
# echo EXTENSION_SUPPORT_TESTNET_URL=${{ secrets.EXTENSION_SUPPORT_TESTNET_URL }} >> .env
# echo CONNECT_WEBSOCKET_MAINNET_URL=${{ secrets.CONNECT_WEBSOCKET_MAINNET_URL }} >> .env
# echo CONNECT_WEBSOCKET_TESTNET_URL=${{ secrets.CONNECT_WEBSOCKET_TESTNET_URL }} >> .env
# ${{ github.event.inputs.testnet == 'true' }} && echo AUTONOMY_AUTH_URL=${{ secrets.AUTONOMY_AUTH_DEV_URL }} >> .env || echo AUTONOMY_AUTH_URL=${{ secrets.AUTONOMY_AUTH_STAGING_URL }} >> .env
# ${{ github.event.inputs.testnet == 'true' }} && echo CUSTOMER_SUPPORT_URL=${{ secrets.CUSTOMER_SUPPORT_DEV_URL }} >> .env || echo CUSTOMER_SUPPORT_URL=${{ secrets.CUSTOMER_SUPPORT_STAGING_URL }} >> .env
# ${{ github.event.inputs.testnet == 'true' }} && echo RENDERING_REPORT_URL=${{ secrets.RENDERING_REPORT_DEV_URL }} >> .env || echo RENDERING_REPORT_URL=${{ secrets.RENDERING_REPORT_STAGING_URL }} >> .env
# ${{ github.event.inputs.testnet == 'true' }} && echo FEED_URL=${{ secrets.FEED_DEV_URL }} >> .env || echo FEED_URL=${{ secrets.FEED_STAGING_URL }} >> .env
# echo CURRENCY_EXCHANGE_URL=${{ secrets.CURRENCY_EXCHANGE_URL }} >> .env
# echo AUTONOMY_PUBDOC_URL=${{ secrets.AUTONOMY_PUBDOC_URL }} >> .env
# echo AUTONOMY_IPFS_PREFIX=${{ secrets.AUTONOMY_IPFS_PREFIX_DEV }} >> .env
# echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
# echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
# echo ONESIGNAL_APP_ID=${{ secrets.ONESIGNAL_DEV_APP_ID }} >> .env
# echo AWS_IDENTITY_POOL_ID=${{ secrets.AWS_IDENTITY_POOL_ID }} >> .env
# echo AUTONOMY_SHARD_SERVICE=${{ secrets.AUTONOMY_SHARD_SERVICE }} >> .env
# echo METRIC_ENDPOINT=${{ secrets.METRIC_ENDPOINT }} >> .env
# echo METRIC_SECRET_KEY=${{ secrets.METRIC_SECRET_KEY }} >> .env
# echo BRANCH_KEY=${{ secrets.BRANCH_KEY }} >> .env
# echo MIXPANEL_KEY=${{ secrets.MIXPANEL_KEY }} >> .env
# echo CLOUD_FLARE_IMAGE_URL_PREFIX=${{ secrets.CLOUD_FLARE_IMAGE_URL_PREFIX }} >> .env
# echo APP_TESTNET_CONFIG=${{ github.event.inputs.testnet }} >> .env
# echo TEZOS_FAUCET_URL=${{ secrets.TEZOS_FAUCET_URL }} >> .env
# echo TEZOS_FAUCET_AUTH_TOKEN=${{ secrets.TEZOS_FAUCET_AUTH_TOKEN }} >> .env
# echo SEED_TO_PURCHASE_ARTWORK=${{ secrets.SEED_TO_PURCHASE_ARTWORK }} >> .env
# echo SEED_TO_RESTORE_ACCOUNT=${{ secrets.SEED_TO_RESTORE_ACCOUNT }} >> .env
# echo SEED_TO_RESTORE_ANOTHER_ACCOUNT=${{ secrets.SEED_TO_RESTORE_ANOTHER_ACCOUNT }} >> .env
# echo SEEDS_TO_RESTORE_FULLACCOUNT=${{ secrets.SEEDS_TO_RESTORE_FULLACCOUNT }} >> .env
# echo SEED_TO_RESTORE_KUKAI=${{ secrets.SEED_TO_RESTORE_KUKAI }} >> .env
# echo SEED_TO_RESTORE_TEMPLE=${{ secrets.SEED_TO_RESTORE_TEMPLE }} >> .env
# echo SEED_TO_RESTORE_ACCOUNT_BUY_NFT=${{ secrets.SEED_TO_RESTORE_ACCOUNT_BUY_NFT }} >> .env
# echo SEED_TO_SEND_ETH=${{ secrets.SEED_TO_SEND_ETH }} >> .env
# echo SEED_TO_RECEIVE_ETH=${{ secrets.SEED_TO_RECEIVE_ETH }} >> .env
# echo AUTO_TEST_PLATFORM=android >> .env
# echo AUTO_TEST_PROFILE=GalaxyA52s5G >> .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 to flutter apk inhouse app
run: flutter build apk --flavor inhouse
# CD to auto-test folder and install node_module
- name: CD to auto-test folder
run: |
cd auto-test
npm install
# 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/ImportSeeds.feature --format ./reporter.js
# - name: Run auto 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 auto 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 auto tests for Suite "Purchase Feral File Ethereum NFT"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/purchaseFeralFileEthereumToken_test.dart
# - name: Run auto tests for Suite "Purchase Tez NFT in outside exchanges"
# 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 Tez NFT"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/purchaseFeralfileTezosToken_test.dart
# - name: Run auto tests for Suite "Send/transfer artworks"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/send_artwork_test.dart
# - name: Run auto 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 auto tests for Suite "Check artwork preview"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/check_artwork_detail_test.dart
# - name: Run auto 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 auto tests for Suite "Customer support"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/customer_support_test.dart
# - name: Run auto tests for Suite "Check artwork metadata compare with indexer. Other cases check with blockchain we need implement in Unit test"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/tests/check_artwork_info_test.dart
# - name: Run auto 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: Run auto tests for Suite "Link Autonomy Connect from FeralFile to Autonomy Wallet"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/linkAutonomyConnect2FeralFileWith1Eth1Tez_test.dart
# - name: Run auto tests for Suite "Link Autonomy Connect from FeralFile to Autonomy Wallet"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/linkAutonomyConnect2FeralFileWith1Eth0Tez_test.dart
# - name: Run auto tests for Suite "Link Autonomy Connect from FeralFile to Autonomy Wallet"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/linkAutonomyConnect2FeralFileWith0Eth1Tez_test.dart
# - name: Run auto tests for Suite "Link Autonomy Connect from FeralFile to Autonomy Wallet"
# if: success() || failure()
# run: |
# cd $GITHUB_WORKSPACE
# flutter test auto-test/mobile_external_webs/linkAutonomyConnect2FeralFileWith0Eth0Tez_test.dart
# Generate report
- 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 FF app 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 }}