/** * @dataProvider getSelectorFailureDataProvider * * @expectedException \QATools\QATools\PageObject\Exception\AnnotationException * @expectedExceptionCode \QATools\QATools\PageObject\Exception\AnnotationException::TYPE_REQUIRED * @expectedExceptionMessage @find-by must be specified in the property "OK" DocBlock or in class "PageClass" DocBlock */ public function testGetSelectorFailure($annotations) { $this->property->shouldReceive('__toString')->andReturn('OK'); $this->property->shouldReceive('getDataType')->andReturn('PageClass'); $this->property->shouldReceive('getAnnotationsFromPropertyOrClass')->with('@find-by')->andReturn($annotations); $this->assertCount(0, $this->locator->findAll()); }
/** * Find the element list. * * @return NodeElement[] */ public function findAll() { if ($this->timeout == 0) { return parent::findAll(); } return $this->searchContext->waitFor($this->timeout, array($this, 'parent::findAll')); }