I'm trying to run Karma tests in Jenkins pipeline.
I'm new to this topic, and to start, I pulled openui5-sample-app from Git repository.
https://github.com/SAP/openui5-sample-app
In order to run Karma in pipeline, we need to set ChromeHeadless flag '--no-sandbox' as shown below.
CustomChromeHeadless: { base: "ChromeHeadless", flags: ['--no-sandbox'] }
However, once I added above flag, Karma tests stared to fail. (I'm running it locally, not under Jenkins yet)
It seemed that some interaction such as pressing button or filtering didn't work (element not found) in no-sandbox mode.
Does anybody have an idea how to get this work?
Below is part of log.
22 05 2020 06:17:53.436:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/ 22 05 2020 06:17:53.450:INFO [launcher]: Launching browsers CustomChromeHeadless with concurrency unlimited 22 05 2020 06:17:53.468:INFO [launcher]: Starting browser ChromeHeadless 22 05 2020 06:17:56.856:INFO [HeadlessChrome 81.0.4044 (Windows 10.0.0)]: Connected on socket DYXsRmwQeX4VNAFCAAAA with id 9827367 HeadlessChrome 81.0.4044 (Windows 10.0.0): Executed 4 of 4 SUCCESS (0 secs / 0.014 secs) HeadlessChrome 81.0.4044 (Windows 10.0.0): Executed 5 of 17 SUCCESS (0 secs / 7.102 secs) ERROR: '2020-05-22 06:18:23.435989 checkbox cannot be pressed Opa timeout after 15 seconds This is what Opa logged: Found 0 blocking out of 3207 tracked timeouts - sap.ui.test.autowaiter._timeoutWaiter#hasPending AutoWaiter syncpoint - sap.ui.test.autowaiter._autoWaiter Found 1 controls of type 'View' in page - sap.ui.test.Opa5 Found 1 views with viewName 'sap.ui.demo.todo.view.App' - sap.ui.test.Opa5 Found view with ID 'undefined' and viewName 'sap.ui.demo.todo.view.App' - sap.ui.test.Opa5 Found control with ID 'clearCompleted' in view 'sap.ui.demo.todo.view.App' - sap.ui.test.Opa5 Control 'Element sap.m.Button#__component1---app--clearCompleted'' is not rendered - sap.ui.test.matchers.Visible 0 out of 1 controls met the matchers pipeline requirements - sap.ui.test.pipelines.MatcherPipeline Matchers found no controls so check function will be skipped - sap.ui.test.Opa5 Callstack: at fnClass.iClearTheCompletedItems (http://localhost:9876/base/webapp/test/integration/pages/App.js:75:18) at Object.<anonymous> (http://localhost:9876/base/webapp/test/integration/TodoListJourney.js:34:9) at Object.<anonymous> (http://localhost:9876/base/webapp/resources/sap/ui/test/opaQunit.js:221:21) at runTest (http://localhost:9876/base/webapp/resources/sap/ui/thirdparty/qunit-2.js:1442:30) at Test.run (http://localhost:9876/base/webapp/resources/sap/ui/thirdparty/qunit-2.js:1428:6) at http://localhost:9876/base/webapp/resources/sap/ui/thirdparty/qunit-2.js:1620:12 at Object.advance (http://localhost:9876/base/webapp/resources/sap/ui/thirdparty/qunit-2.js:1105:26) - Opa sap.ui.test.Opa' HeadlessChrome 81.0.4044 (Windows 10.0.0) /base/webapp/test/integration/opaTests.qunit.html Todo List should remove a completed item FAILED
Best regards,
Yasutake