Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appium doesn't see send button until scrolled down #1074

Closed
tomholub opened this issue Nov 23, 2021 · 11 comments · Fixed by #1220
Closed

appium doesn't see send button until scrolled down #1074

tomholub opened this issue Nov 23, 2021 · 11 comments · Fixed by #1220
Assignees

Comments

@tomholub
Copy link
Collaborator

This is interesting - the create email button always hovers in the same space. Why is it needed to scroll down before we can tap it? (in actual app, I don't need to scroll to see/tap the button)

Originally posted by @tomholub in #1065 (comment)

@tomholub
Copy link
Collaborator Author

image

@tomholub tomholub added this to the 0.6.0: Maintenance milestone Nov 23, 2021
@ivan-ushakov ivan-ushakov added the in progress Work on the issue is in progress label Nov 23, 2021
@ivan-ushakov
Copy link
Contributor

Possible linked with issue #1079

@tomholub
Copy link
Collaborator Author

From my testing, it seemed unrelated. Regardless of loading status, it didn't seem to recognize the send button until I scroll a bit lower. But only if there was more than one page worth of emails (with only a few emails, no problem).

It's as if the additional inbox items obscure the button somehow. Even though visually they don't.

@tomholub
Copy link
Collaborator Author

@sosnovsky maybe you would know?

@tomholub
Copy link
Collaborator Author

I observed it here: https://flowcrypt.semaphoreci.com/jobs/0026251b-48ef-4b3a-8b8d-1587e778380f

[0-2] Screenshot of failed test was saved to /Users/semaphore/git/flowcrypt-ios/appium/tmp 11:55
[0-2] Error in "COMPOSE EMAIL:  user is able to send encrypted email after resetting pass phrase" 11:55
Error: element ("-ios class chain:**/XCUIElementTypeButton[`label == "+"`]") still not displayed after 15000ms 11:55
    at async InboxScreen.checkInboxScreen (/Users/semaphore/git/flowcrypt-ios/appium/tests/screenobjects/inbox.screen.ts:40:5) 11:55
    at async UserContext.<anonymous> (/Users/semaphore/git/flowcrypt-ios/appium/tests/specs/composeEmail/SendEncryptedEmailAfterWrongPassPhrase.spec.ts:41:5) 11:56
[0-2] RETRYING in /Users/semaphore/git/flowcrypt-ios/appium/FlowCrypt.app - /tests/specs/composeEmail/SendEncryptedEmailAfterWrongPassPhrase.spec.ts 12:04
[0-2] RUNNING in /Users/semaphore/git/flowcrypt-ios/appium/FlowCrypt.app - /tests/specs/composeEmail/SendEncryptedEmailAfterWrongPassPhrase.spec.ts 14:11
[0-2] addedRecipientEl value:   demo@flowcrypt.com  14:11
[0-2] Screenshot of failed test was saved to /Users/semaphore/git/flowcrypt-ios/appium/tmp 14:11
[0-2] Error in "COMPOSE EMAIL:  user is able to send encrypted email after resetting pass phrase" 14:11
Error: element ("-ios class chain:**/XCUIElementTypeButton[`label == "+"`]") still not displayed after 15000ms 14:11
    at async InboxScreen.checkInboxScreen (/Users/semaphore/git/flowcrypt-ios/appium/tests/screenobjects/inbox.screen.ts:40:5) 14:11
    at async UserContext.<anonymous> (/Users/semaphore/git/flowcrypt-ios/appium/tests/specs/composeEmail/SendEncryptedEmailAfterWrongPassPhrase.spec.ts:41:5)

@sosnovsky
Copy link
Collaborator

Wasn't able to fix this issue yet, but found that compose button becomes non-accessible after tableNode.reloadData() at https://github.com/FlowCrypt/flowcrypt-ios/blob/master/FlowCrypt/Controllers/Inbox/InboxViewController.swift#L271

Maybe Texture re-renders all views on the screen after reloadData and it causes accessibility issues, which are fixed after any gesture (scroll or tap)
Trying to find solution...

@tomholub
Copy link
Collaborator Author

Thanks for looking into this! Were you able to reproduce this manually - compose email button not tappable on the first tap of loading inbox, if there are many messages?

@sosnovsky
Copy link
Collaborator

No, it works well for me in the app, fails only during ui tests

sosnovsky added a commit that referenced this issue Dec 3, 2021
sosnovsky added a commit that referenced this issue Dec 13, 2021
@tomholub
Copy link
Collaborator Author

So far, do you think this is fixable (with reasonable effort) ?

sosnovsky added a commit that referenced this issue Dec 13, 2021
@sosnovsky
Copy link
Collaborator

It seems there is no simple way to make compose button work without scroll - I tried different methods (like adding zPosition to button, enabling/disabling button it on data load etc), but only scroll make it work in 100% cases.

Probably there is some issue with Texture rendering accessibility structure for views which are floating above another views. Scrolling down re-renders view and structure is fixed.

So I just updated some selectors there to use accessibility identifiers for faster tests, but haven't found any reliable solution for original issue.

@tomholub
Copy link
Collaborator Author

Got it. Thanks for looking into it 👍

sosnovsky added a commit that referenced this issue Dec 13, 2021
tomholub pushed a commit that referenced this issue Dec 13, 2021
* #1074 fix compose button tap

* #1151 update package.json

* #1074 use scrollDownToElement

* #1074 update clickCreateEmail

* #1074 PR updates
@tomholub tomholub removed the in progress Work on the issue is in progress label Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants