Ejemplo n.º 1
0
        public void PurchaseLottoTicket()
        {
            _driver.WdFindElement(BetslipLOC.ButtonPurchase).Click();

            if (_driver.WdIsElementVisible(BetslipLOC.ValidationMessage, 2))
            {
                throw new Exception($"Betslip contans error message: {_driver.WdFindElement(BetslipLOC.ValidationMessage).WeGetAttributeValue(_driver, "innerText")}");
            }

            _driver.WaitUntilElementIsInvisible(BetslipLOC.Spinner, 30);

            if (_driver.WdIsElementVisible(BetslipLOC.ValidationMessage, 2))
            {
                throw new Exception($"Betslip contans error message: {_driver.WdFindElement(BetslipLOC.ValidationMessage).WeGetAttributeValue(_driver, "innerText")}");
            }

            _playerBalance.BalanceAfterPurchase = _cookieManager.GetPlayerBalance();
        }
Ejemplo n.º 2
0
        public void GivenThePlayerIsLoggedIn()
        {
            try
            {
                _navigationObject.NavigateToHomePage();
                _playerSessionObject.OpenLoginModal();
                _playerSessionObject.Login();
                _driver.WdFindElement(NavigationHeaderLOC.SuperbetLogo);

                Assert.IsTrue(_playerSessionObject.IsThePlayerLoggedIn(), "Player login failed!");
                _playerBalance.BalanceAfterLogin = _cookieManager.GetPlayerBalance();

                if (_driver.WdIsElementVisible(PopUpModals.ButtonAcceptCookies, 2))
                {
                    _driver.WdFindElement(PopUpModals.ButtonAcceptCookies).Click();
                }
            }
            catch (Exception e) { Assert.Fail($"Step 'the player is logged in' failed! {e.Message}"); }
        }
Ejemplo n.º 3
0
        public void PurchaseSportTicket()
        {
            var currentTime = DateTime.Now;
            var exceedTime  = currentTime.AddSeconds(300); //5min

            while (currentTime < exceedTime)
            {
                if (_driver.WdIsElementVisible(BetslipLOC.EventValidationMessage, 1))
                {
                    ReplaceDirtyEvent();
                }


                _driver.WdFindElement(BetslipLOC.ButtonPurchase).Click();

                if (_driver.WdIsElementVisible(BetslipLOC.Spinner))
                {
                    break;
                }

                currentTime = DateTime.Now;
            }

            if (_driver.WdIsElementVisible(BetslipLOC.ValidationMessage, 2))
            {
                throw new Exception($"Betslip contans error message: {_driver.WdFindElement(BetslipLOC.ValidationMessage).WeGetAttributeValue(_driver, "innerText")}");
            }

            _driver.WaitUntilElementIsInvisible(BetslipLOC.Spinner, 30);

            if (_driver.WdIsElementVisible(BetslipLOC.ValidationMessage, 2))
            {
                throw new Exception($"Betslip contans error message: {_driver.WdFindElement(BetslipLOC.ValidationMessage).WeGetAttributeValue(_driver, "innerText")}");
            }

            _playerBalance.BalanceAfterPurchase = _cookieManager.GetPlayerBalance();
        }