コード例 #1
0
        /// <summary>
        /// Checks if amount in the first transaction equals expected (back - transactions)
        /// </summary>
        /// <param name="expectedAmount"></param>
        /// <param name="numberOfRecord">Which record to check, the first one or the second one</param>
        public void CheckAmountInTransactions_Back(double expectedAmount, int numberOfRecord = 1)
        {
            _commonActions.SignIn_in_admin_panel();
            _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/transactions");
            TransactionsObj transaction = new TransactionsObj(_driver);

            if (numberOfRecord == 1)
            {
                Assert.AreEqual(expectedAmount, transaction.FirstRecordAmount,
                    "Sorry, but the amount of the first record is not as expected. Page: " + _driverCover.Driver.Url +
                    " ");
            }

            if (numberOfRecord == 2)
            {
                Assert.AreEqual(expectedAmount, transaction.SecondRecordAmount,
                    "Sorry, but the amount of the first record is not as expected. Page: " + _driverCover.Driver.Url +
                    " ");
            }
        }
コード例 #2
0
        /// <summary>
        /// Cheks the time of the last transaction (the first record) on "Back - Transactions" page
        /// </summary>
        public void CheckTransactionTimeInTransactions_Back()
        {
            _commonActions.SignIn_in_admin_panel();
            _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/transactions");
            TransactionsObj transaction = new TransactionsObj(_driver);

            TimeSpan transactionDate = transaction.GetFirstTransactionDate();
            TimeSpan currentUtcDate = DateTime.UtcNow.TimeOfDay;

            //Cheks if the transaction date placed in correct interval (no longer then 5 min from now)
            Assert.IsTrue(transactionDate > currentUtcDate - TimeSpan.FromMinutes(5), "Sorry, the time of the first record is not in set interval. Check if record was added, page: " + _driverCover.Driver.Url + " ");
        }
コード例 #3
0
        /// <summary>
        /// Cheks the email of the last transaction (the first record) on "Back - Transactions" page
        /// </summary>
        public void CheckTransactionsEmailInTransactions_Back(string email)
        {
            _commonActions.SignIn_in_admin_panel();
            _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/transactions");
            TransactionsObj transaction = new TransactionsObj(_driver);
            string realEmail = transaction.GetFirstTransactionEmail();

            Assert.AreEqual(email, realEmail, "Sorry, the email in the first record is wrong, check if a record was added, page: " + _driverCover.Driver.Url + " ");
        }
コード例 #4
0
        /// <summary>
        /// Checks the state of the first transaction
        /// </summary>
        /// <param name="expectedState"></param>
        public void CheckTransactionsStateInTransactions_Back(string expectedState)
        {
            _commonActions.SignIn_in_admin_panel();
            _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/transactions");
            TransactionsObj transaction = new TransactionsObj(_driver);
            string state = transaction.GetFirstTransactionState();

            Assert.AreEqual(expectedState, state, "Sorry but the transaction state is wrong. ");
        }
コード例 #5
0
        /// <summary>
        /// Cheks the merchant of the last transaction (the first record) on "Back - Transactions" page
        /// </summary>
        /// <param name="merchant">Payment method</param>
        public void CheckTransactionMerchantInTransactions_Back(WayToPay merchant)
        {
            _commonActions.SignIn_in_admin_panel();
            _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/transactions");
            TransactionsObj transaction = new TransactionsObj(_driver);

            string transactionMerchant = transaction.GetFirstTransactionMerchant();

            Assert.AreEqual(merchant.ToString(System.Globalization.CultureInfo.InvariantCulture), transactionMerchant, "Sorry, the merchant in the first record is wrong, check if a record was added, page: " + _driverCover.Driver.Url + " ");
        }