serenity-bdd/serenity-junit-starter

Issue with withAction().moveToElement(element) method.

Opened this issue · 9 comments

Test execution blocked if we use withAction().moveToElement(element) method.

This happens only when a step has failed due to some exception, serenity successfully skips the remaining test steps but blocked if there is a step which calls withAction().moveToElement(element) method.

I have created a repository showing the issue.
https://github.com/tiwari90/serenity-junit.git

ok, here is my output

22:17:18.570 [main] INFO  n.t.c.steps.ConsoleLoggingListener - STARTING STEP Open: http://thedemosite.co.uk/savedata.php
22:17:19.313 [main] INFO  n.t.c.steps.ConsoleLoggingListener - FINISHING STEP
22:17:19.319 [main] INFO  n.t.c.steps.ConsoleLoggingListener - STARTING STEP Should see user name enabled
22:17:19.321 [main] INFO  pages.LoginPage - Checking Username Enabled
22:17:19.624 [main] INFO  n.t.c.steps.ConsoleLoggingListener - FINISHING STEP
22:17:19.631 [main] INFO  n.t.c.steps.ConsoleLoggingListener - STARTING STEP Enter user name
22:17:19.633 [main] INFO  pages.LoginPage - Enter Username
22:17:20.080 [main] INFO  n.t.c.steps.ConsoleLoggingListener - FINISHING STEP
22:17:20.085 [main] INFO  n.t.c.steps.ConsoleLoggingListener - STARTING STEP Enter password
22:17:20.088 [main] INFO  pages.LoginPage - Entering Password 
22:17:45.362 [main] INFO  n.t.c.steps.ConsoleLoggingListener - STEP FAILURE: net.thucydides.core.webdriver.exceptions.ElementShouldBeEnabledException: Expected enabled element was not enabled
22:17:45.431 [main] INFO  pages.LandingPage - Hover Started, test case stops here if there is an exception
22:17:45.451 [main] INFO  n.t.c.steps.ConsoleLoggingListener - STARTING STEP Should see submit button enabled
22:17:45.454 [main] INFO  n.t.c.steps.ConsoleLoggingListener - IGNORING STEP

which seems fine, there is nothing blocked for me. I am not sure though if the hover action is actually performed, i hope not.

what chromedriver version you are using ?

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'stalker', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-51-generic', java.version: '1.8.0_171'
Google Chrome Version 74.0.3729.131

@globalworming
tried with chrome 74 and its working for me as well.

While debugging I tried with chrome version 77 and 81, it was not working.
Can you please check once at your end as well?

If it will fail for you then, it should be a chromedriver issue, but then can we handle that in Serenity?

If i use StepEventBus.getEventBus().getBaseStepListener().aStepHasFailed() method then I am able to skip the execution, without downgrading the chromeDriver version, but I think this is not the right way to handle execptions.

public void moveMouseToLogo() throws Exception {
if (!StepEventBus.getEventBus().getBaseStepListener().aStepHasFailed()) {
LOGGER.info("Hover Started, test case stops here if there is an exception");
withAction().moveToElement(addUserText).build().perform();
LOGGER.info("Hover Ended");
}
}

This should be fixed in version 2.2.7

@wakaleo
Thank you for the acknowledgment.
when can we expect 2.2.7 release(approx)?

Verified the issue with the latest serenity version(2.2.7), and it's working as expected now.

Thanks,
@wakaleo