UI tests no longer run locally

Hi,

the tests inside the project openmrs-distro-referenceapplication do not run locally at least in my working environment (Pick one of them, right click on it -> Runs as Junit). I receive java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log exception. By looking at the error in the Internet, it may be due to different versions of SLFJ library. I don’t know if it makes sense for us as well, but we have the version 1.6 in distro-referenceapplication and 1.5.6 in contrib-uitestframework.

Details on the error (it is the same regardless of the test, here it’s for AddDeleteLocationTest): classname=“org.openmrs.reference.AddDeleteLocationTest” time=“9.83”> java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133) at org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCookies.java:122) at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:132) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:182) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:144) at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:90) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:160) at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:380) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:128) at org.openmrs.uitestframework.test.TestBase.setupFirefoxDriver(TestBase.java:282) at org.openmrs.uitestframework.test.TestBase.startWebDriver(TestBase.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) 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.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) 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.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) 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.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

java.lang.NullPointerException at org.openmrs.uitestframework.test.TestBase.takeScreenshot(TestBase.java:355) at org.openmrs.uitestframework.test.TestBase$1.failed(TestBase.java:99) at org.junit.rules.TestWatcher.failedQuietly(TestWatcher.java:84) at org.junit.rules.TestWatcher.access$300(TestWatcher.java:46) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:62) 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.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) 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.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Do they run successfully on command line?

No.Before I spent some time by looking at pom.xml then trying to execute the test with maven, if you already know the command, I’d ask you to suggest it. Thank you

Do you find this helpful? https://github.com/openmrs/openmrs-distro-referenceapplication/blob/master/travis_script.sh

Sorry for my late reply. The following command doesn’t execute the tests mvn clean verify -Dmaven.junit.usefile=false -Dwebapp.url=http://localhost:8 080/openmrs

Anyone can help me? Thank you

Build the ci profile with this command: mvn clean install -Pci

Sorry for my late delay, I’m over busy. Tried the commands with no success: mvn clean install -Pci then mvn clean verify -Dmaven.junit.usefile=false -Dwebapp.url=http://localhost:8080/openmrs

Do you know why it is no longer possible to run the test case from Eclipse (run as junit)? It was possible up to 2 months ago,. Thank you in advance. Domenico

I did run that command locally from my terminal and it runs the tests. Did you try running it on command line? mvn clean install -Pci

I’ve checked deeper, the execution of maven gets broken with the error: ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.18.1:integration-test (default) on project referenceapplication-ui-tests: Execution default of goal org.apache.maven.plugins:maven-failsafe-plugin:2.18.1:integration-test failed: java.lang.NoClassDefFoundError: org/openmrs/uitestframework/test/TestBase: org.openmrs.uitestframework.test.TestBase -> [Help 1]

Please, can you tell me how the folders are deployed on your PC? I have a “root” folder: ~/Testing/openmrs within this folder there are other 2 folders: openmrs-distro-referenceapplication openmrs-contrib-uitestframework

When I exectute mvn clean install -Pci I’m on the master branch of the folder referenceapplication. Note: I’ve checked out them in different periods, at that time I was a newbie in this project, likely I mistakenly cloned the above folders in the wrong location. Actually, I’m not sure that the location of the folders is in charge for the error. I guess that referenceapplication should just download and use the files of contrib-uitestframework independently from its location or whatever I’ve it cloned on my PC .

Please, can you also try to execute a test from Eclipse with the “Run as Junit Test” from the menu. Thank you in advance.

@domenico whenever you will get some free time, ping me on IRC and we go through this.

Ok, thank you very much. Maybe today