Advanced test
Pumpo5 lets you work not only with browsers but with all the following additional endpoint types, see Pumpo#5 intro
Advanced Test Example: Web + Mobile
This test demonstrates Pumpo#5 ability to combine a web test with a mobile test.
The test can verify the multichannel feature of a well-known eshop in Czechia, rohlik.cz. It's a grocery eshop. Be sure to be customer first. You will need to configure your username and password. The test will enter a delivery address and add items to the shopping cart. The test continues on your connected phone in the mobile application. The test adds more items and sets the payment method. The test ends before the order is confirmed, so you do not have to worry about creating fake orders. At the end you should either finalize the purchase or cancel the cart.
There is another challenge here and this is to setup your computer and phone for automated mobile testing. This tutorial is written for Android, but for iOS there are only a few changes, you may check on internet.
Android Phone Setup
This test uses a web browser and a mobile app, so you need to get your phone ready.
- Enable developer mode
- Enable USB debugging in Developer settings https://developer.android.com/studio/debug/dev-options
- Install Rohlik app from Google play
- Use USB cable to connect your phone to your PC
PC Setup
Set up and run Appium on your PC to create a connection with your phone.
- Download and install Appium Desktop (Appium Server GUI) https://github.com/appium/appium-desktop
- Open Appium Server GUI and setup Host 0.0.0.0 and Port 4723 and click on startServer
You should have the repository ready from the First test.
Open the folder pumpo-starter-kit
in your IDE (Intellij IDEA) as an existing project and make sure it is recognized as a standard Maven project. See the instructions on the First test if you don't already have it.
Edit file mobileConfig.template.conf
in src/test/resources/mobileConfig.template.conf
to create your own mobileConfig.conf
file. Set your email and password for your Rohlik account and set your phone device ID in mobileConfig.conf
. You can find device ID of connected phone with command adb devices -l
in Command Prompt.
Don't forget to run your local test farm.
Run the test
In the IDE project navigation open the file src/test/java/cz/pumpitup/pn5/starterkit/rohlik/AdvancedTestRohlik.java
.
Pumpo#5 supports Selenide page objects. We have created a Selenide variant of the advanced test. Check it out in the same folder in the
AdvancedTestSelenide.java
file
Run the test (Shift + F10) and see the magic.
Rohlík.cz is a very dynamic environment. If there are changes on the website side, it can happen that tests start to fail. In case of problems, please contact our test engineer Jakub at jakub.benesovsky@pumpitup.cz