Errors in running e2e tests locally on fedora

I am working on issue #9916.
As described in parent issue I tried running e2e tests on my local machine using the command npm run wdio-visual-desktop.
I am not sure if webdriverIO requires any setup before running e2e tests.
I have the dev server running.

12:45 ~/cht-core $ npm run wdio-visual-desktop

> medic@4.18.0 wdio-visual-desktop
> export VERSION=$(node ./scripts/build/get-version.js) && ./scripts/build/build-service-images.sh && wdio run ./tests/e2e/visual/wdio.conf.js --suite=desktopTests


### removed irrelevant npm and docker logs ###


Execution of 2 workers started at 2025-04-28T07:17:30.510Z

docker compose -f /home/rajeevt/cht-core/tests/cht-core-test.yml -f /home/rajeevt/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes


docker compose -f /home/rajeevt/cht-core/tests/cht-core-test.yml -f /home/rajeevt/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e up -d
 Network cht-net-e2e  Creating
 Network cht-net-e2e  Created
 Volume "cht-e2e_cht-credentials"  Creating
 Volume "cht-e2e_cht-credentials"  Created
 Volume "cht-e2e_cht-ssl"  Creating
 Volume "cht-e2e_cht-ssl"  Created
 Container cht-e2e-couchdb-2.local-1  Creating
 Container cht-e2e-couchdb-3.local-1  Creating
 Container cht-e2e-haproxy-1  Creating
 Container cht-e2e-couchdb-1.local-1  Creating
 Container cht-e2e-healthcheck-1  Creating
 Container cht-e2e-couchdb-3.local-1  Created
 Container cht-e2e-couchdb-2.local-1  Created
 Container cht-e2e-haproxy-1  Created
 Container cht-e2e-healthcheck-1  Created
 Container cht-e2e-api-1  Creating
 Container cht-e2e-sentinel-1  Creating
 Container cht-e2e-couchdb-1.local-1  Created
 Container cht-e2e-api-1  Created
 Container cht-e2e-nginx-1  Creating
 Container cht-e2e-sentinel-1  Created
 Container cht-e2e-nginx-1  Created
 Container cht-e2e-couchdb-3.local-1  Starting
 Container cht-e2e-healthcheck-1  Starting
 Container cht-e2e-couchdb-2.local-1  Starting
 Container cht-e2e-couchdb-1.local-1  Starting
 Container cht-e2e-haproxy-1  Starting
 Container cht-e2e-couchdb-3.local-1  Started
 Container cht-e2e-healthcheck-1  Started
 Container cht-e2e-couchdb-2.local-1  Started
 Container cht-e2e-couchdb-1.local-1  Started
 Container cht-e2e-haproxy-1  Started
 Container cht-e2e-api-1  Starting
 Container cht-e2e-sentinel-1  Starting
 Container cht-e2e-sentinel-1  Started
 Container cht-e2e-api-1  Started
 Container cht-e2e-nginx-1  Starting
 Container cht-e2e-nginx-1  Started


docker compose -f /home/rajeevt/cht-core/tests/cht-core-test.yml -f /home/rajeevt/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e ps -q

97394904ea5e1a94096be388b275acd70832eca9808c48b2d729f10eba4e5dcc
4b602c6ce76c4738a6f92c197d87324b5406823689bb403ab0ac39353e118bb8
fbf983b7c01057702355355248f8ebb8ab57a508984e073799fb5e06e3c3f6da
a67150b4b16a28ebe738413e41529d8b8c4be27964faf3f9c544965c998a788b
f27f836aaea84f69b261f4eb8a1ae6c553d977570a416dc6d4074c54c1b81a57
54faf6f6a8391d6041b725ce3e47d00cde54c185f1494997e52440e043d24185
160fd69cf84d45c4d8ab7d97f8de2227c0ca027676d03c33fd77eb0a5d31c9f5
55b8482f41bed588433992763d46abfd7aa334255a858f7eb6f48d273d16e66c

Checking API, retries left 180
(node:70830) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 179
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 178
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 177

### same error multiple time ###

Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 2
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 1
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
2025-04-28T07:20:33.236Z ERROR @wdio/cli:utils: Error in hook: Error: API failed to start after 3 minutes
    at listenForApi (/home/rajeevt/cht-core/tests/utils/index.js:906:9)
    at async Object.prepServices (/home/rajeevt/cht-core/tests/utils/index.js:1322:3)
    at async Object.onPrepare (/home/rajeevt/cht-core/tests/wdio.conf.js:229:5)
    at async Promise.all (index 0)
    at async Launcher.run (file:///home/rajeevt/cht-core/node_modules/@wdio/cli/build/launcher.js:92:13)
[0-0] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-0] Error with request: POST https://localhost/medic-test/_bulk_docs 502
[0-0] Error in "Contact and User Management."before all" hook: wrappedHook in "Contact and User Management""
Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
    at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
    at async Object.saveDocs (/home/rajeevt/cht-core/tests/utils/index.js:314:19)
    at async Context.<anonymous> (/home/rajeevt/cht-core/tests/e2e/visual/contacts/contact-user-management.wdio-spec.js:42:5)
[0-0] Error with request: POST https://localhost/_users/_all_docs 502
[0-0] Error in "Contact and User Management."after all" hook: wrappedHook in "Contact and User Management""
Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
    at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
    at async Object.deleteUsers (/home/rajeevt/cht-core/tests/utils/index.js:803:20)
    at async Context.<anonymous> (/home/rajeevt/cht-core/tests/e2e/visual/contacts/contact-user-management.wdio-spec.js:50:5)
