SAP / ui5-uiveri5

End-to-end testing framework for SAPUI5
Apache License 2.0
120 stars 56 forks source link

how to integrate Uiveri5 I to gitlab pipeline ? #139

Closed jberthe closed 5 years ago

jberthe commented 5 years ago

Hi, I would like to automate the testing inside gitlab but my script fail. Here is my configuration of my stage:

unit-test: stage: test services:

I'm new in that cicd world :) I think during the test, it doesn't find Chrome instance.

The error : DEBUG: Loading BDD-style page object factory 62 DEBUG: Setting up connection provider environment 63 INFO: Check for latest major version of: chromedriver 64 (node:25) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. 65 Error: [npm translator] Could not identify root project. 66 at /builds/jberthe/demogit/node_modules/@ui5/cli/node_modules/@ui5/project/lib/translators/npm.js:436:10 67 at async Object.generateProjectTree (/builds/jberthe/demogit/node_modules/@ui5/cli/node_modules/@ui5/project/lib/normalizer.js:26:16) 68 INFO: Found latest major version of chromedriver: 78 69 INFO: Check for latest version of: chromedriver 70 INFO: Found latest version of chromedriver: 78.0.3904.105 71 INFO: Downloading webdriver binary: https://chromedriver.storage.googleapis.com/78.0.3904.105/chromedriver_linux64.zip 72 INFO: Executing 1 specs 73 [05:58:46] D/launcher - Running with --troubleshoot 74 [05:58:46] D/launcher - Protractor version: 5.3.2 75 [05:58:46] D/launcher - Your base url for tests is http://localhost:8080/index.html 76 [05:58:46] D/plugins - Plugin "Plugin #0" loaded. 77 [05:58:46] I/launcher - Running 1 instances of WebDriver 78 DEBUG: Starting local chromedriver with executable: /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 79 [05:58:46] E/launcher - spawn /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 ENOENT 80 [05:58:46] E/launcher - Error: spawn /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 ENOENT 81 at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19) 82 at onErrorNT (internal/child_process.js:456:16) 83 at processTicksAndRejections (internal/process/task_queues.js:8

Regards, Joseph

maximnaidenov commented 5 years ago

Hi, has this setup even worked or you are creating it right now ?. Do you run with headless chrome ?. Can you please provide the execution log with -v , only the section with the error ?

jberthe commented 5 years ago

hi,

I have made my project (it is an Hello World one) in public like that you can see all the configuration and the error log 👍 https://gitlab.com/jberthe/demogit

Regards, Joseph

maximnaidenov commented 5 years ago

Hi, I am not an expert on gitlab CI so I can't pinpoint the problem right away and will need to debug, together with you. The error message means that uiveri5 can't start the chromedriver which is strange because it seems to be downloaded correctly. Can you please add a command like ls -a/usr/local/lib/node_modules/@ui5/uiveri5/selenium/ before and after the uiveri5 invocation so we could see that is the state of the container before and after ?

jberthe commented 5 years ago

Hi, I did the ls command and it failed :

28 $ whoami 29 root 30 $ echo "$CI_BUILD_REPO" 31 node_modules 32 $ echo "$CI_BUILD_NAME" 33 unit-test 34 $ echo "$CI_PIPELINE_ID" 35 98364773 36 $ echo "$CI_PIPELINE_IID" 37 43 38 $ echo "$CI_COMMIT_REF_SLUG" 39 master 40 $ ls -a /usr/local/lib/node_modules/@ui5/uiveri5/selenium/ 41 ls: /usr/local/lib/node_modules/@ui5/uiveri5/selenium/: No such file or directory 45 ERROR: Job failed: exit code 1

maximnaidenov commented 5 years ago

I meant to call ls -all before and after execution of uiveri5. I am interested if it managed to create it and what is the size of the downloaded chromedriver ?

jberthe commented 5 years ago

I have modified the configuration file of Gitlab to use an external Selenium server. The result is quite interresting.

The UIVeri5 has been loadded correctly :) but it endded with error.

Here is the log of the script : Log here

There is lot of line like this :

DEBUG: Waiting for redirect to complete, current url: chrome-error://chromewebdata/

Maybe it is normal, but the error is probably regarding a timeout :

INFO: Expectation FAILED: Failed: Waiting for redirection to complete, target url: http://localhost:8080/index.html 901 Wait timed out after 9903ms 902 DEBUG: Expectation FAILED stack: TimeoutError: Waiting for redirection to complete, target url: http://localhost:8080/index.html 903 Wait timed out after 9903ms

Is UIVeri5 orks well with external Selenium ?

Regards, Joseph

maximnaidenov commented 5 years ago

Hi, of course, uiveri5 could run with external selenium server but lets try to find the rootcause and solve the issue and not add hide it under additional layer of infrastructure. What I see in the current log is that uiveri5 is able to connect to the selenium server and tries to open http://localhost:8080/index.html where this localhost is the selenium server itself. Do you have a web server there that serves your app ?. It seems not as the chrome logs error page instead. The repetitive error: Waiting for redirect to complete, current url" means that the app is not opened correctly on the requested url.

jberthe commented 5 years ago

Maxim, Thanks for your time :) I have done what you suggest, I have deactivated the external selenium to use the one in UIveri5. The server which hold the application is the localhost as weel. Because before executing the Uiver5 I do a ui5 serve. Here is the error with the ls command you asked me (sorry it is plain text log):

$ ls -all /usr/local/lib/node_modules/@ui5/uiveri5 total 176 drwxr-sr-x 11 root root 4096 Nov 21 20:36 . drwxr-sr-x 1 root root 4096 Nov 21 20:36 .. -rw-r--r-- 1 root root 177 Oct 26 1985 .editorconfig -rw-r--r-- 1 root root 109 Oct 26 1985 .eslintignore -rw-r--r-- 1 root root 553 Oct 26 1985 .eslintrc.json -rw-r--r-- 1 root root 162 Oct 26 1985 .travis.yml -rw-r--r-- 1 root root 14185 Oct 26 1985 LICENSE.txt -rw-r--r-- 1 root root 59 Oct 26 1985 NOTICE.txt -rw-r--r-- 1 root root 4973 Oct 26 1985 README.md drwxr-sr-x 2 root root 4096 Nov 21 20:36 bin drwxr-sr-x 2 root root 4096 Nov 21 20:36 conf drwxr-sr-x 5 root root 4096 Nov 21 20:36 docs -rw-r--r-- 1 root root 39 Oct 26 1985 driverVersions.json drwxr-sr-x 4 root root 4096 Nov 21 20:36 e2e drwxr-sr-x 3 root root 4096 Nov 21 20:36 lib drwxr-sr-x 180 root root 4096 Nov 21 20:36 node_modules -rw-r--r-- 1 root root 2535 Nov 21 20:36 package.json drwxr-sr-x 3 root root 4096 Nov 21 20:36 sample drwxr-sr-x 13 root root 4096 Nov 21 20:36 spec drwxr-sr-x 11 root root 4096 Nov 21 20:36 src $ npm install

