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

Fix clicks on actions menu of non opaque file rows in acceptance tests #22481

Conversation

danxuliu
Copy link
Member

When a row is added to the file list the opacity of the file row is animated from transparent to fully opaque. As the file actions menu is a descendant of the row but overflows it when the row is not fully opaque clicks on the menu entries "fall-through" and are received instead by the rows behind.

The opacity animation is a CSS animation, and it is not possible to know if a row is appearing or not except from its opacity (the row will have the appear CSS class even after the animation ended). Therefore it should be waited until the row of the file is fully opaque before using the menu.

This should fix the random failures of tests/acceptance/features/app-files.feature:262 I do not know for sure, though, as I run the test, literally, a hundred times and it did not fail 🤷 Due to this I tried to find out why it failed, although I have not been able to reproduce the original Drone failure (that is, without modifying the code to force what I think was the cause).

Note that the problem is not specific to the acceptance tests, although users should not hit it (except Barry Allen, Pietro Maximoff et al.), as they would need to click an item in the file menu action less than 500ms after the file row was added. It can be checked without having to rush with the following steps:

  • Open the Files app
  • Right click on the row of a file and Inspect element
  • Set the opacity of the tr element to 0.5
  • Open the file actions menu
  • Click on any action (except the upper part of the first one, as it is in front of its own row and thus it is not affected by the reduced opacity)

When a row is added to the file list the opacity of the file row is
animated from transparent to fully opaque. As the file actions menu is a
descendant of the row but overflows it when the row is not fully opaque
clicks on the menu entries "fall-through" and are received instead by
the rows behind.

The opacity animation is a CSS animation, and it is not possible to know
if a row is appearing or not except from its opacity (the row will have
the "appear" CSS class even after the animation ended). Therefore it
should be waited until the row of the file is fully opaque before using
the menu.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@danxuliu danxuliu added the 3. to review Waiting for reviews label Aug 29, 2020
@danxuliu danxuliu added this to the Nextcloud 20 milestone Aug 29, 2020
@danxuliu
Copy link
Member Author

/backport to stable19

@danxuliu
Copy link
Member Author

/backport to stable18

@faily-bot
Copy link

faily-bot bot commented Aug 29, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 32418: failure

jsunit

Show full log
PhantomJS 2.1.1 (Linux 0.0.0) LOG: 'JQMIGRATE: Migrate is installed, version 1.4.1'
PhantomJS 2.1.1 (Linux 0.0.0) WARN: 'jQuery is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.'
PhantomJS 2.1.1 (Linux 0.0.0) WARN: '$ is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own.'
PhantomJS 2.1.1 (Linux 0.0.0) WARN: 'Handlebars is deprecated: please ship your own, this will be removed in Nextcloud 20'
PhantomJS 2.1.1 (Linux 0.0.0) DEBUG: 'OCA.Files.Settings initialized'
PhantomJS 2.1.1 (Linux 0.0.0) DEBUG: 'OCA.Files.Sidebar initialized'
PhantomJS 2.1.1 (Linux 0.0.0) DEBUG: 'OCA.Sharing.ShareSearch initialized'
PhantomJS 2.1.1 (Linux 0.0.0) DEBUG: 'OCA.Sharing.ExternalLinkActions initialized'
PhantomJS 2.1.1 (Linux 0.0.0): Executed 847 of 850 (skipped 3) SUCCESS (13.156 secs / 12.55 secs)

mysql8.0-php7.2

  • cancelled - typically means that the tests took longer than the drone CI allows them to run

@rullzer rullzer merged commit 5d4c4b5 into master Aug 30, 2020
@rullzer rullzer deleted the fix-clicks-on-actions-menu-of-non-opaque-file-rows-in-acceptance-tests branch August 30, 2020 18:07
@rullzer rullzer mentioned this pull request Aug 31, 2020
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants