Open bachhavdipak opened 2 years ago
That sound's like an issue with your build script or with Gradle (maybe ask the Gradle community for Gradle-specific advice), not with Serenity. The Serenity sample projects all define the Serenity dependencies as testImplementatinon
dependencies but they also would work as implementation
dependencies - take a look at https://github.com/serenity-dojo/swaglabs-serenity-cucumber.git
Thank you for your valuable reply @wakaleo
I have tried to run my solution as per the above repo. I have made two changes
I am still facing the same issue.
defaultTasks 'clean', 'test', 'aggregate'
repositories {
mavenCentral()
mavenLocal()
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "net.serenity-bdd:serenity-gradle-plugin:3.2.0"
classpath("net.serenity-bdd:serenity-core:${serenityCoreVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "net.serenity-bdd.serenity-gradle-plugin"
sourceCompatibility = 8
targetCompatibility = 8
ext {
slf4jVersion = '1.7.7'
serenityCoreVersion = '3.2.0'
assertJVersion = '3.22.0'
logbackVersion = '1.2.10'
}
dependencies {
implementation "ch.qos.logback:logback-classic:${logbackVersion}"
testImplementation "net.serenity-bdd:serenity-core:${serenityCoreVersion}",
"net.serenity-bdd:serenity-cucumber:${serenityCoreVersion}",
"net.serenity-bdd:serenity-screenplay:${serenityCoreVersion}",
"net.serenity-bdd:serenity-screenplay-webdriver:${serenityCoreVersion}",
"net.serenity-bdd:serenity-ensure:${serenityCoreVersion}",
// "junit:junit:${junitVersion}",
"io.github.fabianlinz:serenity-junit5:${serenityJunit5Version}"
}
test {
systemProperties System.getProperties()
maxParallelForks = 8
}
serenity {
// Specify the root package of any JUnit acceptance tests
testRoot="swaglabs"
// Specify the root directory of any Cucumber feature files
requirementsDir = "src/test/resources/features"
}
gradle.startParameter.continueOnFailure = true
test.finalizedBy(aggregate)
I would recommend using net.serenity-bdd:serenity-junit5
rather than io.github.fabianlinz:serenity-junit5
as it is not part of the official Serenity dependencies. Also, classpath("net.serenity-bdd:serenity-core:${serenityCoreVersion}"
in the buildscript dependencies may not work because of the use of a variable.
@wakaleo : As per your suggestion i have used net.serenity-bdd:serenity-junit5
but still facing the same issue.
I have also created a branch please have a look. I have created branch https://github.com/bachhavdipak/SerenityJunit5
What issue are you facing exactly? There are no Serenity tests in that project.
I am trying to run my test using Junit.
But the test is an ordinary Selenium test, not a Serenity BDD test. What outcome are you expecting?
@wakaleo , if I add web test in the same project and ran the test using serenity dependencies it's working fine for UI projects but for iOS its failing due to the below issues
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'UKC-DSEV023991', ip: '110.4.197.09', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_281'
Driver info: io.appium.java_client.ios.IOSDriver
Command: [null, newSession {capabilities=[{appium:accessKey=546456gfgdfgk, appium:app=cloud:com.experitest.ExperiBank, appium:bundleId=com.experitest.ExperiBank, appium:deviceName= IPad (5th Generation) SPEC-0002, appium:deviceQuery=@os='ios' and @category='TABLET', platformName=iOS, appium:platformVersion=8.1, appium:testName=Quick Start iOS Native Demo}], desiredCapabilities=Capabilities {accessKey: eyJ4cC51IjoxMywieHAucCI6MSw..., app: cloud:com.experitest.Experi..., bundleId: com.experitest.ExperiBank, deviceName: IPad (5th Generation) SPEC..., deviceQuery: @os='ios' and @category='TA..., platformName: iOS, platformVersion: 8.1, testName: Quick Start iOS Native Demo}}]
Capabilities {}
Also if I change the serenity-core to testRuntimeOnly then it's working fine but not with the implementation or testImplementation . I want to run my test using testImplementation or implementation group so that transitive dependencies are available in both compile and run time. Is there any way to resolve this issue?
Have you had a chance to go through my issue @wakaleo ?
No, I have no idea what the issue could be.
Have you tried to run my code at your end @wakaleo ? if not could you please give me a favor and try it from your end. I am stuck at the moment or else try to run it with a free account and provide me simple working code and remove your access key and hub URL.
That could be done as part of a support ticket or commercial support contract - is that something your company is considering?
I am trying to run my automation test using serenity BDD and I am using the 3.2.0 version with Gradle 7.1 but while running the test getting the below issue if I ran my test using the below group.
implementation group: 'net.serenity-bdd', name: 'serenity-core', version: '3.2.0'
But if I change it to testRuntimeOnly then it's working finetestRuntimeOnly("net.serenity-bdd:serenity-core:3.2.0")
I want to run my test using the implementation group only so that transitive dependencies are available in both compile and run time. Is there any way to resolve this issue?Error:
Code: