Broken UI tests in the refapp CI build

The refapp has had some broken tests for a very long time.

Does anyone have time to look into this?

https://ci.openmrs.org/browse/REFAPP-OMODDISTRO-3493#existing-failed-tests

Thanks @tmueller for fixing this!

The QA team wanted to get some publicity :wink:

They are currently working on automating test cases. I’m very excited to see it happening! Thanks guys!

Sorry it took so long to fix those tests, but it’s the part of the learning process. Hopefully we will see less failures on CI running tests locally first.

Btw @tmueller / @natalia, could you please start a new thread and list test cases that you intend to automate in the next few days so we can review them?

More information:

Right now, the registrationApp is not starting on devtest01, which causes CI build to fail

I can see, that after my latest changes the CI build is failing again, although I can’t see any direct relation between them and the reason of failure. Something seems to be wrong with the ‘OBS’ table:

org.dbunit.database.AmbiguousTableNameException: OBS
	at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:198)
	at org.dbunit.database.QueryDataSet.addTable(QueryDataSet.java:93)
	at org.openmrs.uitestframework.test.TestBase.deletePatient(TestBase.java:378)
	at org.openmrs.uitestframework.test.TestBase.deletePatient(TestBase.java:360)
	at org.openmrs.reference.VisitTest.tearDown(VisitTest.java:35)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

Some problems with registering a patient appeared. I created an issue here:

I guess I just caused a hanging CI build:( The fix is already commited, but someone needs to stop the current build…

Fixed. https://ci.openmrs.org/browse/REFAPP-OMODDISTRO-3522 Thanks @tmueller!

It hangs again:( Looks like it’s some random issue as I don’t see any direct influence of my latest changes on this…

Is it possible that it hangs waiting for some page element indefinitely? Do you recall adding a piece of code that could misbehave that way?

The waitForElement function that i use for waiting for page elements should throw a TimeoutException after waiting too long, shouldn’t it? It is used in few places in the hanging test, but it has been there before, and caused no trouble. And the next build with no changes in code didn’t hang, but failed, so I believe the reason of hanging is something more complicated…