Example #1
0
        public static SubmittedNewUserForm CreateUser(this IWebDriver driver, RoleData roleData, AdminUserRegistrationData userData, string[] permissions)
        {
            // create a role
            var menu            = new BackendMenuBar(driver);
            var roleManagerPage = menu.ClickRoleManagerMenuItem();
            var newRoleForm     = roleManagerPage.OpenNewRoleForm();

            newRoleForm.SelectPermissions(permissions);
            var submittedForm = newRoleForm.FillInRequiredFieldsAndSubmit(roleData);

            submittedForm.CloseTab("View Role");

            // create a user
            var adminManagerPage = submittedForm.Menu.ClickAdminManagerMenuItem();
            var newUserForm      = adminManagerPage.OpenNewUserForm();

            newUserForm.Submit(userData);

            var submittedUserForm = new SubmittedNewUserForm(driver);

            Assert.AreEqual("User has been successfully created", submittedUserForm.ConfirmationMessage);
            submittedUserForm.CloseTab("View User");

            return(submittedUserForm);
        }
Example #2
0
        public void Can_view_Deposit_report()
        {
            const decimal depositAmount = 150;

            // login to admin website, create a player and make an offline deposit
            var playerData        = _driver.LoginAsSuperAdminAndCreatePlayer(Licensee, Brand, "RMB");
            var menu              = new BackendMenuBar(_driver);
            var playerManagerPage = menu.ClickPlayerManagerMenuItem();

            playerManagerPage.SelectPlayer(playerData.LoginName);
            var newOfflineDepositRequest           = playerManagerPage.OpenOfflineDepositRequestForm();
            var submittedOfflineDepositRequestForm = newOfflineDepositRequest.Submit(amount: depositAmount);
            var referenceCode = submittedOfflineDepositRequestForm.ReferenceCode;

            // open report page
            _driver.Logout();
            _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin();
            var paymentReportsPage = _dashboardPage.Menu.ClickPaymentReportsMenuItem();
            var reportTab          = paymentReportsPage.OpenDepositReport();

            // generate empty report in order to ensure, that grid contains no records before actual filter is applied
            GenerateEmptyReport(reportTab, "Transaction ID");

            // generate report with existed (just created) data, check that report contains one record
            _driver.TypeFilterCriterion(column: "Transaction ID", condition: "is", value: referenceCode);
            _driver.GenerateReport();

            var reportDataDisplayed = reportTab.CheckIfAnyReportDataDisplayed();

            Assert.IsTrue(reportDataDisplayed);
        }
Example #3
0
 public override void BeforeEach()
 {
     base.BeforeEach();
     _driver.Logout();
     _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin();
     _menu          = _dashboardPage.Menu;
 }
Example #4
0
        public static DashboardPage MakeOfflineDeposit(this IWebDriver driver, string username, decimal depositAmount, string fullName, string bonusName = null)
        {
            driver.LoginToAdminWebsiteAsSuperAdmin();
            var menu = new BackendMenuBar(driver);
            var playerManagerPage = menu.ClickPlayerManagerMenuItem();

            //create a deposit request, apply a bonus
            playerManagerPage.SelectPlayer(username);
            var offlineDepositRequestForm = playerManagerPage.OpenOfflineDepositRequestForm();
            SubmittedOfflineDepositRequestForm submittedOfflineDeposit;

            if (bonusName == null)
            {
                submittedOfflineDeposit = offlineDepositRequestForm.Submit(depositAmount);
                Assert.AreEqual("Offline deposit request has been created successfully", submittedOfflineDeposit.Confirmation);
            }
            else
            {
                submittedOfflineDeposit = offlineDepositRequestForm.SubmitWithBonus(bonusName, depositAmount);
                Assert.AreEqual("Offline deposit request has been created successfully", submittedOfflineDeposit.Confirmation);
            }
            var referenceCode = submittedOfflineDeposit.ReferenceCode;

            //confirm a deposit request
            var offlineDepositRequestsPage = menu.ClickOfflineDepositConfirmMenuItem();

            offlineDepositRequestsPage.SelectOfflineDepositRequest(username, referenceCode);
            var depositConfirmPage      = offlineDepositRequestsPage.ClickConfirmButton();
            var validDepositConfirmData = TestDataGenerator.CreateValidDepositConfirmData(fullName, depositAmount);
            var submittedConfirmDeposit = depositConfirmPage.SubmitValidDepositConfirm(validDepositConfirmData);

            Assert.AreEqual("Offline deposit request has been confirmed successfully", submittedConfirmDeposit.GetConfirmationMessage);

            //verify a deposit request
            var playerDepositVerifyPage = menu.ClickPlayerDepositVerifyItem();

            playerDepositVerifyPage.FilterGrid(username);
            playerDepositVerifyPage.SelectConfirmedDeposit(referenceCode);
            var verifyForm             = playerDepositVerifyPage.OpenVerifyForm();
            var submittedVerifyDeposit = verifyForm.Submit();

            Assert.AreEqual("Offline deposit request has been verified successfully", submittedVerifyDeposit.ConfirmationMessage);

            //approve a deposit request
            var playerDepositApprovePage = menu.ClickPlayerDepositApproveItem();

            playerDepositApprovePage.FilterGrid(username);
            playerDepositApprovePage.SelectVerifiedDeposit(referenceCode);
            var approveForm             = playerDepositApprovePage.OpenApproveForm();
            var submittedApproveDeposit = approveForm.Submit(depositAmount, "0");

            Assert.AreEqual("Offline deposit request has been approved successfully", submittedApproveDeposit.ConfirmationMessage);

            driver.Navigate().Refresh();
            var dashboardPage = new DashboardPage(driver);

            return(dashboardPage);
        }
Example #5
0
        public static SubmittedNewUserForm CreateUserBasedOnPredefinedRole(this IWebDriver driver, AdminUserRegistrationData userData)
        {
            var menu             = new BackendMenuBar(driver);
            var adminManagerPage = menu.ClickAdminManagerMenuItem();
            var newUserForm      = adminManagerPage.OpenNewUserForm();

            newUserForm.Submit(userData);
            return(new SubmittedNewUserForm(driver));
        }
Example #6
0
 public override void BeforeEach()
 {
     base.BeforeEach();
     _driver.Logout();
     _dashboardPage     = _driver.LoginToAdminWebsiteAsSuperAdmin();
     _menu              = _dashboardPage.Menu;
     _paymentTestHelper = _container.Resolve <PaymentTestHelper>();
     _bonusName         = TestDataGenerator.GetRandomString(12);
     _bonusTemplateName = TestDataGenerator.GetRandomString(12);
 }
Example #7
0
        public static PlayerRegistrationDataForAdminWebsite CreatePlayerAsAdmin(this IWebDriver driver,
                                                                                string licensee, string brand, string currency = null, string culture = null, string country = null, bool isActive = true)
        {
            var menu = new BackendMenuBar(driver);
            var playerManagerPage         = menu.ClickPlayerManagerMenuItem();
            var newPlayerForm             = playerManagerPage.OpenNewPlayerForm();
            var playerDataForAdminWebsite = TestDataGenerator.CreateValidPlayerDataForAdminWebsite(licensee, brand, currency, culture, country);

            playerDataForAdminWebsite.IsInactive = !isActive;
            var submittedPlayerForm = newPlayerForm.Register(playerDataForAdminWebsite);

            submittedPlayerForm.CloseTab("View Player");
            driver.Navigate().Refresh();

            return(playerDataForAdminWebsite);
        }