The QuickStart guide is intended for intermediate to advanced test automation engineers. This guide assumes you have Appium already setup on your machine. For a detailed guide to MoQuality, head to our MoQuality Tutorials.
Before you get started you need to have all the basic requirements for Appium installed. This includes Android SDK including Android Platform Tools for
aapt, Java Development Kit (JDK) and Node.JS. If you want to test on iOS, you need to have Xcode installed.
If you want to test on a real device, you should also have an Android or iOS device handy. Remember that to test on iOS devices you need to have an Apple Developer account with your iOS devices as one of the registered authorized devices on your account.
To get started install MoQuality's CLI tool:
npm install -g @moquality/mq
You can use this tool to do everything from creating, debugging your Appium tests, uploading your app and running tests from your CI/CD.
We have created a few starter examples. These are simple Appium boilerplates with sample apps to get you started easily. Get a starter with:
mq starer add-wd
This will create an
add-wd folder and download the starter there. It should include an Appium test in
test.js using Appium's
wd framework along with MoQuality's
mq.json configuration file.
Open the "Debugger" in MoQuality's dashboard. To debug the
add-wd appium tests, start the debugger in the
cd add-wd mq debug
Then click on the "Run Test" button in Debugger on the dashboard. It will run the current Appium test and show you the test with all the debugging information (each test step along with before and after screenshots).
To record a test run, you will first need to get your API Key from your accounts page. Then connect a local Android device and run the following:
export MQ_APIKEY=<your_api_key> mq record
Note: If there is only one Android device or emulator currently on your system, Appium automatically runs the test on that device.
To record a test on a cloud device, do the following:
mq record --cloud
This will select a random Android device in the cloud and run the current test.
To create a new test step select any existing step in MoQuality. You will see the before and after screenshots fo that particular step along with options for creating a new step. If the new step does not depend on the widget you will find the action on this page. Select the action and MoQuality will show you the Appium code you should use in your test for this step.
If the new step depends on a widget, hover over the screenshot and select the widget first. MoQuality will try to find the best selector that widget. Choose the action you want to perform on that widget and MoQuality will show you the Appium code you should use in your test for this step. You can choose to modify the selectors if you need to and MoQuality will show you the modified code.
To run these tests in your CI/CD you need to upload the app and run the test on a cloud device. You can accomplish both with:
npx @moquality/mq record --cloud --upload <path_to_app>
That's it. Use MoQuality to create, debug or run your tests. Once you are done, you can simply share it with your team.
Updated a day ago