Automated Testing Android App Upgrades in OpenSooq

Automated Testing Android App Upgrades in OpenSooq

Testing at OpenSooq is one of the most important things that a quality assurance should do before any release whatever what is the release such as (big feature, small fix or even a hotfix) testing should be done to make sure that the quality is always perfect .

The theory is that our duty as testers reaches beyond the features of an app in one version only. We are also concerned about issues that may arise with users migrating, upgrading from one version to another.

One of the most important cases that any tester should do for an application [android or iOS] is an upgrade case or update case. We care about issues that might arise as users migrate from one version to another. Your customers are upgrading to the latest version, not installing it from scratch. There might be all kinds of existing user data that needs to be migrated for the app to work correctly, and simply running functional tests of the new version would not be sufficient to catch these cases. Example: The developer did a migration on storage like REALM or ROOM to remove the filed or add field without handing the old version. The customer will face an issue when he upgrades the application.

Here at OpenSooq we automate this case to reduce time and effort, also to make sure that any new version of the app works fine after upgrade / update.

Appium comes with certain commands to manage this case, but what should we do in this situation? Here are two methods below:

driver.installApp("YourApkPath/apk"); // 'activity' is an instance of import io.appium.java_client.android.Activity; driver.startActivity(activity); 

Above commands explanation:

  1. driver.installApp(“YourPath/apk”); This changes the existing app with the one given in the [URL] as the argument to installApp.
  2. driver.startActivity(activity); This one to let the newer version of the app start.

One thing must keep in mind about the startActivity need to be from type Activity and for our case of upgrade we can use it and create our  Activity  like below :

Activity activity = new Activity("com.mycompany.myapp", "MyActivity"); driver.startActivity(activity); 

So we’re going to do a full test with one example now:

A. Run the order app or like V1.0.

B. Do some cases ,assertions.

C. Upgrade to new version V2.0.

D. Do some cases ,assertions.

Here’s the code for the implementation of the above steps :

Quick trick if there is a problem with run V2 from app this sometimes due to activity not close or something so use this command driver.closeApp(); before you start the new version .

Now check below how the run will be like:



Conclusion

OpenSooq is always trying to make the quality of app better and better by using all ways like automate cases as possible to make the team of quality focus on other areas,components and performance to make sure we deliver to user clean app without any issues,bugs.

Leave a Reply

Your email address will not be published. Required fields are marked *