nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.76k stars 4k forks source link

[Bug]: Login instrumented test on Android fails as element not interactable #38213

Open tobiasKaminsky opened 1 year ago

tobiasKaminsky commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

On Android we run a test using web login. This since a while fails with:

java.lang.RuntimeException: java.lang.RuntimeException: Error in evaluationEvaluation: status: 12 value: {message=Element is not currently interactable and may not be manipulated} hasMessage: true message: Element is not currently interactable and may not be manipulated
at androidx.test.espresso.web.sugar.Web$WebInteraction$ExceptionPropagator.<init>(Web.java:4)
at androidx.test.espresso.web.sugar.Web$WebInteraction.doEval(Web.java:17)
at androidx.test.espresso.web.sugar.Web$WebInteraction.perform(Web.java:1)
at com.owncloud.android.ui.LoginIT.login(LoginIT.kt:89)

We try to access and enter login name:

// username
        Web.onWebView()
            .withElement(DriverAtoms.findElement(Locator.XPATH, "//input[@id='user']"))
            .perform(DriverAtoms.webKeys(loginName))

Steps to reproduce

  1. run LoginIT from Android test suite

Expected behavior

Test should pass

Installation method

None

Nextcloud Server version

master

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

No response

List of activated Apps

/

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

szaimen commented 1 year ago

cc @nextcloud/server-frontend

tobiasKaminsky commented 1 year ago

Argh. Actually the problem is that test is not going to username/password view, but is stucked in "connect to your account".

tobiasKaminsky commented 1 year ago

image

I now need to find correct XPATH, as "//form[@id='login-form']/input[@type='submit']", seems not work anymore.

tobiasKaminsky commented 1 year ago

Hm. It seems that click is executed, but nothing happens. Connecting to it via remote chrome tab, I cannot see a problem, when clicking on it.

Only errors are:

Error with Feature-Policy header: Unrecognized feature: 'payment'.
background:1 Failed to load resource: the server responded with a status of 404 (Not Found)
core-common.js:2 Uncaught SyntaxError: Unexpected token .
core-files_fileinfo.js:2 Uncaught ReferenceError: OC is not defined
    at core-files_fileinfo.js:2
mimetype.js:26 Uncaught ReferenceError: OC is not defined
    at mimetype.js:26
mimetypelist.js:9 Uncaught ReferenceError: OC is not defined
    at mimetypelist.js:9
select2-toggleselect.js:53 Uncaught ReferenceError: Select2 is not defined
    at select2-toggleselect.js:53
authpicker.js:1 Uncaught ReferenceError: jQuery is not defined
    at authpicker.js:1
encryption.js:12 Uncaught ReferenceError: OC is not defined
    at encryption.js:12
files_sharing-main.js:2 Uncaught ReferenceError: OC is not defined
    at files_sharing-main.js:2
theming.js:1 Uncaught ReferenceError: OCA is not defined
    at theming.js:1
26 background:1 Failed to load resource: the server responded with a status of 404 (Not Found)
SystemKeeper commented 1 year ago

Could it be a timing issue because of the button being disabled at first? See https://github.com/nextcloud/server/pull/36286

tobiasKaminsky commented 1 year ago

Is the "login" button really disabled? I let the system wait 5s. And even interrupting it and trying to click manually does not work.

As it works with stable NC25, there must be a change…

SystemKeeper commented 1 year ago

Connecting to it via remote chrome tab, I cannot see a problem, when clicking on it.

May I misinterpreted this line. When you connect via remote tab, it does work or it does not work?

SystemKeeper commented 1 year ago

Also sounds a bit like https://github.com/nextcloud/server/issues/36934

marinofaggiana commented 1 year ago

Seems the same with old device iOS.

https://github.com/nextcloud/ios/issues/2431

mpivchev commented 1 year ago

As @marinofaggiana mentioned, there is a similar issue on iOS 14 where the Log in button can't be pressed. We are probably not going to work on it ourselves since we will drop support for iOS 14 (it's too old), but if this manages to fix it until then that would be great.

tobiasKaminsky commented 1 year ago

I tested it with latest android 14 and it works. So whatever it caused, it is only happening on old emulator / with old webviews.

mpivchev commented 1 year ago

We dropped support for iOS 14 on our end and this doesn't seem to be a problem in newer versions.