
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
io.cloudbeat.cucumber:cb-plugin-cucumber
Advanced tools
This plugin allows executing Java based Cucumber tests using the CloudBeat platform.
git clone https://github.com/oxygenhq/cb-framework-plugin-cucumber-java
cd cb-framework-plugin-cucumber-java
mvn install
Add the plugin to your project. If you are using a maven based project, you can directly add this library as a dependency:
<dependency>
<groupId>io.cloudbeat.cucumber</groupId>
<artifactId>cb-plugin-cucumber</artifactId>
<version>0.8.0</version>
</dependency>
Add io.cloudbeat.cucumber.Plugin
to Cucumber options and make sure the class annotated with @RunWith(Cucumber.class)
extends CucumberRunner
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty", "io.cloudbeat.cucumber.Plugin:"})
public class RunCucumberTest extends CucumberRunner {
}
Browser name is set by the plugin as a system property, and can be obtained using System.getProperty
:
String browserName = System.getProperty('browserName');
When using Selenium it might be beneficiary to be able to take browser screenshots in case of failures. This can be achieved in a three different ways. Please note that all 3 options are mutually exclusive.
@After()
method within the glue classes. Screenshot should be embedded as a Base64 string using the image/png
mime type. See the examples below for more details.public class SeleniumDefs {
private final WebDriver driver = new ChromeDriver();
@Given("^I am on the Google search page$")
public void I_visit_google() {
...
}
@When("^I search for \"(.*)\"$")
public void search_for(String query) {
...
}
@Then("^the page title should start with \"(.*)\"$")
public void checkTitle(String titleStartsWith) {
...
}
@After()
public void tearDown(Scenario scenario) {
if (scenario.isFailed()) {
try {
final byte[] screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.BYTES);
scenario.embed(screenshot, "image/png");
} catch (Exception e){
System.err.println("Couldn't take screenshot" + e);
}
}
driver.quit();
}
}
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty", "io.cloudbeat.cucumber.Plugin:"})
public class RunCucumberTest extends CucumberRunner {
@BeforeClass
public static void setUp() {
WebDriver driver = ... // WebDriver initialization
setWebDriver(driver);
}
}
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty", "io.cloudbeat.cucumber.Plugin:"})
public class RunCucumberTest extends CucumberRunner {
@BeforeClass
public static void setUp() {
WebDriverProvider provider = new WebDriverProvider();
// getter should have WebDriver as its return type and shouldn't expect any arguments
setWebDriverGetter(provider::getWebDriver);
}
}
public class WebDriverProvider {
public WebDriver getWebDriver() {
return driver;
}
}
FAQs
CloudBeat plugin for Cucumber-Java
We found that io.cloudbeat.cucumber:cb-plugin-cucumber demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.