This project leverages the Screenplay Design Pattern, which promotes the adherence to SOLID principles for better maintainability and scalability of automated test scripts.
For a similar setup targeting iOS (Apple iPhone), visit the following repository: Appium + Java + iOS - 2023.
This project is inspired by and based on the work available at Jacobvu84's Serenity Screenplay Appium repository.
The following technologies are utilized in this project:
- Java 17
- Appium 2.x
- Serenity BDD
- Cucumber
- Gradle
- Android 13
- Android SDK
- IntelliJ IDEA
To set up the development environment, refer to the detailed installation guide provided in INSTALLATION.md.
Thank you for considering contributing to this repository! Here is everything you need to know to get started.
Follow the steps below to execute the tests:
-
Update the device name in
/src/test/resources/serenity.conf. -
Start the Android emulator with the following command:
emulator -avd Pixel_5 -no-boot-anim -no-audio
-
Start the Appium server:
appium --allow-insecure=true --allow-cors --session-override
-
Run the tests. You can choose to run them from the terminal or directly from IntelliJ. Details are provided in the next sections.
-
Open a terminal.
-
Navigate to the project's root directory.
-
Execute the following command:
./gradlew clean test aggregate
- Right-click on the
featurefile you want to run. - Go to the Run menu and select Run....
- From the contextual menu, choose the feature, then select Edit....
- In the 'Edit Configuration Settings' window, set the main class to
net.serenitybdd.cucumber.cli.Main. - Set the Glue field to the root package of your project (or the location of your step definitions).
- Click Apply.
For additional details, visit John Ferguson Smart's blog post on running Cucumber Serenity feature files in IntelliJ.
Test reports are generated in the target/site/serenity directory. To view the
report in your browser:
-
On Mac:
open target/site/serenity/index.html
-
On Windows:
start target/site/serenity/index.html
Maintaining a consistent coding style is crucial for readability and collaboration.
"The ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. …making it easy to read makes it easier to write."
Robert C. Martin (a.k.a Uncle Bob)
Java files are formatted using the Google Java Format rules. You can check and fix the formatting by running:
-
To check the code:
./gradlew clean build spotlessCheck
-
To fix the code:
./gradlew clean build spotlessApply
Gherkin files are linted using the gherkin-lint tool. The configuration is
available in .gherkin-lintrc.json. Run the following command to lint Gherkin
files:
sh gherkin_check.shGitHub automatically deletes the APK file after 100 days. If you need the APK, you can download it from the following link: MetaTrader 5 Trading Platform for Android.