php - 无法访问场景大纲示例的值
问题描述
我试图在我的步骤定义中访问我的场景大纲示例,但我无法访问。
这是我的特点和场景......
功能:验证电子邮件背景:鉴于我在“<a href="https://www.somewebsite.com" rel="nofollow noreferrer">https://www.somewebsite.com” 场景大纲:确认电子邮件地址
鉴于我在电子邮件字段中填写了“”当我提交表单时,我应该会看到“”</p>
示例:| | | | | 电子邮件是必需的| | 无效@ | 电子邮件必须有效 | | 有效@gmail.com | 成功页面 |
这是我的步骤定义...
/**
* @Given /^I fill in the email field with “(.*)”$/
*/
public function iFillInTheEmailFieldWith($email_value)
{
echo("email =====");
echo($email_value);
}
- 输出是打印标题名称。
它没有得到电子邮件的实际值(例如 invalid@、valid@gmail.com 等),而是给了我文字标题名称<email_value>
。
我在这里做错了什么?请帮忙...
解决方案
欢迎来到 SO。在这里我认为场景文件在这里没有正确写入。下面是正确的方法。您必须在引号中指定列名,"<email_value>"
以便访问步骤 def 中的值。
Feature: verify email Background: Given I am on “https://www.somewebsite.com”
Scenario Outline: Confirm email address
Given I fill in the email field with "<email_value>"
When I submit the form Then I should see "<message>"
Examples:
| email_value | message |
| | email is required |
| invalid@ | email must be valid |
| valid@gmail.com | success page |
推荐阅读
- python - 将 cmd 命令的过滤输出存储在变量中
- excel - 如果匹配一个单元格中的两个文本,则求和值
- java - REST API 的 JSON 响应
- azure - 带有 bot 扩展名的 Azure CLI 状态代码的含义
- angular - 表单输入字段中的 ngModule 是什么
- nginx - 页面部分具有特殊字符(#)的 Nginx 重写 URL 规则
- ssis - ssis用空字符串替换null
- javascript - 打印窗口 - 失去对父页面的控制
- woocommerce - 如何在 woocommerce 中添加多个选项卡?
- javascript - 如何遍历文本并替换特定单词