Skip to content

fifernandez/appium-mobile-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Mobile Automation

The idea of this project is to help you start doing automation for cross platform Apps (Android & iOS).

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

If you want to run Things you need to install

Installing

Clone this repo:

https://github.com/fifernandez/basic-mobile-automation.git

Navigate to the repo folder and run

./gradlew build idea

Run IntelliJ and before opening the project

click on configure -> project defaults -> project structure.
Inside project sdk click on new and search the folder where you installed java sdk, and click on Ok.
Now go to configure -> plugins -> install jetbrains plugins.
Search cucumber for groovy and isntall it with all the other required plugins that intellij informs.
Close and restart when prompted.

Now lets open the project in IntelliJ

Click on open, search for the project folder and click on ok.
Wait for loading.
Click on import gradle project and click on ok.
Wait for loading.
On the menu bar clin on view -> tool windows -> project
folders : features and groovy must be marked as test sources root (green)
folders: resources must be marked as test resources root (yellow icon)

Running the tests

To start the Appium server, Open a console and run:

appium -a 127.0.0.1 -p 4444

Then ou can run the tests, open a different console (leave the previous one running) and run:

./gradlew cucumber -Pdevice=Android7

Same sample for iOS:

./gradlew cucumber -Pdevice=iPhone7

Special Parameters

  • -Pdevice: defines the model of the device you will run (real, simulator, emulator)
    • Availables:
      • iPhone7: Simulator for iPhone7 with ios 12.0
      • Android7: Android Emulator with Android 7.0
      • Android5: Android Emulator with Android 5.1.1
    • You can add your models in GebConfig.groovy file.
  • -Ptags: defines the scenario/s you want to run
    • If not present then it will run for all
    • The tag is define in the first line of the cucumber file
    • Sample: -Ptags="@Boca"

And coding style tests

  • Write the features in the features folder
    • Assign tags to them
    • You can parametrize the scenario using 'Scenario Outline'
  • Define your steps in the steps folder
    • Parametrize buttons, fields, inputs so you can easily reuse steps
    • Keep good organization of the files, it' a good idea to have one step file per page
  • Create your pages/modules files in the groovy folder
  • To config your drivers edit: GebConfig.groovy
  • For changing cucumber configs edit: env.groovy

Built With

  • Cucumber - For writing the tests scenarios
  • Geb - For the browser automation
  • Appium - For the Android driver
  • Groovy - For writing the steps implementations
  • Gradle - For building and running

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

About

Mobileautomation, using Appium, cucumber and groovy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published