我只用过类似 contains()
的东西在我的断言中,所以我不确定如何处理像这样复杂的事情。
假设我有一系列预期答案 - 在本例中是"is"、"is"、“否”。
所以这意味着有效,对于第一个和第二个问题,我希望看到 <span class="glyphicon glyphicon-ok"></span>
第三个里面<td>
对于第三个问题,我希望在第四个 <td>
中看到它.
这是我的 HTML 代码:
<table class="table table-curved">
<tr>
<th width="10%">Item</th>
<th width="60%">Description</th>
<th width="10%">YES</th>
<th width="10%">NO</th>
<th width="10%">NOT APPLICABLE</th>
</tr>
<tr>
<td class="report-table-inner report-centre">1</td>
<td class="report-table-inner">Check cargo is secure and undamaged.</td>
<td class="report-centre success"><span class="glyphicon glyphicon-ok"></span></td>
<td class="report-centre"></td>
<td class="report-centre"></td>
</tr>
<tr>
<td class="report-table-inner report-centre">2</td>
<td class="report-table-inner">Is all cargo accounted for.</td>
<td class="report-centre success"><span class="glyphicon glyphicon-ok"></span></td>
<td class="report-centre"></td>
<td class="report-centre"></td>
</tr>
<tr>
<td class="report-table-inner report-centre">3</td>
<td class="report-table-inner">Is all cargo checked by customs.</td>
<td class="report-centre"></td>
<td class="report-centre danger"><span class="glyphicon glyphicon-ok"></span></td>
<td class="report-centre"></td>
</tr>
...
我应该如何为此编写测试?遍历 <tr>
很难吗?是程序化的吗?
谢谢
最佳答案
关于php - Symfony2 功能测试 - 检查表格内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31868369/