Мой план сценария не выводится в формате, который я видел раньше - PullRequest
0 голосов
/ 03 апреля 2019

Я решил начать освежать память о том, как работает огурец.И сегодня я столкнулся с тем, что на самом деле не выглядит знакомым.Я использую таблицу данных, чтобы сделать тест масштабируемым.Когда я генерирую вывод из сценария, он, кажется, производит нагрузки или аргументы?Зачем?Что я делаю не так?

Я пытался добавить строки в мои определения шагов.

@Given("^I navigate to cover checker site$")
public void i_navigate_to_cover_checker_site() throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

@When("^I add the registration number and search$")
public void i_add_the_registration_number_and_search(String registration) throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

@Then("^I will be presented cover start and cover end (\\d+) FEB (\\d+) : (\\d+) : (\\d+) dates$")
public void i_will_be_presented_cover_start_and_cover_end_dates(String coverStart, String CoverEnd) throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

}

Итак, вот мой сценарий:

Feature: Covercheck


      Scenario Outline: : Registration number check
        Given I navigate to cover checker site
        When I add the registration number <Registration> and search
        Then I will be presented cover start <CoverStart> and cover end <CoverEnd> dates

        Examples:
          | Registration | CoverStart            | CoverEnd              |
          | OV12UYY      | 09 FEB 2022 : 16 : 26 | 18 FEB 2022 : 23 : 59 |

Вывод:

@Given("^I navigate to cover checker site$")
public void i_navigate_to_cover_checker_site() throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

@When("^I add the registration number OV(\\d+)UYY and search$")
public void i_add_the_registration_number_OV_UYY_and_search(int arg1) throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

@Then("^I will be presented cover start (\\d+) FEB (\\d+) : (\\d+) : (\\d+)$")
public void i_will_be_presented_cover_start_FEB(int arg1, int arg2, int arg3, int arg4) throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

@Then("^cover end (\\d+) FEB (\\d+) : (\\d+) : (\\d+) dates$")
public void cover_end_FEB_dates(int arg1, int arg2, int arg3, int arg4) throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

Из того, что я помню, вы добавили бы строки в ваши определения своих данных в набросках сценария файлов объектов.

Ответы [ 2 ]

0 голосов
/ 07 апреля 2019

Если вы хотите сопоставить как строки, попробуйте следующее:


@Given("^I navigate to cover checker site$")
public void i_navigate_to_cover_checker_site() throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

@When("^I add the registration number (.*) and search$")
public void i_add_the_registration_number_and_search(String registration) throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

@Then("^I will be presented cover start (.*) and cover end (.*) dates$")
public void i_will_be_presented_cover_start_and_cover_end_dates(String coverStart, String CoverEnd) throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

(.*) будет соответствовать строкам; убедитесь, что поместили их в нужное место в вашем определении шага и шага. Вам нужно будет самостоятельно преобразовать строки в даты в определении шага.

0 голосов
/ 03 апреля 2019

Вы неправильно выполняете шаги в своем файле объектов в разделе Схема сценария. У вас есть Регистрация, CoverStart и CoverEnd в примерах, которые должны быть закрыты между <> в ваших соответствующих шагах в файле объектов, например: - Когда я добавляю число, аналогично другим 2. Я приведу один пример.

Пожалуйста, обратите внимание на лучшее понимание того, как реализовать таблицу примеров и данных.

  @BAMS_Submitted_State_Guest_User
  Scenario Outline: Validation of UseCase Guest User Order Placement flow from Search
    Given User is on Brand Home Page <Site>
    And User searches for a styleId and makes product selection on the basis of given color and size
      | Style_ID  | Product_Size | Product_Color |
      | TestData1 | TestData1    | TestData1     |
      | TestData2 | TestData2    | TestData2     |
    Then Clicking on Cart icon shall take user to Shopping Bag
    Then Clicking on Proceed To Checkout button shall take user to Shipping Page
    And Submitting FN as <FName> LN as <LName> Add as <AddL1> ZCode as <ZipCode> PNo as <PhoneNo> EmailID as <EmailID> shall take user to payment page
    And Submitting CCardNo as <CCNo> Month as <CCMonth> Year as <CCYear> and CVV as <CVV> shall take user to Order Review Page
    And Click on the place order button
    Then Verify order gets placed successfully and capture the Order ID in excel as CellNo as <CellNo>
Examples: Checkout User Information
  | Site  | EmailID   | FName     | LName     | AddL1     | ZipCode   | PhoneNo   | CCNo      | CCMonth   | CCYear    | CVV       | CellNo    |
  | Site1 | TestData3 | TestData2 | TestData2 | TestData2 | TestData2 | TestData2 | TestData1 | TestData1 | TestData1 | TestData1 | TestData1 |
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...