core-js@2.6.9 postinstall /builds/jberthe/demogit/node_modules/@ui5/cli/node_modules/core-js node scripts/postinstall || echo "ignore"

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/@ui5/cli/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1031 packages from 849 contributors and audited 4017 packages in 24.023s

5 packages are looking for funding. Run "npm fund" to find out more. $ cd webapp/test/e2e/ $ npm run teste2e

DemoGitLab@0.0.1 teste2e /builds/jberthe/demogit npm-run-all --parallel start:webapp uiveri5

DemoGitLab@0.0.1 start:webapp /builds/jberthe/demogit ui5 serve

DemoGitLab@0.0.1 uiveri5 /builds/jberthe/demogit cd webapp/test/e2e/ && ZHOSTNAME=$(hostname -i) && uiveri5 -v --baseUrl=http://${ZHOSTNAME}:8080/index.html

INFO: @ui5/uiveri5 v1.41.0 DEBUG: Config from command-line: {"seleniumLoopback":false,"ignoreNothing":true,"v":1,"verbose":1,"baseUrl":"http://172.17.0.3:8080/index.html","conf":"/builds/jberthe/demogit/webapp/test/e2e/conf.js"} DEBUG: Loading default config from: /builds/jberthe/demogit/webapp/test/e2e/conf.js DEBUG: Loading profile config config from: ../conf/integration.profile.conf.js DEBUG: Loading common profile config from: ../conf/profile.conf.js DEBUG: Resolved runtime: {"browserName":"chrome","platformName":"linux","platformResolution":"1600x1200","browserVersion":"","platformVersion":"","deviceName":"","ui5":{"theme":"belize","direction":"ltr","mode":"cozy"},"capabilities":{"chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true}}} DEBUG: Config after resolving config file and profile: {"timeouts":{"waitForUI5Delta":200,"getPageTimeout":10000,"allScriptsTimeout":11000,"defaultTimeoutInterval":30000,"waitForUI5PollingInterval":400},"useClassicalWaitForUI5":false,"connection":"direct","connectionConfigs":{"direct":{"name":"./connection/directConnectionProvider","binaries":{"selenium":{"version":"3.12","patch":"0","filename":"selenium-server-standalone","url":"https://selenium-release.storage.googleapis.com/3.12/selenium-server-standalone-3.12.0.jar","executable":"selenium-server-standalone-3.12.0.jar"},"chromedriver":{"version":"{chrome.latest}","unzip":true,"filename":"chromedriver","baseurl":"https://chromedriver.storage.googleapis.com","url":"https://chromedriver.storage.googleapis.com/{chrome.latest}/chromedriver_linux64.zip","latestVersionUrl":"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_{chrome.latest}","latestVersionFileUrl":"https://raw.githubusercontent.com/SAP/ui5-uiveri5/master/driverVersions.json","executable":{"win32":"chromedriver-{chrome.latest}.exe","mac64":"chromedriver-{chrome.latest}","linux32":"chromedriver-{chrome.latest}","linux64":"chromedriver-{chrome.latest}"}},"iedriver":{"version":"3.12","patch":"0","unzip":true,"filename":"IEDriverServer.exe","url":"http://selenium-release.storage.googleapis.com/3.12/IEDriverServer_Win32_3.12.0.zip","executable":"IEDriverServer.exe"},"geckodriver":{"version":"{latest}","unzip":"false","untar":"true","filename":"geckodriver","baseurl":"http://github.com/mozilla/geckodriver/releases","url":"http://github.com/mozilla/geckodriver/releases/download/{latest}/geckodriver-{latest}-linux64.tar.gz","latestVersionUrlRedirect":"http://github.com/mozilla/geckodriver/releases/latest","executable":{"win32":"geckodriver-{latest}.exe","win64":"geckodriver-{latest}.exe","mac64":"geckodriver-{latest}","linux32":"geckodriver-{latest}","linux64":"geckodriver-{latest}"}}}}},"browserCapabilities":{"browser,chrome":{"android":{"":{"deviceName":"android"}}},"firefox,ie,edge,safari,chrome,chromium":{"windows,mac,linux":{"":{"remoteWebDriverOptions":{"maximized":true}}}},"chrome,chromium":{"":{"":{"chromeOptions":{"args":["disable-infobars"]}}}},"safari":{"mac":{"":{"safaridriverOptions":{"addArguments":["--legacy"]}}}},"chromeMobileEmulation":{"":{"":{"browserName":"chrome","remoteWebDriverOptions":{"maximized":false,"scaling":{"x":4,"y":4}},"chromeOptions":{"mobileEmulation":{"deviceMetrics":{"width":360,"height":560,"pixelRatio":4}}}}}},"chromeHeadless":{"":{"":{"browserName":"chrome","chromeOptions":{"args":["--headless","--no-sandbox"]}}}}},"auth":"plain","authConfigs":{"plain":{"name":"./authenticator/plainAuthenticator"},"basic":{"name":"./authenticator/basicUrlAuthenticator"},"fiori-form":{"name":"./authenticator/formAuthenticator","userFieldSelector":"#USERNAME_BLOCK input","passFieldSelector":"#PASSWORD_BLOCK input","logonButtonSelector":"#LOGIN_LINK"},"sapcloud-form":{"name":"./authenticator/formAuthenticator","userFieldSelector":"#j_username","passFieldSelector":"#j_password","logonButtonSelector":"#logOnFormSubmit"}},"reporters":[{"name":"./reporter/consoleReporter"},{"name":"./reporter/screenshotReporter"}],"locators":[{"name":"./defaultLocators"}],"plugins":[],"matchers":[],"specResolver":"./resolver/localSpecResolver","pageLoading":{"wait":"3000"},"takeScreenshot":{"onExpectFailure":true,"onExpectSuccess":true,"onAction":true},"profile":"integration","baseUrl":"http://172.17.0.3:8080/index.html","seleniumLoopback":false,"ignoreNothing":true,"v":1,"verbose":1,"conf":"/builds/jberthe/demogit/webapp/test/e2e/conf.js","osTypeString":"linux64","runtimes":[{"browserName":"chrome","platformName":"linux","platformResolution":"1600x1200","browserVersion":"*","platformVersion":"*","deviceName":"*","ui5":{"theme":"belize","direction":"ltr","mode":"cozy"},"capabilities":{"chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true}}}]} DEBUG: Current working directory: /builds/jberthe/demogit/webapp/test/e2e DEBUG: Loading module: ./resolver/localSpecResolver with instance config: {} INFO: Resolving specs DEBUG: Resolving specs from: ./.spec.js DEBUG: Spec found, name: masterdetail ,path: /builds/jberthe/demogit/webapp/test/e2e/masterdetail.spec.js ,url:http://172.17.0.3:8080/index.html DEBUG: Loading module: ./connection/directConnectionProvider with instance config: {"binaries":{"selenium":{"version":"3.12","patch":"0","filename":"selenium-server-standalone","url":"https://selenium-release.storage.googleapis.com/3.12/selenium-server-standalone-3.12.0.jar","executable":"selenium-server-standalone-3.12.0.jar"},"chromedriver":{"version":"{chrome.latest}","unzip":true,"filename":"chromedriver","baseurl":"https://chromedriver.storage.googleapis.com","url":"https://chromedriver.storage.googleapis.com/{chrome.latest}/chromedriver_linux64.zip","latestVersionUrl":"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_{chrome.latest}","latestVersionFileUrl":"https://raw.githubusercontent.com/SAP/ui5-uiveri5/master/driverVersions.json","executable":{"win32":"chromedriver-{chrome.latest}.exe","mac64":"chromedriver-{chrome.latest}","linux32":"chromedriver-{chrome.latest}","linux64":"chromedriver-{chrome.latest}"}},"iedriver":{"version":"3.12","patch":"0","unzip":true,"filename":"IEDriverServer.exe","url":"http://selenium-release.storage.googleapis.com/3.12/IEDriverServer_Win32_3.12.0.zip","executable":"IEDriverServer.exe"},"geckodriver":{"version":"{latest}","unzip":"false","untar":"true","filename":"geckodriver","baseurl":"http://github.com/mozilla/geckodriver/releases","url":"http://github.com/mozilla/geckodriver/releases/download/{latest}/geckodriver-{latest}-linux64.tar.gz","latestVersionUrlRedirect":"http://github.com/mozilla/geckodriver/releases/latest","executable":{"win32":"geckodriver-{latest}.exe","win64":"geckodriver-{latest}.exe","mac64":"geckodriver-{latest}","linux32":"geckodriver-{latest}","linux64":"geckodriver-{latest}"}}}} DEBUG: Setting getPageTimeout: 10000 DEBUG: Setting allScriptsTimeout: 11000 DEBUG: Setting defaultTimeoutInterval: 30000 DEBUG: Resolved protractor multiCapabilities from runtime: [{"browserName":"chrome","platform":"LINUX","chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true},"runtime":{"browserName":"chrome","platformName":"linux","platformResolution":"1600x1200","browserVersion":"","platformVersion":"","deviceName":"","ui5":{"theme":"belize","direction":"ltr","mode":"cozy"},"capabilities":{"chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true}}}}] DEBUG: Loading BDD-style page object factory DEBUG: Setting up connection provider environment INFO: Check for latest major version of: chromedriver (node:94) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. Server started URL: http://localhost:8080 INFO: Found latest major version of chromedriver: 78 INFO: Check for latest version of: chromedriver INFO: Found latest version of chromedriver: 78.0.3904.105 INFO: Downloading webdriver binary: https://chromedriver.storage.googleapis.com/78.0.3904.105/chromedriver_linux64.zip INFO: Executing 1 specs [15:52:55] D/launcher - Running with --troubleshoot [15:52:55] D/launcher - Protractor version: 5.3.2 [15:52:55] D/launcher - Your base url for tests is http://172.17.0.3:8080/index.html [15:52:55] D/plugins - Plugin "Plugin #0" loaded. [15:52:55] I/launcher - Running 1 instances of WebDriver DEBUG: Starting local chromedriver with executable: /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 [15:52:55] E/launcher - spawn /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 ENOENT [15:52:55] E/launcher - Error: spawn /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19) at onErrorNT (internal/child_process.js:456:16) at processTicksAndRejections (internal/process/task_queues.js:80:21) [15:52:55] E/launcher - Process exited with error code 199 npm ERR! code ELIFECYCLE npm ERR! errno 199 npm ERR! DemoGitLab@0.0.1 uiveri5: cd webapp/test/e2e/ && ZHOSTNAME=$(hostname -i) && uiveri5 -v --baseUrl=http://${ZHOSTNAME}:8080/index.html npm ERR! Exit status 199 npm ERR! npm ERR! Failed at the DemoGitLab@0.0.1 uiveri5 script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-11-26T15_52_55_618Z-debug.log ERROR: "uiveri5" exited with 199. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! DemoGitLab@0.0.1 teste2e: npm-run-all --parallel start:webapp uiveri5 npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the DemoGitLab@0.0.1 teste2e script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-11-26T15_52_55_679Z-debug.log section_end:1574783578:build_script section_start:1574783578:after_script Running after script... $ ls -all /usr/local/lib/node_modules/@ui5/uiveri5 total 184 drwxr-sr-x 1 root root 4096 Nov 26 15:52 . drwxr-sr-x 1 root root 4096 Nov 21 20:36 .. -rw-r--r-- 1 root root 177 Oct 26 1985 .editorconfig -rw-r--r-- 1 root root 109 Oct 26 1985 .eslintignore -rw-r--r-- 1 root root 553 Oct 26 1985 .eslintrc.json -rw-r--r-- 1 root root 162 Oct 26 1985 .travis.yml -rw-r--r-- 1 root root 14185 Oct 26 1985 LICENSE.txt -rw-r--r-- 1 root root 59 Oct 26 1985 NOTICE.txt -rw-r--r-- 1 root root 4973 Oct 26 1985 README.md drwxr-sr-x 2 root root 4096 Nov 21 20:36 bin drwxr-sr-x 2 root root 4096 Nov 21 20:36 conf drwxr-sr-x 5 root root 4096 Nov 21 20:36 docs -rw-r--r-- 1 root root 39 Oct 26 1985 driverVersions.json drwxr-sr-x 4 root root 4096 Nov 21 20:36 e2e drwxr-sr-x 3 root root 4096 Nov 21 20:36 lib drwxr-sr-x 180 root root 4096 Nov 21 20:36 node_modules -rw-r--r-- 1 root root 2535 Nov 21 20:36 package.json drwxr-sr-x 3 root root 4096 Nov 21 20:36 sample drwxr-sr-x 2 root root 4096 Nov 26 15:52 selenium drwxr-sr-x 13 root root 4096 Nov 21 20:36 spec drwxr-sr-x 11 root root 4096 Nov 21 20:36 src $ ls -all /usr/local/lib/node_modules/@ui5/uiveri5/selenium total 11360 drwxr-sr-x 2 root root 4096 Nov 26 15:52 . drwxr-sr-x 1 root root 4096 Nov 26 15:52 .. -rwxr-xr-x 1 root root 11610824 Nov 18 10:20 chromedriver-78.0.3904.105 section_end:1574783580:after_script section_start:1574783580:upload_artifacts_on_failure section_end:1574783582:upload_artifacts_on_failure ERROR: Job failed: exit code 1 

maximnaidenov commented 5 years ago

Downloading of the webdriver seems to be fine but starting it fails with: 15:52:55] E/launcher - Error: spawn /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19) at onErrorNT (internal/child_process.js:456:16) at processTicksAndRejections (internal/process/task_queues.js:80:21) [15:52:55] E/launcher - Process exited with error code 199

