diff options
author | Artur Signell <artur@vaadin.com> | 2015-01-29 11:06:16 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-01-29 14:58:26 +0000 |
commit | 6f0817fbe7ad064b4a7d38db341575f02efc193b (patch) | |
tree | 75c58f98cceabe7a2eeba4832f71833a03e97a59 /uitest | |
parent | 02e920e1a75aaa39b73279dad09b718cf38887b2 (diff) | |
download | vaadin-framework-6f0817fbe7ad064b4a7d38db341575f02efc193b.tar.gz vaadin-framework-6f0817fbe7ad064b4a7d38db341575f02efc193b.zip |
Make tests more reliable
Especially fixes problems with GridStructureTest
Change-Id: Iad0b25fc9cb182940db45af76d47292fd6d1b0bf
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index 15585c7e45..c8ca4c12a1 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -67,6 +67,7 @@ import com.vaadin.testbench.TestBench; import com.vaadin.testbench.TestBenchDriverProxy; import com.vaadin.testbench.TestBenchElement; import com.vaadin.testbench.TestBenchTestCase; +import com.vaadin.testbench.elements.AbstractElement; import com.vaadin.testbench.elements.CheckBoxElement; import com.vaadin.testbench.elements.LabelElement; import com.vaadin.testbench.elements.TableElement; @@ -1332,4 +1333,16 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { checkbox.findElement(By.xpath("input")).click(); } + @Override + public boolean isElementPresent(Class<? extends AbstractElement> clazz) { + // This is a bug in TB4 as isElementPresent(..) should just return true + // or false but can also throw exceptions. The problem is possibly if + // this is run when the Vaadin app is not initialized yet + try { + return super.isElementPresent(clazz); + } catch (NoSuchElementException e) { + return false; + } + } + } |