Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long/update auto test ci android i os #1645

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
21 changes: 17 additions & 4 deletions .github/workflows/auto_test_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ on:
# - update_autotest
jobs:
build:
runs-on: [self-hosted, Linux, ci-local-bmvn, X64]
runs-on: [bmvn, autotest-android]
steps:
- name: SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.SSH_ASSETS_KEY }}
---
${{ secrets.SUBMODULE_AUTOTEST }}
# Checkout code and get packages.
- name: Checkout code
uses: actions/checkout@v3

# Set build number
- name: Set env
run: |
Expand Down Expand Up @@ -75,14 +83,19 @@ jobs:
# 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 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
# - name: Checkout private submodule auto-test
# run: |
# git submodule update --init --recursive --remote auto-test
# env:
# GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no -i ${{ secrets.SUBMODULE_AUTOTEST }}"
- run: flutter pub cache repair
- run: flutter pub get
# Build app
Expand All @@ -99,7 +112,7 @@ jobs:
if: success() || failure()
run: |
cd auto-test
npx cucumber-js ./src/features/ImportSeeds.feature --format ./reporter.js
npx cucumber-js ./src/features/*.feature --format ./reporter.js
# - name: Run auto tests for Suite "Connect wallet to NFT exchanges"
# if: success() || failure()
# run: |
Expand Down
182 changes: 91 additions & 91 deletions .github/workflows/auto_test_ios.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Auto test iOS
on:
# schedule:
# - cron: '0 18 * * *'
# - cron: '0 19 * * *'
workflow_dispatch:
# push:
# branches:
# - develop
jobs:
build:
runs-on: [self-hosted, macOS, X64, ci-local-bmvn-macos]
runs-on: [bmvn, autotest-ios]
steps:
# Checkout code and get packages.
- name: Checkout code
Expand All @@ -20,110 +20,101 @@ jobs:
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 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=ios >> .env
echo AUTO_TEST_PROFILE=iphone8 >> .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 to IPA inhouse app
run: flutter build ipa --flavor inhouse --export-options-plist ios/ExportOptions-Inhouse.plist
- 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: Submoudles update again
# run: git submodule update --init --recursive
- 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 "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 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: |
Expand All @@ -149,16 +140,25 @@ jobs:
# 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()
# - 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: |
cd $GITHUB_WORKSPACE
flutter test auto-test/tests/send_eth_test.dart
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
Expand Down
2 changes: 1 addition & 1 deletion auto-test
Loading