Could you please temporary enable chromedriver log and copy it here. just add this section: browsers: [{ browserName: 'chrome', capabilities: { chromedriverOptions: { 'enableVerboseLogging': [], 'loggingTo': ['chromedriver.log'] } } } }] in your conf.js The log file will appear in the working directory.

maximnaidenov commented 5 years ago

My assumption is that the problem is network-related and maybe is: https://stackoverflow.com/a/49985242 but the chromedriver log will clarify it. Another possibility is if your container is alpine-based and does not have IPv6 network stack enabled by default. Then you would need an option for chromedriver to force IPv4 usage.

jberthe commented 5 years ago

OUps i made a mistake... the issue is still open...

jberthe commented 5 years ago

For the log, I don't know how to retreive the file because it is in the pipeline (in a docker). I will try to push it into Git.

maximnaidenov commented 5 years ago

maybe you can cat the content and see it in the log. It will be only few lines.

jberthe commented 5 years ago

https://stackoverflow.com/a/49985242 The localhost is well configured.

For the log file, it seams that the system doesn't generate the file. HEre is what I did : cat /builds/jberthe/demogit/webapp/test/e2e/chromedriver.log

conf.js :

exports.config = { profile: 'integration',

baseUrl: 'http://localhost:8080/index.html',

browsers: [{
    browserName: 'chrome',
        capabilities: {
         chromedriverOptions: {
            'enableVerboseLogging': [],
            'loggingTo': ['chromedriver.log']
            }
        }
    }
    ]

};

