Skip to content

Commit

Permalink
Merge pull request #33950 from owncloud/stable10-adjust-waitTillXpath…
Browse files Browse the repository at this point in the history
…IsVisible-calls

[stable10] Adjust waitTillXpathIsVisible calls
  • Loading branch information
phil-davis authored Dec 20, 2018
2 parents 95cddaf + c6cc013 commit 81f9a77
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 22 deletions.
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/AdminAppsSettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public function waitTillPageIsLoaded(
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
$this->waitForAjaxCallsToStartAndFinish($session);
$this->waitTillXpathIsVisible($session, $this->appEnableDisableButtonXpath);
$this->waitTillXpathIsVisible(
$this->appEnableDisableButtonXpath, $timeout_msec
);
}
}
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/AdminGeneralSettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ public function waitTillPageIsLoaded(
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
$this->waitForAjaxCallsToStartAndFinish($session);
$this->waitTillXpathIsVisible($session, $this->ownCloudVersionStringXpath);
$this->waitTillXpathIsVisible(
$this->ownCloudVersionStringXpath, $timeout_msec
);
}
}
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/AdminSharingSettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ public function waitTillPageIsLoaded(
Session $session,
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
$this->waitTillXpathIsVisible($session, $this->shareApiCheckboxXpath);
$this->waitTillXpathIsVisible(
$this->shareApiCheckboxXpath, $timeout_msec
);
}
}
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/AdminStorageSettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ public function waitTillPageIsLoaded(
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
$this->waitForAjaxCallsToStartAndFinish($session);
$this->waitTillXpathIsVisible($session, $this->filesExternalFormXpath);
$this->waitTillXpathIsVisible(
$this->filesExternalFormXpath, $timeout_msec
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ public function waitTillPageIsLoaded(
$xpath = null
) {
if ($xpath === null) {
throw new \InvalidArgumentException('$xpath need to be set');
throw new \InvalidArgumentException('$xpath needs to be set');
}
$this->waitForOutstandingAjaxCalls($session);
$element = $this->waitTillXpathIsVisible($session, $xpath);
$element = $this->waitTillXpathIsVisible($xpath, $timeout_msec);
$this->setElement($element);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ public function waitTillPageIsLoaded(
$xpath = null
) {
if ($xpath === null) {
throw new \InvalidArgumentException('$xpath need to be set');
throw new \InvalidArgumentException('$xpath needs to be set');
}
$this->waitForOutstandingAjaxCalls($session);
$this->waitTillXpathIsVisible($session, $xpath);
$this->waitTillXpathIsVisible($xpath, $timeout_msec);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ public function waitTillPageIsLoaded(
$xpath = null
) {
if ($xpath === null) {
throw new \InvalidArgumentException('$xpath need to be set');
throw new \InvalidArgumentException('$xpath needs to be set');
}
$this->waitForOutstandingAjaxCalls($session);
$popupElement = $this->waitTillXpathIsVisible($session, $xpath);
$popupElement = $this->waitTillXpathIsVisible($xpath, $timeout_msec);
$this->setElement($popupElement);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public function waitTillPageIsLoaded(
$xpath = null
) {
if ($xpath === null) {
throw new \InvalidArgumentException('$xpath need to be set');
throw new \InvalidArgumentException('$xpath needs to be set');
}
$this->waitForOutstandingAjaxCalls($session);
$element = $this->waitTillXpathIsVisible($session, $xpath);
$element = $this->waitTillXpathIsVisible($xpath, $timeout_msec);
$this->setElement($element);
}

Expand Down
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/NotificationsAppDialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public function waitTillPageIsLoaded(
Session $session,
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
$this->waitTillXpathIsVisible($session, $this->notificationContainerXpath);
$this->waitTillXpathIsVisible(
$this->notificationContainerXpath, $timeout_msec
);
}
}
10 changes: 4 additions & 6 deletions tests/acceptance/features/lib/OwncloudPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,12 @@ public function waitTillElementIsNotNull(
/**
* waits for the element located by the xpath to be visible
*
* @param Session $session
* @param string $xpath the xpath of the element to wait for
* @param int $timeout_msec
*
* @return NodeElement
*/
public function waitTillXpathIsVisible(
Session $session,
$xpath,
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
Expand All @@ -162,13 +160,13 @@ public function waitTillXpathIsVisible(
$element,
__METHOD__ .
" xpath: $xpath" .
" timeout waiting for element to be availiable"
" timeout waiting for element to be available"
);
$visibibity = $this->waitFor(
STANDARD_UI_WAIT_TIMEOUT_MILLISEC / 1000,
$visibility = $this->waitFor(
$timeout_msec / 1000,
[$element, 'isVisible']
);
if ($visibibity !== true) {
if ($visibility !== true) {
throw new \Exception(
__METHOD__ .
" xpath: $xpath" .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public function waitTillPageIsLoaded(
Session $session,
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
$this->waitTillXpathIsVisible($session, $this->logoutButtonXpath);
$this->waitTillXpathIsVisible($this->logoutButtonXpath, $timeout_msec);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public function waitTillPageIsLoaded(
Session $session,
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
$this->waitTillXpathIsVisible($session, $this->personalProfilePanelXpath);
$this->waitTillXpathIsVisible(
$this->personalProfilePanelXpath, $timeout_msec
);
$this->waitForOutstandingAjaxCalls($session);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public function waitTillPageIsLoaded(
$timeout_msec = STANDARD_UI_WAIT_TIMEOUT_MILLISEC
) {
$this->waitForOutstandingAjaxCalls($session);
$this->waitTillXpathIsVisible($session, $this->corsInputfieldXpath);
$this->waitTillXpathIsVisible(
$this->corsInputfieldXpath, $timeout_msec
);
}
}

0 comments on commit 81f9a77

Please sign in to comment.