In order for the Github App to work successfully with our Espresso SDK, the following needs to happen:
Adding the plugin to your project
1. Add the URL for our artifactory to the buildscript -> repositories section of the root build.gradle file.
buildscript {
…
...
repositories {
…
...
maven {
url 'https://applitools.jfrog.io/artifactory/Android/'
}
}
…
...
}
2. Add classpath of the plugin to the buildscript -> dependencies section of the root build.gradle file.
buildscript {
...
...
dependencies {
...
...
classpath 'com.applitools:espresso-git-integration:1.0'
}
}
Applying the plugin
1. Apply plugin in the application build.gradle file. Add the next line at the top of build.gradle.
apply plugin: 'com.applitools.espresso.git'
2. Add Gradle task in the application build.gradle file that will create a variable in the BuildConfig class and we will use it inside Eyes SDK
task applitoolsGitIntegration {
gitBranches {
process()
android.defaultConfig.buildConfigField "String", "APPLITOOLS_SCM_MERGE_BASE_TIME", "\"" + gitBranches + "\""
}
}
That’s it! When you set a batch ID to your project, the build process will automatically grab the correct branches for you and set them in your Eyes tests.