/**
  * @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'));
 }
Esempio n. 3
0
 /**
  * Creates a new element locator.
  *
  * @param Property          $property           Property.
  * @param ISearchContext    $search_context     The context to use when finding the element.
  * @param AnnotationManager $annotation_manager Annotation manager.
  * @param LocatorHelper     $locator_helper     Locator helper.
  */
 public function __construct(Property $property, ISearchContext $search_context, AnnotationManager $annotation_manager, LocatorHelper $locator_helper)
 {
     parent::__construct($property, $search_context, $annotation_manager);
     $this->_helper = $locator_helper;
 }