Example #1
0
        public void Cannot_login_with_empty_data()
        {
            _loginPage.TryToLogin(string.Empty, string.Empty);
            var errorMsg = _loginPage.GetErrorMsg();

            Assert.That(errorMsg, Is.StringContaining("User name and password combination is not valid"));
        }
        public void Can_deactivate_player()
        {
            // create a player
            var playerData    = TestDataGenerator.CreateValidPlayerDataForAdminWebsite(DefaultLicensee, DefaultBrand);
            var newPlayerForm = _playerManagerPage.OpenNewPlayerForm();
            var submittedForm = newPlayerForm.Register(playerData);

            Assert.AreEqual("The player has been successfully created", submittedForm.ConfirmationMessage);
            submittedForm.CloseTab("View Player");

            //deactivate a player
            var playerInfoPage = _playerManagerPage.OpenPlayerInfoPage(playerData.LoginName);

            playerInfoPage.OpenAccountInformationSection();
            playerInfoPage.DeactivatePlayer();
            playerInfoPage.CloseTab("Player Info");

            //check player in admin website
            _driver.Navigate().Refresh();
            _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem();
            _playerManagerPage.SelectPlayer(playerData.LoginName);
            Assert.AreEqual("Inactive", _playerManagerPage.Status);

            //check deactivate a player in member website (try to login)
            var _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);

            _memberWebsiteLoginPage.NavigateToMemberWebsite();
            _memberWebsiteLoginPage.TryToLogin(playerData.LoginName, playerData.Password);
            Assert.AreEqual("Non active", _memberWebsiteLoginPage.GetErrorMsg());
        }
        public void Cannot_login_to_brand_website_as_deactivated_player()
        {
            var player = _playerTestHelper.CreatePlayerForMemberWebsite();

            //deactivate a player
            var playerInfoPage = _playerManagerPage.OpenPlayerInfoPage(player.Username);

            playerInfoPage.OpenAccountInformationSection();
            playerInfoPage.DeactivatePlayer();

            //Refresh the page as a temporary solution
            _driver.Navigate().Refresh();
            _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem();
            _playerManagerPage.SelectPlayer(player.Username);
            Assert.AreEqual("Inactive", _playerManagerPage.Status);

            //try to log in to the brand website
            var brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);

            brandWebsiteLoginPage.NavigateToMemberWebsite();
            brandWebsiteLoginPage.TryToLogin(player.Username, player.Password);

            Assert.AreEqual("Non active", brandWebsiteLoginPage.GetErrorMsg());

            var expectedUrl = _settingsProvider.GetMemberWebsiteUrl() + "Home/PlayerProfile";
            var actualUrl   = _driver.Url;

            Assert.AreNotEqual(expectedUrl, actualUrl);
        }