Skip to content

AlexAndradeNet/appiumjavaios

Repository files navigation

Appium + Java + iOS - 2023

This project is written with the Screenplay design pattern that helps to maintain the SOLID principles.

You can find a version for Android here: Appium + Java + Android - 2023.


🔧 Tech stack

This project uses the following technologies:

  • ⚠️ macOS. This does not work in Windows, Linux u other OS. ⚠️
  • Java 17
  • Appium 2
  • Serenity BDD
  • Cucumber
  • Gradle
  • Xcode
  • IntelliJ IDEA

If you need help to install the environment, you can find the instructions in this file INSTALLATION.md.


🚀 Running the project

  1. Change de device name in the file /src/test/resources/serenity.conf
  2. Run the emulator (See INSTALLATION.md for more details):
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID 447FDF42-DA89-4CF2-88F0-6F7A94402171
  1. Run the Appium server:
appium --allow-insecure=true --allow-cors --session-override
  1. Run the tests. See the two next sections for more details.

Running from Gradle / Terminal

  1. Open a terminal
  2. Navigate to the project root
  3. Run the following command: ./gradlew clean test aggregate

Running feature from IntelliJ

  1. Click on the feature file you want to run
  2. In the Run menu Select Run...
  3. In the contextual menu, select the feature, then "Edit..."
  4. You should now see the 'Edit Configuration Settings' window. Set the main class to net.serenitybdd.cucumber.cli.Main
  5. Change the Glue field to the root package of your project (or of your step definitions)
  6. Click Apply

Source: https://johnfergusonsmart.com/running-cucumber-serenity-feature-files-directly-intellij/


📊 Reporting

The reports are generated in the target/site/serenity folder.

If you are in Mac, you can run the following command to open the report in your browser:

open target/site/serenity/index.html

💅🏽 Linting / Coding style

Coding style is very important. It helps to maintain the code clean and easy to read.

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

The Java files are linted using the Google Java Format rules. Run the following command to lint the Java files:

# To check the code
./gradlew clean build spotlessCheck
# To fix the code
./gradlew clean build spotlessApply

Linting Gherkin files

The Gherkin files are linted using the NodeJS gherkin-lint tool. The configuration file is located in the .gherkin-lintrc file, and helps you find duplicated test names that can cause problems in the reports. Run the following command to lint the Gherkin files:

sh gherkin_check.sh

🐞 Troubleshooting

GitHub delete the App file

GitHub deletes the APK/IPA file after 100 days. You can download the APK/IPA file from the following link: https://github.com/bitbar/test-samples/tree/master/apps

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published