Log :

$ npm run teste2e 92 > DemoGitLab@0.0.1 teste2e /builds/jberthe/demogit 93 > npm-run-all --parallel start:webapp uiveri5 94 > DemoGitLab@0.0.1 uiveri5 /builds/jberthe/demogit 95 > cd webapp/test/e2e/ && ZHOSTNAME=$(hostname -i) && uiveri5 -v --baseUrl=http://${ZHOSTNAME}:8080/index.html 96 > DemoGitLab@0.0.1 start:webapp /builds/jberthe/demogit 97 > ui5 serve 98 INFO: @ui5/uiveri5 v1.41.0 99 DEBUG: Config from command-line: {"seleniumLoopback":false,"ignoreNothing":true,"v":1,"verbose":1,"baseUrl":"http://172.17.0.3:8080/index.html","conf":"/builds/jberthe/demogit/webapp/test/e2e/conf.js"} 100 DEBUG: Loading default config from: /builds/jberthe/demogit/webapp/test/e2e/conf.js 101 DEBUG: Loading profile config config from: ../conf/integration.profile.conf.js 102 DEBUG: Loading common profile config from: ../conf/profile.conf.js 103 DEBUG: Resolved runtime: {"browserName":"chrome","capabilities":{"chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true},"chromedriverOptions":{"enableVerboseLogging":[],"loggingTo":["chromedriver.log"]}},"platformName":"linux","platformResolution":"1600x1200","browserVersion":"","platformVersion":"","deviceName":"","ui5":{"theme":"belize","direction":"ltr","mode":"cozy"}} 104 DEBUG: Config after resolving config file and profile: {"timeouts":{"waitForUI5Delta":200,"getPageTimeout":10000,"allScriptsTimeout":11000,"defaultTimeoutInterval":30000,"waitForUI5PollingInterval":400},"useClassicalWaitForUI5":false,"connection":"direct","connectionConfigs":{"direct":{"name":"./connection/directConnectionProvider","binaries":{"selenium":{"version":"3.12","patch":"0","filename":"selenium-server-standalone","url":"https://selenium-release.storage.googleapis.com/3.12/selenium-server-standalone-3.12.0.jar","executable":"selenium-server-standalone-3.12.0.jar"},"chromedriver":{"version":"{chrome.latest}","unzip":true,"filename":"chromedriver","baseurl":"https://chromedriver.storage.googleapis.com","url":"https://chromedriver.storage.googleapis.com/{chrome.latest}/chromedriver_linux64.zip","latestVersionUrl":"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_{chrome.latest}","latestVersionFileUrl":"https://raw.githubusercontent.com/SAP/ui5-uiveri5/master/driverVersions.json","executable":{"win32":"chromedriver-{chrome.latest}.exe","mac64":"chromedriver-{chrome.latest}","linux32":"chromedriver-{chrome.latest}","linux64":"chromedriver-{chrome.latest}"}},"iedriver":{"version":"3.12","patch":"0","unzip":true,"filename":"IEDriverServer.exe","url":"http://selenium-release.storage.googleapis.com/3.12/IEDriverServer_Win32_3.12.0.zip","executable":"IEDriverServer.exe"},"geckodriver":{"version":"{latest}","unzip":"false","untar":"true","filename":"geckodriver","baseurl":"http://github.com/mozilla/geckodriver/releases","url":"http://github.com/mozilla/geckodriver/releases/download/{latest}/geckodriver-{latest}-linux64.tar.gz","latestVersionUrlRedirect":"http://github.com/mozilla/geckodriver/releases/latest","executable":{"win32":"geckodriver-{latest}.exe","win64":"geckodriver-{latest}.exe","mac64":"geckodriver-{latest}","linux32":"geckodriver-{latest}","linux64":"geckodriver-{latest}"}}}}},"browserCapabilities":{"browser,chrome":{"android":{"":{"deviceName":"android"}}},"firefox,ie,edge,safari,chrome,chromium":{"windows,mac,linux":{"":{"remoteWebDriverOptions":{"maximized":true}}}},"chrome,chromium":{"":{"":{"chromeOptions":{"args":["disable-infobars"]}}}},"safari":{"mac":{"":{"safaridriverOptions":{"addArguments":["--legacy"]}}}},"chromeMobileEmulation":{"":{"":{"browserName":"chrome","remoteWebDriverOptions":{"maximized":false,"scaling":{"x":4,"y":4}},"chromeOptions":{"mobileEmulation":{"deviceMetrics":{"width":360,"height":560,"pixelRatio":4}}}}}},"chromeHeadless":{"":{"":{"browserName":"chrome","chromeOptions":{"args":["--headless","--no-sandbox"]}}}}},"auth":"plain","authConfigs":{"plain":{"name":"./authenticator/plainAuthenticator"},"basic":{"name":"./authenticator/basicUrlAuthenticator"},"fiori-form":{"name":"./authenticator/formAuthenticator","userFieldSelector":"#USERNAME_BLOCK input","passFieldSelector":"#PASSWORD_BLOCK input","logonButtonSelector":"#LOGIN_LINK"},"sapcloud-form":{"name":"./authenticator/formAuthenticator","userFieldSelector":"#j_username","passFieldSelector":"#j_password","logonButtonSelector":"#logOnFormSubmit"}},"reporters":[{"name":"./reporter/consoleReporter"},{"name":"./reporter/screenshotReporter"}],"locators":[{"name":"./defaultLocators"}],"plugins":[],"matchers":[],"specResolver":"./resolver/localSpecResolver","pageLoading":{"wait":"3000"},"takeScreenshot":{"onExpectFailure":true,"onExpectSuccess":true,"onAction":true},"profile":"integration","baseUrl":"http://172.17.0.3:8080/index.html","browsers":[{"browserName":"chrome","capabilities":{"chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true},"chromedriverOptions":{"enableVerboseLogging":[],"loggingTo":["chromedriver.log"]}},"platformName":"linux","platformResolution":"1600x1200","browserVersion":"*","platformVersion":"*","deviceName":"*","ui5":{"theme":"belize","direction":"ltr","mode":"cozy"}}],"seleniumLoopback":false,"ignoreNothing":true,"v":1,"verbose":1,"conf":"/builds/jberthe/demogit/webapp/test/e2e/conf.js","osTypeString":"linux64","runtimes":[{"browserName":"chrome","capabilities":{"chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true},"chromedriverOptions":{"enableVerboseLogging":[],"loggingTo":["chromedriver.log"]}},"platformName":"linux","platformResolution":"1600x1200","browserVersion":"*","platformVersion":"*","deviceName":"*","ui5":{"theme":"belize","direction":"ltr","mode":"cozy"}}]} 105 DEBUG: Current working directory: /builds/jberthe/demogit/webapp/test/e2e 106 DEBUG: Loading module: ./resolver/localSpecResolver with instance config: {} 107 INFO: Resolving specs 108 DEBUG: Resolving specs from: ./.spec.js 109 DEBUG: Spec found, name: masterdetail ,path: /builds/jberthe/demogit/webapp/test/e2e/masterdetail.spec.js ,url:http://172.17.0.3:8080/index.html 110 DEBUG: Loading module: ./connection/directConnectionProvider with instance config: {"binaries":{"selenium":{"version":"3.12","patch":"0","filename":"selenium-server-standalone","url":"https://selenium-release.storage.googleapis.com/3.12/selenium-server-standalone-3.12.0.jar","executable":"selenium-server-standalone-3.12.0.jar"},"chromedriver":{"version":"{chrome.latest}","unzip":true,"filename":"chromedriver","baseurl":"https://chromedriver.storage.googleapis.com","url":"https://chromedriver.storage.googleapis.com/{chrome.latest}/chromedriver_linux64.zip","latestVersionUrl":"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_{chrome.latest}","latestVersionFileUrl":"https://raw.githubusercontent.com/SAP/ui5-uiveri5/master/driverVersions.json","executable":{"win32":"chromedriver-{chrome.latest}.exe","mac64":"chromedriver-{chrome.latest}","linux32":"chromedriver-{chrome.latest}","linux64":"chromedriver-{chrome.latest}"}},"iedriver":{"version":"3.12","patch":"0","unzip":true,"filename":"IEDriverServer.exe","url":"http://selenium-release.storage.googleapis.com/3.12/IEDriverServer_Win32_3.12.0.zip","executable":"IEDriverServer.exe"},"geckodriver":{"version":"{latest}","unzip":"false","untar":"true","filename":"geckodriver","baseurl":"http://github.com/mozilla/geckodriver/releases","url":"http://github.com/mozilla/geckodriver/releases/download/{latest}/geckodriver-{latest}-linux64.tar.gz","latestVersionUrlRedirect":"http://github.com/mozilla/geckodriver/releases/latest","executable":{"win32":"geckodriver-{latest}.exe","win64":"geckodriver-{latest}.exe","mac64":"geckodriver-{latest}","linux32":"geckodriver-{latest}","linux64":"geckodriver-{latest}"}}}} 111 DEBUG: Setting getPageTimeout: 10000 112 DEBUG: Setting allScriptsTimeout: 11000 113 DEBUG: Setting defaultTimeoutInterval: 30000 114 DEBUG: Resolved protractor multiCapabilities from runtime: [{"browserName":"chrome","platform":"LINUX","chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true},"chromedriverOptions":{"enableVerboseLogging":[],"loggingTo":["chromedriver.log"]},"runtime":{"browserName":"chrome","capabilities":{"chromeOptions":{"args":["disable-infobars"]},"remoteWebDriverOptions":{"maximized":true},"chromedriverOptions":{"enableVerboseLogging":[],"loggingTo":["chromedriver.log"]}},"platformName":"linux","platformResolution":"1600x1200","browserVersion":"","platformVersion":"","deviceName":"","ui5":{"theme":"belize","direction":"ltr","mode":"cozy"}}}] 115 DEBUG: Loading BDD-style page object factory 116 DEBUG: Setting up connection provider environment 117 INFO: Check for latest major version of: chromedriver 118 (node:94) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. 119 Server started 120 URL: http://localhost:8080 121 INFO: Found latest major version of chromedriver: 78 122 INFO: Check for latest version of: chromedriver 123 INFO: Found latest version of chromedriver: 78.0.3904.105 124 INFO: Downloading webdriver binary: https://chromedriver.storage.googleapis.com/78.0.3904.105/chromedriver_linux64.zip 125 INFO: Executing 1 specs 126 [15:30:20] D/launcher - Running with --troubleshoot 127 [15:30:20] D/launcher - Protractor version: 5.3.2 128 [15:30:20] D/launcher - Your base url for tests is http://172.17.0.3:8080/index.html 129 [15:30:20] D/plugins - Plugin "Plugin #0" loaded. 130 [15:30:20] I/launcher - Running 1 instances of WebDriver 131 DEBUG: Starting local chromedriver with executable: /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 132 [15:30:20] E/launcher - spawn /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 ENOENT 133 [15:30:20] E/launcher - Error: spawn /usr/local/lib/node_modules/@ui5/uiveri5/selenium/chromedriver-78.0.3904.105 ENOENT 134 at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19) 135 at onErrorNT (internal/child_process.js:456:16) 136 at processTicksAndRejections (internal/process/task_queues.js:80:21) 137 [15:30:20] E/launcher - Process exited with error code 199 138 npm ERR! code ELIFECYCLE 139 npm ERR! errno 199 140 npm ERR! DemoGitLab@0.0.1 uiveri5: cd webapp/test/e2e/ && ZHOSTNAME=$(hostname -i) && uiveri5 -v --baseUrl=http://${ZHOSTNAME}:8080/index.html 141 npm ERR! Exit status 199 142 npm ERR! 143 npm ERR! Failed at the DemoGitLab@0.0.1 uiveri5 script. 144 npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 145 npm ERR! A complete log of this run can be found in: 146 npm ERR! /root/.npm/_logs/2019-11-27T15_30_20_212Z-debug.log 147 ERROR: "uiveri5" exited with 199. 148 npm ERR! code ELIFECYCLE 149 npm ERR! errno 1 150 npm ERR! DemoGitLab@0.0.1 teste2e: npm-run-all --parallel start:webapp uiveri5 151 npm ERR! Exit status 1 152 npm ERR! 153 npm ERR! Failed at the DemoGitLab@0.0.1 teste2e script. 154 npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 155 npm ERR! A complete log of this run can be found in: 156 npm ERR! /root/.npm/_logs/2019-11-27T15_30_20_271Z-debug.log 157 Running after script... 00:02 158 $ ls -all /usr/local/lib/node_modules/@ui5/uiveri5 159 total 184 160 drwxr-sr-x 1 root root 4096 Nov 27 15:30 . 161 drwxr-sr-x 1 root root 4096 Nov 21 20:36 .. 162 -rw-r--r-- 1 root root 177 Oct 26 1985 .editorconfig 163 -rw-r--r-- 1 root root 109 Oct 26 1985 .eslintignore 164 -rw-r--r-- 1 root root 553 Oct 26 1985 .eslintrc.json 165 -rw-r--r-- 1 root root 162 Oct 26 1985 .travis.yml 166 -rw-r--r-- 1 root root 14185 Oct 26 1985 LICENSE.txt 167 -rw-r--r-- 1 root root 59 Oct 26 1985 NOTICE.txt 168 -rw-r--r-- 1 root root 4973 Oct 26 1985 README.md 169 drwxr-sr-x 2 root root 4096 Nov 21 20:36 bin 170 drwxr-sr-x 2 root root 4096 Nov 21 20:36 conf 171 drwxr-sr-x 5 root root 4096 Nov 21 20:36 docs 172 -rw-r--r-- 1 root root 39 Oct 26 1985 driverVersions.json 173 drwxr-sr-x 4 root root 4096 Nov 21 20:36 e2e 174 drwxr-sr-x 3 root root 4096 Nov 21 20:36 lib 175 drwxr-sr-x 180 root root 4096 Nov 21 20:36 node_modules 176 -rw-r--r-- 1 root root 2535 Nov 21 20:36 package.json 177 drwxr-sr-x 3 root root 4096 Nov 21 20:36 sample 178 drwxr-sr-x 2 root root 4096 Nov 27 15:30 selenium 179 drwxr-sr-x 13 root root 4096 Nov 21 20:36 spec 180 drwxr-sr-x 11 root root 4096 Nov 21 20:36 src 181 $ ls -all /usr/local/lib/node_modules/@ui5/uiveri5/selenium 182 total 11360 183 drwxr-sr-x 2 root root 4096 Nov 27 15:30 . 184 drwxr-sr-x 1 root root 4096 Nov 27 15:30 .. 185 -rwxr-xr-x 1 root root 11610824 Nov 18 10:20 chromedriver-78.0.3904.105 186 $ cat /builds/jberthe/demogit/webapp/test/e2e/chromedriver.log 187 cat: can't open '/builds/jberthe/demogit/webapp/test/e2e/chromedriver.log': No such file or directory

