Esempio n. 1
0
  /**
   *
   *
   * <ul>
   *   <li><B>Info: </B>Test out of scope global sequence question
   *   <li><B>Step: </B>Navigate to landing page
   *   <li><B>Step: </B>Ask Out of Scope sequence question
   *   <li><B>Verify: </B>Validate that we get an expected response
   * </ul>
   */
  @Test
  public void askOutScopeQuestion() {

    Driver test = new Driver();
    WebDriver driver = test.getInstance();
    rule.setDriver(driver);

    MovieUI ui = test.getGui(driver);

    // pick random question
    BaseQuestion question = Utils.getRandomSample(1, OUT_SCOPE_QUESTION, true).get(0);

    // select Next action
    logger.info("INFO: Select next button");
    ui.selectNextButton();

    logger.info("INFO: Question - " + question.getText());
    question.ask(ui);

    // Validation
    // Check response vs expected
    logger.info("INFO: Response - " + question.getResponse().getResponseText());
    Assert.assertTrue(
        "ERROR: Response - "
            + question.getResponse().getResponseText()
            + " does not match any of the expected response.",
        Utils.parseResp(question));
  }
  /**
   *
   *
   * <ul>
   *   <li><B>Info: </B>Test a series of repair sequence question designed to redirect the user
   *   <li><B>Step: </B>Connect to Showcase Dialog app using initchat rest api call
   *   <li><B>Step: </B>Ask a series of repair sequence question
   *   <li><B>Verify: </B>Validate that the response is expected response from dialog mct file
   * </ul>
   */
  @Test
  public void repairQuestion() {

    RestAPI api = RestAPI.getAPI();

    // Ask questions in separate Conversation thread
    question.seperateConver();

    // ask question
    logger.info("INFO: Question - " + question.getText());
    question.ask(api);

    // Validation
    // Check response vs expected
    logger.info("INFO: Response - " + question.getResponse().getResponseText());
    Assert.assertTrue(
        "ERROR: Response "
            + question.getResponse().getResponseText()
            + " does not match expected response.",
        Utils.parseResp(question));
  }