Permalink
Browse files

Added some safeguard for not found elements in the select tests

  • Loading branch information...
1 parent 59d7ca7 commit eb2d9f2c528ccf09a89bc42df8c2b786c171b794 @stof stof committed May 17, 2014
Showing with 3 additions and 0 deletions.
  1. +3 −0 driver-testsuite/tests/Form/SelectTest.php
@@ -67,6 +67,7 @@ public function testElementSelectedStateCheck($selectName, $optionValue, $option
$session = $this->getSession();
$session->visit($this->pathTo('/multiselect_form.html'));
$select = $session->getPage()->findField($selectName);
+ $this->assertNotNull($select);
$optionValueEscaped = $session->getSelectorsHandler()->xpathLiteral($optionValue);
$option = $select->find('named', array('option', $optionValueEscaped));
@@ -90,6 +91,7 @@ public function testSetValueSingleSelect()
$session = $this->getSession();
$session->visit($this->pathTo('/multiselect_form.html'));
$select = $session->getPage()->findField('select_number');
+ $this->assertNotNull($select);
$select->setValue('10');
$this->assertEquals('10', $select->getValue());
@@ -100,6 +102,7 @@ public function testSetValueMultiSelect()
$session = $this->getSession();
$session->visit($this->pathTo('/multiselect_form.html'));
$select = $session->getPage()->findField('select_multiple_values[]');
+ $this->assertNotNull($select);
$select->setValue(array('1', '2'));
$this->assertEquals(array('1', '2'), $select->getValue());

0 comments on commit eb2d9f2

Please sign in to comment.