How to activate the IPV4 ?

jberthe commented 5 years ago

I think I am in IPv6 because when I look at /etc/hosts I have this : $ cat /etc/hosts 43 127.0.0.1 localhost 44 ::1 localhost ip6-localhost ip6-loopback 45 fe00::0 ip6-localnet 46 ff00::0 ip6-mcastprefix 47 ff02::1 ip6-allnodes 48 ff02::2 ip6-allrouters 49 127.0.0.1 0hshit.hopto.org 50 127.0.0.1 daymndaymn.myftp.org 51 127.0.0.1 loba.webhop.me 52 172.17.0.3 runner-ed2dce3a-project-15233843-concurrent-0

maximnaidenov commented 5 years ago

As mentioned, I expect to see the logfile in the CWD e.g. in webapp/test/e2e/ Please try again listing the content and cat'ing the file

maximnaidenov commented 5 years ago

Ups, this seems to be the last cat so somehow the logfile is not created. Lets try once more - please try running the downloaded chromedriver (after uiveri5 fails) and see what error will be thrown.

maximnaidenov commented 5 years ago

One suggestion - we use extensively docker images based in ubuntu and never had any such issues. Here we lost so much time to debug the docker image setup, it is totally unproductive. My suggestion is to switch to running uiveri5 in an ubuntu-based image. Try this manually - just run the image locally, install uiveri5, clone the repo and run this in an interactive shell on locally started docker. And once you verified the setup, push the CI setup.

