Пример #1
0
        public static void VerifyAllDataloadedMakerDao()
        {
            try
            {
                Open();
                IWebElement makerDaoColumn = Engine.Browser.CurrentBrowser.FindElement(MakerDaoColumn);
                makerDaoColumn.Click();
                Engine.Browser.MiddlePause();

                IWebElement firstrow = Engine.Browser.CurrentBrowser.FindElement(Row);
                firstrow.Click();
                Engine.Browser.MiddlePause();

                IList <IWebElement> datamakerdao = Engine.Browser.CurrentBrowser.FindElements(AllDataMakerDao);
                foreach (var value in datamakerdao)
                {
                    string valuetext = value.Text;
                    Assert.IsTrue(!valuetext.Contains(""), "[" + Env + "] LOANSCAN", "Some values are missing on the MakerDao Single Card");
                }
            }
            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #2
0
        public static void VerifyCollateralistheSameThroughTableandCardMakerDao()
        {
            try
            {
                Open();
                IWebElement makerDaoColumn = Engine.Browser.CurrentBrowser.FindElement(MakerDaoColumn);
                makerDaoColumn.Click();
                Engine.Browser.MiddlePause();

                IWebElement collateralTable      = Engine.Browser.CurrentBrowser.FindElement(CollateralTable);
                string      collateralTableValue = collateralTable.Text;
                string[]    stringSeparators     = new string[] { "(" };
                var         result = collateralTableValue.Split(stringSeparators, StringSplitOptions.None);

                string token  = result[0].Substring(0, 4);
                string dollar = result[1];

                IWebElement firstrow = Engine.Browser.CurrentBrowser.FindElement(Row);
                firstrow.Click();
                Engine.Browser.LongPause();
                IWebElement collateralCard = Engine.Browser.CurrentBrowser.FindElement(CollateralTableMakerDao);

                var valueFromCard  = Convert.ToDouble(collateralCard.Text.Substring(0, 4));
                var valueFromTable = Convert.ToDouble(token.Substring(0, 4));
                var difference     = valueFromTable - valueFromCard;
                Assert.IsTrue(difference < 1 || difference == 0, "[" + Env + "] LOANSCAN", "Collateral vlaue on the card is not the same as in the table | expected: " + collateralCard.Text + " was: " + token + " URL " + Browser.CurrentBrowser.Url);
            }

            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #3
0
        //Tests

        public static void VerifySingleCardOpening()
        {
            try
            {
                Open();
                IWebElement dharmacolumn = Engine.Browser.CurrentBrowser.FindElement(DharmaColumn);
                dharmacolumn.Click();
                Engine.Browser.MiddlePause();

                IWebElement firstrow      = Engine.Browser.CurrentBrowser.FindElement(Row);
                IWebElement annualintrate = Engine.Browser.CurrentBrowser.FindElement(AnnaulInterestRateTable);
                string      value         = annualintrate.Text;

                firstrow.Click();
                Engine.Browser.MiddlePause();

                IWebElement annualinterestratecard = Engine.Browser.CurrentBrowser.FindElement(AnnualInterestRateCard);

                Assert.IsTrue(annualinterestratecard.Text.Contains(value), "[" + Env + "] LOANSCAN", "The appopriate card is not opened from the table");
            }
            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #4
0
        public static void TermSwitch()
        {
            IWebElement hoursTerm = Engine.Browser.CurrentBrowser.FindElement(HoursTab);

            hoursTerm.Click();
            Engine.Browser.MiddlePause();
            IWebElement bannervaluehours = Engine.Browser.CurrentBrowser.FindElement(TermonBanner);

            Assert.IsTrue(bannervaluehours.Text.Contains("24 hours"), "LOANSCAN", "The term is not switched as expected");

            IWebElement sevenTerm = Engine.Browser.CurrentBrowser.FindElement(SevenDaysTab);

            sevenTerm.Click();
            Engine.Browser.MiddlePause();
            IWebElement bannervalueSevenDays = Engine.Browser.CurrentBrowser.FindElement(TermonBanner);

            Assert.IsTrue(bannervalueSevenDays.Text.Contains("7 days"), "LOANSCAN", "The term is not switched as expected");


            IWebElement thirtyTerm = Engine.Browser.CurrentBrowser.FindElement(ThirtyDaysTab);

            thirtyTerm.Click();
            Engine.Browser.MiddlePause();
            IWebElement bannervalueThirtyDays = Engine.Browser.CurrentBrowser.FindElement(TermonBanner);

            Assert.IsTrue(bannervalueThirtyDays.Text.Contains("30 days"), "LOANSCAN", "The term is not switched as expected");
        }
Пример #5
0
        public static void VerifyCollateralistheSameThroughTableandCard()
        {
            try
            {
                Open();
                IWebElement dharmacolumn = Engine.Browser.CurrentBrowser.FindElement(DharmaColumn);
                dharmacolumn.Click();
                Engine.Browser.LongPause();

                IWebElement collateralTable      = Engine.Browser.CurrentBrowser.FindElement(CollateralTable);
                string      collateralTableValue = collateralTable.Text;
                string[]    stringSeparators     = new string[] { "(" };
                var         result = collateralTableValue.Split(stringSeparators, StringSplitOptions.None);

                string token  = result[0];
                string dollar = result[1];


                IWebElement firstrow = Engine.Browser.CurrentBrowser.FindElement(Row);
                firstrow.Click();
                Engine.Browser.LongPause();
                var         currentURL     = Browser.CurrentBrowser.Url;
                IWebElement collateralCard = Engine.Browser.CurrentBrowser.FindElement(CollateralCard);
                Assert.IsTrue(collateralCard.Text.Contains(dollar), "[" + Env + "] LOANSCAN", "Collateral vlaue on the card is not the same as in the table. expected: " + collateralCard.Text + " was: " + dollar + " url: " + currentURL);
            }

            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #6
0
        public static void SwitchCurrency()
        {
            IWebElement btcButton = Engine.Browser.CurrentBrowser.FindElement(BtcButton);

            btcButton.Click();
            Engine.Browser.MiddlePause();
            IWebElement btconBanner = Engine.Browser.CurrentBrowser.FindElement(CurrencyBanner);
            string      bannervalue = btconBanner.Text;

            Assert.IsTrue(bannervalue.Contains("BTC"), "[" + Env + "] LOANSCAN", "The currency on banner is not displayed as expected");

            IWebElement ethButton = Engine.Browser.CurrentBrowser.FindElement(EthButton);

            ethButton.Click();
            Engine.Browser.MiddlePause();
            IWebElement ethonBanner      = Engine.Browser.CurrentBrowser.FindElement(CurrencyBanner);
            string      ethonBannervalue = ethonBanner.Text;

            Assert.IsTrue(ethonBannervalue.Contains("ETH"), "[" + Env + "] LOANSCAN", "The currency on banner is not displayed as expected");

            IWebElement usdButton = Engine.Browser.CurrentBrowser.FindElement(UsdButton);

            usdButton.Click();
            Engine.Browser.MiddlePause();
            IWebElement usdonBanner      = Engine.Browser.CurrentBrowser.FindElement(CurrencyBanner);
            string      usdonBannervalue = usdonBanner.Text;

            Assert.IsTrue(usdonBannervalue.Contains("$"), "[" + Env + "] LOANSCAN", "The currency on banner is not displayed as expected");
        }
Пример #7
0
        public static void VerifyLoanAmountisTheSameinTableandOnCard()
        {
            try
            {
                Open();
                IWebElement dharmacolumn = Engine.Browser.CurrentBrowser.FindElement(DharmaColumn);
                dharmacolumn.Click();
                Engine.Browser.MiddlePause();

                IWebElement firstrow = Engine.Browser.CurrentBrowser.FindElement(Row);

                IWebElement loanamount       = Engine.Browser.CurrentBrowser.FindElement(LoanAmount);
                string      loanamountvalue  = loanamount.Text;
                string[]    stringSeparators = new string[] { "(" };
                var         result           = loanamountvalue.Split(stringSeparators, StringSplitOptions.None);

                string token  = result[0];
                string dollar = result[1];

                firstrow.Click();
                Engine.Browser.MiddlePause();

                IWebElement loanamountCard = Engine.Browser.CurrentBrowser.FindElement(LaonAmountCard);
                Assert.IsTrue(loanamountCard.Text.Contains(dollar), "[" + Env + "] LOANSCAN", "Loan amount in the card is not the same as in the table");
            }

            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #8
0
        public static void PaginationbyTheTable()
        {
            IWebElement paginationbox = Engine.Browser.CurrentBrowser.FindElement(PAginationElements3rdPage);

            paginationbox.Click();
            Engine.Browser.MiddlePause();
            IList <IWebElement> creationcolumn = Engine.Browser.CurrentBrowser.FindElements(CreationDate);

            Assert.IsTrue(creationcolumn.Count.Equals(50), "[" + Env + "] LOANSCAN", "The table is not displayed properly");

            IWebElement lastpagenavigationicon = Engine.Browser.CurrentBrowser.FindElement(LastPageNavigationIcon);

            lastpagenavigationicon.Click();
            Engine.Browser.MiddlePause();
            IWebElement selectedlastpage = Engine.Browser.CurrentBrowser.FindElement(LastPageNumber);
            string      selectedpage     = selectedlastpage.Text;

            Assert.IsTrue(selectedpage.Contains("current"), "[" + Env + "] LOANSCAN", "The table is not displayed properly");
            IWebElement creationcolumnlast = Engine.Browser.CurrentBrowser.FindElement(CreationDate);

            Assert.IsTrue(creationcolumnlast.Displayed, "[" + Env + "] LOANSCAN", "The table is not displayed properly");

            IWebElement previouspageicon = Engine.Browser.CurrentBrowser.FindElement(PreviousPageIcon);

            previouspageicon.Click();
            Engine.Browser.MiddlePause();

            IWebElement previouspagenumber = Engine.Browser.CurrentBrowser.FindElement(PreviousPageNumber);

            string previouspage = previouspagenumber.Text;

            Assert.IsTrue(previouspage.Contains("current"), "[" + Env + "] LOANSCAN", "The table is not displayed properly");
        }
Пример #9
0
        public static void VerifyDataonMakerDaoCardcorrespondsDataFromTable()
        {
            try
            {
                Open();
                IWebElement makerDaoColumn = Engine.Browser.CurrentBrowser.FindElement(MakerDaoColumn);
                makerDaoColumn.Click();
                Engine.Browser.MiddlePause();
                IWebElement row = Engine.Browser.CurrentBrowser.FindElement(Row);

                IWebElement annaulInterestRateTable = Engine.Browser.CurrentBrowser.FindElement(AnnaulInterestRateTable);
                string      annaulintRateTableValue = annaulInterestRateTable.Text;

                IWebElement repayedTable      = Engine.Browser.CurrentBrowser.FindElement(RepayedTable);
                string      repayedTableValue = repayedTable.Text;

                IWebElement lendingProtocol      = Engine.Browser.CurrentBrowser.FindElement(LendingProtocolTable);
                string      lendingProtocolValue = lendingProtocol.Text;



                row.Click();
                Engine.Browser.LongPause();
                Console.WriteLine(Engine.Browser.CurrentBrowser.Url);

                IWebElement annualInterestRateCard = Engine.Browser.CurrentBrowser.FindElement(AnnualInterestRateCardMakerDao);
                string      annaulVlaueCard        = annualInterestRateCard.Text;
                Console.WriteLine("Annual Interest Rate: card " + annaulVlaueCard + " table " + annaulintRateTableValue);
                if (!annaulVlaueCard.Contains(annaulintRateTableValue))
                {
                    throw new Exception("[" + Env + "] LOANSCAN: Annual Interest Rate value doesn't match through the table and the card of Maker DAO lending protocol. Please check manually.");
                }


                //IWebElement repayedCard = Engine.Browser.CurrentBrowser.FindElement(RepayedCard);
                //Console.WriteLine("%Repayed value: card " + repayedCard + " table " + repayedTableValue);
                //if (!repayedCard.Text.Contains(repayedTableValue))
                //{
                //    throw new Exception("[" + Env + "] LOANSCAN: %Repayed value doesn't match through the table and the card. Please check manually.");
                //}

                IWebElement lendingProtocolCard = Engine.Browser.CurrentBrowser.FindElement(LendingProtocolCard);
                Console.WriteLine("Lending Protocol: card " + lendingProtocolCard + " table " + lendingProtocolValue);
                if (!lendingProtocolCard.Text.Contains(lendingProtocolValue))
                {
                    throw new Exception("[" + Env + "] LOANSCAN: Lending Protocol type doesn't match through the table and the card. Please check manually.");
                }
            }

            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #10
0
 public static void CurrencySwtichingTest()
 {
     try
     {
         Open();
         SwitchCurrency();
     }
     catch (Exception exception)
     {
         Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
     }
 }
Пример #11
0
 public static void LendingProtocolSwitch()
 {
     try
     {
         Open();
         LendingProtocolsSwitch();
     }
     catch (Exception exception)
     {
         Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
     }
 }
Пример #12
0
 public static void SearchFunctionality()
 {
     try
     {
         Open();
         PerformSearch();
     }
     catch (Exception exception)
     {
         Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
     }
 }
Пример #13
0
 public static void TermSwitchingFunctionality()
 {
     try
     {
         Open();
         TermSwitch();
     }
     catch (Exception exception)
     {
         Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
     }
 }
Пример #14
0
 public static void ColumnsTable()
 {
     try
     {
         Open();
         ColumnsAvailabilityintheTable();
     }
     catch (Exception exception)
     {
         Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
     }
 }
Пример #15
0
 public static void PaginationTable()
 {
     try
     {
         Open();
         PaginationbyTheTable();
     }
     catch (Exception exception)
     {
         Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
     }
 }
Пример #16
0
        public static void LendingProtocolsSwitch()
        {
            IWebElement all      = Engine.Browser.CurrentBrowser.FindElement(AllLoanProtocol);
            string      allvalue = all.Text;
            IWebElement dharma   = Engine.Browser.CurrentBrowser.FindElement(DharmaLoanProtocol);
            string      dhvalue  = dharma.Text;
            IWebElement makerdao = Engine.Browser.CurrentBrowser.FindElement(MakerDaoLoanProtocol);
            string      mkvalue  = makerdao.Text;

            Assert.IsTrue(allvalue.Contains("All"), "LOANSCAN", "The landing protocol is not switched as expected");
            Assert.IsTrue(dhvalue.Contains("Dharma"), "LOANSCAN", "The landing protocol is not switched as expected");
            Assert.IsTrue(mkvalue.Contains("Maker DAO"), "LOANSCAN", "The landing protocol is not switched as expected");
        }
Пример #17
0
        public static void FilteringTable()
        {
            try
            {
                Open();
                FilteringTablebyLendingProtocol();
            }

            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #18
0
 public static void ChartTabsAvailability()
 {
     try
     {
         Open();
         ChartTabsSwitching();
         //ScreenShot.TakeScreenshotFullPageWithScroll(Engine.Browser.CurrentBrowser);
     }
     catch (Exception exception)
     {
         Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
     }
 }
Пример #19
0
        public static void VerifyRepaytoLiquidityPoolFunctionality()
        {
            Console.WriteLine("Login to the app...");
            ReadOnlyCollection <string> windows = MainPageBb.LoginToMainPage("lender");
            string MetamaskTab  = windows[0];
            string BloqboardTab = windows[1];

            Console.WriteLine("Test started...");
            Browser.CurrentBrowser.Navigate().GoToUrl(TestData.Urls.Lend);
            Browser.MiddlePause();

            IList <IWebElement> repaybtns = Browser.CurrentBrowser.FindElements(RepayBtn);

            foreach (var btn in repaybtns)
            {
                string btnvalue = btn.Text;
                if (btnvalue.Contains("REPAY"))
                {
                    btn.Click();
                    break;
                }
            }
            Browser.ShortPause();
            IWebElement amountinput = Browser.CurrentBrowser.FindElement(LendAMountImput);

            amountinput.SendKeys("0.1");

            IWebElement greenbtn = Browser.CurrentBrowser.FindElement(RepayGreenBtn);

            greenbtn.Click();
            Browser.ShortPause();

            Browser.CurrentBrowser.SwitchTo().Window(MetamaskTab);
            Browser.CurrentBrowser.Navigate().GoToUrl("chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html#");
            Browser.LongPause();
            Browser.CurrentBrowser.Navigate().Refresh();
            Browser.ShortPause();

            Console.WriteLine("Confirming request...");
            BloqBoard.MainPageBb.SignRequest();

            Browser.CurrentBrowser.SwitchTo().Window(BloqboardTab);
            Browser.LongPause();

            IWebElement msg = Browser.CurrentBrowser.FindElement(BorrowMessage);

            Assert.IsTrue(msg.Text.Contains("successfully"), "[" + Env + "] BLOQBOARD", "Repay functionlaity is not working as expected");
        }
Пример #20
0
        public static void VerifyTokensCanBeWithdrawn()
        {
            try
            {
                Console.WriteLine("Login to the app...");
                ReadOnlyCollection <string> windows = MainPageBb.LoginToMainPage("lender");
                string MetamaskTab  = windows[0];
                string BloqboardTab = windows[1];

                Console.WriteLine("Test started...");
                Browser.CurrentBrowser.Navigate().GoToUrl(TestData.Urls.Lend);

                Browser.MiddlePause();
                TermsandConditionAceptance();

                Browser.MiddlePause();

                IWebElement withdrawBtnt = Browser.CurrentBrowser.FindElement(WithdrawBtn);
                withdrawBtnt.Click();
                IWebElement amount = Browser.CurrentBrowser.FindElement(LendAMountImput);
                amount.SendKeys("1");
                Browser.MiddlePause();
                IWebElement confirm = Browser.CurrentBrowser.FindElement(ConfirmWithdrawBtn);
                confirm.Click();
                Browser.MiddlePause();

                Browser.CurrentBrowser.SwitchTo().Window(MetamaskTab);
                Browser.CurrentBrowser.Navigate().GoToUrl("chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html#");
                Browser.LongPause();
                Browser.CurrentBrowser.Navigate().Refresh();
                Browser.ShortPause();

                Console.WriteLine("Confirming request...");
                BloqBoard.MainPageBb.SignRequest();

                Browser.CurrentBrowser.SwitchTo().Window(BloqboardTab);
                Browser.LongPause();
                IWebElement msg = Browser.CurrentBrowser.FindElement(ConfirmationMessage);
                Assert.IsTrue(msg.Text.Contains("successfully"), "[" + Env + "] BLOQBOARD", "Withdraw functionality is not working properly");
            }
            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "BLOQBOARD", exception, false);
            }
        }
Пример #21
0
        public static void PerformSearch()
        {
            IWebElement searchinput = Engine.Browser.CurrentBrowser.FindElement(SearchInput);

            searchinput.SendKeys("Dharma");
            IWebElement searchbtn = Engine.Browser.CurrentBrowser.FindElement(SearchBtn);

            searchbtn.Click();
            Engine.Browser.ShortPause();

            IList <IWebElement> values = Engine.Browser.CurrentBrowser.FindElements(FoundLendingProtocol);

            foreach (var value in values)
            {
                string result = value.Text;
                Assert.IsTrue(result.Contains("Dharma"), "[" + Env + "] LOANSCAN", "LoanScan search is not working as expected");
            }
        }
Пример #22
0
        //Tests

        public static void SearchAvailability()
        {
            try
            {
                // IList<IWebElement> MyElements = Engine.Browser.CurrentBrowser.FindElements(By.CssSelector("[text-anchor='start']"));



                Open();
                IWebElement searchinput = Engine.Browser.CurrentBrowser.FindElement(SearchInput);
                Assert.IsTrue(searchinput.Displayed, "[" + Env + "] LOANSCAN", "Search is not available on the page");
            }

            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #23
0
        //Tests
        public static void VerifyLendToLiquidityPoolTableisOpened()
        {
            try
            {
                Console.WriteLine("Login to the app...");
                ReadOnlyCollection <string> windows = MainPageBb.LoginToMainPage("lender");
                string MetamaskTab  = windows[0];
                string BloqboardTab = windows[1];

                Console.WriteLine("Test started...");
                Browser.CurrentBrowser.SwitchTo().Window(BloqboardTab);
                Browser.CurrentBrowser.Navigate().GoToUrl(TestData.Urls.Lend);
                Browser.MiddlePause();

                IWebElement table = Browser.CurrentBrowser.FindElement(LendToLiquidityTable);
                Assert.IsTrue(table.Displayed, "[" + Env + "] BLOQBOARD", "Lend to liquidity table is not loaded correctly");
            }
            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "BLOQBOARD", exception, false);
            }
        }
Пример #24
0
        public static void VerifyProtocolsSingleCards()
        {
            try
            {
                Engine.Browser.CurrentBrowser.Navigate().GoToUrl("https://loanscan.io/agreements/MakerDao/14142");
                Engine.Browser.MiddlePause();

                string valuesStr           = "";
                IList <IWebElement> values = Engine.Browser.CurrentBrowser.FindElements(By.CssSelector(".col-sm-3"));
                foreach (var val in values)
                {
                    valuesStr += val.Text;
                }
                if (valuesStr != "Repayment progressLoan balanceLoan termLoan interest rate (annual)Loan-to-value (LTV) currentBorrower addressLender addressLoan drawsCollateralRepaymentsCumulative liquidation feeCDP creation linkLending platformLending protocol")
                {
                    throw new Exception("[" + Env + "] LOANSCAN: MakerDao card is probably broken. Please check manually.");
                }

                Engine.Browser.MiddlePause();
                Engine.Browser.CurrentBrowser.Navigate().GoToUrl("https://loanscan.io/agreements/Dharma/0x2544c6eeb2cc029f216b7d032b31b35b8efd01ac243b8a391cf7bb23e33e05be");
                Engine.Browser.MiddlePause();

                string valuesDharmaStr           = "";
                IList <IWebElement> valuesDharma = Engine.Browser.CurrentBrowser.FindElements(By.CssSelector(".col-sm-3"));
                foreach (var val in valuesDharma)
                {
                    valuesDharmaStr += val.Text;
                }
                var finalDharma = valuesDharmaStr.Replace(" ", string.Empty);
                if (!valuesDharmaStr.Contains("(annual)/(per loan term)Loan issuance dateLoan maturity dateLoan-to-value (LTV) at originationLoan-to-value (LTV) currentBorrower addressLender addressCollateralRepaymentsRepayment frequencyAgreement IdLending platformLending platform addressLending platform feesUnderwriter nameUnderwriter addressUnderwriter feesUnderwriter risk ratingLoan issuance linkLoan contractLending protocol"))
                {
                    throw new Exception("[" + Env + "] LOANSCAN: Dharma card is probably broken. Please check manually.");
                }
            }
            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #25
0
        public static void ColumnsAvailabilityintheTable()
        {
            IWebElement loanamountcolumn = Engine.Browser.CurrentBrowser.FindElement(LoanAmount);

            Assert.IsTrue(loanamountcolumn.Text.Contains("Loan amount"), "[" + Env + "] LOANSCAN", "The table doesn't contain the 'Loan Amount' value");

            IWebElement annaulInterestRate = Engine.Browser.CurrentBrowser.FindElement(AnnaulInterestRate);

            Assert.IsTrue(annaulInterestRate.Text.Contains("Annual interest rate"), "[" + Env + "] LOANSCAN", "The table doesn't contain the 'Annual Interest Rate' value");

            IWebElement loanterm = Engine.Browser.CurrentBrowser.FindElement(LoanTerm);

            Assert.IsTrue(loanterm.Text.Contains("Loan term"), "[" + Env + "] LOANSCAN", "The table doesn't contain the 'Loan term' value");

            IWebElement ltv = Engine.Browser.CurrentBrowser.FindElement(LTV);

            Assert.IsTrue(ltv.Text.Contains("LTV"), "[" + Env + "] LOANSCAN", "The table doesn't contain the 'LTV' value");

            IWebElement collateral = Engine.Browser.CurrentBrowser.FindElement(Collateral);

            Assert.IsTrue(collateral.Text.Contains("Collateral"), "[" + Env + "] LOANSCAN", "The table doesn't contain the 'Collateral' value");

            IWebElement loanstatus = Engine.Browser.CurrentBrowser.FindElement(LoanStatus);

            Assert.IsTrue(loanstatus.Text.Contains("Loan status"), "[" + Env + "] LOANSCAN", "The table doesn't contain the 'Loan status' value");

            IWebElement repaid = Engine.Browser.CurrentBrowser.FindElement(Repaid);

            Assert.IsTrue(repaid.Text.Contains("% repaid"), "[" + Env + "] LOANSCAN", "The table doesn't contain the '% Repaid' value");

            IWebElement underwrirename = Engine.Browser.CurrentBrowser.FindElement(UnderwriterName);

            Assert.IsTrue(underwrirename.Text.Contains("Underwriter name"), "[" + Env + "] LOANSCAN", "The table doesn't contain the 'Underwriter name' value");

            IWebElement relayerName = Engine.Browser.CurrentBrowser.FindElement(RelayerName);

            Assert.IsTrue(relayerName.Text.Contains("Lending platform"), "[" + Env + "] LOANSCAN", "The table doesn't contain the 'Relayer name' value");
        }
Пример #26
0
        public static void VerifyDataonDharmaCardcorrespondsDataFromTable()
        {
            try
            {
                Open();
                IWebElement dharmacolumn = Engine.Browser.CurrentBrowser.FindElement(DharmaColumn);
                dharmacolumn.Click();
                Engine.Browser.MiddlePause();
                IWebElement row = Engine.Browser.CurrentBrowser.FindElement(Row);

                IWebElement annaulInterestRateTable = Engine.Browser.CurrentBrowser.FindElement(AnnaulInterestRateTable);
                string      annaulintRateTableValue = annaulInterestRateTable.Text;

                IWebElement loanTermTable      = Engine.Browser.CurrentBrowser.FindElement(LoanTermTable);
                string      loanTermtableValue = loanTermTable.Text;

                IWebElement repayedTable      = Engine.Browser.CurrentBrowser.FindElement(RepayedTable);
                string      repayedTableValue = repayedTable.Text;

                IWebElement underwriterNameTable      = Engine.Browser.CurrentBrowser.FindElement(UnderwriterNameTable);
                string      underwriterNameTableValue = underwriterNameTable.Text;

                IWebElement relayerNameTable      = Engine.Browser.CurrentBrowser.FindElement(RelayerNameTable);
                string      relayerNameTableValue = relayerNameTable.Text;

                row.Click();
                Engine.Browser.MiddlePause();


                IWebElement annualInterestRateCard = Engine.Browser.CurrentBrowser.FindElement(AnnualInterestRateCard);
                string      annaulVlaueCard        = annualInterestRateCard.Text;

                if (!annaulVlaueCard.Contains(annaulintRateTableValue))
                {
                    throw new Exception("[" + Env + "] LOANSCAN: Annual Interest Rate value doesn't match through the table and the card. Please check manually.");
                }


                IWebElement repayedCard = Engine.Browser.CurrentBrowser.FindElement(RepayedCard);
                if (!repayedCard.Text.Contains(repayedTableValue))
                {
                    throw new Exception("[" + Env + "] LOANSCAN: %Repayed value doesn't match through the table and the card. Please check manually.");
                }

                IWebElement loanTermCard = Engine.Browser.CurrentBrowser.FindElement(LoanTermCard);
                if (!loanTermCard.Text.Contains(loanTermtableValue))
                {
                    throw new Exception("[" + Env + "] LOANSCAN: Loan Term value doesn't match through the table and the card. Please check manually.");
                }

                IWebElement underwritercard = Engine.Browser.CurrentBrowser.FindElement(UnderwrietrNameCard);
                if (!underwritercard.Text.Contains(underwriterNameTableValue))
                {
                    throw new Exception("[" + Env + "] LOANSCAN: Underwriter Name value doesn't match through the table and the card. Please check manually.");
                }
                //IWebElement relayername = Engine.Browser.CurrentBrowser.FindElement(By.CssSelector("dl.row > dd:nth-of-type(16) > a > span.d-none.d-md-inline-block"));
                //OR
                //if (!relayername.Text.Substring(0, 5).Contains(relayerNameTableValue.Substring(0, 5)))
                //{
                //    throw new Exception("[" + Env + "] LOANSCAN: Relayer Name value doesn't match through the table and the card. Please check manually.");
                //}
            }

            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "LOANSCAN", exception, false);
            }
        }
Пример #27
0
        public static void VerifyTokenCanbeLendedtoLiquidityPool()
        {
            try
            {
                Console.WriteLine("Login to the app...");
                ReadOnlyCollection <string> windows = MainPageBb.LoginToMainPage("lender");
                string MetamaskTab  = windows[0];
                string BloqboardTab = windows[1];

                Console.WriteLine("Test started...");
                IWebElement MyLoans = Browser.CurrentBrowser.FindElement(By.CssSelector("div > div:nth-of-type(2) > a:nth-of-type(2)"));
                MyLoans.Click();
                Browser.LongPause();

                string loanedcount = CheckLoanedAmount();
                Browser.MiddlePause();

                Browser.CurrentBrowser.Navigate().GoToUrl(TestData.DefineRootAdressDependingOnEnvironment() + "lend");
                Browser.LongPause();
                IList <IWebElement> elementListRows = Browser.CurrentBrowser.FindElements(By.CssSelector(".on-demand-wrapper .content-table-row"));
                foreach (var el in elementListRows)
                {
                    var children  = el.FindElements(By.XPath(".//*"));
                    var tokenName = children[0].Text;
                    int i         = 1;
                    if (tokenName.Contains("WETH"))
                    {
                        foreach (var ele in children)
                        {
                            if (ele.Text.Contains("LEND") && ele.TagName == "div")
                            {
                                i++;

                                if (i >= 3)
                                {
                                    ele.Click();
                                    break;
                                }
                            }
                        }
                    }
                }

                Browser.ShortPause();
                IWebElement amount = Browser.CurrentBrowser.FindElement(LendAMountImput);
                amount.SendKeys("0.0001");
                Browser.MiddlePause();
                IWebElement confirm = Browser.CurrentBrowser.FindElement(ConfirmLendRedButton);
                confirm.Click();

                Console.WriteLine("Approve on MetaMask...");
                Wallets.ApproveTransaction(MetamaskTab, BloqboardTab);
                Browser.LongPause();

                Console.WriteLine("Do the final assert...");
                IWebElement Close = Browser.CurrentBrowser.FindElement(By.CssSelector("button.main-btn"));
                Close.Click();
                Browser.ShortPause();

                IWebElement MyLoansAfter = Browser.CurrentBrowser.FindElement(By.CssSelector("div > div:nth-of-type(2) > a:nth-of-type(2)"));
                MyLoansAfter.Click();
                Browser.LongPause();

                var loanedAfter = CheckLoanedAmount();
                //Assert.IsTrue(loanedcount != loanedAfter, "[" + Env + "] BLOQBOARD", "Lend functionality is not working as expected");
            }

            catch (Exception exception)
            {
                Browser.Close();
                string Environment = TestData.DefineEnvironmentDependingOnEnvironment();
                if (Environment.Contains("STAGING_Mainnet"))
                {
                    throw new Exception("Transaction wait is too long (more than 3 minutes)...");
                }

                Assert.FinilizeErrors(Env, "BLOQBOARD", exception, false);
            }
        }
Пример #28
0
        public static void VerifyTokenCanbeBorrowedFromLiquidityPool()
        {
            try
            {
                Console.WriteLine("Login to the app...");
                ReadOnlyCollection <string> windows = MainPageBb.LoginToMainPage("borrower");
                string MetamaskTab  = windows[0];
                string BloqboardTab = windows[1];

                Console.WriteLine("Test started...");
                IWebElement Borrow = Browser.CurrentBrowser.FindElement(By.CssSelector("div.sidebar-block.loans-block > a:nth-of-type(1)"));
                Borrow.Click();
                Browser.LongPause();

                string environment = TestData.DefineEnvironmentDependingOnEnvironment();
                if (environment.Contains("STAGING"))
                {
                    IWebElement MyLoans = Browser.CurrentBrowser.FindElement(By.CssSelector("div > div:nth-of-type(2) > a:nth-of-type(2)"));
                    MyLoans.Click();
                    Browser.LongPause();
                    string loanedcountSTAGING = "";

                    IList <IWebElement> elementListRowsSTAGING = Browser.CurrentBrowser.FindElements(By.CssSelector(".on-demand-wrapper .content-table-row"));
                    foreach (var el in elementListRowsSTAGING)
                    {
                        var children  = el.FindElements(By.XPath(".//*"));
                        var tokenName = children[0].Text;
                        int i         = 1;
                        if (tokenName.Contains("ZRX"))
                        {
                            foreach (var ele in children)
                            {
                                if (ele.Text.Contains("Borrowed") && loanedcountSTAGING == "")
                                {
                                    loanedcountSTAGING = ele.Text;
                                }
                            }
                        }
                    }

                    Browser.CurrentBrowser.Navigate().GoToUrl(TestData.Urls.Lend);
                    Browser.LongPause();

                    IList <IWebElement> elementListRowsBorrow = Browser.CurrentBrowser.FindElements(By.CssSelector(".on-demand-wrapper .content-table-row"));
                    foreach (var el in elementListRowsBorrow)
                    {
                        var children  = el.FindElements(By.XPath(".//*"));
                        var tokenName = children[0].Text;
                        int i         = 1;
                        if (tokenName.Contains("ZRX"))
                        {
                            foreach (var ele in children)
                            {
                                if (ele.Text.Contains("BORROW") && ele.TagName == "div")
                                {
                                    i++;

                                    if (i >= 3)
                                    {
                                        ele.Click();
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    Browser.ShortPause();
                    IWebElement amountBorrow = Browser.CurrentBrowser.FindElement(LendAMountImput);
                    amountBorrow.SendKeys("0.0001");
                    Browser.MiddlePause();
                    IWebElement confirmBorrow = Browser.CurrentBrowser.FindElement(By.CssSelector("button.on-demand-modal__button.btn-green"));
                    confirmBorrow.Click();
                    Browser.LongPause();

                    Console.WriteLine("Approve on MetaMask...");
                    Wallets.ApproveTransaction(MetamaskTab, BloqboardTab);
                    Browser.LongPause();

                    Console.WriteLine("Do the final assert...");
                    IWebElement Close = Browser.CurrentBrowser.FindElement(By.CssSelector("button.main-btn"));
                    Close.Click();
                    Browser.ShortPause();

                    //IWebElement MyLoansAfter = Browser.CurrentBrowser.FindElement(By.CssSelector("div > div:nth-of-type(2) > a:nth-of-type(2)"));
                    //MyLoansAfter.Click();
                    //Browser.LongPause();
                    //string loanedAmountAfterBorrow = loanedcountSTAGING;
                    //var loanedAfterStaging = CheckBorrowedAmount();
                    //Assert.IsTrue(loanedcountSTAGING != loanedAfterStaging, "[" + Env + "] BLOQBOARD", "Lend functionality is not working as expected");
                }
                else
                {
                    string loanedcount = "";

                    IList <IWebElement> elementListRows = Browser.CurrentBrowser.FindElements(By.CssSelector(".on-demand-wrapper .content-table-row"));
                    foreach (var el in elementListRows)
                    {
                        var children  = el.FindElements(By.XPath(".//*"));
                        var tokenName = children[0].Text;
                        int i         = 1;
                        if (tokenName.Contains("ZRX"))
                        {
                            foreach (var ele in children)
                            {
                                if (ele.Text.Contains("Borrowed") && loanedcount == "")
                                {
                                    loanedcount = ele.Text;
                                }

                                if (ele.Text.Contains("BORROW") && ele.TagName == "div")
                                {
                                    i++;

                                    if (i >= 3)
                                    {
                                        ele.Click();
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    Browser.ShortPause();
                    IWebElement amount = Browser.CurrentBrowser.FindElement(LendAMountImput);
                    amount.SendKeys("0.0001");
                    Browser.MiddlePause();
                    IWebElement confirm = Browser.CurrentBrowser.FindElement(By.CssSelector("button.on-demand-modal__button.btn-green"));
                    confirm.Click();

                    Console.WriteLine("Approve on MetaMask...");
                    Wallets.ApproveTransaction(MetamaskTab, BloqboardTab);

                    Console.WriteLine("Do the final assert...");
                    string loanedAmountAfter = loanedcount;
                    var    loanedAfter       = CheckBorrowedAmount();
                    //Assert.IsTrue(loanedcount != loanedAfter, "[" + Env + "] BLOQBOARD", "Lend functionality is not working as expected");
                }
            }
            catch (Exception exception)
            {
                Browser.Close();
                Assert.FinilizeErrors(Env, "BLOQBOARD", exception, false);
            }
        }
Пример #29
0
        public static void VerifyTokenCanbeRepaidFromLiquidityPool()
        {
            try
            {
                Console.WriteLine("Login to the app...");
                ReadOnlyCollection <string> windows = MainPageBb.LoginToMainPage("lender");
                string MetamaskTab  = windows[0];
                string BloqboardTab = windows[1];

                Console.WriteLine("Test started...");
                Browser.CurrentBrowser.Navigate().GoToUrl(TestData.DefineRootAdressDependingOnEnvironment() + "lend");
                Browser.MiddlePause();

                //IWebElement loansbtn = Browser.CurrentBrowser.FindElement(By.CssSelector("div > div:nth-of-type(2) > a:nth-of-type(2)"));
                //loansbtn.Click();
                Browser.LongPause();

                //IWebElement loanedRepamount = Browser.CurrentBrowser.FindElement(LoanedRep);
                //string[] stringSeparators = new string[] { "." };
                //var result = loanedRepamount.Text.Split(stringSeparators, StringSplitOptions.None);

                //double loanedRep = double.Parse(result[0]);
                //string loanedcount = "";

                //IList<IWebElement> elementListRows = Browser.CurrentBrowser.FindElements(By.CssSelector(".on-demand-wrapper .content-table-row"));
                //foreach (var el in elementListRows)
                //{
                //    var children = el.FindElements(By.XPath(".//*"));
                //    var tokenName = children[0].Text;
                //    int i = 1;
                //    if (tokenName.Contains("ZRX"))
                //    {

                //        foreach (var ele in children)
                //        {
                //            if (ele.Text.Contains("Borrowed") && loanedcount == "")
                //            {
                //                loanedcount = ele.Text;

                //            }


                //            if (ele.Text.Contains("REPAY") && ele.TagName == "div")
                //            {
                //                i++;

                //                if (i >= 3)
                //                {
                //                    ele.Click();
                //                    break;
                //                }
                //            }
                //        }
                //    }
                //}

                //Browser.ShortPause();
                //IWebElement amount = Browser.CurrentBrowser.FindElement(LendAMountImput);
                //amount.SendKeys("0.002");
                //Browser.MiddlePause();
                //IWebElement confirm = Browser.CurrentBrowser.FindElement(By.CssSelector("button.on-demand-modal__button.btn-red"));
                //confirm.Click();
                //Browser.MiddlePause();



                //Browser.CurrentBrowser.SwitchTo().Window(MetamaskTab);
                //Browser.CurrentBrowser.Navigate().GoToUrl("chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html#");
                //Browser.LongPause();
                //Browser.CurrentBrowser.Navigate().Refresh();
                //Browser.ShortPause();

                //Console.WriteLine("Confirming request...");
                //BloqBoard.MainPageBb.SignRequest();
                //Browser.ShortPause();
                //Browser.CurrentBrowser.SwitchTo().Window(BloqboardTab);
                //Browser.LongPause();
                //string loanedAmountAfter = loanedcount;



                //var loanedAfter = CheckBorrowedAmount();



                //Assert.IsTrue(loanedcount != loanedAfter, "[" + Env + "] BLOQBOARD", "Lend functionality is not working as expected");
            }

            catch (Exception exception)
            {
                Assert.FinilizeErrors(Env, "BLOQBOARD", exception, false);
            }
        }
Пример #30
0
        public static void FilteringTablebyLendingProtocol()
        {
            IWebElement dharmatab = Engine.Browser.FindElementNew(DharmaColumn);

            dharmatab.Click();
            Engine.Browser.MiddlePause();
            IList <IWebElement> values = Engine.Browser.CurrentBrowser.FindElements(FoundLendingProtocol);

            foreach (var value in values)
            {
                string result = value.Text;
                Assert.IsTrue(result.Contains("Dharma"), "[" + Env + "] LOANSCAN", "Filtering by Landing Protocol is not working as expected");
            }

            IWebElement marketdaotab = Engine.Browser.FindElementNew(MarketDaoColumn);

            marketdaotab.Click();
            Engine.Browser.MiddlePause();

            IList <IWebElement> values2 = Engine.Browser.CurrentBrowser.FindElements(FoundLendingProtocol);

            foreach (var value in values2)
            {
                string result = value.Text;
                Assert.IsTrue(result.Contains("Maker DAO"), "[" + Env + "] LOANSCAN", "Filtering by Landing Protocol is not working as expected");
            }
            Engine.Browser.ShortPause();


            IWebElement alltab = Engine.Browser.FindElementNew(AllColumn);

            alltab.Click();
            Engine.Browser.MiddlePause();

            int countD = 0;
            int countM = 0;

            for (int i = 0; i < 5; i++)
            {
                IList <IWebElement> values3 = Engine.Browser.CurrentBrowser.FindElements(FoundLendingProtocol);
                foreach (var value in values3)
                {
                    string result = value.Text;
                    if (result.Contains("Dharma"))
                    {
                        countD++;
                    }
                    if (result.Contains("MakerDao"))
                    {
                        countM++;
                    }
                }
                if (countD > 0 && countM > 0)
                {
                    break;
                }
                else
                {
                    IWebElement nextpageicon = Engine.Browser.CurrentBrowser.FindElement(NextPage);
                    nextpageicon.Click();
                    Engine.Browser.MiddlePause();
                }
            }
            Assert.IsTrue(countM > 0 && countD > 0, "[" + Env + "] LOANSCAN", "Filtering by Landing Protocol is not working as expected");
        }