2016-06-21 2 views
1

웹 사이트에서 결제 파일을 올바르게 처리했는지 확인하는 오이 기능 (BACS, SEPA, FPS 등)이 있습니다. 프로세스의 첫 번째 단계는 예상 결과 데이터를 데이터베이스에 생성하는 지불 파일을 만드는 것입니다. 이 데이터는 결제 처리 웹 사이트를 확인하는 데 사용됩니다.오이 - 데이터베이스의 레코드에 따라 동일한 기능을 여러 번 실행하십시오.

하나의 파일을 처리하는 경우 내 기능이 예상되는 결과를 완벽하게 검증합니다. 내가 갇혀있는 곳은 원래 처리 된 레코드 수/파일 수에 따라이 기능을 (n) 회 실행하는 방법입니다.

필자는 기쁨없이 레코드 카운트 반복을 사용하여 '주변'후크를 시도했는데 개요 시나리오에 맞출 수있는 방법을 볼 수 없으며 이제 해당 기능을 호출하는 레이크 작업이 효과가 있다고 생각할 수 있습니다.

모든 아이디어는 크게 감사하겠습니다.

기능 : 처리 SEPA 신용 파일 전송

다음은 기능의 샘플입니다. 당일 치 지불. 내가 처음 데이터베이스 레코드를 호출과 같이 주요 기능으로 (행 ID 적어도 나) 레코드의 각 세트를 공급 할 수 있도록

Background: 
    Given we want to test the "SEPA_Regression" scenario suite 
     And that we have processed a "SEPA" file from the "LDN" branch 
     And we plan to use the "ITA1" environment 
    Then we log in to "OPF" as a "SEPA Department" user 

@feature @find_and_check_sepa_interchange @all_rows 
Scenario: Receive SEPA Credit Transfer Files for branch 
    Given that we are on the "Payment Management > Interchanges" page 
    When I search for our Interchange with the following search parameters: 
     | Field Name | 
     | Transport Date From | 
     | Bank | 
     | Interchange Reference | 
    Then I can check the following fields for the given file in the "Interchanges" table: 
     | Field Name| 
     | Interchange Reference | 
     | Transport Date | 
     | File Name | 
     | File Format | 
     | Clearing Participant | 
     | Status | 
     | Direction | 
     | Bank | 
    When I select the associated "Interchange Id" link 
    Then the "Interchange Details" page is displayed 

업데이트가 나는 기능에 대한 중첩 단계를 구현했습니다 :

기능

@trial_feature 
Scenario: Validate multiple Files 
    Given we have one or more records in the database to process for the "SEPA_Regression" scenario 
    Then we can validate each file against the system 

기능 단계 :

Then(/^we can validate each file against the system$/) do 
x = 0 
while x <= $interchangeHash.count - 1 
    $db_row = x 
    # Get the other sets of data using the file name in the query  
    id = $interchangeHash[x]['id'] 
    file_name = $interchangeHash[x]['CMS_Unique_Reference_Id'] 
    Background.get_data_for_scenario(scenario, file_name) 
    steps %{ 
    Given that we are on the "Payment Management > Interchanges" page 
     When I search for our Interchange with the following search parameters: 
      | Field Name | 
      | Transport Date From | 
      | Bank | 
      | Interchange Reference | 
     Then I can check the following fields for the given file in the "Interchanges" table: 
      | Field Name| 
      | Interchange Reference | 
      | Transport Date | 
      | File Name | 
      | File Format | 
      | Clearing Participant | 
      | Status | 
      | Direction | 
      | Bank | 
     When I select the associated "Interchange Id" link 
     Then the "Interchange Details" page is displayed 

'해킹'이 약간 보이지만 작동합니다.

+0

안녕 밀튼! 스택 오버플로에 오신 것을 환영합니다! 프로그램이 현재 어떻게 작동하는지 더 구체적으로 설명 할 수 있습니까? 아마도 지금 사용하고있는 코드를 추가하고 어떻게 작동시키려는 psudo 코드를 추가할까요? – thesecretmaster

+0

@thesecretmaster - 어떤 이유로 초기 stackoverflow 질문 양식이 내 회사에 의해 차단되어 있으므로 내 전화에 써야했습니다. 마치 여기에 코멘트 할 수있는 것처럼 보입니다. 웹 사이트에 로그인하고 watir을 사용하여 dom에있는 데이터의 유효성을 검사하는 기본적인 오이 기능입니다. 언급했듯이, 내가 단 하나의 기록 만 가지고 있다면 모든 것이 잘됩니다. 데이터베이스에 2 개의 레코드가있는 경우,이 기능을 두 번째로 처리하는 방법을 알지 못합니다. – Milton70

+0

간단한 루프가 작동하지 않는 이유는 무엇입니까? – thesecretmaster

답변

0

일괄 처리 소프트웨어가있는 경우 몇 가지 감안 (설정) 단계, 1 가지 경우 (트리거) 단계, 몇 가지 (기준) 단계가 있어야합니다.

Given I have these SEPA bills 
| sepa bill 1 | 
| sepa bill 2 | 
And I have these BAC bills 
| bac bill 1 | 
| bac bill 2 | 
When the payments are processed 
Then these sepa bills are completed 
| sepa bill 1 | 
| sepa bill 2 | 
And I these bac bills are completed 
| bac bill 1 | 
| bac bill 2 | 

더 쉽게 수행 할 내용을 읽고 더 확장 할 수 있습니다. 작업은 설정 및 확인의 단계 정의에서 수행해야합니다.

관련 문제