jberthe commented 5 years ago

Do you have an image I can use to base my pipeline?

I will create one, based on image ubuntu:lastest but if you have one it will be faster :)

-- Envoi sécurisé avec Tutanota. Obtenez votre propre adresse email chiffrée : https://tutanota.com

28 nov. 2019 à 10:32 de notifications@github.com:

One suggestion - we use extensively docker images based in ubuntu and never had any such issues. Here we lost so much time to debug the docker image setup, it is totally unproductive. My suggestion is to switch to running uiveri5 in an ubuntu-based image. Try this manually - just run the image locally, install uiveri5, clone the repo and run this in an interactive shell on locally started docker. And once you verified the setup, push the CI setup.

— You are receiving this because you modified the open/close state. Reply to this email directly, > view it on GitHub https://github.com/SAP/ui5-uiveri5/issues/139?email_source=notifications&email_token=ABOJHU6VXXCG4BLKIRDMJSLQV6F3VA5CNFSM4JQMJ4NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFMABPY#issuecomment-559415487> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/ABOJHU35KGJT7BJIEY4QOWLQV6F3VANCNFSM4JQMJ4NA> .

maximnaidenov commented 5 years ago

We don't have "official image", we have few internals but they have more stuff than you need. Actually, it is quite simple, you only need to add a few tools over the base ubuntu image:

