示例#1
0
        public void CasePartyScreenedOrRestricted()
        {
            // #Case 138908
            #region Private variables
            var caseId = string.Empty; var caseId2 = string.Empty;
            var caseScreenedTitle   = string.Format("Case party screened or restricted");
            var caseUnScreenedTitle = string.Format("Case party unscreened not restricted");
            #endregion

            #region Case Level - Step 1 to 4
            //Pre-requisite
            #region ---- Admin Module - Prereq ----
            Selenium_Run((driver) =>
            {
                #region Login to Admin Module
                FrontPage.LoginToApplication(driver, ApplicationModules.Administrator.GetStringValue());
                #endregion

                #region Navigate to Tilgangskoder and check the Access code is 6 is setup
                AdminstratorPage adminPage = new AdminstratorPage(driver);
                adminPage.NavigateToMenuItem("Brukeradministrasjon/tilgangsstyring", "Tilgangskoder", "Tilgangskoder (alle)");
                adminPage.VerifyAccessCodeExist("6");
                adminPage.ClickItemInGrid("6");
                adminPage.ClickCheckBoxInAdminModuleSwitchOnOff("Hide title automatically when creating new post", true);
                adminPage.ClickCheckBoxInAdminModuleSwitchOnOff("Hide sender/recipient automatically when creating new post", true);
                adminPage.Save();
                #endregion

                #region Guilt User - authorized for access code 6 for adm unit ENG
                adminPage.NavigateToMenuItem("Person", "Person");

                adminPage.SelectPerson("GUILT");
                adminPage.AddOrEditAutorization("6", "Adm.unit", "ENG");
                #endregion

                #region Sda User - is NOT Authorized for access code 6 on adm unit ENG
                adminPage.ClickDropDownInAdminModule("Person");
                adminPage.SelectPerson("SDA");

                adminPage.RemoveAutorization("6", "SDA");
                #endregion

                #region Logout from Admin Module
                LogoutPage logoutPage = new LogoutPage(driver);
                logoutPage.LogoutApplication();
                #endregion
            });
            #endregion

            //Step 1-3
            #region Login to RM module with Guilt user as TstIndia1
            Selenium_Run((driver) =>
            {
                #region Login to RM Module as User 1 -Guilt
                FrontPage.LoginToApplication(driver);
                #endregion

                #region Create new Case and edit title
                CasePage casePage = new CasePage(driver);

                casePage.AddTitle(caseScreenedTitle);
                casePage.SelectKendoDropdownAndAddValue("Access code", "6");
                casePage.SaveCase();
                caseId = casePage.GetCaseNumber();
                #endregion

                #region create a new case party and add restricted (checkbox)
                casePage.AddParties("Short name", "AA");
                #endregion

                #region Logout from Application
                LogoutPage logoutPage = new LogoutPage(driver);
                logoutPage.LogoutApplication();
                #endregion
            });
            #endregion

            //Step 4
            #region Login to RM module with user 2 SDA
            Selenium_Run((driver) =>
            {
                #region Login to RM Module as User 2 - SDA User
                FrontPage.LoginToApplication(driver, ApplicationModules.RecordManagement.GetStringValue(), "SDA", "SDA");
                #endregion

                #region Open Case Number and verify the case parties is resticted
                CasePage casePage = new CasePage(driver);
                casePage.QuickSearchCaseId(caseId);
                casePage.VerifyCasePartryIsRestricted("*****", true);
                #endregion

                #region Logout from Application
                LogoutPage logoutPage = new LogoutPage(driver);
                logoutPage.LogoutApplication();
                #endregion
            });
            #endregion

            //Step 5
            #region Login to RM module with user 1 Guilt
            Selenium_Run((driver) =>
            {
                #region Login to RM Module as User 1 - Guilt User
                FrontPage.LoginToApplication(driver);
                #endregion

                #region Open Case Number and verify the case parties is resticted
                CasePage casePage = new CasePage(driver);
                casePage.CreateCase(caseUnScreenedTitle);
                caseId2 = casePage.GetCaseNumber();
                #endregion

                #region create a new case party and add restricted (checkbox)
                casePage.AddParties("Short name", "AA", false);
                #endregion

                #region Logout from Application
                LogoutPage logoutPage = new LogoutPage(driver);
                logoutPage.LogoutApplication();
                #endregion
            });
            #endregion

            #region Login to RM module with user 2 SDA
            Selenium_Run((driver) =>
            {
                #region Login to RM Module as User 2 - SDA User
                FrontPage.LoginToApplication(driver, ApplicationModules.RecordManagement.GetStringValue(), "SDA", "SDA");
                #endregion

                #region Open Case Number and verify the case parties is resticted
                CasePage casePage = new CasePage(driver);
                casePage.QuickSearchCaseId(caseId2);
                casePage.VerifyCasePartryIsRestricted("Anda Apotek", false);
                #endregion

                #region Logout from Application
                LogoutPage logoutPage = new LogoutPage(driver);
                logoutPage.LogoutApplication();
                #endregion
            });
            #endregion
            #endregion
        }