SAP / ui5-uiveri5

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

Authentication failing when we navigate using browser.get #368

Open NarayanM01 opened 2 years ago

NarayanM01 commented 2 years ago

We are using browser.get() to navigate to external app. browser.get( oParams.systemURL ,{ auth: { 'sapcloud-form': { user: oParams.ProjBillingUser.UserName, pass: oParams.ProjBillingUser.Password, userFieldSelector: oParams.userFieldSelector, passFieldSelector: oParams.passFieldSelector, logonButtonSelector: oParams.logonButtonSelector } } }); It seems like browser is waiting for login page. And authentication is happening twice.

Error: TimeoutError: Waiting to redirect to login page Wait timed out after 110000ms at /home/jenkins/workspace/us.cpm.projengagement.maint_main/infra/webapp/test/uiveri5/nodemodules/selenium-webdriver/lib/promise.js:2201:17 at ManagedPromise.invokeCallback (/home/jenkins/workspace/us.cpm.projengagement.maint_main/infra/webapp/test/uiveri5/nodemodules/selenium-webdriver/lib/promise.js:1376:14) at TaskQueue.execute (/home/jenkins/workspace/us.cpm.projengagement.maint_main/infra/webapp/test/uiveri5/nodemodules/selenium-webdriver/lib/promise.js:3084:14) at TaskQueue.executeNext (/home/jenkins/workspace/us.cpm.projengagement.maint_main/infra/webapp/test/uiveri5/node_modules/selenium-webdriver/lib/promise.js:3067:27) at /home/jenkins/workspace/us.cpm.projengagement.maint_main/infra/webapp/test/uiveri5/node_modules/selenium-webdriver/lib/promise.js:2927:27 at /home/jenkins/workspace/us.cpm.projengagement.maint_main/infra/webapp/test/uiveri5/node_modules/selenium-webdriver/lib/promise.js:668:7 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) From: Task: Waiting to redirect to login page at scheduleWait (/home/jenkins/workspace/us.cpm.projengagement.maint_main/infra/webapp/test/uiveri5/node_modules/selenium-webdriver/lib/promise.js:2188:20) image

Build : https://fio-pipe06.codepipes.wdf.sap.corp/job/S4-FIORI-CORE-6%20GitHub%20Quality/job/cus.cpm.projengagement.maint/job/main/395/UIVeri5_20Test_20Report/

NarayanM01 commented 2 years ago

We have already tried the fix suggested in one of the issue reported in the past. https://github.com/SAP/ui5-uiveri5/issues/195

Please check this issue.

hmanchev commented 2 years ago

Hi, It seems you try to authenticate twice as described in #195 Do you have auth in your conf.js file?

Please use one of the available options. In your case maybe the auth in browser.get should be fine, but in conbination with auth in conf.js it's not possible to make it work properly.

NarayanM01 commented 2 years ago

Hi, We don't have auth in conf.js. and still authentication did not work properly.

Again we tried only browser.get() to open multiple apps from one spec file. That is also not working. Have a look into below file and let us know whether we are using it correctly. SpecFile

Build : https://fio-pipe06.codepipes.wdf.sap.corp/job/S4-FIORI-CORE-6%20GitHub%20Quality/job/cus.cpm.projengagement.maint/job/main/402/UIVeri5_20Test_20Report

hmanchev commented 2 years ago

Hi,

As I can see, you are providing authentication from the command line where the UIVeri5 test is started. In the repo you sent, I see that browser.get with auth calls are commented. Is this the state of the test which is executed in the provided build?

I still suppose that you have somewhere provided auth configuration twice.