以下代码:
<div class="row">
<div class=" col-md-4">
<p>Try entering some values for this widget</p>
<form class="form-inline ng-valid ng-dirty" role="form">
<p>This widget is outside of a niwa-big-number-model directive - it should get its values from the form </p>
<div class="big-number content widget green ng-isolate-scope" units="%" value="75" title="Humidity">
<div class="body">
<h1 class="ng-binding">Humidity </h1>
<div class="bigNum ng-binding">
</div>
</div>
</div>
<div class=" col-md-4">
<niwa-big-number-model class="ng-isolate-scope">
<div class="big-number-model"/>
<p class="ng-scope">This widget is fed from a niwa-big-number-model directive</p>
<div class="big-number content widget green ng-scope ng-isolate-scope" units="°C" value="15.5" title="Model Test">
<div class="body">
<h1 class="ng-binding">Model Test </h1>
<div class="bigNum ng-binding">
</div>
</div>
</niwa-big-number-model>
</div>
任务:
我想找到title = Model Test的CSS路径,因为在上面的代码中有多个具有相同名称的类,因此很难获得准确的CSS路径。 我试过的是:
$I->see('Model Test','.bigNum.body:nth-child(2)');
仍然失败 谁能告诉我title = model test的确切CSS路径?
答案 0 :(得分:0)
有很多方法可以获得此功能,具体取决于您的网页上是否有其他重复标记。最简单的一个是:
.big-number-model h1 {}
另一个是:
.big-number-model .body .ng-binding {}
只需查找任何非重复的类,并根据需要添加其他嵌套特异性。 Fiddle so you can play around with it.