在Feature文件中传递变量

时间:2016-02-29 18:08:42

标签: ruby cucumber nokogiri pdf-reader

我有一封信要对其中的内容进行验证。 它看起来像

Sender Name                                       LetterSendDate mm/dd/yy
Sender Address
1-XXX-XXX-XXXX

                                                        ActNum:XXXXXXXXX  
Dear Customer,                                        
              blah blah...... call us at 1-XXX-XXX-XXXX, Monday through Friday, from 8:00 a.m. to 9:00 p.m. Eastern Time 
Sincerely,
SenderName.

我有一个场景大纲:

Scenario Outline: Validate verbiage of the letter 
Given I have read the PDF file of the letter
When I extract the text from PDF and validate "<StaticText>"
Then I validate the Dynamic Text "<xmlTags>"

Examples:
|StaticText|                                                                       |xmlTags|
|1-XXX-XXX-XXXX|                                                                   |RTLtr_LetterSendDate|
|1-XXX-XXX-XXXX, Monday through Friday, from 8:00 a.m. to 9:00 p.m. Eastern Time|  |RTLtr_ACCT          |

从XML文件中提取xmlTags值,并在“提取的文本”中查找该值。

我尝试了上面给出的例子并且它有效。但我想验证它所在序列中的字母内容。

例如我想这样做:
    发件人姓名
    发件人地址     1-XXX-XXX-XXXX

                                               ActNum:<RTLtr_AcctNum>  
Dear <RTLtr_Customer>,                                        
              blah blah...... call us at 1-XXX-XXX-XXXX, Monday through Friday, from 8:00 a.m. to 9:00 p.m. Eastern Time 
Sincerely,
SenderName.

RTLtr_LetterSendDate,RTLtr_Customer和RTLtr_ACCT是变量,它们的值将从XML文件中提取。

0 个答案:

没有答案