Simple and easy to use boilerplate for writing tests for mobile or web.
- PHP >= 7.0
- Appium - For Mobile Testing
- Selenium - For Web application testing
You can install this appium-selenium-starter
using the following methods:
Run the following command to configure the boilerplate on your machine:
git clone [email protected]:me-io/appium-selenium-starter.git
Alternatively, you may also install appium-selenium-starter
by issuing the Composer create-project command in your
terminal:
composer create-project --prefer-dist me-io/appium-selenium-starter
Now run the following command to install required dependencies:
composer install
There are two cli applications included in starter. To view a list of all commands in these cli applications inside your terminal run the following commands one by one:
composer run appium
composer run selenium
Lets configure your environment for running mobile application testing. Open your terminal and run the following command:
composer run appium configure
To configure your environment for running selenium server run the below command:
composer run selenium configure
Note: For running example tests you need to have installed and configured the android emulator or iOS simulator on your machine.
Before running the mobile tests we need to start the appium server. To start appium server run the following command inside your terminal:
composer run appium start
We need to move everything from example
directory to the root folder of the project. Run the following command inside your terminal:
mv example/* .
You can find the android and ios example tests inside /tests
directory. We also put some example apps for android and ios inside /tests/_data/test-apps
directory.
For running android emulator we are using genymotion. Follow this guide if you do not know how to install and run android emulator. You also need to install the application that you want to test inside android emulator.
Now you need to update the android.suite.yml
you can find this filw inside tests
directory. And also update the deviceName
to your android emulator device name. If you have genymotion installed you can find the device name from the devices list.
To run the android tests run the following codecept command inside your terminal:
./vendor/bin/codecept -c example/codeception.yml run android --steps
Note: Make sure appium server is running before running the android tests.
First you need to run the appium server than you need to start the iOS simulator. Use the following if you do not know how to run iOS sumulator http://www.macinstruct.com/node/494.
Now you need to update the ios.suite.yml
you can find this file inside tests
directory. Open ios.suite.yml
file and update xcodeOrgId
and udid
to your running simulator identifier
string. You can find your identifier
string by opening the simulator then Hardware > Device > Manage Devices > Simulators
. You will find a list of iOS devices now open the device that you are running and after clicking on the device name you will find the identifier
string.
To run the ios tests run the following codecept command inside your terminal:
./vendor/bin/codecept -c example/codeception.yml run ios --steps
A huge thanks to all of our contributors:
Mohamed Meabed π» π’ |
Zeeshan Ahmad π» π |
---|
The code is available under the MIT license.