[0-0] Error with request: GET https://localhost/_users/_all_docs?start_key="org.couchdb.user:" 502
[0-0] 2025-04-28T07:21:04.785Z ERROR @wdio/utils:shim: Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[0-0]     at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
[0-0]     at async Object.getCreatedUsers (/home/rajeevt/cht-core/tests/utils/index.js:837:17)
[0-0]     at async Object.after (/home/rajeevt/cht-core/tests/wdio.conf.js:338:19)
[0-0]     at async Promise.all (index 0)
[0-0]     at async executeHooksWithArgs (file:///home/rajeevt/cht-core/node_modules/@wdio/utils/build/shim.js:68:20)
[0-0]     at async MochaAdapter.run (file:///home/rajeevt/cht-core/node_modules/@wdio/mocha-framework/build/index.js:113:9)
[0-0]     at async Runner.run (file:///home/rajeevt/cht-core/node_modules/@wdio/runner/build/index.js:157:24)
[0-0] FAILED in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-1] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[0-1] Error with request: GET https://localhost/medic-test/org.couchdb.user:admin 502
[0-1] Error in "Creating and editing contacts and users."before all" hook: wrappedHook for "should create health facility, chw area and chw chw supervisor and chw user""
Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
    at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
    at async Object.cookieLogin (/home/rajeevt/cht-core/tests/page-objects/default/login/login.wdio.page.js:81:5)
    at async Context.<anonymous> (/home/rajeevt/cht-core/tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js:17:5)
[0-1] Error with request: GET https://localhost/medic-test/_all_docs?include_docs=true 502
[0-1] Error in "Creating and editing contacts and users."after all" hook: wrappedHook for "should create health facility, chw area and chw chw supervisor and chw user""
Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
    at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
    at async Object.revertDb (/home/rajeevt/cht-core/tests/utils/index.js:741:3)
    at async Context.<anonymous> (/home/rajeevt/cht-core/tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js:22:5)
[0-1] Error with request: GET https://localhost/_users/_all_docs?start_key="org.couchdb.user:" 502
[0-1] 2025-04-28T07:21:08.560Z ERROR @wdio/utils:shim: Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[0-1]     at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
[0-1]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
[0-1]     at async Object.getCreatedUsers (/home/rajeevt/cht-core/tests/utils/index.js:837:17)
[0-1]     at async Object.after (/home/rajeevt/cht-core/tests/wdio.conf.js:338:19)
[0-1]     at async Promise.all (index 0)
[0-1]     at async executeHooksWithArgs (file:///home/rajeevt/cht-core/node_modules/@wdio/utils/build/shim.js:68:20)
[0-1]     at async MochaAdapter.run (file:///home/rajeevt/cht-core/node_modules/@wdio/mocha-framework/build/index.js:113:9)
[0-1]     at async Runner.run (file:///home/rajeevt/cht-core/node_modules/@wdio/runner/build/index.js:157:24)
[0-1] FAILED in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
docker compose -f /home/rajeevt/cht-core/tests/cht-core-test.yml -f /home/rajeevt/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes
 Container cht-e2e-nginx-1  Stopping
 Container cht-e2e-healthcheck-1  Stopping
 Container cht-e2e-couchdb-3.local-1  Stopping
 Container cht-e2e-sentinel-1  Stopping
 Container cht-e2e-couchdb-1.local-1  Stopping
 Container cht-e2e-couchdb-2.local-1  Stopping
 Container cht-e2e-couchdb-1.local-1  Stopped
 Container cht-e2e-couchdb-1.local-1  Removing
 Container cht-e2e-couchdb-1.local-1  Removed
 Container cht-e2e-couchdb-2.local-1  Stopped
 Container cht-e2e-couchdb-2.local-1  Removing
 Container cht-e2e-couchdb-2.local-1  Removed
 Container cht-e2e-healthcheck-1  Stopped
 Container cht-e2e-healthcheck-1  Removing
 Container cht-e2e-healthcheck-1  Removed
 Container cht-e2e-couchdb-3.local-1  Stopped
 Container cht-e2e-couchdb-3.local-1  Removing
 Container cht-e2e-couchdb-3.local-1  Removed
 Container cht-e2e-nginx-1  Stopped
 Container cht-e2e-nginx-1  Removing
 Container cht-e2e-nginx-1  Removed
 Container cht-e2e-api-1  Stopping
 Container cht-e2e-api-1  Stopped
 Container cht-e2e-api-1  Removing
 Container cht-e2e-sentinel-1  Stopped
 Container cht-e2e-sentinel-1  Removing
 Container cht-e2e-api-1  Removed
 Container cht-e2e-sentinel-1  Removed
 Container cht-e2e-haproxy-1  Stopping
 Container cht-e2e-haproxy-1  Stopped
 Container cht-e2e-haproxy-1  Removing
 Container cht-e2e-haproxy-1  Removed
 Volume cht-e2e_cht-credentials  Removing
 Volume cht-e2e_cht-ssl  Removing
 Network cht-net-e2e  Removing
 Volume cht-e2e_cht-credentials  Removed
 Volume cht-e2e_cht-ssl  Removed
 Network cht-net-e2e  Removed


Report successfully generated to allure-report
Allure report successfully generated

 "spec" Reporter:
------------------------------------------------------------------
[chrome 135.0.7049.114 linux #0-0] Running: chrome (v135.0.7049.114) on linux
[chrome 135.0.7049.114 linux #0-0] Session ID: 1a2218b0e5e1991ab518672c84aa6d3e
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] » /tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[chrome 135.0.7049.114 linux #0-0] Contact and User Management
[chrome 135.0.7049.114 linux #0-0]    ✖ "before all" hook for Contact and User Management
[chrome 135.0.7049.114 linux #0-0]    ✖ "after all" hook for Contact and User Management
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] 2 failing (108ms)
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] 1) Contact and User Management "before all" hook for Contact and User Management
[chrome 135.0.7049.114 linux #0-0] 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[chrome 135.0.7049.114 linux #0-0] Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[chrome 135.0.7049.114 linux #0-0]     at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
[chrome 135.0.7049.114 linux #0-0]     at async Object.saveDocs (/home/rajeevt/cht-core/tests/utils/index.js:314:19)
[chrome 135.0.7049.114 linux #0-0]     at async Context.<anonymous> (/home/rajeevt/cht-core/tests/e2e/visual/contacts/contact-user-management.wdio-spec.js:42:5)
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] 2) Contact and User Management "after all" hook for Contact and User Management
[chrome 135.0.7049.114 linux #0-0] 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[chrome 135.0.7049.114 linux #0-0] Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[chrome 135.0.7049.114 linux #0-0]     at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
[chrome 135.0.7049.114 linux #0-0]     at async Object.deleteUsers (/home/rajeevt/cht-core/tests/utils/index.js:803:20)
[chrome 135.0.7049.114 linux #0-0]     at async Context.<anonymous> (/home/rajeevt/cht-core/tests/e2e/visual/contacts/contact-user-management.wdio-spec.js:50:5)
------------------------------------------------------------------
[chrome 135.0.7049.114 linux #0-1] Running: chrome (v135.0.7049.114) on linux
[chrome 135.0.7049.114 linux #0-1] Session ID: 07a1fe70aec39d23b7074645062303d3
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] » /tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[chrome 135.0.7049.114 linux #0-1] Creating and editing contacts and users
[chrome 135.0.7049.114 linux #0-1]    ✖ "before all" hook for Creating and editing contacts and users
[chrome 135.0.7049.114 linux #0-1]    ✖ "after all" hook for Creating and editing contacts and users
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] 2 failing (123ms)
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] 1) Creating and editing contacts and users "before all" hook for Creating and editing contacts and users
[chrome 135.0.7049.114 linux #0-1] 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[chrome 135.0.7049.114 linux #0-1] Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[chrome 135.0.7049.114 linux #0-1]     at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
[chrome 135.0.7049.114 linux #0-1]     at async Object.cookieLogin (/home/rajeevt/cht-core/tests/page-objects/default/login/login.wdio.page.js:81:5)
[chrome 135.0.7049.114 linux #0-1]     at async Context.<anonymous> (/home/rajeevt/cht-core/tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js:17:5)
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] 2) Creating and editing contacts and users "after all" hook for Creating and editing contacts and users
[chrome 135.0.7049.114 linux #0-1] 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[chrome 135.0.7049.114 linux #0-1] Error: 502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
[chrome 135.0.7049.114 linux #0-1]     at request (/home/rajeevt/cht-core/tests/utils/index.js:242:15)
[chrome 135.0.7049.114 linux #0-1]     at async Object.revertDb (/home/rajeevt/cht-core/tests/utils/index.js:741:3)
[chrome 135.0.7049.114 linux #0-1]     at async Context.<anonymous> (/home/rajeevt/cht-core/tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js:22:5)


Spec Files:	 0 passed, 2 failed, 2 total (100% completed) in 00:03:41  

hey @rajeevtapadia are all the processes running in different 3 terminals mentioned in documentation?

Hi @rajeevtapadia, thanks for the detailed logs!

It looks like the main issue is that the API inside the e2e test environment isn’t coming up properly — you’re getting repeated 502 Bad Gateway errors from nginx when trying to connect.

One thing to check first: make sure you are not running the dev server when starting the e2e tests.
The npm run wdio-visual-desktop command automatically sets up its own test environment with Docker containers. If you have the dev environment running at the same time, it can cause conflicts.

Can you try stopping your dev server completely, and then running npm run wdio-visual-desktop again?

If you still see issues after that, we can dig deeper — but trying with the dev server stopped is the first thing I’d recommend.

Let us know how it goes!

3 Likes

Hey @Lorena_Rodriguez in my case it is showing 502 bad gateway error but due to many retry mechanisms implemented it will be going to get connected after some failure so it’s expected to see that nginx error at first but eventually it will get connected.

I think @rajeevtapadia is going through some other issues at this moment.

1 Like

Logs when I run the same tests:


> medic@4.18.0 wdio-visual-desktop
> export VERSION=$(node ./scripts/build/get-version.js) && ./scripts/build/build-service-images.sh && wdio run ./tests/e2e/visual/wdio.conf.js --suite=desktopTests

build-service-images: running
copy-static-files: copying
copy-static-files: done
cleancss-api: cleaning
cleancss-api: done
copying modules to working directory
installing modules

> medic@4.18.0 postinstall
> patch-package

patch-package 8.0.0
Applying patches...
prometheus-api-metrics@3.2.2 ✔

> medic@4.18.0 prepare
> husky

.git can't be found
added 651 packages, and audited 679 packages in 5s

109 packages are looking for funding
  run `npm fund` for details

6 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
working directory /tmp/tmp.qLnq6Kx5Kj


Building docker image for api medicmobile/cht-api:replace-db-object-appearance-with-select-contact




Building docker image for sentinel medicmobile/cht-sentinel:replace-db-object-appearance-with-select-contact




Building docker image for couchdb




Building docker image for haproxy




Building docker image for haproxy-healthcheck




Building docker image for nginx


build-service-images: done

Execution of 2 workers started at 2025-04-28T14:10:01.965Z

docker compose -f /home/apoorva/programming/cht-core/tests/cht-core-test.yml -f /home/apoorva/programming/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes

docker compose -f /home/apoorva/programming/cht-core/tests/cht-core-test.yml -f /home/apoorva/programming/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e up -d

docker compose -f /home/apoorva/programming/cht-core/tests/cht-core-test.yml -f /home/apoorva/programming/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e ps -q
c94293362065a9fb9427fa83cb5d6656841cb3b42be903dab5d26bff30fc8789
7179d6082771aff397f036c4037baf921d0cdf809e7eb9b6400449f71ed80f08
6a519b1bca7966f7599c808ede90afbb69f995dbc151dbfd49100e54daa4343d
3619c7d0558dd0dd78bb16cd7aa92d5d4d43197a562242e08eebcc3e31b19d58
bab7cf76daf77a5bbcb0ea50f57dd2d9b596a829f96c7ad6a259245d595b789a
7fdd7ad4d13f37bc620a17734cedcb5d28b349b87c3186c5620ded24f9fe4576
a539a0e043331c135828fd3b645e60e43b04fecfb275fdb233cae81c111d3451
ed6dca072ebd5be453c23437254c6f78d82bf3045c205c2ae371e0caf12871b9

Checking API, retries left 180
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 179
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 178
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 177
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 176
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 175
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 174
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 173
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 172
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 171
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 170
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 169
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 168
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 167
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 166
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 165
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 164
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 163
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 162
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 161
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 160
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 159
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 158
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 157
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 156
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 155
API startup: User contact doc setup
API startup: Getting default forms
[0-0] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-0] Error in "Contact and User Management.Contact and user overview.should show contacts list, search, profiles (person and family), contact summary"
Error: ./tests/e2e/visual/images/people-list-desktop.png: unable to open for write
unix error: No such file or directory
    at Sharp.toFile (/home/apoorva/programming/cht-core/node_modules/sharp/lib/output.js:90:19)
    at generateScreenshot (/home/apoorva/programming/cht-core/tests/utils/screenshots.js:69:25)
    at async Context.<anonymous> (/home/apoorva/programming/cht-core/tests/e2e/visual/contacts/contact-user-management.wdio-spec.js:64:7)
[0-0] FAILED in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-1] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[0-1] Error in "Creating and editing contacts and users.should create health facility, chw area and chw chw supervisor and chw user"
Error: ./tests/e2e/visual/images/new-facility-select-new-facility-desktop.png: unable to open for write
unix error: No such file or directory
    at Sharp.toFile (/home/apoorva/programming/cht-core/node_modules/sharp/lib/output.js:90:19)
    at generateScreenshot (/home/apoorva/programming/cht-core/tests/utils/screenshots.js:69:25)
    at async Context.<anonymous> (/home/apoorva/programming/cht-core/tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js:32:5)
[0-1] FAILED in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
docker compose -f /home/apoorva/programming/cht-core/tests/cht-core-test.yml -f /home/apoorva/programming/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes

Report successfully generated to allure-report
Allure report successfully generated

 "spec" Reporter:
------------------------------------------------------------------
[chrome 135.0.7049.114 linux #0-0] Running: chrome (v135.0.7049.114) on linux
[chrome 135.0.7049.114 linux #0-0] Session ID: a918dafb417158114ed58536116f770f
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] » /tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[chrome 135.0.7049.114 linux #0-0] Contact and User Management
[chrome 135.0.7049.114 linux #0-0]     Contact and user overview
[chrome 135.0.7049.114 linux #0-0]        ✖ should show contacts list, search, profiles (person and family), contact summary (5 retries)
[chrome 135.0.7049.114 linux #0-0]        ? should show condition cards
[chrome 135.0.7049.114 linux #0-0]        - should show condition cards
[chrome 135.0.7049.114 linux #0-0]        ? should show profiles (area and branch)
[chrome 135.0.7049.114 linux #0-0]        - should show profiles (area and branch)
[chrome 135.0.7049.114 linux #0-0]        ? should show UHC sort
[chrome 135.0.7049.114 linux #0-0]        - should show UHC sort
[chrome 135.0.7049.114 linux #0-0]        ? should show cares guides
[chrome 135.0.7049.114 linux #0-0]        - should show cares guides
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] 1 failing (48.5s)
[chrome 135.0.7049.114 linux #0-0] 4 skipped
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] 1) Contact and user overview should show contacts list, search, profiles (person and family), contact summary
[chrome 135.0.7049.114 linux #0-0] ./tests/e2e/visual/images/people-list-desktop.png: unable to open for write
unix error: No such file or directory
[chrome 135.0.7049.114 linux #0-0] Error: ./tests/e2e/visual/images/people-list-desktop.png: unable to open for write
[chrome 135.0.7049.114 linux #0-0] unix error: No such file or directory
[chrome 135.0.7049.114 linux #0-0]     at Sharp.toFile (/home/apoorva/programming/cht-core/node_modules/sharp/lib/output.js:90:19)
[chrome 135.0.7049.114 linux #0-0]     at generateScreenshot (/home/apoorva/programming/cht-core/tests/utils/screenshots.js:69:25)
[chrome 135.0.7049.114 linux #0-0]     at async Context.<anonymous> (/home/apoorva/programming/cht-core/tests/e2e/visual/contacts/contact-user-management.wdio-spec.js:64:7)
------------------------------------------------------------------
[chrome 135.0.7049.114 linux #0-1] Running: chrome (v135.0.7049.114) on linux
[chrome 135.0.7049.114 linux #0-1] Session ID: 1dce53beab1083fbb0caf56a1369b4f7
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] » /tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[chrome 135.0.7049.114 linux #0-1] Creating and editing contacts and users
[chrome 135.0.7049.114 linux #0-1]    ✖ should create health facility, chw area and chw chw supervisor and chw user (5 retries)
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] 1 failing (13.9s)
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] 1) Creating and editing contacts and users should create health facility, chw area and chw chw supervisor and chw user
[chrome 135.0.7049.114 linux #0-1] ./tests/e2e/visual/images/new-facility-select-new-facility-desktop.png: unable to open for write
unix error: No such file or directory
[chrome 135.0.7049.114 linux #0-1] Error: ./tests/e2e/visual/images/new-facility-select-new-facility-desktop.png: unable to open for write
[chrome 135.0.7049.114 linux #0-1] unix error: No such file or directory
[chrome 135.0.7049.114 linux #0-1]     at Sharp.toFile (/home/apoorva/programming/cht-core/node_modules/sharp/lib/output.js:90:19)
[chrome 135.0.7049.114 linux #0-1]     at generateScreenshot (/home/apoorva/programming/cht-core/tests/utils/screenshots.js:69:25)
[chrome 135.0.7049.114 linux #0-1]     at async Context.<anonymous> (/home/apoorva/programming/cht-core/tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js:32:5)


Spec Files:	 0 passed, 2 failed, 2 total (100% completed) in 00:01:46  


hey @apoorvapendse you have to create a images directory inside /tests/e2e/visual location

1 Like

Yes, that might be it based on this:

Error: ./tests/e2e/visual/images/people-list-desktop.png: unable to open for write
unix error: No such file or directory

Update:
Creating the images dir worked.
Thanks @shashi_sah!

Here are the logs for a successful run:


> medic@4.18.0 wdio-visual-desktop
> export VERSION=$(node ./scripts/build/get-version.js) && ./scripts/build/build-service-images.sh && wdio run ./tests/e2e/visual/wdio.conf.js --suite=desktopTests

build-service-images: running
copy-static-files: copying
copy-static-files: done
cleancss-api: cleaning
cleancss-api: done
copying modules to working directory
installing modules

> medic@4.18.0 postinstall
> patch-package

patch-package 8.0.0
Applying patches...
prometheus-api-metrics@3.2.2 ✔

> medic@4.18.0 prepare
> husky

.git can't be found
added 651 packages, and audited 679 packages in 5s

109 packages are looking for funding
  run `npm fund` for details

6 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
working directory /tmp/tmp.swlJrkaJwQ


Building docker image for api medicmobile/cht-api:master




Building docker image for sentinel medicmobile/cht-sentinel:master




Building docker image for couchdb




Building docker image for haproxy




Building docker image for haproxy-healthcheck




Building docker image for nginx


build-service-images: done

Execution of 2 workers started at 2025-04-28T14:40:14.040Z

docker compose -f /home/apoorva/programming/cht-core/tests/cht-core-test.yml -f /home/apoorva/programming/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes

docker compose -f /home/apoorva/programming/cht-core/tests/cht-core-test.yml -f /home/apoorva/programming/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e up -d

docker compose -f /home/apoorva/programming/cht-core/tests/cht-core-test.yml -f /home/apoorva/programming/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e ps -q
35018ecc32e1490c03f1a48b14da868b14568f23d8ba87180da5256fc016d904
05dee64f486224cf80c944bc5990c99bb67e0b37458890e5477f1374e4f26d26
37b9144506457e8d0262c1708b1012d3ec680138db7b05f4131d07f3b25f1dc9
d38cf125e7fbe26d58f5010fa7aaf0a63d0b570e71daca34442f288adc61ecb6
4095197583aaaefac4521fc40476b3decff90702642b491a625f6541b5a80a0a
5237511e680999b4b500059260025a5f4e96da5add130054ccffe4d0f5219e0c
45493578d2d8287b3f930528e422f3e2c4ce649f12632d59d89d4ed631e7c1e0
b78a6a10152add6527c7526d4fa18527978b431f6c9a27567c2fe83cc75244bd

Checking API, retries left 180
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 179
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 178
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 177
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 176
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 175
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 174
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 173
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 172
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 171
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 170
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 169
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 168
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 167
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 166
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 165
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 164
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 163
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 162
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 161
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 160
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 159
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 158
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 157
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 156
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 155
API startup: User contact doc setup
API startup: Getting default forms
[0-0] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-0] PASSED in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-1] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[0-1] PASSED in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
docker compose -f /home/apoorva/programming/cht-core/tests/cht-core-test.yml -f /home/apoorva/programming/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes

Report successfully generated to allure-report
Allure report successfully generated

 "spec" Reporter:
------------------------------------------------------------------
[chrome 135.0.7049.114 linux #0-0] Running: chrome (v135.0.7049.114) on linux
[chrome 135.0.7049.114 linux #0-0] Session ID: 35b92ad4ed5068e0368739b9ae3c3a5f
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] » /tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[chrome 135.0.7049.114 linux #0-0] Contact and User Management
[chrome 135.0.7049.114 linux #0-0]     Contact and user overview
[chrome 135.0.7049.114 linux #0-0]        ✓ should show contacts list, search, profiles (person and family), contact summary
[chrome 135.0.7049.114 linux #0-0]        ? should show condition cards
[chrome 135.0.7049.114 linux #0-0]        - should show condition cards
[chrome 135.0.7049.114 linux #0-0]        ? should show profiles (area and branch)
[chrome 135.0.7049.114 linux #0-0]        - should show profiles (area and branch)
[chrome 135.0.7049.114 linux #0-0]        ? should show UHC sort
[chrome 135.0.7049.114 linux #0-0]        - should show UHC sort
[chrome 135.0.7049.114 linux #0-0]        ? should show cares guides
[chrome 135.0.7049.114 linux #0-0]        - should show cares guides
[chrome 135.0.7049.114 linux #0-0]
[chrome 135.0.7049.114 linux #0-0] 1 passing (42.5s)
[chrome 135.0.7049.114 linux #0-0] 4 skipped
------------------------------------------------------------------
[chrome 135.0.7049.114 linux #0-1] Running: chrome (v135.0.7049.114) on linux
[chrome 135.0.7049.114 linux #0-1] Session ID: 7eabac4c2229a2ed4e82c676355912ee
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] » /tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[chrome 135.0.7049.114 linux #0-1] Creating and editing contacts and users
[chrome 135.0.7049.114 linux #0-1]    ✓ should create health facility, chw area and chw chw supervisor and chw user
[chrome 135.0.7049.114 linux #0-1]
[chrome 135.0.7049.114 linux #0-1] 1 passing (46.4s)


Spec Files:	 2 passed, 2 total (100% completed) in 00:02:12  
2 Likes

Hi @rajeevtapadia, just following up — were you able to run the tests too? after stopping the dev server?
Let me know if you’re still running into any issues and we can troubleshoot further!

I also have same issue. Can you help me out here @rajeevtapadia @Lorena_Rodriguez @shashi_sah? Logs:

> medic@4.18.0 wdio-visual-desktop
> export VERSION=$(node ./scripts/build/get-version.js) && ./scripts/build/build-service-images.sh && wdio run ./tests/e2e/visual/wdio.conf.js --suite=desktopTests

build-service-images: running
copy-static-files: copying
copy-static-files: done
cleancss-api: cleaning
cleancss-api: done
copying modules to working directory
installing modules
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated later@1.2.0: Please upgrade to the maintained and new drop-in replacement @breejs/later at https://github.com/breejs/later 🚀 Thanks and happy hacking! 🚀  @niftylettuce

> medic@4.18.0 postinstall
> patch-package

patch-package 8.0.0
Applying patches...
prometheus-api-metrics@3.2.2 ✔

> medic@4.18.0 prepare
> husky


added 651 packages, and audited 679 packages in 58s

109 packages are looking for funding
  run `npm fund` for details

6 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
working directory /tmp/tmp.6dWSLVLAUr


Building docker image for api medicmobile/cht-api:9926-Targets-Overview


[+] Building 47.9s (12/12) FINISHED         docker:default
 => [internal] load build definition from Dockerfile  0.1s
 => => transferring dockerfile: 395B                  0.0s
 => [internal] load metadata for docker.io/library/n  2.9s
 => [auth] library/node:pull token for registry-1.do  0.0s
 => [internal] load .dockerignore                     0.1s
 => => transferring context: 266B                     0.0s
 => [internal] load build context                    43.7s
 => => transferring context: 149.51MB                43.4s
 => [1/6] FROM docker.io/library/node:22-alpine@sha2  0.0s
 => CACHED [2/6] RUN apk add --update --no-cache   b  0.0s
 => CACHED [3/6] WORKDIR /service                     0.0s
 => CACHED [4/6] COPY ./shared-libs ./shared-libs     0.0s
 => CACHED [5/6] COPY node_modules/@medic ./node_mod  0.0s
 => CACHED [6/6] COPY api ./api                       0.0s
 => exporting to image                                0.1s
 => => exporting layers                               0.0s
 => => writing image sha256:a3890ad05a317ae234ce480c  0.0s
 => => naming to docker.io/medicmobile/cht-api:9926-  0.0s


Building docker image for sentinel medicmobile/cht-sentinel:9926-Targets-Overview


[+] Building 21.9s (11/11) FINISHED         docker:default
 => [internal] load build definition from Dockerfile  0.0s
 => => transferring dockerfile: 403B                  0.0s
 => [internal] load metadata for docker.io/library/n  1.2s
 => [internal] load .dockerignore                     0.0s
 => => transferring context: 266B                     0.0s
 => [1/6] FROM docker.io/library/node:22-alpine@sha2  0.0s
 => [internal] load build context                    20.3s
 => => transferring context: 80.71MB                 20.1s
 => CACHED [2/6] RUN apk add --update --no-cache   b  0.0s
 => CACHED [3/6] WORKDIR /service                     0.0s
 => CACHED [4/6] COPY ./shared-libs ./shared-libs     0.0s
 => CACHED [5/6] COPY node_modules/@medic ./node_mod  0.0s
 => CACHED [6/6] COPY sentinel ./sentinel             0.0s
 => exporting to image                                0.0s
 => => exporting layers                               0.0s
 => => writing image sha256:1133bec82ac75e753c5dd366  0.0s
 => => naming to docker.io/medicmobile/cht-sentinel:  0.0s


Building docker image for couchdb


[+] Building 3.4s (12/12) FINISHED          docker:default
 => [internal] load build definition from Dockerfile  0.1s
 => => transferring dockerfile: 900B                  0.1s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' ca  0.1s
 => [internal] load metadata for docker.io/library/c  2.8s
 => [auth] library/couchdb:pull token for registry-1  0.0s
 => [internal] load .dockerignore                     0.0s
 => => transferring context: 2B                       0.0s
 => [base_couchdb_build 1/6] FROM docker.io/library/  0.0s
 => [internal] load build context                     0.1s
 => => transferring context: 147B                     0.0s
 => CACHED [base_couchdb_build 2/6] COPY --chown=cou  0.0s
 => CACHED [base_couchdb_build 3/6] COPY --chown=cou  0.0s
 => CACHED [base_couchdb_build 4/6] COPY docker-entr  0.0s
 => CACHED [base_couchdb_build 5/6] COPY set-up-clus  0.0s
 => CACHED [base_couchdb_build 6/6] RUN apt-get upda  0.0s
 => exporting to image                                0.0s
 => => exporting layers                               0.0s
 => => writing image sha256:15a6938d55965ef9605891e3  0.0s
 => => naming to docker.io/medicmobile/cht-couchdb:9  0.0s

 1 warning found (use docker --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)


Building docker image for haproxy


[+] Building 2.3s (14/14) FINISHED          docker:default
 => [internal] load build definition from Dockerfile  0.0s
 => => transferring dockerfile: 400B                  0.0s
 => [internal] load metadata for docker.io/library/h  1.9s
 => [auth] library/haproxy:pull token for registry-1  0.0s
 => [internal] load .dockerignore                     0.0s
 => => transferring context: 2B                       0.0s
 => [1/8] FROM docker.io/library/haproxy:2.6.17@sha2  0.0s
 => [internal] load build context                     0.0s
 => => transferring context: 1.06kB                   0.0s
 => CACHED [2/8] RUN apt-get update && apt-get insta  0.0s
 => CACHED [3/8] COPY entrypoint.sh /                 0.0s
 => CACHED [4/8] RUN chmod +x /entrypoint.sh          0.0s
 => CACHED [5/8] ADD default_frontend.cfg /usr/local  0.0s
 => CACHED [6/8] ADD backend.cfg.template /usr/local  0.0s
 => CACHED [7/8] COPY scripts /usr/local/etc/haproxy  0.0s
 => CACHED [8/8] COPY errors/*.http /usr/local/etc/h  0.0s
 => exporting to image                                0.0s
 => => exporting layers                               0.0s
 => => writing image sha256:26194236c294ebf981c5f08e  0.0s
 => => naming to docker.io/medicmobile/cht-haproxy:9  0.0s


Building docker image for haproxy-healthcheck


[+] Building 2.0s (11/11) FINISHED          docker:default
 => [internal] load build definition from Dockerfile  0.0s
 => => transferring dockerfile: 266B                  0.0s
 => [internal] load metadata for docker.io/library/p  1.7s
 => [auth] library/python:pull token for registry-1.  0.0s
 => [internal] load .dockerignore                     0.0s
 => => transferring context: 148B                     0.0s
 => [internal] load build context                     0.0s
 => => transferring context: 139B                     0.0s
 => [1/5] FROM docker.io/library/python:3.10.13-alpi  0.0s
 => CACHED [2/5] WORKDIR /app                         0.0s
 => CACHED [3/5] COPY requirements/base-freeze.txt /  0.0s
 => CACHED [4/5] RUN pip install -r /app/requirement  0.0s
 => CACHED [5/5] COPY *.py /app/                      0.0s
 => exporting to image                                0.0s
 => => exporting layers                               0.0s
 => => writing image sha256:5516e13b07c407590e0e94ba  0.0s
 => => naming to docker.io/medicmobile/cht-haproxy-h  0.0s

 1 warning found (use docker --debug to expand):
 - JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 13)


Building docker image for nginx


[+] Building 1.9s (15/15) FINISHED          docker:default
 => [internal] load build definition from Dockerfile  0.0s
 => => transferring dockerfile: 969B                  0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' ca  0.0s
 => [internal] load metadata for docker.io/library/n  1.6s
 => [auth] library/nginx:pull token for registry-1.d  0.0s
 => [internal] load .dockerignore                     0.0s
 => => transferring context: 2B                       0.0s
 => [base_nginx 1/9] FROM docker.io/library/nginx:1.  0.0s
 => [internal] load build context                     0.0s
 => => transferring context: 3.57kB                   0.0s
 => CACHED [base_nginx 2/9] RUN apk add --update --n  0.0s
 => CACHED [base_nginx 3/9] COPY ssl-install.sh /doc  0.0s
 => CACHED [base_nginx 4/9] RUN chmod 755 /docker-en  0.0s
 => CACHED [base_nginx 5/9] COPY templates /etc/ngin  0.0s
 => CACHED [base_nginx 6/9] COPY nginx.conf /etc/ngi  0.0s
 => CACHED [base_nginx 7/9] COPY mime.types /etc/ngi  0.0s
 => CACHED [base_nginx 8/9] COPY conf.d/ /etc/nginx/  0.0s
 => CACHED [base_nginx 9/9] COPY nginx_error_pages/   0.0s
 => exporting to image                                0.0s
 => => exporting layers                               0.0s
 => => writing image sha256:ebc96825d2704e22cc6b3bee  0.0s
 => => naming to docker.io/medicmobile/cht-nginx:992  0.0s

 1 warning found (use docker --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 2)
build-service-images: done

Execution of 2 workers started at 2025-04-29T16:18:05.142Z

docker compose -f /home/dhruv11p/cht-core/tests/cht-core-test.yml -f /home/dhruv11p/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes
 Volume cht-e2e_cht-credentials  Removing
 Volume cht-e2e_cht-ssl  Removing
 Volume cht-e2e_cht-credentials  Removed
 Volume cht-e2e_cht-ssl  Removed


docker compose -f /home/dhruv11p/cht-core/tests/cht-core-test.yml -f /home/dhruv11p/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e up -d
 Network cht-net-e2e  Creating
 Network cht-net-e2e  Created
 Volume "cht-e2e_cht-credentials"  Creating
 Volume "cht-e2e_cht-credentials"  Created
 Volume "cht-e2e_cht-ssl"  Creating
 Volume "cht-e2e_cht-ssl"  Created
 Container cht-e2e-couchdb-3.local-1  Creating
 Container cht-e2e-healthcheck-1  Creating
 Container cht-e2e-couchdb-2.local-1  Creating
 Container cht-e2e-haproxy-1  Creating
 Container cht-e2e-couchdb-1.local-1  Creating
 Container cht-e2e-haproxy-1  Created
 Container cht-e2e-sentinel-1  Creating
 Container cht-e2e-api-1  Creating
 Container cht-e2e-couchdb-2.local-1  Created
 Container cht-e2e-healthcheck-1  Created
 Container cht-e2e-couchdb-3.local-1  Created
 Container cht-e2e-couchdb-1.local-1  Created
 Container cht-e2e-sentinel-1  Created
 Container cht-e2e-api-1  Created
 Container cht-e2e-nginx-1  Creating
 Container cht-e2e-nginx-1  Created
 Container cht-e2e-couchdb-1.local-1  Starting
 Container cht-e2e-couchdb-3.local-1  Starting
 Container cht-e2e-healthcheck-1  Starting
 Container cht-e2e-haproxy-1  Starting
 Container cht-e2e-couchdb-2.local-1  Starting
 Container cht-e2e-healthcheck-1  Started
 Container cht-e2e-haproxy-1  Started
 Container cht-e2e-sentinel-1  Starting
 Container cht-e2e-api-1  Starting
 Container cht-e2e-couchdb-3.local-1  Started
 Container cht-e2e-couchdb-1.local-1  Started
 Container cht-e2e-couchdb-2.local-1  Started
 Container cht-e2e-api-1  Started
 Container cht-e2e-nginx-1  Starting
 Container cht-e2e-sentinel-1  Started
 Container cht-e2e-nginx-1  Started


docker compose -f /home/dhruv11p/cht-core/tests/cht-core-test.yml -f /home/dhruv11p/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e ps -q

6fccbaed72be3e5da958d676720eb138dc334b2b9b4c55a93d08b72939fe3c48
fdf5c7ebd51e30033d1752309fcb096f22003d94f41e69074c156e61092a4fd0
7cb92ca164329e7890ebf14c981c89c45abd9cdde345f06bdf0129feb78be0fa
099de3444621849823938e2575b63fe4dfcc29b02c4e868a9c2abdcc22ccce22
2fe7929213769826d6830735f3dc2ea8f2331f5a42a5401ccde6e2c07081023f
89090b0aa22b2c99fefdd0ad4e58b9c7d0f1d94cbd14c2bdc9b94177f778ba06
f603d7a54761d3e3162711319b4ef43d57a4111c730ff76511e462e54cd006cb
a42a06a87842e74fd3177e9df1e6ecf3ac3e487def1d92978d5ddcdcd0608881

Checking API, retries left 180
(node:13637) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 179
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 178
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 177
API check failed, trying again in 1 second
fetch failed
Checking API, retries left 176
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 175
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 174
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 173
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 172
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 171
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 170
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 169
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 168
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 167
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 166
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 165
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 164
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 163
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 162
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 161
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 160
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 159
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 158
Error with request: GET https://localhost/api/info 502
API check failed, trying again in 1 second
502 - {"type":"ERROR","error":"502 Bad Gateway","server":"nginx"}
Checking API, retries left 157
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 156
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 155
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 154
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 153
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 152
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 151
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 150
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 149
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 148
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 147
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 146
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 145
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 144
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 143
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 142
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 141
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 140
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 139
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 138
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 137
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 136
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 135
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 134
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 133
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 132
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 131
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 130
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 129
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 128
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 127
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 126
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 125
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 124
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 123
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 122
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 121
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 120
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 119
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 118
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 117
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 116
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 115
Error with request: GET https://localhost/api/info 503
API check failed, trying again in 1 second
503 - {"error":"Service unavailable"}
Checking API, retries left 114
API startup: User contact doc setup
API startup: Getting default forms
[0-0] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-0] 2025-04-29T16:20:10.857Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:37655
[0-0]     at ClientRequest.<anonymous> (file:///home/dhruv11p/cht-core/node_modules/webdriver/node_modules/got/dist/source/core/index.js:790:107)
[0-0]     at Object.onceWrapper (node:events:633:26)
[0-0]     at ClientRequest.emit (node:events:530:35)
[0-0]     at ClientRequest.emit (node:domain:489:12)
[0-0]     at emitErrorEvent (node:_http_client:104:11)
[0-0]     at Socket.socketErrorListener (node:_http_client:518:5)
[0-0]     at Socket.emit (node:events:518:28)
[0-0]     at Socket.emit (node:domain:489:12)
[0-0]     at emitErrorNT (node:internal/streams/destroy:170:8)
[0-0]     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:90:21)
[0-0]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1636:16)
[0-0] 2025-04-29T16:20:10.859Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] Unable to connect to "http://127.0.0.1:37655/", make sure browser driver is running on that address.
[0-0] It seems like the service failed to start or is rejecting any connections.
[0-0]     at startWebDriverSession (file:///home/dhruv11p/cht-core/node_modules/webdriver/build/utils.js:69:15)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
[0-0]     at async Function.newSession (file:///home/dhruv11p/cht-core/node_modules/webdriver/build/index.js:19:45)
[0-0]     at async remote (file:///home/dhruv11p/cht-core/node_modules/webdriverio/build/index.js:46:22)
[0-0]     at async Runner._startSession (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:241:29)
[0-0]     at async Runner._initSession (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:207:25)
[0-0]     at async Runner.run (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:88:19)
[0-0] FAILED in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-1] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[0-1] 2025-04-29T16:20:33.292Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:36659
[0-1]     at ClientRequest.<anonymous> (file:///home/dhruv11p/cht-core/node_modules/webdriver/node_modules/got/dist/source/core/index.js:790:107)
[0-1]     at Object.onceWrapper (node:events:633:26)
[0-1]     at ClientRequest.emit (node:events:530:35)
[0-1]     at ClientRequest.emit (node:domain:489:12)
[0-1]     at emitErrorEvent (node:_http_client:104:11)
[0-1]     at Socket.socketErrorListener (node:_http_client:518:5)
[0-1]     at Socket.emit (node:events:518:28)
[0-1]     at Socket.emit (node:domain:489:12)
[0-1]     at emitErrorNT (node:internal/streams/destroy:170:8)
[0-1]     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
[0-1]     at processTicksAndRejections (node:internal/process/task_queues:90:21)
[0-1]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1636:16)
[0-1] 2025-04-29T16:20:33.299Z ERROR @wdio/runner: Error: Failed to create session.
[0-1] Unable to connect to "http://127.0.0.1:36659/", make sure browser driver is running on that address.
[0-1] It seems like the service failed to start or is rejecting any connections.
[0-1]     at startWebDriverSession (file:///home/dhruv11p/cht-core/node_modules/webdriver/build/utils.js:69:15)
[0-1]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
[0-1]     at async Function.newSession (file:///home/dhruv11p/cht-core/node_modules/webdriver/build/index.js:19:45)
[0-1]     at async remote (file:///home/dhruv11p/cht-core/node_modules/webdriverio/build/index.js:46:22)
[0-1]     at async Runner._startSession (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:241:29)
[0-1]     at async Runner._initSession (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:207:25)
[0-1]     at async Runner.run (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:88:19)
[0-1] FAILED in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
docker compose -f /home/dhruv11p/cht-core/tests/cht-core-test.yml -f /home/dhruv11p/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes
 Container cht-e2e-couchdb-1.local-1  Stopping
 Container cht-e2e-healthcheck-1  Stopping
 Container cht-e2e-couchdb-2.local-1  Stopping
 Container cht-e2e-sentinel-1  Stopping
 Container cht-e2e-nginx-1  Stopping
 Container cht-e2e-couchdb-3.local-1  Stopping
 Container cht-e2e-couchdb-3.local-1  Stopped
 Container cht-e2e-couchdb-3.local-1  Removing
 Container cht-e2e-couchdb-3.local-1  Removed
 Container cht-e2e-couchdb-1.local-1  Stopped
 Container cht-e2e-couchdb-1.local-1  Removing
 Container cht-e2e-couchdb-1.local-1  Removed
 Container cht-e2e-sentinel-1  Stopped
 Container cht-e2e-sentinel-1  Removing
 Container cht-e2e-sentinel-1  Removed
 Container cht-e2e-couchdb-2.local-1  Stopped
 Container cht-e2e-couchdb-2.local-1  Removing
 Container cht-e2e-healthcheck-1  Stopped
 Container cht-e2e-healthcheck-1  Removing
 Container cht-e2e-couchdb-2.local-1  Removed
 Container cht-e2e-healthcheck-1  Removed
 Container cht-e2e-nginx-1  Stopped
 Container cht-e2e-nginx-1  Removing
 Container cht-e2e-nginx-1  Removed
 Container cht-e2e-api-1  Stopping
 Container cht-e2e-api-1  Stopped
 Container cht-e2e-api-1  Removing
 Container cht-e2e-api-1  Removed
 Container cht-e2e-haproxy-1  Stopping
 Container cht-e2e-haproxy-1  Stopped
 Container cht-e2e-haproxy-1  Removing
 Container cht-e2e-haproxy-1  Removed
 Volume cht-e2e_cht-credentials  Removing
 Volume cht-e2e_cht-ssl  Removing
 Volume cht-e2e_cht-ssl  Removed
 Volume cht-e2e_cht-credentials  Removed
 Network cht-net-e2e  Removing
 Network cht-net-e2e  Removed



ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

2025-04-29T16:20:44.242Z ERROR @wdio/cli:utils: Error in onCompleteHook: Error: Could not generate Allure report
    at generateReport (/home/dhruv11p/cht-core/tests/utils/allure.js:4:23)
    at Object.onComplete (/home/dhruv11p/cht-core/tests/wdio.conf.js:364:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///home/dhruv11p/cht-core/node_modules/@wdio/cli/build/utils.js:101:13
    at async Promise.all (index 0)
    at async Launcher.run (file:///home/dhruv11p/cht-core/node_modules/@wdio/cli/build/launcher.js:110:39)

Spec Files:      0 passed, 2 failed, 2 total (100% completed) in 00:02:39  

Sorry for replying late,
I did some debugging and found out the some of e2e test docker containers are failing to start on my machine.

CONTAINER ID   IMAGE                                        COMMAND                   CREATED         STATUS                          PORTS                                                                                                      NAMES
0a0063136bf4   medicmobile/cht-nginx:master                 "/docker-entrypoint.…"    2 minutes ago   Up 2 minutes                    0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp                                   cht-e2e-nginx-1
d373a39620be   medicmobile/cht-api:master                   "/bin/bash /service/…"    2 minutes ago   Up 2 minutes                    5988/tcp                                                                                                   cht-e2e-api-1
9c50fa068e3d   medicmobile/cht-sentinel:master              "/bin/bash /service/…"    2 minutes ago   Up 2 minutes                                                                                                                               cht-e2e-sentinel-1
30b24063f91f   medicmobile/cht-couchdb:master               "tini -- /docker-ent…"    2 minutes ago   Up About a minute               4369/tcp, 5984/tcp, 9100/tcp                                                                               cht-e2e-couchdb-2.local-1
9ca4d49f8fd7   medicmobile/cht-couchdb:master               "tini -- /docker-ent…"    2 minutes ago   Restarting (2) 12 seconds ago                                                                                                              cht-e2e-couchdb-1.local-1
34f2dde5231b   medicmobile/cht-haproxy:master               "/entrypoint.sh"          2 minutes ago   Restarting (1) 12 seconds ago                                                                                                              cht-e2e-haproxy-1
3baacd82f791   medicmobile/cht-couchdb:master               "tini -- /docker-ent…"    2 minutes ago   Up About a minute               4369/tcp, 5984/tcp, 9100/tcp                                                                               cht-e2e-couchdb-3.local-1
bda1537308cb   medicmobile/cht-haproxy-healthcheck:master   "/bin/sh -c \"/app/ch…"   2 minutes ago   Up 2 minutes                                                                                                                               cht-e2e-healthcheck-1

I suspect this might be linked to the ulimit error I had earlier.
I think it will be more productive if i try to contribute to some other issue than e2e tests.
Thank you for your time and consideration!

Based on the logs, I guess you’d have to export this variable in your shell’s rc file.

To find the correct path for your Java binary, you can run:

readlink -f $(which java)

hey @rajeevtapadia if you still wanna contribute to e2e tests then pls consider using github codespaces as it is working fine for me there. Need any help with codespace setup do let me know

2 Likes

Hi @dhruv, I’m sorry to hear you’re running into issues locally when running the e2e visual tests.
To help us assist you better, could you please share a few more details about your setup?

  • Are you also using Fedora as an operating system?
  • What is the state of the e2e test containers? For example, have you checked whether all required containers are running using docker ps?
  • Can you see any errors in the container logs?

Thanks in advance — we’ll be glad to help you get unblocked!

Hi @apoorvapendse, Do we have to close all the running server and then run this command npm run wdio-visual-desktop ?

Hi @Lorena_Rodriguez , i am using ubuntu and when I run the command npm run wdio-visual-desktop the cht-e2e test containers are generated but they are eventually stopped and these are the errors I am getting

API startup: User contact doc setup
API startup: Getting default forms
[0-0] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-0] 2025-04-30T10:28:41.296Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:36063
[0-0]     at ClientRequest.<anonymous> (file:///home/dhruv11p/cht-core/node_modules/webdriver/node_modules/got/dist/source/core/index.js:790:107)
[0-0]     at Object.onceWrapper (node:events:633:26)
[0-0]     at ClientRequest.emit (node:events:530:35)
[0-0]     at ClientRequest.emit (node:domain:489:12)
[0-0]     at emitErrorEvent (node:_http_client:104:11)
[0-0]     at Socket.socketErrorListener (node:_http_client:518:5)
[0-0]     at Socket.emit (node:events:518:28)
[0-0]     at Socket.emit (node:domain:489:12)
[0-0]     at emitErrorNT (node:internal/streams/destroy:170:8)
[0-0]     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:90:21)
[0-0]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1636:16)
[0-0] 2025-04-30T10:28:41.297Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] Unable to connect to "http://127.0.0.1:36063/", make sure browser driver is running on that address.
[0-0] It seems like the service failed to start or is rejecting any connections.
[0-0]     at startWebDriverSession (file:///home/dhruv11p/cht-core/node_modules/webdriver/build/utils.js:69:15)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
[0-0]     at async Function.newSession (file:///home/dhruv11p/cht-core/node_modules/webdriver/build/index.js:19:45)
[0-0]     at async remote (file:///home/dhruv11p/cht-core/node_modules/webdriverio/build/index.js:46:22)
[0-0]     at async Runner._startSession (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:241:29)
[0-0]     at async Runner._initSession (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:207:25)
[0-0]     at async Runner.run (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:88:19)
[0-0] FAILED in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-1] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[0-1] 2025-04-30T10:29:01.664Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:35563
[0-1]     at ClientRequest.<anonymous> (file:///home/dhruv11p/cht-core/node_modules/webdriver/node_modules/got/dist/source/core/index.js:790:107)
[0-1]     at Object.onceWrapper (node:events:633:26)
[0-1]     at ClientRequest.emit (node:events:530:35)
[0-1]     at ClientRequest.emit (node:domain:489:12)
[0-1]     at emitErrorEvent (node:_http_client:104:11)
[0-1]     at Socket.socketErrorListener (node:_http_client:518:5)
[0-1]     at Socket.emit (node:events:518:28)
[0-1]     at Socket.emit (node:domain:489:12)
[0-1]     at emitErrorNT (node:internal/streams/destroy:170:8)
[0-1]     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
[0-1]     at processTicksAndRejections (node:internal/process/task_queues:90:21)
[0-1]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1636:16)
[0-1] 2025-04-30T10:29:01.665Z ERROR @wdio/runner: Error: Failed to create session.
[0-1] Unable to connect to "http://127.0.0.1:35563/", make sure browser driver is running on that address.
[0-1] It seems like the service failed to start or is rejecting any connections.
[0-1]     at startWebDriverSession (file:///home/dhruv11p/cht-core/node_modules/webdriver/build/utils.js:69:15)
[0-1]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
[0-1]     at async Function.newSession (file:///home/dhruv11p/cht-core/node_modules/webdriver/build/index.js:19:45)
[0-1]     at async remote (file:///home/dhruv11p/cht-core/node_modules/webdriverio/build/index.js:46:22)
[0-1]     at async Runner._startSession (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:241:29)
[0-1]     at async Runner._initSession (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:207:25)
[0-1]     at async Runner.run (file:///home/dhruv11p/cht-core/node_modules/@wdio/runner/build/index.js:88:19)
[0-1] FAILED in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
docker compose -f /home/dhruv11p/cht-core/tests/cht-core-test.yml -f /home/dhruv11p/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes
 Container cht-e2e-couchdb-2.local-1  Stopping
 Container cht-e2e-couchdb-3.local-1  Stopping
 Container cht-e2e-couchdb-1.local-1  Stopping
 Container cht-e2e-sentinel-1  Stopping
 Container cht-e2e-nginx-1  Stopping
 Container cht-e2e-healthcheck-1  Stopping
 Container cht-e2e-couchdb-3.local-1  Stopped
 Container cht-e2e-couchdb-3.local-1  Removing
 Container cht-e2e-couchdb-3.local-1  Removed
 Container cht-e2e-sentinel-1  Stopped
 Container cht-e2e-sentinel-1  Removing
 Container cht-e2e-sentinel-1  Removed
 Container cht-e2e-couchdb-2.local-1  Stopped
 Container cht-e2e-couchdb-2.local-1  Removing
 Container cht-e2e-couchdb-2.local-1  Removed
 Container cht-e2e-couchdb-1.local-1  Stopped
 Container cht-e2e-couchdb-1.local-1  Removing
 Container cht-e2e-couchdb-1.local-1  Removed
 Container cht-e2e-nginx-1  Stopped
 Container cht-e2e-nginx-1  Removing
 Container cht-e2e-nginx-1  Removed
 Container cht-e2e-api-1  Stopping
 Container cht-e2e-healthcheck-1  Stopped
 Container cht-e2e-healthcheck-1  Removing
 Container cht-e2e-healthcheck-1  Removed
 Container cht-e2e-api-1  Stopped
 Container cht-e2e-api-1  Removing
 Container cht-e2e-api-1  Removed
 Container cht-e2e-haproxy-1  Stopping
 Container cht-e2e-haproxy-1  Stopped
 Container cht-e2e-haproxy-1  Removing
 Container cht-e2e-haproxy-1  Removed
 Volume cht-e2e_cht-ssl  Removing
 Volume cht-e2e_cht-credentials  Removing
 Volume cht-e2e_cht-ssl  Removed
 Volume cht-e2e_cht-credentials  Removed
 Network cht-net-e2e  Removing
 Network cht-net-e2e  Removed



ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

2025-04-30T10:29:16.331Z ERROR @wdio/cli:utils: Error in onCompleteHook: Error: Could not generate Allure report
    at generateReport (/home/dhruv11p/cht-core/tests/utils/allure.js:4:23)
    at Object.onComplete (/home/dhruv11p/cht-core/tests/wdio.conf.js:364:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///home/dhruv11p/cht-core/node_modules/@wdio/cli/build/utils.js:101:13
    at async Promise.all (index 0)
    at async Launcher.run (file:///home/dhruv11p/cht-core/node_modules/@wdio/cli/build/launcher.js:110:39)

Spec Files:      0 passed, 2 failed, 2 total (100% completed) in 00:03:03  

Thanks for the update!

No worries about the delay — I really appreciate you digging into the issue. It does look like some of the CouchDB and HAProxy containers are having trouble starting, which could definitely be related to the ulimit error you mentioned earlier.

Before switching tasks, would you mind checking the logs for the failing containers (especially cht-e2e-couchdb-1.local-1 and cht-e2e-haproxy-1) to confirm if it’s the same ulimit issue? That would help us better understand and document the root cause for others who might hit the same problem.

That said, if troubleshooting this further is taking too much time, it is totally okay if you’d prefer to pick up a different issue— just let us know which one and I’ll be happy to help you get started!

Thanks again!

Hey @dhruv

First install java, you can follow this tutorial
Then setup JAVA_HOME, you can follow this answer
Also make sure you have chrome on your machine

Hope this helps!!

Hey @Sujal , Thanks Now I am not facing the java error.

1 Like

Hi @Lorena_Rodriguez , For me everything is running fine and just one error is coming–

API startup: User contact doc setup
API startup: Getting default forms
[0-0] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-0] Error: Failed to sync
[0-0]     at syncAndWaitForSuccess (/home/dhruv11p/cht-core/tests/page-objects/default/common/common.wdio.page.js:413:13)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
[0-0]     at async Object.sync (/home/dhruv11p/cht-core/tests/page-objects/default/common/common.wdio.page.js:439:3)
[0-0]     at async Object.updateSettings (/home/dhruv11p/cht-core/tests/utils/index.js:602:5)
[0-0]     at async updateContactSummarySettings (/home/dhruv11p/cht-core/tests/e2e/visual/contacts/contact-user-management.wdio-spec.js:20:5)
[0-0]     at async Context.<anonymous> (/home/dhruv11p/cht-core/tests/e2e/visual/contacts/contact-user-management.wdio-spec.js:46:5)
[0-0]     at async Context.executeAsync (file:///home/dhruv11p/cht-core/node_modules/@wdio/utils/build/shim.js:286:24)
[0-0]     at async Context.testFrameworkFnWrapper (file:///home/dhruv11p/cht-core/node_modules/@wdio/utils/build/test-framework/testFnWrapper.js:51:18)
[0-0] PASSED in chrome - file:///tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[0-1] RUNNING in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[0-1] PASSED in chrome - file:///tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
docker compose -f /home/dhruv11p/cht-core/tests/cht-core-test.yml -f /home/dhruv11p/cht-core/tests/cht-couchdb-cluster-test.yml -p cht-e2e down -t 0 --remove-orphans --volumes
 Container cht-e2e-couchdb-1.local-1  Stopping
 Container cht-e2e-healthcheck-1  Stopping
 Container cht-e2e-couchdb-2.local-1  Stopping
 Container cht-e2e-couchdb-3.local-1  Stopping
 Container cht-e2e-sentinel-1  Stopping
 Container cht-e2e-nginx-1  Stopping
 Container cht-e2e-couchdb-2.local-1  Stopped
 Container cht-e2e-couchdb-2.local-1  Removing
 Container cht-e2e-couchdb-2.local-1  Removed
 Container cht-e2e-couchdb-3.local-1  Stopped
 Container cht-e2e-couchdb-3.local-1  Removing
 Container cht-e2e-couchdb-3.local-1  Removed
 Container cht-e2e-sentinel-1  Stopped
 Container cht-e2e-sentinel-1  Removing
 Container cht-e2e-couchdb-1.local-1  Stopped
 Container cht-e2e-couchdb-1.local-1  Removing
 Container cht-e2e-sentinel-1  Removed
 Container cht-e2e-couchdb-1.local-1  Removed
 Container cht-e2e-healthcheck-1  Stopped
 Container cht-e2e-healthcheck-1  Removing
 Container cht-e2e-healthcheck-1  Removed
 Container cht-e2e-nginx-1  Stopped
 Container cht-e2e-nginx-1  Removing
 Container cht-e2e-nginx-1  Removed
 Container cht-e2e-api-1  Stopping
 Container cht-e2e-api-1  Stopped
 Container cht-e2e-api-1  Removing
 Container cht-e2e-api-1  Removed
 Container cht-e2e-haproxy-1  Stopping
 Container cht-e2e-haproxy-1  Stopped
 Container cht-e2e-haproxy-1  Removing
 Container cht-e2e-haproxy-1  Removed
 Volume cht-e2e_cht-ssl  Removing
 Volume cht-e2e_cht-credentials  Removing
 Network cht-net-e2e  Removing
 Volume cht-e2e_cht-ssl  Removed
 Volume cht-e2e_cht-credentials  Removed
 Network cht-net-e2e  Removed


Report successfully generated to allure-report
Allure report successfully generated

 "spec" Reporter:
------------------------------------------------------------------
[chrome 136.0.7103.59 linux #0-0] Running: chrome (v136.0.7103.59) on linux
[chrome 136.0.7103.59 linux #0-0] Session ID: 6b1e3cda4ce896ad06a6937c6078ff25
[chrome 136.0.7103.59 linux #0-0]
[chrome 136.0.7103.59 linux #0-0] » /tests/e2e/visual/contacts/contact-user-management.wdio-spec.js
[chrome 136.0.7103.59 linux #0-0] Contact and User Management
[chrome 136.0.7103.59 linux #0-0]     Contact and user overview
[chrome 136.0.7103.59 linux #0-0]        ✓ should show contacts list, search, profiles (person and family), contact summary
[chrome 136.0.7103.59 linux #0-0]        ? should show condition cards
[chrome 136.0.7103.59 linux #0-0]        - should show condition cards
[chrome 136.0.7103.59 linux #0-0]        ? should show profiles (area and branch)
[chrome 136.0.7103.59 linux #0-0]        - should show profiles (area and branch)
[chrome 136.0.7103.59 linux #0-0]        ? should show UHC sort
[chrome 136.0.7103.59 linux #0-0]        - should show UHC sort
[chrome 136.0.7103.59 linux #0-0]        ? should show cares guides
[chrome 136.0.7103.59 linux #0-0]        - should show cares guides
[chrome 136.0.7103.59 linux #0-0]
[chrome 136.0.7103.59 linux #0-0] 1 passing (2m 10.5s)
[chrome 136.0.7103.59 linux #0-0] 4 skipped
------------------------------------------------------------------
[chrome 136.0.7103.59 linux #0-1] Running: chrome (v136.0.7103.59) on linux
[chrome 136.0.7103.59 linux #0-1] Session ID: 069b07ce839e084520a789598edb50f4
[chrome 136.0.7103.59 linux #0-1]
[chrome 136.0.7103.59 linux #0-1] » /tests/e2e/visual/contacts/contact-user-hierarchy-creation.wdio-spec.js
[chrome 136.0.7103.59 linux #0-1] Creating and editing contacts and users
[chrome 136.0.7103.59 linux #0-1]    ✓ should create health facility, chw area and chw chw supervisor and chw user
[chrome 136.0.7103.59 linux #0-1]
[chrome 136.0.7103.59 linux #0-1] 1 passing (1m 45.9s)


Spec Files:      2 passed, 2 total (100% completed) in 00:06:23  

Hi @dhruv, thanks for the update! I’m really glad to hear that the tests ran successfully and everything is working on your end.

The Failed to sync error during updateContactSummarySettings looks like a timing issue—most likely the app wasn’t fully ready when the sync was triggered. Since the test still passed and everything else is successful, it doesn’t seem to be affecting the outcome at the moment.

That said, if it starts happening more frequently or interferes with other tests, we can consider adding a more robust wait condition or retry logic before calling syncAndWaitForSuccess.

Feel free to reach out if you’d like to dig into it further!

1 Like