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