Laravel TestCase로 정렬 작업이 올바르게 작동하는지 테스트하고 싶습니다. 나는 간단한 테스트 페이지가 있습니다페이지의 elemets의 Laravel 순서
<div id="values">
@foreach(['Value1', 'Value2'] as $value)
<div class="test-class">{{$value}}</div>
@endforeach
</div>
을 그리고 지금은 처음 .test 수준의 요소가 '값 1'가 포함되어있는 경우 테스트하려는. 나는 다른 접근법을 시도했지만 성공하지 못했습니다. 여기에 첫 번째입니다
public function testSorting()
{
$this->visit(route('dummy'));
$this->see('Value1');
$this->seeInElement('.test-class:first-of-type', 'Value2');
}
이 사람은 예외 결과 :
Symfony\Component\CssSelector\Exception\ExpressionErrorException: "*:first-of-type" is not implemented.
가 그럼 난
$this->seeInElement('#values:first-child', 'Value2');
내 테스트 녹색을 시도했다. 그러나 첫 번째 자식이
'값 1'이므로 빨간색이어야합니다. 그것은 완전히
': first-child' 부분을 무시했습니다.
은 그 때 나는
$this->seeInElement('#values:nth-child(1)', 'Value2');
을 시도하고도 녹색 얻었다. 따라서이 방법은 효과가 없습니다.
내가 놓친 것이 있습니까? 아니면 Laravel 테스트를 통해 페이지의 요소 순서를 테스트 할 수있는 방법이 없습니까?