Exemplo n.º 1
0
        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.*/
            }
        }