# Reference Application UI Tests Failures!

**URL:** https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241
**Category:** Development
**Created:** [December 22, 2016, 10:39am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241 "2016-12-22T10:39:30Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [December 22, 2016, 10:39am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/1 "2016-12-22T10:39:31Z")

</div>

Could any one be knowing the cause of these failures? [https://ci.openmrs.org/browse/REFAPP-DUT](https://ci.openmrs.org/browse/REFAPP-DUT)

---

<div class="post-metadata">

### Author: ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)
#### Post date: [December 22, 2016, 11:30am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/2 "2016-12-22T11:30:50Z")

</div>

I have disabled the plan until we have time to look into why the server is not starting up properly. It started to happen after upgrading openmrs-core to 2.x so it may be related.

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [December 22, 2016, 11:58am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/3 "2016-12-22T11:58:57Z")

</div>

Do you mean the upgrade from 2.0.1 to 2.0.2? [https://github.com/openmrs/openmrs-distro-referenceapplication/commit/6922356ec3e9cb45a3c6af8fe5c262f17de6d4e3](https://github.com/openmrs/openmrs-distro-referenceapplication/commit/6922356ec3e9cb45a3c6af8fe5c262f17de6d4e3)

---

<div class="post-metadata">

### Author: ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)
#### Post date: [December 22, 2016, 1:35pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/4 "2016-12-22T13:35:23Z")

</div>

No, the upgrade from 1.x to 2.x… when legacyui module was introduced. It seems to fail to start randomly.

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [January 13, 2017, 2:48pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/5 "2017-01-13T14:48:18Z")

</div>

@raff when do we plan to enable this plan again? Am asking because now some commits are breaking the reference application in ways that some of our existing tests used to catch, but not any more. As an example, [http://int02.openmrs.org/openmrs/](http://int02.openmrs.org/openmrs/) is broken but there is no way of the committer being automatically notified. I think it could be the same reason as to why we did not catch [Registration Summary Page Broken – Reference App](https://talk.openmrs.org/t/registration-summary-page-broken-reference-app/9541) until when @mogoodrich reported it. 🙂

Just on a side note, [https://ci.openmrs.org/browse/SDK-SDK-213](https://ci.openmrs.org/browse/SDK-SDK-213) is broken too.

If travis is the problem, then we can take the tests back to bamboo. 🙂

---

<div class="post-metadata">

### Author: ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)
#### Post date: [January 16, 2017, 11:59am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/6 "2017-01-16T11:59:53Z")

</div>

I don’t think it’s a travis issue. It’s an issue of modules not starting up occasionally when starting a fresh reference application server. I didn’t have time to look into that yet. The misbehavior can be seen e.g. here [https://saucelabs.com/beta/tests/ca1a143afda84356a0347637fd83acaa/watch](https://saucelabs.com/beta/tests/ca1a143afda84356a0347637fd83acaa/watch)

Server logs are supposed to be pasted at the end of [https://travis-ci.org/openmrs/openmrs-distro-referenceapplication/builds/192023595](https://travis-ci.org/openmrs/openmrs-distro-referenceapplication/builds/192023595) but they are not there since we exceeded the log limit (we need to fail tests faster in case of modules not starting up).

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [January 16, 2017, 3:15pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/7 "2017-01-16T15:15:03Z")

</div>

@raff so what is the way forward? 🙂

---

<div class="post-metadata">

### Author: ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)
#### Post date: [January 16, 2017, 3:33pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/8 "2017-01-16T15:33:07Z")

</div>

Either me finding time to look into those failures or someone else (I think @adamg from [@SolDevelo](https://talk.openmrs.org/groups/SolDevelo) tried at some point, but with no avail). Basically one needs to configure ALL tests to fail fast in case no login screen shows up and then look at Tomcat logs to see why modules do not start up.

If it involves me then it needs to wait until next Monday.

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [January 16, 2017, 5:53pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/9 "2017-01-16T17:53:41Z")

</div>

@raff if am to help or any one else, can you give us some pointers? Like where the server logs are, or anything else you think would be useful.

---

<div class="post-metadata">

### Author: ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)
#### Post date: [January 17, 2017, 10:35am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/10 "2017-01-17T10:35:54Z")

</div>

@dkayiwa, perfect. As I wrote in my previous post Tomcat logs should be appended in build logs on Travis, however our tests get stuck and produce too much output, which exceed build log limit of 4 MBs on Travis.

Therefore, we first need to fix things so that tests fail fast when server is not properly initialized. I attempted to do it at [https://github.com/openmrs/openmrs-contrib-uitestframework/commit/ff4db0069ac4b4fbfec7868433e9d144a442675f](https://github.com/openmrs/openmrs-contrib-uitestframework/commit/ff4db0069ac4b4fbfec7868433e9d144a442675f) but for some reason you can still see in logs that they are being rerun too many times…

Once you fix tests to fail fast in a scenario when server is not properly up, then you will see Tomcat logs being appended by Travis at the end of build log and hopefully see why modules don’t start.

@domenico may be able to help with the issue as well.

---

<div class="post-metadata">

### Author: ![domenico](https://talk.openmrs.org/letter_avatar/domenico/32/5_5575768a8748004e209b776fc1b2916d.png) [@domenico](https://talk.openmrs.org/u/domenico)
#### Post date: [January 17, 2017, 11:02am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/11 "2017-01-17T11:02:21Z")

</div>

Ok guys I can help you, but give me some time since I have hard work to do during this week.

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [January 17, 2017, 8:12pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/12 "2017-01-17T20:12:14Z")

</div>

For now, i have enabled the bamboo plan to run these tests, but disabled the provider test which fails as per the details at [https://issues.openmrs.org/browse/RA-1200](https://issues.openmrs.org/browse/RA-1200)

---

<div class="post-metadata">

### Author: ![domenico](https://talk.openmrs.org/letter_avatar/domenico/32/5_5575768a8748004e209b776fc1b2916d.png) [@domenico](https://talk.openmrs.org/u/domenico)
#### Post date: [January 19, 2017, 3:11pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/13 "2017-01-19T15:11:33Z")

</div>

I have a guess about why the tests do not fail fast. Is it possible to visualize the page with the text “If you are seeing this page, it means that the OpenMRS Platform is running” somewhere on the integration server? Basically I’d like to reproduce Rafal conditions. Thank you.

---

<div class="post-metadata">

### Author: ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)
#### Post date: [January 19, 2017, 3:15pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/14 "2017-01-19T15:15:17Z")

</div>

I guess your best bet is to run the server with platform 2.0.1 locally without any modules… The easiest way is to setup a platform with SDK… see [https://wiki.openmrs.org/display/docs/OpenMRS+SDK#OpenMRSSDK-Settingupservers](https://wiki.openmrs.org/display/docs/OpenMRS+SDK#OpenMRSSDK-Settingupservers)

---

<div class="post-metadata">

### Author: ![domenico](https://talk.openmrs.org/letter_avatar/domenico/32/5_5575768a8748004e209b776fc1b2916d.png) [@domenico](https://talk.openmrs.org/u/domenico)
#### Post date: [January 21, 2017, 11:56pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/15 "2017-01-21T23:56:31Z")

</div>

Rafal,

I’m trying to install OpenMRS, but I got a [problem](https://talk.openmrs.org/t/database-driver-class-was-not-found/9675). Regarding your issue, what I guess it does not work properly is the following method which returns false even if it should return true.

```
public boolean containsTextWithoutWait(String text) {
return driver.getPageSource().contains(text);
}

```

Some users report of a [problem](http://stackoverflow.com/questions/19358658/selenium-driver-getpagesource-differs-than-the-source-viewed-from-browser) with getPageSource. Maybe here we have the same issue, unfortunately I can’t verify my hypothesis. I hope to make OpenMRS work asap and provides your with a solution.

---

<div class="post-metadata">

### Author: ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)
#### Post date: [January 23, 2017, 10:52am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/16 "2017-01-23T10:52:59Z")

</div>

@domenico, I replied to the problem you reported. We need to change the condition to use something different than getPageSource() then…

---

<div class="post-metadata">

### Author: ![domenico](https://talk.openmrs.org/letter_avatar/domenico/32/5_5575768a8748004e209b776fc1b2916d.png) [@domenico](https://talk.openmrs.org/u/domenico)
#### Post date: [January 23, 2017, 11:04am UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/17 "2017-01-23T11:04:31Z")

</div>

Yes, but I have to verify if my guess is correct.

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [January 23, 2017, 2:43pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/18 "2017-01-23T14:43:56Z")

</div>

@raff as we figure out how to append tomcat logs to the build logs on travis, how can i get access to the source tomcat logs? That will help me figure out why the current tests fail. In other words, can i access the tomcat logs as i used to, when the tests were running on our bamboo server?

---

<div class="post-metadata">

### Author: ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)
#### Post date: [January 24, 2017, 4:05pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/19 "2017-01-24T16:05:38Z")

</div>

@dkayiwa, I’ve committed [https://github.com/openmrs/openmrs-contrib-uitestframework/commit/7ade6b9910c482647749231309867c4c5d511258](https://github.com/openmrs/openmrs-contrib-uitestframework/commit/7ade6b9910c482647749231309867c4c5d511258) so that when we have a server failure, no other tests will run. You can see that Tomcat logs are now appended at the end of the travis log file at [https://travis-ci.org/openmrs/openmrs-distro-referenceapplication/builds/194852568](https://travis-ci.org/openmrs/openmrs-distro-referenceapplication/builds/194852568) (expand travis\_after\_script.sh)

Currently, the build is passing. We’ll need to wait for a server failure to see if my fix works and then we can look at Tomcat logs.

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [January 24, 2017, 7:43pm UTC](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241/20 "2017-01-24T19:43:58Z")

</div>

Thanks @raff 😄

[Next page](https://talk.openmrs.org/t/reference-application-ui-tests-failures/9241.md?page=2)
