量具:在规格

时间:2019-11-21 19:32:09

标签: markdown bdd getgauge

我是Gauge的新手,我需要在场景之前运行“背景场景”之类的东西(本例中为“规格”)

我在这样的规格中登录:

table: resources/data/login_data.csv

## Login with valid username and password
----------------------------------------------

* Navigate to Login Profile page
* Login with profile as <Profile> and password as <Password>
* Access Mailtrap with valid username <Username> and pass <Pass>
* Successfully logged to Page

现在这是概念文件(Concept_Login.cpt)

# Login as profile <Profile> and access Mailtrap with valid username <Username>


* Navigate to Login Profile page
* Login with profile as <Profile> and password as <Password>
* Access Mailtrap with valid username <Username> and pass <Pass>
* Successfully logged to Page

我想要的是:在其他规范中,请重新使用登录名。我举了一个例子:

Second Spec File
=================


Successfull Login Scenario
--------------------------

* Login as profile <Profile> and access Mailtrap with valid username <Username>


Redirect to Contact Page
-------------------------

* Accessing to the contact section
* Click in Contacts Menu
* The contacts menu is displayed

但是当我运行第二个规格文件时,系统显示下一个错误:

[ParseError] /Users/rodrigo.g/Documents/automation_projects/Gauge/gauge_maven/specs/concepts/Concept_Login.cpt:9 Dynamic parameter <Password> could not be resolved => 'Login with profile as <Profile> and password as <Password>'
[ParseError] /Users/rodrigo.g/Documents/automation_projects/Gauge/gauge_maven/specs/concepts/Concept_Login.cpt:10 Dynamic parameter <Pass> could not be resolved => 'Access Mailtrap with valid username <Username> and pass <Pass>'
[ParseError] /Users/rodrigo.g/Documents/automation_projects/Gauge/gauge_maven/specs/normalflow.spec:12 Dynamic parameter <Profile> could not be resolved => 'Login as profile <Profile> and access Mailtrap with valid username <Username>'
[ParseError] /Users/rodrigo.g/Documents/automation_projects/Gauge/gauge_maven/specs/normalflow.spec:12 Dynamic parameter <Username> could not be resolved => 'Login as profile <Profile> and access Mailtrap with valid username <Username>'

顺便说一句:概念文件夹位于specs文件夹内。

有人可以帮助我吗?

0 个答案:

没有答案