Skip to content

FanaticalTest/ft-test-mobile-factory-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft-test-mobile-factory-demo

Pre-requirement

Getting started

  • Ensure to have Appium server running like using Appium Desktop.
  • Ensure the build.gradle is properly set and the application.properties correctly set.
  • If you are running iOS real device ensure to have porperly set licences.properties
  • Update the build.gradle by changing the glue com.fanaticaltest.fttestmobilefactorydemo.cucumber => with your package name where the cucumber are implemented. For convenience we move the device tag as a project property
task cucumber() {
	dependsOn assemble, compileTestJava
	doLast {
		javaexec {
			main = "cucumber.api.cli.Main"
			classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
			args = ['--plugin', 'pretty',
					'--plugin', 'html:build/cucumber-html-report',
					'--plugin', 'json:build/cucumber.json',
					'--tags', "@Device=${device}",
					'--glue', 'com.fanaticaltest.fttestmobilefactorydemo.cucumber', 'src/test/resources']
		}
	}
}

Running

export APPIUM_SERVER_URL=http://127.0.0.1:4723/wd/hub
gradle cucumber -Pdevice=IosSimulator -PAPPIUM_SERVER_URL=http://127.0.0.1:4723/wd/hub
gradle cucumber -Pdevice=AndroidRealDevice -PAPPIUM_SERVER_URL=http://127.0.0.1:4723/wd/hub
gradle cucumber -Pdevice=IosRealDevice -PAPPIUM_SERVER_URL=http://127.0.0.1:4723/wd/hub

To run specific tag just uncomment the tags line in the cucumber task in build.gradle : '--tags', '@Id=002'.

Running a subset of scenarios

cucumber --tags @billing            # Runs both scenarios
cucumber --tags @important          # Runs the first scenario
cucumber --tags ~@important         # Runs the second scenario (Scenarios without @important)

cucumber --tags @billing --tags @important    # Runs the first scenario (Scenarios with @important AND @billing)
cucumber --tags @billing,@important           # Runs both scenarios (Scenarios with @important OR @billing)

Jenkins in Docker running Mac host

If you are running a Jenkins in a docker hosted in a mac, you need to be careful with some elements:

  • When the jenkins container tries to connect to the docker host with the Appium-Desktop you should use http://docker.for.mac.localhost:4723/wd/hub as appiumServer.appiumServerUrl property
  • In your Appium server you need to set executeAsync Callback Host with the value docker.for.mac.localhost otherwise it will use localhost and it won't work.

About

Test factory for Mobile App with Cucumber (BDD) and Appium

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published