use of io.cucumber.java.en.Given in project Selenium_Jan_2022 by TestLeafPages.
the class StepDefinition method openBrowser.
@Given("Open the chrome browser")
public void openBrowser() {
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
}
use of io.cucumber.java.en.Given in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class ConnectorSteps method a_connector.
@Given("^a Connector with:$")
public void a_connector(Map<String, String> entry) {
final Long drv = Long.parseLong(entry.getOrDefault(ConnectorContext.COS_DEPLOYMENT_RESOURCE_VERSION, "1"));
final Long crv = Long.parseLong(entry.getOrDefault(ConnectorContext.COS_CONNECTOR_RESOURCE_VERSION, "1"));
final String connectorId = entry.getOrDefault(ConnectorContext.COS_CONNECTOR_ID, uid());
final String deploymentId = entry.getOrDefault(ConnectorContext.COS_DEPLOYMENT_ID, uid());
final String clusterId = ctx.clusterId();
var connector = new ManagedConnectorBuilder().withMetadata(new ObjectMetaBuilder().addToLabels(Resources.LABEL_CLUSTER_ID, clusterId).addToLabels(Resources.LABEL_CONNECTOR_ID, connectorId).addToLabels(Resources.LABEL_DEPLOYMENT_ID, deploymentId).addToLabels(Resources.LABEL_OPERATOR_TYPE, entry.get(ConnectorContext.OPERATOR_TYPE)).withName(Connectors.generateConnectorId(deploymentId)).build()).withSpec(new ManagedConnectorSpecBuilder().withClusterId(clusterId).withConnectorId(connectorId).withDeploymentId(deploymentId).withDeployment(new DeploymentSpecBuilder().withConnectorResourceVersion(crv).withConnectorTypeId(entry.get(ConnectorContext.CONNECTOR_TYPE_ID)).withDeploymentResourceVersion(drv).withKafka(new KafkaSpecBuilder().withUrl(entry.getOrDefault("kafka.bootstrap", "kafka.acme.com:443")).build()).withDesiredState(entry.get(ConnectorContext.DESIRED_STATE)).withSecret(Connectors.generateConnectorId(deploymentId) + "-" + drv).build()).withOperatorSelector(new OperatorSelectorBuilder().withId(entry.get(ConnectorContext.OPERATOR_ID)).withType(entry.get(ConnectorContext.OPERATOR_TYPE)).withVersion(entry.get(ConnectorContext.OPERATOR_VERSION)).build()).build()).build();
var secret = new SecretBuilder().withMetadata(new ObjectMetaBuilder().addToLabels(Resources.LABEL_OPERATOR_TYPE, entry.get(ConnectorContext.OPERATOR_TYPE)).withName(connector.getMetadata().getName() + "-" + connector.getSpec().getDeployment().getDeploymentResourceVersion()).build()).withData(new HashMap<>()).addToData(Secrets.SECRET_ENTRY_SERVICE_ACCOUNT, Secrets.toBase64(Serialization.asJson(Serialization.jsonMapper().createObjectNode().put("client_id", entry.getOrDefault("kafka.client.id", uid())).put("client_secret", entry.getOrDefault("kafka.client.secret", Secrets.toBase64(uid())))))).build();
ctx.connector(connector);
ctx.secret(secret);
}
use of io.cucumber.java.en.Given in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class ManagedConnectorOperatorSteps method a_managedConnectorOperator.
@Given("^a ManagedConnectorOperator with:$")
public void a_managedConnectorOperator(Map<String, String> entry) {
final String operatorId = entry.getOrDefault("operator.id", uid());
final String operatorType = entry.get("operator.type");
final String operatorVersion = entry.get("operator.version");
final String operatorRuntime = entry.get("operator.runtime");
var connector = new ManagedConnectorOperatorBuilder().withMetadata(new ObjectMetaBuilder().withName(operatorId).addToLabels(Resources.LABEL_OPERATOR_TYPE, operatorType).addToLabels(Resources.LABEL_OPERATOR_VERSION, operatorVersion).build()).withSpec(new ManagedConnectorOperatorSpecBuilder().withVersion(operatorVersion).withType(operatorType).withRuntime(operatorRuntime).build()).build();
ctx.managedConnectorOperator(connector);
}
use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.
the class BundledSetAdministrativeStatusSteps method theBundleRequestContainsASetAdministrativeStatusAction.
@Given("^the bundle request contains a set administrative status action$")
public void theBundleRequestContainsASetAdministrativeStatusAction() throws Throwable {
final SetAdministrativeStatusRequest action = new SetAdministrativeStatusRequestBuilder().withDefaults().build();
this.addActionToBundleRequest(action);
}
use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.
the class BundledSetPushSetupAlarmSteps method theBundleRequestContainsASetPushSetupAlarmAction.
@Given("^the bundle request contains a set push setup alarm action with parameters$")
public void theBundleRequestContainsASetPushSetupAlarmAction(final Map<String, String> parameters) throws Throwable {
final SetPushSetupAlarmRequest action = new SetPushSetupAlarmRequestBuilder().fromParameterMap(parameters).build();
this.addActionToBundleRequest(action);
}
Aggregations