Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validations with the Ensure class do not work #3511

Open
Moncada25 opened this issue Aug 19, 2024 · 1 comment
Open

Validations with the Ensure class do not work #3511

Moncada25 opened this issue Aug 19, 2024 · 1 comment

Comments

@Moncada25
Copy link

What happened?

When I perform validations using the Ensure class it seems that everything is ok when it is not.
image

What did you expect to happen?

The test should fail because those validations are not true.
This is how it works in version 4.0.30, I tried the latest version 4.2.0 and the error continues.

image

Serenity BDD version

4.2.0

JDK version

21

Execution environment

Serenity Core 4.2.0
Java 21
Mac OS 14.6
JUnit 5
serenity-ensure:4.2.0

How to reproduce the bug.

import net.serenitybdd.screenplay.annotations.Subject
import net.serenitybdd.screenplay.Actor
import net.serenitybdd.screenplay.Question
import net.serenitybdd.screenplay.ensure.that

open class Test : Question<Boolean> {

    companion object {
        fun ensure() : Test {
            return Test()
        }
    }

    @Subject("test ensure")
    override fun answeredBy(actor: Actor) : Boolean {

        actor.attemptsTo(
            that(200).isEqualTo(201),
            that("Hello").isEqualTo("Hola"),
            that(true).isFalse()
        )

        return true
    }
}

How can we make it happen?

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

@wakaleo
Copy link
Member

wakaleo commented Aug 19, 2024

I would need to check, but generally a Question is a read-only operation, it is not designed to have assertions, just to read information. The assertions are generally built with the results returned by the question objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants