serenity-bdd

How to use Serenity with Junit5?

半腔热情 提交于 2021-02-19 07:04:52
问题 I'm trying to run Serenity Tests in my maven project. I'm using junit-jupiter-engine 5.3.1. (It's in the parent pom.) I'm getting multiple error. Is it because the JUnit's version or is there something else? How can I solve it? My test class: @RunWith(SerenityRunner.class) public class MyTestClass { private static final String CHARACTER_ENCODING_UTF_8 = "UTF-8"; @Steps private ApiSteps apiSteps; @Test public void aTest() { try { String filePath = "initiatepayment/input.xml"; Client client =

How to use Serenity with Junit5?

柔情痞子 提交于 2021-02-19 07:03:29
问题 I'm trying to run Serenity Tests in my maven project. I'm using junit-jupiter-engine 5.3.1. (It's in the parent pom.) I'm getting multiple error. Is it because the JUnit's version or is there something else? How can I solve it? My test class: @RunWith(SerenityRunner.class) public class MyTestClass { private static final String CHARACTER_ENCODING_UTF_8 = "UTF-8"; @Steps private ApiSteps apiSteps; @Test public void aTest() { try { String filePath = "initiatepayment/input.xml"; Client client =

How to get all the cucumber scenario steps in before hook?

白昼怎懂夜的黑 提交于 2021-01-07 06:35:53
问题 I want to access all the cucumber scenario steps in @before hook. Is there a way to do this? I have tried passing the cucumber scenario object in the before hook method but it only provides the basic info like scenario.getName() , scenario.getId() . What I require is something like getSteps() which give me the List<String> of all the steps of that particular scenario. What I am looking for is something like this @Before("@dev") public void testcase(Scenario scenario){ for (Step a : scenario

Serenity Reports Logo Change

久未见 提交于 2020-01-05 03:37:51
问题 I am using Serenity with Jbehave. i would like to know how to replace the current reports default logo of serenity to a custom company logo. what is the code changes need to be done for changing the default logo. 回答1: You can do that by replacing the serenity-bdd-logo.png in serenity-report-resources-x.x.xx.jar . Save your logo and name it likewise, then copy and overwrite the existing one. Mine is stored in the following location: serenity-report-resources-x.x.xx.jar\report-resources\images\

Running Serenity -Cucumber Test cases in parallel

做~自己de王妃 提交于 2020-01-01 07:06:10
问题 I'm new to Serenity and BDD. I've a small demo project based on Serenity-Cucumber and Page Based model. Below is the structure of the project: The Login and Logout features have around 8 scenarios. I want to be able to run the feature files in parallel. What is the easiest and most effective way to achieve this? So far I have Created separate Runner class for each feature and then used failsafe or surefire plugin - This is something I don't want as I don't want a new runner for each feature

Serenity BDD dont delete Browser Memory

时间秒杀一切 提交于 2019-12-24 21:17:36
问题 @Managed(uniqueSession = true, clearCookies = Never) I have a serenity app that has a Oauth login mechanism using the Microsoft login. I am using the above code to make browser retain browser's memory. What I want to happened is I have a test to Login using the Microsoft Oauth. Then Have another test that will open the dashboard. Since the previous test already log in. I am hoping that Opening the dashboard of the app should be pass. Unfortunately when I access the dashboard. The test will

How do I include screenshots of the full page in my serenity report (and not only of the viewport) using ChromeDriver?

孤者浪人 提交于 2019-12-24 01:18:56
问题 I am using serenity in combination with cucumber for automated screen tests and want to include full-page screenshots in my serenity report. The screenshots in the report are normally only a capture of the viewport. Oftentimes however, this doesn't provide enough information as this is only a part of the screen. I found that the capturing of serenity screenshots is a part of driver implementation. As most drivers conform with the W3C definition of screenshots those drivers only capture the

Why hover to element and click submenu does not work when browser is opened full screen?

喜你入骨 提交于 2019-12-24 00:27:50
问题 I am working on a page where a left hand main menu has submenus. I try to hover to the main menu item, and it will show the submenu, and then I will click the submenu. I am using below code: @FindBy(id = "xxx") private WebElementFacade mainmenu; @FindBy(id = "yyy") private WebElementFacade submenu; Actions builder = new Actions(getDriver()); builder.moveToElement(mainmenu).perform(); submenu.waitUntilClickable().click(); I've tried other ways like: action.moveToElement(mainmenu).moveToElement

Firefox - org.openqa.selenium.interactions.MoveTargetOutOfBoundsException

扶醉桌前 提交于 2019-12-20 04:21:22
问题 I have faced a weird situation, where on the page in Serenity I have to scroll to the element: withAction().moveToElement(webElement).perform(); and this method for some elements throws: org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: (377.375, 958.3999938964844) is out of bounds of viewport width (1268) and height (943) It happens only in Firefox(Chrome works fine). Moreover almost all other places, where I'm using the same method are working well. All elements are just

serenity cucumber browser unique session per feature

我与影子孤独终老i 提交于 2019-12-12 04:05:58
问题 I'm looking at serenity (the following versions) <serenity.version>1.1.26</serenity.version> <serenity.maven.version>1.1.26</serenity.maven.version> <serenity.cucumber.version>1.1.5</serenity.cucumber.version> I have feature files F1, F2, F3. I'm looking for support to run all the scenarios in F1 (only) to run in a single browser session. The scenarios in F2 and F3 can run in a "browser per scenario" mode. How to achieve this? 回答1: Cucumber hooks do the job for you. import cucumber.annotation