当我运行我的测试时,我想确定是否选择了正确的类别(bn)并在页面上处于活动状态。这是由<li class="active">
. 在我的测试数据中,我将所有产品与每个类别匹配,因此我知道该选项卡何时应该处于活动状态,但我不知道如何断言此正确。任何人都可以帮助我朝着正确的方向前进吗?:)
这是HTML代码:
<div class="tabs">
<h3><span>Hovedkategorier</span></h3>
<div class="content">
<ul class="shortcuts">
<li><a href=""><span class="one"><span class="two">Text 1</span></span></a></li>
<li class="last"><a href="?tag=weekly1"><span class="one"><span class="two">Text 2</span></span></a></li>
</ul>
<ul class="main">
<li><a href="?bn=10000"><span class="one"><span class="two">Text 3</span></span></a></li>
<li><a href="?bn=10306"><span class="one"><span class="two">Text 4</span></span></a></li>
<li><a href="?bn=10723"><span class="one"><span class="two">Text 5</span></span></a></li>
<li class="active"><a href="?bn=10719"><span class="one"><span class="two">Text 6</span></span></a></li>
<li><a href="?bn=10190"><span class="one"><span class="two">Text 7</span></span></a></li>
<li><a href="?bn=10444"><span class="one"><span class="two">Text 8</span></span></a></li>
<li><a href="?bn=10431"><span class="one"><span class="two">Text 9</span></span></a></li>
<li class="last"><a href="?bn=10560"><span class="one"><span class="two">Text 10</span></span></a></li>
</ul>
</div>
</div>