Currently, Verne exposes step definitions from Hercules so you can consume via custom groovy in step definitions. The following list exposes the call API for the step definitions for Selenium steps.

I set application to (.*)

    setApplication(appCode);

I set my cluster prefix to (.+)

    String prefix = StringUtils.removeEnd(decodeVariables(delegate(), code), "-");
    getVariables().put(HerculesBaseSteps.VAR_MASTER_APP, prefix + "-master");
    getVariables().put(HerculesBaseSteps.VAR_SECURITY_APP, prefix + "-security");
    getVariables().put(HerculesBaseSteps.VAR_PAYMENT_APP, prefix + "-payment");
    getVariables().put(HerculesBaseSteps.VAR_WORKFLOW_APP, prefix + "-workflow");

I logon as (\S+) with password (\S+)

    logonAs(user, pwd);

I logoff

    logoff();

I click button (.*)

    clickButton(_path);

I click menu (.+)

    clickMenu(_path);

I click link (.+)

    clickButton(_path);

I click checkbox (.+)

    clickCheckbox(_path);

I click tab (.+)

    clickTab(_path);

I click (.+) for dashboard item (.+)

    clickDashboardItem(_option, _path);

I select option (.+) from dropdown (.+)

    selectDropdownOption(_path, _option, false);

I select radio button (.+) in radio button group (.+)

    selectRadioButtonOption(_path, _option); 

I enter (text|date) (.+) in (.+)

    enterText(_path, _text, _type);

I clear (text|date) in (.+)

    enterText(_path, null, _type);

I expect no invalid config

    expectNoInvalidConfig();

I expect (.+) to have (info|warn|error) message (.+)

    expectMessage(_path, _level, _message);

I expect (info|warn|error) message (.+)

    expectMessage(null, _level, _message);

I expect no (info|warn|error) message (.+)

    expectMessage(null, _level, null);

I expect (text|help|heading|subHeading) (.+)

    expectText(_type, _text);

I do not expect (text|help|heading|subHeading) (.+)

    notExpectText(_type, _text);

I (approve|return|reject|open) task with for (.+)

    taskAction(_action, _text);

I (allocate|assign) task to (.+) for (.+)

    taskAllocation(_action,_allocate, _text);

I expect (pdf|excel|csv) (.+) to contain (.+)

    expectTextOnFile(_type,_path, _text);

I do not expect (pdf|excel|csv) (.+) to contain (.+)

    expectNoTextInFile(_type,_path, _text);

I (create|default) a random (\d+) (uppercase |lowercase )?(character|digit|letter) variable called (.*)

    if (!mode.equals("default") || !StringUtils.isNotBlank(getVariables().getString(name))) {
      String var;
      if (type.equals("digit")) {
        int i = RandomUtils.nextInt(8) + 1;
        var = "" + i + RandomStringUtils.randomNumeric(length - 1);
      } else if (type.equals("letter")) {
        var = RandomStringUtils.randomAlphabetic(length);
      } else {
        var = RandomStringUtils.randomAlphanumeric(length);
      }

      _case = StringUtils.trim(_case);
      if (StringUtils.equals("uppercase", _case)) {
        var = StringUtils.upperCase(var);
      } else if (StringUtils.equals("lowercase", _case)) {
        var = StringUtils.lowerCase(var);
      } else if (StringUtils.equals("titlecase", _case)) {
        var = StringUtils.capitalize(var.toLowerCase());
      }
      getVariables().put(name, var);
      log.debug("[%s] '%s' variable '%s' with value '%s' in %s", getMode(), mode, name, var, getElapsedNanos(start));
      return;
    } else {
      log.debug("[%s] variable '%s' already exists with value '%s' completed in %s", getMode(), name, getVariables().getString(name), getElapsedNanos(start));
    }

I (create|default) a variable called (.) with value (.)

    if (!mode.equals("default") || !StringUtils.isNotBlank(getVariables().getString(name))) {
      Support support = new Support();
      getVariables().put(_name, _value);
      log.debug("[%s] '%s' variable '%s' with value '%s' in %s", getMode(), mode, _name, _value, getElapsedNanos(start));
      return;
    } else {
      log.debug("[%s] variable '%s' already exists with value '%s' completed in %s", getMode(), name, getVariables().getString(name), getElapsedNanos(start));
    }
  }
0
0

Jump to Section