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
722 stars 518 forks source link

Serenity core does not obey the screenshot configuration set by serenity.properties file. #3532

Open AmarjeetSinghMatharu opened 2 months ago

AmarjeetSinghMatharu commented 2 months ago

What happened?

I am facing a issue where serenity throws error while taking screenshot of the failure case: [ForkJoinPool-2-worker-3] WARN net.thucydides.core.steps.BaseStepListener - SRP:Found duplicate snapshot 244adc7e2143949efbb6e2446584419b506ca762154a50bee11e86af6bd27737.png

in order the by pass thes messages or disable the serenity capability of taking screen shots I set the following configuration in Serenity.properties file: serenity.take.screenshots=DISABLED as per https://github.com/serenity-bdd/serenity-documentation/blob/master/src/asciidoc/screenshots.adoc but I still get these errors: [ForkJoinPool-2-worker-9] INFO com.ford.utils.Util - pause(): waitTime= LONG [ForkJoinPool-2-worker-3] WARN net.thucydides.core.steps.BaseStepListener - SRP:Found duplicate snapshot 244adc7e2143949efbb6e2446584419b506ca762154a50bee11e86af6bd27737.png [ForkJoinPool-2-worker-3] WARN net.thucydides.core.steps.BaseStepListener - SRP:Found duplicate snapshot 244adc7e2143949efbb6e2446584419b506ca762154a50bee11e86af6bd27737.png [ForkJoinPool-2-worker-3] WARN net.thucydides.core.steps.BaseStepListener - SRP:Found duplicate snapshot 244adc7e2143949efbb6e2446584419b506ca762154a50bee11e86af6bd27737.png [ForkJoinPool-2-worker-3] WARN net.thucydides.core.steps.BaseStepListener - SRP:Found duplicate snapshot 244adc7e2143949efbb6e2446584419b506ca762154a50bee11e86af6bd27737.png [ForkJoinPool-2-worker-3] WARN net.thucydides.core.steps.BaseStepListener - SRP:Found duplicate snapshot 244adc7e2143949efbb6e2446584419b506ca762154a50bee11e86af6bd27737.png [ForkJoinPool-2-worker-3] INFO com.ford.steps.HomeSteps - theUserEntersCorrespondingEventForInJumpToEventFieldAndSelectFirstRecordOnHomePage Instantiated Content of line 10: 31333362636135642D333066632D3464

Please suggest me when this fix will be available: Following is my configuration:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <serenitycore.version>4.2.0</serenitycore.version>
    <serenitynavigator.version>4.2.0</serenitynavigator.version>
    <serenity.junit.version>4.2.0</serenity.junit.version>
    <serenity.maven.version>4.2.0</serenity.maven.version>
    <serenity.cucumber.version>4.2.0</serenity.cucumber.version>
    <slf4j-version>2.0.4</slf4j-version>
    <maven-failsafe-plugin.version>3.0.0-M8</maven-failsafe-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M8</maven-surefire-plugin.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version>
    <junit.version>4.13.2</junit.version>
    <lambdaj.version>2.3.3</lambdaj.version>
    <fest-assert.version>1.4</fest-assert.version>
    <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
    <serenity-rest-assured.version>4.1.17</serenity-rest-assured.version>
    <jsonassert.version>1.5.0</jsonassert.version>
</properties>

What did you expect to happen?

No response

Serenity BDD version

4.2.0

JDK version

java version "18.0.2.1" 2022-08-18

Execution environment

No response

How to reproduce the bug.

  1. Fail a test case deliberately
  2. Have a more then one thread spawned for test cases execution.

How can we make it happen?

Add it to the Serenity BDD backlog and wait for a volunteer to pick it up

janmekota commented 2 months ago

Hi, I also encountered the issue that serenity.take.screenshots=DISABLED is ignored. We use

Even though the property -Dserenity.take.screenshots=DISABLED is set the screenshots are still taken.

The codeLevelScreenshotConfiguration is TakeScreenshots.UNDEFINED

janmekota commented 2 months ago

@wakaleo Hi John, please, do you know about this problem with ignoring serenity.take.screenshots=DISABLED?

murkl commented 2 months ago

With Version 4.1.3 the property serenity.take.screenshots seems to be ignored. If setting serenity.take.screenshots=FOR_FAILURES the screenshots are also created if the tests are successful.

akhi246 commented 6 days ago

Hi, I am also facing the same issue as @janmekota . Please let me know if any resolution. @wakaleo @janmekota I am also using serenity version 4.1.3

We use

serenity-core-4.1.3 serenity-cucumber-4.1.3 JUnit 5 plugin io.cucumber.core.plugin.SerenityReporterParallel trigger test as mvn verify -Dserenity.take.screenshots=DISABLED and also set this property explicitely in serenity properties, still the screenshots are taken for every step