public void Can_deactivate_active_default_vip_level()
        {
            //create a default vip level
            var vipLevelData = TestDataGenerator.CreateValidVipLevelData(_defaultLicensee.Name, _brand.Name);

            _vipLevelsPage = _dashboardPage.Menu.ClickVipLevelManagerMenuItem();
            var newForm       = _vipLevelsPage.OpenNewVipLevelForm();
            var submittedForm = newForm.Submit(vipLevelData);

            Assert.AreEqual("VIP Level has been created successfully.", submittedForm.ConfirmationMessage);
            submittedForm.CloseTab("View VIP Level");

            //create a not default vip level
            var secondVipLevelData = TestDataGenerator.CreateValidVipLevelData(_defaultLicensee.Name, _brand.Name, false);

            _vipLevelsPage = _dashboardPage.Menu.ClickVipLevelManagerMenuItem();
            newForm        = _vipLevelsPage.OpenNewVipLevelForm();
            submittedForm  = newForm.Submit(secondVipLevelData);
            Assert.AreEqual("VIP Level has been created successfully.", submittedForm.ConfirmationMessage);
            submittedForm.CloseTab("View VIP Level");

            //deactivate active default vip level
            var deactivateDialog = _vipLevelsPage.OpenDeactivateDialog(vipLevelData.Name);

            deactivateDialog.Deactivate(secondVipLevelData.Name);
            Assert.AreEqual("The VIP level has been successfully deactivated", _vipLevelsPage.ConfirmationMessage);
            _driver.FindElementWait(By.XPath("//button[text()='Close']")).Click();

            Assert.IsTrue(_vipLevelsPage.CheckDeactivatedVipLevelStatus(vipLevelData.Name));
            Assert.IsTrue(!_vipLevelsPage.CheckDeactivatedVipLevelStatus(secondVipLevelData.Name));
        }
        public void Can_edit_color_of_vip_Level()
        {
            //create vip level
            var vipLevelData = TestDataGenerator.CreateValidVipLevelData(_defaultLicensee.Name, _brand.Name, false);

            _vipLevelsPage = _dashboardPage.Menu.ClickVipLevelManagerMenuItem();
            var newForm       = _vipLevelsPage.OpenNewVipLevelForm();
            var submittedForm = newForm.Submit(vipLevelData);

            Assert.AreEqual("VIP Level has been created successfully.", submittedForm.ConfirmationMessage);
            submittedForm.CloseTab("View VIP Level");
            //deactivate vip level
            var deactivateDialog = _vipLevelsPage.OpenDeactivateDialog(vipLevelData.Name).Deactivate();

            Assert.IsTrue(_vipLevelsPage.CheckDeactivatedVipLevelStatus(vipLevelData.Name));

            //edit color of vip level
            var color = TestDataGenerator.GetRandomColor();

            _vipLevelsPage.Grid.SelectRecord(vipLevelData.Name);
            var editForm = _vipLevelsPage.OpenEditVipLevelForm();

            submittedForm = editForm.EditColor(color);
            Assert.AreEqual("VIP Level has been edited successfully.", submittedForm.ConfirmationMessage);
            submittedForm.CloseTab("View VIP Level");

            //check color's change
            _vipLevelsPage.Grid.SelectRecord(vipLevelData.Name);
            var viewVipLevelForm = _vipLevelsPage.OpenViewVipLevelForm();

            Assert.IsTrue(viewVipLevelForm.IsColorDisplayed(ColorTranslator.FromHtml(color)));
        }
        public void Can_deactivate_vip_level()
        {
            var vipLevelData = TestDataGenerator.CreateValidVipLevelData(DefaultLicensee, "831", false);

            //create a vip level for brand '831'
            _vipLevelsPage = _dashboardPage.Menu.ClickVipLevelManagerMenuItem();
            var newForm       = _vipLevelsPage.OpenNewVipLevelForm();
            var submittedForm = newForm.Submit(vipLevelData);

            submittedForm.CloseTab("View VIP Level");

            //deactivate the vip level
            var deactivateDialog = _vipLevelsPage.OpenDeactivateDialog(vipLevelData.Name);

            deactivateDialog.Deactivate();

            Assert.IsTrue(_vipLevelsPage.CheckDeactivatedVipLevelStatus(vipLevelData.Name));
        }
        public void Can_edit_inactive_vip_level()
        {
            //create vip level
            var vipLevelData = TestDataGenerator.CreateValidVipLevelData(_defaultLicensee.Name, _brand.Name, false);

            _vipLevelsPage = _dashboardPage.Menu.ClickVipLevelManagerMenuItem();
            var newForm       = _vipLevelsPage.OpenNewVipLevelForm();
            var submittedForm = newForm.Submit(vipLevelData);

            Assert.AreEqual("VIP Level has been created successfully.", submittedForm.ConfirmationMessage);
            submittedForm.CloseTab("View VIP Level");
            //deactivate vip level
            var deactivateDialog = _vipLevelsPage.OpenDeactivateDialog(vipLevelData.Name).Deactivate();

            Assert.IsTrue(_vipLevelsPage.CheckDeactivatedVipLevelStatus(vipLevelData.Name));

            //edit vip level
            var secondVipLevelData = TestDataGenerator.CreateValidVipLevelData(_defaultLicensee.Name, _brand.Name, false);

            _vipLevelsPage.Grid.SelectRecord(vipLevelData.Name);
            var editForm = _vipLevelsPage.OpenEditVipLevelForm();

            submittedForm = editForm.Submit(secondVipLevelData);
            Assert.AreEqual("VIP Level has been edited successfully.", submittedForm.ConfirmationMessage);
            submittedForm.CloseTab("View VIP Level");

            //check changes
            _vipLevelsPage.Grid.SelectRecord(secondVipLevelData.Name);
            var viewVipLevelForm = _vipLevelsPage.OpenViewVipLevelForm();

            Assert.AreEqual(secondVipLevelData.Licensee, viewVipLevelForm.Licensee);
            Assert.AreEqual(secondVipLevelData.Brand, viewVipLevelForm.Brand);
            Assert.AreEqual(secondVipLevelData.DefaultForNewPlayers, viewVipLevelForm.DefaultForNewPlayers);
            Assert.AreEqual(secondVipLevelData.Code, viewVipLevelForm.Code);
            Assert.AreEqual(secondVipLevelData.Name, viewVipLevelForm.Name);
            Assert.AreEqual(secondVipLevelData.Rank.ToString(), viewVipLevelForm.Rank);
            Assert.AreEqual(secondVipLevelData.Description, viewVipLevelForm.Description);
        }