add nodejs and npm RUN apt-get update && apt-get install -y \ nodejs \ npm

add latest stable chrome

RUN curl -s https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ && echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list \ && apt-get update && apt-get install -y google-chrome-stable

add npm and uiveri5

RUN npm install -g npm \ && npm install -g @ui5/uiveri5

enable chrome driver download

RUN mkdir /usr/local/lib/node_modules/@ui5/uiveri5/selenium \ && chmod -R 777 /usr/local/lib/node_modules/@ui5/uiveri5/selenium

jberthe commented 5 years ago

Thanks for your answer, I'm still trying to create my docker image and use it in interactive mode, but I'm new in it end it takes some times.... I have an error with docker on my Windows machine.. so I will let you know when it will be OK....

jberthe commented 5 years ago

Here is the log :)

[1575063786.710][INFO]: Starting ChromeDriver 78.0.3904.105 (60e2d8774a8151efa6a00b1f358371b1e0e07ee2-refs/branch-heads/3904@{#877}) [1575063786.710][INFO]: Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. [1575063786.719][SEVERE]: bind() failed: Cannot assign requested address (99) [1575063786.719][INFO]: listen on IPv6 failed with error ERR_ADDRESS_INVALID [1575063786.801][INFO]: [b2e659cae9d333ac03f809e82ebde9e4] COMMAND InitSession { "desiredCapabilities": { "browserName": "chrome", "chromeOptions": { "args": [ "disable-infobars" ] } } } [1575063786.805][INFO]: Populating Preferences file: { "alternate_error_pages": { "enabled": false }, "autofill": { "enabled": false }, "browser": { "check_default_browser": false }, "distribution": { "import_bookmarks": false, "import_history": false, "import_search_engine": false, "make_chrome_default_for_user": false, "skip_first_run_ui": true }, "dns_prefetching": { "enabled": false }, "profile": { "content_settings": { "pattern_pairs": { "https://,": { "media-stream": { "audio": "Default", "video": "Default" } } } }, "default_content_setting_values": { "geolocation": 1 }, "default_content_settings": { "geolocation": 1, "mouselock": 1, "notifications": 1, "popups": 1, "ppapi-broker": 1 }, "password_manager_enabled": false }, "safebrowsing": { "enabled": false }, "search": { "suggest_enabled": false }, "translate": { "enabled": false } } [1575063786.805][INFO]: Populating Local State file: { "background_mode": { "enabled": false }, "ssl": { "rev_checking": { "enabled": false } } } [1575063786.810][INFO]: Launching chrome: /usr/bin/chromium-browser --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-infobars --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --force-fieldtrials --ignore-certificate-errors --load-extension=/tmp/.com.google.Chrome.wsYo3s/internal --log-level=0 --no-first-run --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.UEwZCh data:, [168:168:1129/214307.311494:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [1575063787.376][INFO]: [b2e659cae9d333ac03f809e82ebde9e4] RESPONSE InitSession ERROR unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.) [1575063787.378][DEBUG]: Log type 'driver' lost 0 entries on destruction [1575063787.378][DEBUG]: Log type 'browser' lost 0 entries on destruction

It seams that you have to put this command line -no-sandbox when you call Chrome.

maximnaidenov commented 5 years ago

That's easy, see the how to add args here: https://github.com/SAP/ui5-uiveri5/blob/master/docs/config/drivers.md

jberthe commented 5 years ago

Thanks, it's better but still not working...

here is the error now :

Gtk-WARNING **: 08:12:28.209: cannot open display: :0

The full log :

[1575275499.843][INFO]: Starting ChromeDriver 78.0.3904.105 (60e2d8774a8151efa6a00b1f358371b1e0e07ee2-refs/branch-heads/3904@{#877}) 272 [1575275499.843][INFO]: Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. 273 [1575275499.911][INFO]: [4cd63a17182894249ebcbfb3bb68db79] COMMAND InitSession { 274 "desiredCapabilities": { 275 "browserName": "chrome", 276 "chromeOptions": { 277 "args": [ "--no-sandbox", "--headerless", "--disable-gpu" ] 278 } 279 } 280 } 281 [1575275499.912][INFO]: Populating Preferences file: { 282 "alternate_error_pages": { 283 "enabled": false 284 }, 285 "autofill": { 286 "enabled": false 287 }, 288 "browser": { 289 "check_default_browser": false 290 }, 291 "distribution": { 292 "import_bookmarks": false, 293 "import_history": false, 294 "import_search_engine": false, 295 "make_chrome_default_for_user": false, 296 "skip_first_run_ui": true 297 }, 298 "dns_prefetching": { 299 "enabled": false 300 }, 301 "profile": { 302 "content_settings": { 303 "pattern_pairs": { 304 "https://,": { 305 "media-stream": { 306 "audio": "Default", 307 "video": "Default" 308 } 309 } 310 } 311 }, 312 "default_content_setting_values": { 313 "geolocation": 1 314 }, 315 "default_content_settings": { 316 "geolocation": 1, 317 "mouselock": 1, 318 "notifications": 1, 319 "popups": 1, 320 "ppapi-broker": 1 321 }, 322 "password_manager_enabled": false 323 }, 324 "safebrowsing": { 325 "enabled": false 326 }, 327 "search": { 328 "suggest_enabled": false 329 }, 330 "translate": { 331 "enabled": false 332 } 333 } 334 [1575275499.912][INFO]: Populating Local State file: { 335 "background_mode": { 336 "enabled": false 337 }, 338 "ssl": { 339 "rev_checking": { 340 "enabled": false 341 } 342 } 343 } 344 [1575275499.913][INFO]: Launching chrome: /usr/bin/chromium-browser --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-gpu --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --force-fieldtrials --headerless --ignore-certificate-errors --load-extension=/tmp/.com.google.Chrome.GWzsIr/internal --log-level=0 --no-first-run --no-sandbox --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.JsAY5O data:, 345 (chromium-browser:134): Gtk-WARNING **: 08:31:40.004: cannot open display: :0 346 [1575275500.015][INFO]: [4cd63a17182894249ebcbfb3bb68db79] RESPONSE InitSession ERROR unknown error: Chrome failed to start: exited abnormally 347 (unknown error: DevToolsActivePort file doesn't exist) 348 (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 349 [1575275500.017][DEBUG]: Log type 'driver' lost 0 entries on destruction 350 [1575275500.017][DEBUG]: Log type 'browser' lost 0 entries on destruction

maximnaidenov commented 5 years ago

you have a typo in the "headless" BTW why don't you use browsers: chromeHeadless, it hs all necessary args.

jberthe commented 5 years ago

How to use chromeHeadless ? (maybe stupid question... sorry)

maximnaidenov commented 5 years ago

--browsers=chromeHeadless from cmd or browsers: [{browserName: chromeHeadless}] in cons.js

jberthe commented 5 years ago

I have corrected my typo and no more DISPLAY problem 👍

But now I have this issue :

[09:06:47] D/runner - Running with spec files /root/demogit/webapp/test/e2e/masterdetail.spec.js DEBUG: Loading module: ./defaultLocators with instance config: {} DEBUG: Registering default locators DEBUG: Loading module: ./reporter/consoleReporter with instance config: {} DEBUG: Loading module: ./reporter/screenshotReporter with instance config: {} INFO: Suite started: masterdetail INFO: Spec started: should load the app DEBUG: Runtime resolved from capabilities: {"browserName":"chrome","capabilities":{"chromeOptions":{"args":["--no-sandbox","--headless","--disable-gpu","--disable-setuid-sandbox"]},"remoteWebDriverOptions":{"maximized":true},"chromedriverOptions":{"enableVerboseLogging":[],"loggingTo":["chromedriver.log"]}},"platformName":"linux","platformResolution":"1600x1200","browserVersion":"","platformVersion":"","deviceName":"*","ui5":{"theme":"belize","direction":"ltr","mode":"cozy"}} DEBUG: Maximizing browser window DEBUG: Loading module: ./authenticator/plainAuthenticator with instance config: {} DEBUG: Execute async script: loadUI5Dependencies with params: {"waitForUI5Timeout":10800,"waitForUI5PollingInterval":400,"useClassicalWaitForUI5":false} INFO: Opening: http://localhost:8080/index.html DEBUG: Waiting for redirect to complete, current url: http://localhost:8080/index.html DEBUG: Initial page load wait: 3000ms DEBUG: Async script: loadUI5Dependencies logs: Loading waitForUI5 implementation Loading OPA5 control locator utilities. Loading OPA5 waitForUI5 implementation. DEBUG: Async script: loadUI5Dependencies result: undefined INFO: UI5 Version: 1.65.14 INFO: UI5 Timestamp: 201911140917 DEBUG: Screenshot created "target/report/screenshots/masterdetail-should-load-the-app_0_pass_2019-12-02T09-06-56.png" INFO: Spec finished: should load the app with status: PASSED INFO: Spec started: should display the details screen DEBUG: Screenshot created "target/report/screenshots/click___button0_0_2019-12-02T09-06-57.png" INFO: Spec finished: should display the details screen with status: PASSED INFO: Suite finished: masterdetail with status: PASSED for: 9.479s INFO: Suite specs summary, total: 2, passed: 2, failed: 0, pending: 0, disabled: 0 INFO: Suite expectations summary, total: 1, passed: 1, failed total: 0, failed with error: 0, failed with image comparison: 0 INFO: Overall status: PASSED for: 9.487s INFO: Overall suites summary, total: 1, passed: 1, failed: 0 INFO: Overall specs summary, total: 2, passed: 2, failed: 0, pending: 0, disabled: 0 INFO: Overall expectations summary, total: 1, passed: 1, failed total: 0, failed with error: 0, failed with image comparison: 0 [09:06:57] I/launcher - 0 instance(s) of WebDriver still running [09:06:57] I/launcher - chrome #01 passed DEBUG: Tearing down connection provider environment

And it's waiting... and waiting....

maximnaidenov commented 5 years ago

uiveri5 is finished and closed chrome. I have no idea what else you script may be waiting.

jberthe commented 5 years ago

uiveri5 is finished and closed chrome. I have no idea what else you script may be waiting.

Good to know :) but, in the pipeline, the script doesn't end up. The status is still running....

jberthe commented 5 years ago

It's WORKING !!!!!!!!!!!!!! The waiting process was because I've used into my npm script: npm-run-all --parallel So I have modify the script to make it working. Here the files :

conf.js file:

exports.config = { profile: 'integration',

baseUrl: 'http://localhost:8080/index.html',

browsers: [{
    browserName: 'chrome',
        capabilities: {
        chromeOptions: {
              args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-setuid-sandbox']
            }
        }
    }
    ]

};

.gitlab-ci.yml file:

image: jberthe/sapui5:latest

stages:

  • test

before_script:

  • mkdir /usr/lib/node_modules/@ui5/uiveri5/selenium
  • chmod -R 777 /usr/lib/node_modules/@ui5/uiveri5/selenium

unit-test: stage: test script:

  • npm install
  • ui5 serve &
  • cd webapp/test/e2e/
  • uiveri5

Many thanks Maxim 🥇

maximnaidenov commented 5 years ago

you can remove the chromedriver log parts - the configuration the the cat'ing. Rest is fine.

arv-inc commented 4 years ago

How add experimental options to Chrome? Like this: add_experimental_option("detach", True)

maximnaidenov commented 4 years ago

args:[] ?