MobileFirst Quality Assurance for Cordova applications
Overview
This tutorial is a continuation of the IBM Mobile Quality Assurance setup step.
If you haven't done it yet, please do so now.
This tutorial explains how to install and configure the Mobile Quality Assurance client for Apache Cordova, and how to enable apps to send back bug reports and feedback.
Use the command line to set up and instrument Mobile Quality Assurance. You must download and install the latest version of Apache Cordova and its required co-requisites before you begin this procedure.
Note:Currently MQA support for Cordova iOS and Cordova Android in MobileFirst Foundation 8.0 is unavailable. Contact MQA support for more information.
The libraries support both preproduction mode or production mode. Use preproduction mode when you want internal testers to report bugs and feedback with detailed information and have apps under test automatically report crashes.
Navigate to the directory that contains your app project files.
cd hello
Add the Mobile Quality Assurance plug-in to your Cordova project by completing the following steps:
Enter the following command to install the MQA plugin:
cordova plugin add plugin_location
Where plugin_location is the path to the directory of the extracted Mobile Quality Assurance plugin that you downloaded.
Enter the following command to install the required device plugin:
cordova plugin add cordova-plugin-device
If your app has an Android runtime that is earlier than 4.0, rename the project_name\app_name\platforms\android\custom_rules.xml file to custom_rules_bak.xml.
Configuring how MQA communicates with your app
For your app to send data to Mobile Quality Assurance, you must have an application key from the MQA service in IBM Cloud. For more information about application settings, see Registering apps. If you already have an account, you can find your application key by clicking the settings icon (gear) and then selecting App Settings.
Configure MQA to start a new Mobile Quality Assurance session each time your app starts in the JavaScript file
Open the index.js file that is in the your_project_name\www\js directory.
Place the following function and required parameters inside the onDeviceReady() function before the end brace of the function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
MQA.startNewSession({mode:"QA",//or mode: "MARKET" for production modeandroid:{appKey:"your_MQA_Android_appKey",notificationsEnabled:true},ios:{appKey:"your_MQA_iOS_appKey",screenShotsFromGallery:true,}},{success:function(){console.log("Session Started successfully");},error:function(string){console.log("Session error"+string);}});
To learn more about starting a Mobile Quality Assurance session, including details about the different session configuration options, see Starting Cordova quality assurance sessions.
Build and run your app.
cordova build
cordova run
Testing your app
After the environment is set up, you can load your app on your device and start testing it. Complete the following steps to report a bug or provide feedback during testing:
Shake your mobile device lightly.
Select Report a bug or Give feedback.
Enter the required information and select Send to send the information.
View the bug reports and feedback in your IBM Cloud MQA instance where you retrieved the AppKey.
For more information about reporting bugs, see Reporting bugs. For more information about submitting feedback, see User feedback.
Further discovery
After you are comfortable with the basics of setting up MQA with your app, you can read content in IBM Knowledge Center to learn and explore some of the other things that you can do. For example:
Managing users and testers. You can manage the roles and access of your team as they apply to your app and MQA instance.
Managing reports. You can automatically distribute test builds and production builds to your audience.
User sentiment analytics. You can use MQA to analyze and monitor user comments and information about your app. You can also compare the analysis of those comments with the analysis of the user feedback from similar apps.
Inclusive terminology note: The Mobile First Platform team is making changes to support
the IBM® initiative to replace racially biased and other discriminatory language in our code and content
with more inclusive language. While IBM values the use of inclusive language, terms that are outside of
IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other
industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the
documentation to reflect those changes.