Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

webUI tests that set invalid quota fail intermittently #159

Closed
phil-davis opened this issue Mar 12, 2019 · 1 comment
Closed

webUI tests that set invalid quota fail intermittently #159

phil-davis opened this issue Mar 12, 2019 · 1 comment

Comments

@phil-davis
Copy link
Contributor

e.g. https://drone.owncloud.com/owncloud/user_management/665/56

  Scenario Outline: change quota to an invalid value                                                                # /var/www/owncloud/apps/user_management/tests/acceptance/features/webUIManageQuota/manageUserQuota.feature:38
    When the administrator changes the quota of user "user1" to the invalid string "<wished_quota>" using the webUI # WebUIUsersContext::theAdministratorSetsInvalidQuotaOfUserUsingTheWebUI()
    Then a notification should be displayed on the webUI with the text 'Invalid quota value "<wished_quota>"'       # WebUIGeneralContext::aNotificationShouldBeDisplayedOnTheWebUIWithTheText()
    And the quota of user "user1" should be set to "<wished_quota>" on the webUI                                    # WebUIUsersContext::quotaOfUserShouldBeSetToOnTheWebUI()

    Examples:
      | wished_quota |
      | stupidtext   |
SCENARIO RESULT: (pass)
      | 34,54GB      |
SCENARIO RESULT: (pass)
      | 30/40GB      |
SCENARIO RESULT: (pass)
      | 30/40        |
SCENARIO RESULT: (pass)
      | 3+56 B       |
SCENARIO RESULT: (fail)
      | -1 B         |
        Exception: Page\OwncloudPage::waitTillXpathIsVisible xpath: //*[@id='notification'] timeout waiting for element to be visible in /var/www/owncloud/tests/acceptance/features/lib/OwncloudPage.php:170
        Stack trace:
        #0 /var/www/owncloud/apps/user_management/tests/acceptance/features/lib/UsersPage.php(548): Page\OwncloudPage->waitTillXpathIsVisible('//*[@id='notifi...')
        #1 /tmp/ProxyManagerGeneratedProxy__PM__PageUsersPageGenerated66e34eaab36d13143e41501a3c46e15f.php(134): Page\UsersPage->setQuotaOfUserTo('user1', '-1 B', Object(Behat\Mink\Session), false)
        #2 /var/www/owncloud/apps/user_management/tests/acceptance/features/bootstrap/WebUIUsersContext.php(109): ProxyManagerGeneratedProxy\__PM__\Page\UsersPage\Generated66e34eaab36d13143e41501a3c46e15f->setQuotaOfUserTo('user1', '-1 B', Object(Behat\Mink\Session), false)
        #3 [internal function]: WebUIUsersContext->theAdministratorSetsInvalidQuotaOfUserUsingTheWebUI('user1', '-1 B')
        #4 /var/www/owncloud/apps/user_management/vendor-bin/behat/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php(109): call_user_func_array(Array, Array)
        #5 /var/www/owncloud/apps/user_management/vendor-bin/behat/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php(64): Behat\Testwork\Call\Handler\RuntimeCallHandler->executeCall(Object(Behat\Behat\Definition\Call\DefinitionCall))

and

  Scenario Outline: change quota to an invalid value                                                                # /var/www/owncloud/apps/user_management/tests/acceptance/features/webUIManageQuota/manageUserQuota.feature:38
    When the administrator changes the quota of user "user1" to the invalid string "<wished_quota>" using the webUI # WebUIUsersContext::theAdministratorSetsInvalidQuotaOfUserUsingTheWebUI()
    Then a notification should be displayed on the webUI with the text 'Invalid quota value "<wished_quota>"'       # WebUIGeneralContext::aNotificationShouldBeDisplayedOnTheWebUIWithTheText()
    And the quota of user "user1" should be set to "<wished_quota>" on the webUI                                    # WebUIUsersContext::quotaOfUserShouldBeSetToOnTheWebUI()

    Examples:
      | wished_quota |
      | -1 B         |
        Failed asserting that two strings are equal.
        --- Expected
        +++ Actual
        @@ @@
        -'Invalid quota value "-1 B"'
        +''

--- Failed scenarios:

    /var/www/owncloud/apps/user_management/tests/acceptance/features/webUIManageQuota/manageUserQuota.feature:50

likely these are test timing issues - the notification about the invalid value pops up for about 5 seconds. We have to wait for the notification to appear, and not end up waiting so long that we miss it.

@phil-davis
Copy link
Contributor Author

The "offending" scenario is for an outstanding issue #100 anyway. So I have commented out the step that tries to check the notification message - see PR #162
When issue #100 is being fixed, the step can be enabled, and it might even work reliably.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant