owncloud / web

:dragon_face: Next generation frontend for ownCloud Infinite Scale
https://owncloud.dev/clients/web/
GNU Affero General Public License v3.0
448 stars 156 forks source link

publicLinkCreate.feature:190 can fail #6321

Closed phil-davis closed 2 years ago

phil-davis commented 2 years ago

https://drone.owncloud.com/owncloud/web/22203/62/16

runsh: Total unexpected failed scenarios throughout the test run:
webUISharingPublicBasic/publicLinkCreate.feature:190
4) Scenario: Sharing the share_folder as public link is not possible # features/webUISharingPublicBasic/publicLinkCreate.feature:190
   ✔ Before # setup.js:34
   ✔ Before # setup.js:38
   ✔ Before # setup.js:42
   ✔ Before # setup.js:59
   ✔ Before # setup.js:66
   ✔ Before # setup.js:77
   ✔ Before # stepDefinitions/filesContext.js:18
   ✔ Before # stepDefinitions/generalContext.js:290
   ✔ Before # stepDefinitions/generalContext.js:336
   ✔ Before # stepDefinitions/middlewareContext.js:46
   ✔ Given user "Alice" has been created with default attributes and without skeleton files in the server # stepDefinitions/middlewareContext.js:66
   ✔ Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" # stepDefinitions/generalContext.js:177
   ✔ And the administrator has set the default folder for received shares to "Shares" in the server # stepDefinitions/middlewareContext.js:66
   ✔ And user "Brian" has been created with default attributes and without skeleton files in the server # stepDefinitions/middlewareContext.js:66
   ✔ And user "Brian" has created folder "simple-folder" in the server # stepDefinitions/middlewareContext.js:66
   ✔ And user "Carol" has been created with default attributes and without skeleton files in the server # stepDefinitions/middlewareContext.js:66
   ✔ And user "Brian" has shared folder "simple-folder" with user "Alice" in the server # stepDefinitions/middlewareContext.js:66
   ✔ And user "Alice" has accepted the share "Shares/simple-folder" offered by user "Brian" in the server # stepDefinitions/middlewareContext.js:66
   ✔ And user "Alice" has logged in using the webUI # stepDefinitions/loginContext.js:70
   ✔ And the user opens the link share dialog for folder "Shares" using the webUI # stepDefinitions/sharingContext.js:600
   ✖ Then the link share permission denied message should be displayed in the sharing dialog on the webUI # stepDefinitions/sharingContext.js:586
       Timed out while waiting for element <//p[@data-testid="files-links-no-reshare-permissions-message"]> to be present for 10000 milliseconds. - expected "visible" but got: "not found" (10015ms)
           at Proxy.isLinkSharePermissionMessageVisible (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/sharingDialog.js:538:19)
           at World.<anonymous> (/var/www/owncloud/web/tests/acceptance/stepDefinitions/sharingContext.js:589:57)
   ✔ After # stepDefinitions/middlewareContext.js:60
   ✔ After # stepDefinitions/generalContext.js:354
   ✔ After # stepDefinitions/generalContext.js:315
   ✔ After # stepDefinitions/generalContext.js:256
   ✔ After # setup.js:110
   ✔ After # setup.js:106
   ✔ After # setup.js:102
   ✔ After # setup.js:95
   ✔ After # setup.js:86
individual-it commented 2 years ago

failed again in https://drone.owncloud.com/owncloud/web/22245/62/15

saw-jan commented 2 years ago

Sometimes Shares folder can be shared in oCIS, hence causing the test to fail. Doesn't happen in oC10.

debugSuite-try_feature-L10

saw-jan commented 2 years ago

@phil-davis I think we cannot do anything in the test code. Should we keep this one as it is?

phil-davis commented 2 years ago

Here is another random fail: https://drone.owncloud.com/owncloud/ocis/9080/46/9

runsh: Total unexpected failed scenarios throughout the test run:
webUISharingPublicBasic/publicLinkCreate.feature:190

That is running full-ci in oCIS.

phil-davis commented 2 years ago

@pascalwengerter @kulmann it seems that "sometimes" web thinks that a public link can be created to the Shares folder. But the majority of times, web correctly thinks that Shares cannot have a public link.

In the test scenario, Brian shares to Alice and Alice accepts the share all using API requests. Only after all that Given step setup has happened, then Alice logs in to the web UI.

I am struggling to think what timing issue could cause the web UI to sometimes not understand correctly about the Shares folder. Any thoughts/ideas are welcome!

phil-davis commented 2 years ago

https://drone.owncloud.com/owncloud/web/22625/65/15

  Scenario: Sharing the share_folder as public link is not possible # features/webUISharingPublicBasic/publicLinkCreate.feature:190
- Connecting to selenium on port 4444...

ℹ Connected to selenium on port 4444 (237ms).
  Using: chrome (94.0.4606.61) on Linux platform.

    Given user "Alice" has been created with default attributes and without skeleton files in the server
    Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" in the server
    And the administrator has set the default folder for received shares to "Shares" in the server
    And user "Brian" has been created with default attributes and without skeleton files in the server
    And user "Brian" has created folder "simple-folder" in the server
    And user "Carol" has been created with default attributes and without skeleton files in the server
    And user "Brian" has shared folder "simple-folder" with user "Alice" in the server
    And user "Alice" has accepted the share "Shares/simple-folder" offered by user "Brian" in the server
    And user "Alice" has logged in using the webUI
