serenity-bdd / serenity-core

Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.
http://serenity-bdd.info
Other
721 stars 517 forks source link

how to change window target folder in serenity 4.0 #3250

Open jecardenasri01 opened 1 year ago

jecardenasri01 commented 1 year ago

What happened?

Hi experts. study material: https://serenity-bdd.github.io/docs/reference/serenity-properties https://johnfergusonsmart.com/configuring-different-output-directories-serenity-bdd-maven/

My project is a gradle implement serenity 4.0.0-beta-3. I want my report to be saved on my local drive c i tried change output directory of serenity screenplay to my folder "C:\SeleniumEvidencias" :

i tried whit : execute by cmd : gradle clean test --tests Ru_busquedaGoogle -Dwebdriver.driver=chrome -Dserenity.outputDirectory=C:/SeleniumEvidencias

i tried whit aggregate lines on serenity.properties serenity.project.name = "My Special Project" serenity.test.root = "src.resources.feature" serenity.outputDirectory = C:/SeleniumEvidencias

this is my structure for proyect :

image

but this is result image image

What did you expect to happen?

i need the report on disk local c : image

Serenity BDD version

4.0.0-beta-3

JDK version

17.0.7

Execution environment

windows chrome

How to reproduce the bug.

https://github.com/jecardenasri01/serenity-screenplay-4.0.0-beta-3

How can we make it happen?

wakaleo commented 1 year ago

Use serenity.conf rather than serenity.properties, which is no longer fully supported in Serenity 4.0.0, e.g.

serenity {
  outputDirectory = "reports"
}
jecardenasri01 commented 1 year ago

Utilice serenity.conf en lugar de serenity.properties, que ya no es totalmente compatible con Serenity 4.0.0, por ejemplo

serenity {
  outputDirectory = "reports"
}

i tried but it fails too image image image

image image

wakaleo commented 1 year ago

For Windows, this should work:

serenity {
  outputDirectory = "C:/Users/john/report"
}

or

serenity {
  outputDirectory = "report"
}
jecardenasri01 commented 1 year ago

Index and others files cannot move to new folder

new folder image

target folder still in inteli j idea image

my serenity.conf image

since the target folder is not moved the index fails image

jecardenasri01 commented 1 year ago

For Windows, this should work:

serenity {
  outputDirectory = "C:/Users/john/report"
}

or

serenity {
  outputDirectory = "report"
}

Cannot move all files to new folder (comment preview)

only move page source cannot generate index.html, only move pagesources ,screenshot ,browser chrome properties

image

wakaleo commented 1 year ago

I am not able to reproduce this - did you run mvn serenity:aggregate or grade aggregate?

jecardenasri01 commented 1 year ago

I am not able to reproduce this - did you run mvn serenity:aggregate or grade aggregate?

yes i tried manually or for command line but result failed .

you can execute my proyect and add these command ?

i cant understand why failed on windows move evidences

How to reproduce the bug. https://github.com/jecardenasri01/serenity-screenplay-4.0.0-beta-3

wakaleo commented 1 year ago

Try using the latest versions of JUnit

jecardenasri01 commented 1 year ago

JUnit

i tryed actualized all libraruies but failed to move files. my build is wrong?

image

image


serenity build.gradle


`defaultTasks 'clean', 'test', 'aggregate'

repositories { mavenCentral() mavenLocal() }

buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "net.serenity-bdd:serenity-gradle-plugin:4.0.1" } }

apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: "net.serenity-bdd.serenity-gradle-plugin"

sourceCompatibility = 11 targetCompatibility = 11

ext { serenity_version = '4.0.1' junit_platform_launcher_version="1.10.0" junit_platform_suite_version="1.10.0" junit_jupiter_engine_version="5.10.0" junit_vintage_engine_version="5.10.0" cucumber_junit_platform_engine_version="7.2.3" logback_classic_version="1.2.10" assertj_core_version="3.23.1" }

dependencies { dependencies { testImplementation "net.serenity-bdd:serenity-core:${serenity_version}" testImplementation "net.serenity-bdd:serenity-cucumber:${serenity_version}" testImplementation "net.serenity-bdd:serenity-screenplay:${serenity_version}" testImplementation "net.serenity-bdd:serenity-screenplay-webdriver:${serenity_version}" testImplementation "net.serenity-bdd:serenity-ensure:${serenity_version}" testImplementation "org.junit.platform:junit-platform-launcher:${junit_platform_launcher_version}" testImplementation "io.cucumber:cucumber-junit-platform-engine:${cucumber_junit_platform_engine_version}" testImplementation "org.junit.platform:junit-platform-suite:${junit_platform_suite_version}" testImplementation "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_engine_version}" testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_engine_version}" implementation "ch.qos.logback:logback-classic:${logback_classic_version}" testImplementation "org.assertj:assertj-core:${assertj_core_version}" } }

test { useJUnitPlatform() testLogging.showStandardStreams = true systemProperties System.getProperties() }

gradle.startParameter.continueOnFailure = true

test.finalizedBy(aggregate)

`


an my serenity conf


` drivers { windows { webdriver.chrome.driver = src/test/resources/webdriver/chromedriver.exe webdriver.gecko.driver = src/test/resources/webdriver/geckodriver.exe webdriver.ie.driver = src/test/resources/webdriver/msedgedriver.exe } }

chrome.switches = """remote-allow-origins=*;ignore-certificate-errors;start-maximized;incognito """

webdriver {

//driver = "edge" driver = "chrome" //driver = "chrome" autodownload = true

timeouts { script = 15000 pageLoad = 15000 implicit = 15000 }

} serenity { outputDirectory = "C:/Users/Imagemaker/Desktop/reporte" }

`

wakaleo commented 1 year ago

Possibly a Windows/Gradle-specific issue.