BranchMetrics / android-branch-deep-linking-attribution

The Branch Android SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://docs.branch.io/pages/apps/android/
MIT License
399 stars 156 forks source link

Test automation improvements #1194

Closed NidhiDixit09 closed 4 months ago

NidhiDixit09 commented 5 months ago

Reference

SDK-2355 -- Remove Extra Screens from Automation Testbed Apps. https://branch.atlassian.net/browse/SDK-2355

Description

-> Removed extra Screens from Automation Testbed App which were earlier used for getting params values for different APIs. -> Now Params are passed as optionalIntentArguments on MainActivity. -> Added classes for parsing json string passed as optionalIntentArguments and creating BUO, link refernce etc. -> Added buttons for InitSession, Send V2 Event and Read Logs -> Added a Test App - Link Click Test. This app is used by Appium tests for testing deep linking. -> Updated workflow for deug binary signing using keystore file.

Testing Instructions

For Testing using Appium -

Run Appium tests from branch Test-Automation-Improvements

Screenshot 2024-04-29 at 6 12 52 PM

For manually testing testbed app,

either pass json string with param values from command line --es "testData" '{"dma_ad_user_data":false,"BUOData":--es "testData" '{"dma_ad_user_data":false,"BUOData":{"imageUrl":"https:\/\/www.qentelli.com\/sites\/default\/files\/qentelli-logo.svg","canonicalIdentifier":"content\/1","trackContentData":"ADD_TO_CART","contentTitle":"When app is already installed, here Instagram","contentDesc":"When all fields provided with valid entries"},"DelayInitialization":true,"dma_eea":true,"Include":"Yes","URL":"\"https:\/\/timber.test-app.link\/80OHAnv8DHb\"","dma_ad_personalization":false,"TrackContentData":{"coupon":"BranchCoupon","description":"Branch Track Content Desc","tax":"100","eventType":"COMMERCE","availability":"available","transactionId":"Branch007XYZ","revenue":"10000","shipping":"12345","purchaseLocation":"US","affiliation":"Affiliation","searchQuery":"nothing","registrationId":"AEU10EEEE1123","alias":"My Alias","currency":"AED","additionalData":"Track content Commerce Additional data","customEventProperty2":"My custom event2","event":"ADD_TO_CART","customEventProperty1":"My custom event1","customData1":"Branch custom data1","customData2":"Branch custom data2"}}'

Or

Set this intent extra in code (Uncomment following line. I have left it here for testing purpose for now. https://github.com/BranchMetrics/android-branch-deep-linking-attribution/blob/61be6555e46a463bcaae00de0f5a2fb90b1f1676/Branch-SDK-Automation-TestBed/src/main/java/io/branch/branchandroiddemo/activities/MainActivity.java#L75)

cc @BranchMetrics/saas-sdk-devs for visibility.