√ Element <input[autocomplete="kopano-account username"]> was visible after 561 milliseconds.
√ Element <input[autocomplete="kopano-account username"]> was not present after 62 milliseconds.
√ Element <.app-content> was visible after 534 milliseconds.
    And the user opens the link share dialog for folder "Shares" using the webUI
   NoSuchElementError: An error occurred while running .isVisible() command on <//*[@id="files-sidebar"]>: 
   {"sessionId":"7509f61fd53919ae6c566fa20c3f68aa","status":0,"value":[]}
       at Proxy.isSideBarOpen (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js:30:18)
       at Proxy.isSideBarOpenForResource (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js:52:24)
       at Proxy.openSideBar (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:246:28)
       at Proxy.openPublicLinkDialog (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:33:18)
       at World.<anonymous> (/var/www/owncloud/web/tests/acceptance/stepDefinitions/sharingContext.js:578:53)
   NoSuchElementError: An error occurred while running .isVisible() command on <//*[@id="files-sidebar"]>: 
   {"sessionId":"7509f61fd53919ae6c566fa20c3f68aa","status":0,"value":[]}
       at Proxy.isSideBarOpen (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js:30:18)
       at Proxy.closeSidebarIfOpen (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js:13:24)
       at Proxy.openSideBar (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:252:24)
       at runMicrotasks (<anonymous>)
       at processTicksAndRejections (internal/process/task_queues.js:95:5)
       at Proxy.openPublicLinkDialog (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:33:7)
   NoSuchElementError: An error occurred while running .isVisible() command on <//*[@id="files-sidebar"]>: 
   {"sessionId":"7509f61fd53919ae6c566fa20c3f68aa","status":0,"value":[]}
       at Proxy.isSideBarOpen (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js:30:18)
       at Proxy.closeSidebarIfOpen (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js:13:24)
       at Proxy.waitForFileVisible (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:338:24)
       at runMicrotasks (<anonymous>)
       at processTicksAndRejections (internal/process/task_queues.js:95:5)
       at Proxy.clickRow (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:265:7)
       at Proxy.openSideBar (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:255:7)
       at Proxy.openPublicLinkDialog (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:33:7)
√ Element <//span[contains(@class, "oc-resource-name") and (@data-test-resource-name='Shares' or @data-test-resource-path='/Shares')]/ancestor::tr[contains(@class, "oc-tbody-tr")]> was present after 12 milliseconds.
√ Element <.files-table .oc-tbody-tr> was present after 16 milliseconds.
waiting for 500ms ...
   NoSuchElementError: An error occurred while running .isVisible() command on <//div[contains(@id, "files-sidebar")]//*[contains(@class, "is-active-sub-panel")]//button[contains(@class, "header__back")]>: 
   {"sessionId":"7509f61fd53919ae6c566fa20c3f68aa","status":0,"value":[]}
       at Proxy.activatePanel (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js:80:20)
       at runMicrotasks (<anonymous>)
       at processTicksAndRejections (internal/process/task_queues.js:95:5)
       at Proxy.openPublicLinkDialog (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/filesList.js:34:14)
Timeout waiting for Ajax calls to start
waiting for 500ms ...
√ Element <//*[@id="sidebar-panel-links-item"]//*[contains(@class, "sidebar-panel__body-content")]> was present after 10 milliseconds.
    Then the link share permission denied message should be displayed in the sharing dialog on the webUI
Timed out while waiting for element <//p[@data-testid="files-links-no-reshare-permissions-message"]> to be present for 10000 milliseconds. - expected "visible" but got: "not found" (10006ms)
undefined    ✖ failed
      Timed out while waiting for element <//p[@data-testid="files-links-no-reshare-permissions-message"]> to be present for 10000 milliseconds. - expected "visible" but got: "not found" (10006ms)
          at Proxy.isLinkSharePermissionMessageVisible (/var/www/owncloud/web/tests/acceptance/pageObjects/FilesPageElement/sharingDialog.js:538:19)
          at World.<anonymous> (/var/www/owncloud/web/tests/acceptance/stepDefinitions/sharingContext.js:564:57)
saving screenshot of failed test

Failed in nightly.

phil-davis commented 2 years ago

https://drone.owncloud.com/owncloud/web/22907/65/15 webUISharingPublicBasic/publicLinkCreate.feature:190 failed in nightly

phil-davis commented 2 years ago

https://drone.owncloud.com/owncloud/web/22914/65/15 webUISharingPublicBasic/publicLinkCreate.feature:190 failed in nightly.

Is there something that we can do about this? Or are we able to clearly demonstrate that the web app has some intermittent behavior?

individual-it commented 2 years ago

Please try to give it some time before trying to share, I guess there is some JS check that we are getting ahead of.

SwikritiT commented 2 years ago

@individual-it I tried to add some pause, reload the page locally and on ci https://github.com/owncloud/web/pull/6469 but nothing solves this issue. Sometimes it shows that the share folder is shareable, can't reproduce it manually but only when running test multiple times.

SwikritiT commented 2 years ago

I noticed that while trying to share the shares folder sometimes the permission is set to SRDNVCK so while doing the canShare check will return truehttps://github.com/owncloud/web/blob/db72a9b34a84fd9ed65155abbac30ebbfd046653/packages/web-app-files/src/helpers/resources.js#L90-L92 . In the normal condition, the permission is set to S and the function will return false

I don't think this is a server error either, the permission for when both when the Share folder can be shared and cannot be shared is the same. So maybe the permission is not properly updated, maybe it's taking some previously set value? I couldn't pinpoint exactly why this is happening. Still can't reproduce manually, only while running the test multiple times.

kulmann commented 2 years ago

Thank you for investing time and efforts :heart:

We prioritized the implementation of the sharing jail for web in this sprint. You can find more context here: https://github.com/owncloud/web/issues/6448

As a result, the Shares folder will not exist in the All files view anymore (and that one gets renamed to Personal). I'll close here, because it is in sight to have that done and we should not invest more time here.