4

In Cucumber 5.7.0 the support of tags is handled in different way so that expression(infix boolean expression) can also be used in the same way. You can pass the multiple tags like @CucumberOptions(tags = "@smoke and @positive") public class RunCucumberTest {} Another way to manage the tags by JVM System Property mvn test -Dcucumber.filter.tags="@smoke ...


4

It depends The point of the Given/When/Then pattern is that it describes test preconditions (Given), actions (When), and expected results (Then) - very similar to the unit test arrange/act/assert pattern. In the example you've given the actions are implied: the user navigates to the website. Depending on what's needed to prove the user's access, that could ...


3

You don't actually initialize the driver before you call it. Your SeleniumDriver.openPage() call happens without any of the initialization code for the driver being called. Your code: public static SeleniumDriver seleniumDriver; //initialize webdriver public static WebDriver driver; does not actually initialize the driver - it merely declares the variable. ...


3

Configuring the Unit Test Provider Tests are executed using a unit test provider. Add the corresponding NuGet package to your project to define your unit test provider: SpecRun.Runner SpecFlow.xUnit SpecFlow.MsTest SpecFlow.NUnit You can only have one unit test provider! Source: Executing SpecFlow Scenarios All these frameworks are supported , why would you ...


2

You shouldn't use hooks to supply WebDriver to your scenarios. Instead use PicoContainer dependency injection framework. Mark the fields of your step class with @Inject annotations Create a class that would implement WebDriver interface and delegate calls to internal driver object that would be lazily initialized. That class should also implement Disposable ...


2

First of all I do not know why you ask for a "junit package" since the problematic part is usually the interaction with Java applications, not the flow control behind them. So you should be able to integrate all of the following with cucumber (which is basically just an overblown pattern matcher) or the unit testing library of your choice. Beyond ...


2

No, the when is the action you are testing. Why not write it as: Scenario: User has to open a website Given Joey (a typical user) that has access to the website When Joey visits the page Then Joey is be able to validate the page content You can technical skip step phases, you can also leave the implementation of a step empty. Sometimes I create ...


2

The approach you are using works only with native check-boxes (i.e. <input type="checkbox"/>). What you have is a custom element that looks like a check-box and behaves like a check-box but which is not really a check-box from Selenium point of view. When you have custom check-boxes you need to obtain theirs states via the CSS properties ...


1

WebElement Searchbox = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[contains(text(),'Search')]/ancestor::button"))); Searchbox.click(); webdriver wait returns the element , so don't find it before using wait . ALso change normalize text to text() or string()


1

You have several ways to go: If your app is pure black-box Store what you already created in memory of your test. Example - parameterization that cucumber supplies. The downside is that when your tests are done and re-run they will start from scratch so you will have to reset your application database If you have any interface that your application exposes ...


1

The maximum number you can parse to integer is 2147483647 while you're trying to parse 200 times bigger number Try to use Long.parseLong() instead.


1

The documentation has some suggestions: OutSystems generates 100% standard mobile and web apps, with a standard .NET web stack on the server side. As such, most testing tools on the market can be used for UI testing and load testing. For this reason, we won't recommend any specific tool here, but we'll focus on the aspects you should keep in mind to pick ...


1

You are using java jdk 8 , You should update it to jdk 11+ https://stackoverflow.com/q/9170832/6793637


1

xUnit. ( ... or even unittest, pytest, if you would consider python: "unittest : A unit testing framework for Python. It is python’s xUnit style framework." )


1

Although the question is highly broad ("How to test"-ish) I would guess that a good first step would be to create automated checks in two aspects: 1 - (Main part) Consumer Contracts You may want to check if your application is generating messages in the format expected by your consumer application(s). In case you are not familiar, here and here you ...


1

Your java is defined as a folder and not package try defining it as package and calling java.uk.co... if you see the folder color scheme , it shows that green means the folder is test source ; https://www.jetbrains.com/help/idea/content-roots.html#adding_content_root if you scroll down you can see its not java but test folder needs to be green color. I am ...


1

I would go with different features. CAN you go with DB1.feature doing everything and then DB7.feature? Can you create employee and customer in one run on the same DB?


1

I don't recommend reusing sessions but you could do the login as part of your [OneTimeSetUp]/[AssemblyInitialize] in your test class and likewise [TearDown]/[AssemblyCleanup] the session (what you use depends on the 'Custom Tool' set on your .feature file). You can save what ever you want as a global like I outlined on a similar question. I did this once for ...


1

make sure you have installed cucumber for eclipse from market place: https://marketplace.eclipse.org/content/cucumber-eclipse-plugin Goto preference and search for cucumber and enable step detection


1

You can simply use a global variable. Save it in a base class that you inherit or you can import a helper class/file in your test. // DataFile.java class DataFile { string myVar; } // Test1.java import DataFile; ... @Then("I get and save my response") { DataFile.myVar = thing1.value; } // Test2.java import DataFile; ... @When("I ...


1

You don't use the Test Parameters when using Cucumber, you use the Scenario outlines. So, when you have: Scenario Outline: Login As User When I log in as '<user>' Examples: | user | | xyz@gmail.com | You would have your test step definition handle that by using an Excel reader. @When("^I log in as \"([^\"]*)\") ...


1

Register event handle: publisher.registerHandlerFor(EmbedEvent.class, this::stepEmbedded); Catch the event: private void stepEmbedded(EmbedEvent event) { byte[] a = event.getData(); String s = new String(a); try { step.log(Status.FAIL, "Test Failed" , MediaEntityBuilder....


1

+1 for View Results Tree. This ticks most of your boxes and each call will display green or red after running. If you want to put together a workflow diagram manually, you could use a free online editor like app.diagrams.net


1

Test automation code is code, it should follow the same princibles as maintaining regular code. One princible that comes to mind is: The Single Responsibility Principle (SRP) states that there should never be more than one reason for a class to change. When you need to change the test-code, challenge yourself does it follow the SRP. Is it a good reason to ...


1

Cucumber has the facility to address the issues like yours one. It is called Object Factory. Object factory is responsible for creating objects once per scenario through the chosen injection framework. Recommended injection framework is PicoContainer: <dependency> <groupId>io.cucumber</groupId> <artifactId>cucumber-...


1

This may help you TestBase.java public class TestBase { public Properties prop; public FileInputStream file; public WebDriver driver; // Pages objects public HomePage homepage; public Dashboard dashboard; public void intialization() { try { System.setProperty("webdriver.chrome.driver", ...


1

It looks like for the internal implementation, you need to extract delegate function, that would perform these actions in a following order: cy.get(selectors.buttons.sideMenu.accessibility).click(); function(); cy.contains(selectors.accessibilityOptions.okButton).click(); In C# this mechanism is called delegates, for JS - you need to implement a callback ...


1

The closest you can get to your Katalon example is using Templates with embedded arguments: Verify Prices of All Plans [Template] Account ${account} and ${plan} Should Have Price ${price} Free Android 19.79 Free IOS 19.79 Free Both 24.99 All other logic would be inside Account ${account} and ${plan} Should Have ...


1

The two ways to avoid duplication are using: Background Using page object and creating wrapper function with all prerequisite Given('a web browser is at the Google home page', () => { homepage.goto() } When('the user enters "panda" into the search bar', () => { homepage.enter("panda") } Then('links related to "panda&...


1

Try to understand what the code does: const { Before } = require('cucumber'); const {AfterAll} = require('cucumber'); module.exports = function () { Before(function () { browser.manage().window().maximize(); /// await browser.manage().deleteAllCookies(); }); AfterAll(async function () { return driver....


Only top voted, non community-wiki answers of a minimum length are eligible