public void WaitForBackendCalcEnd() { /*The elapsed time is updated with a Backend process, this occurs after * a Process completed" label appeared. Four elements with a green check * icon are also searched for since it's one of the visual changes that * ocurr in the page prior to the time being updated.*/ LogHelpers.Write(string.Format("Wait for \"Calculation\" process to finish.")); int backEndSuggestedTime = 60; Waits.WaitForProcessToFinish(drv => RegularTaxCalcDoneCheck); Waits.WaitForProcessToFinish(drv => AmtCalcDoneCheck); Waits.WaitForProcessToFinish(drv => EandPCalcDoneCheck); Waits.WaitForProcessToFinish(drv => StateCalcDoneCheck); try { Waits.WaitForElementIfChanges(drv => CalculationTimeElement, backEndSuggestedTime); } catch (WebDriverTimeoutException) { /*It's not sure if the data will always change after "Process completed" * label appeared, how many seconds after that it will occur or even if it * can be updated before because of a fast Calculation and a slow recognition * of the check elements. An until method is used for it to exit the wait, * but since that causes an exception I setted an empty catch.*/ } }
public CalculationPage ClickBeginCalculationsButton() { LogHelpers.Write(string.Format("Click \"Begin calculation\" button.")); BeginCalculationButton.ClickJS(); Waits.WaitForProcessToFinish(drv => CalculationProgress); return(this); }
public ReviewPage ExecuteReviewProcess() { Waits.WaitUntilElementPresent(drv => ReviewButton); LogHelpers.Write(string.Format("Click \"Review\" button.")); ReviewButton.ClickJS(); LogHelpers.Write(string.Format("Wait for \"Review process\" to finish...")); Waits.WaitUntilElementPresent(drv => ReviewProgress); Waits.WaitForProcessToFinish(drv => ReviewProgress); return(this); }
public CalculationPage ExecuteCalculationForEYDS() { LogHelpers.Write(string.Format("Click \"Begin calculation\" button.")); BeginCalculationButton.ClickJS(); Waits.WaitUntilElementPresent(drv => ForceReRunContinueButton); LogHelpers.Write(string.Format("Click \"Force Re-Run\" button.")); ForceReRunContinueButton.ClickAndWaitForAjax(); Waits.WaitForProcessToFinish(drv => CalculationProgress); WaitForBackendCalcEnd(); return(this); }