예제 #1
0
        public void LoginAsAdminWithValidData()
        {
            LogProgress("Getting role from AdminSideBar");
            var actualRole   = GeneralPage.GetRole(driver);
            var expectedRole = "ADMIN";

            Assert.AreEqual(expectedRole, actualRole, "Not logined as admin");
        }
예제 #2
0
파일: NavBar.cs 프로젝트: y8x/CGSpecflowBVT
        private static bool IsNavBarExpanded()
        {
            bool isExpanded = true;

            //check if first and last buttons are visible
            isExpanded &= GeneralPage.IsElementVisible(IncidentModulePage.ID.sidebarIncidentModuleSelectBtn);
            isExpanded &= GeneralPage.IsElementVisible(ReportsModulePage.ID.sidebarReportsModuleSelectBtn);
            return(isExpanded);
        }
예제 #3
0
        public static void InputSignature(string signature)
        {
            GeneralPage gp = new GeneralPage();

            gp.RbSignature1.Click();
            gp.TbText.ClearAndType(signature);
            Thread.Sleep(4000);
            gp.ButtonSave.Click();
            Thread.Sleep(4000);
        }
예제 #4
0
        private static bool IsUserConfigMenuExpanded()
        {
            bool isExpanded = true;

            //Check if the following links are available
            isExpanded &= GeneralPage.IsElementVisible(GeneralPage.ID.userPreferencesLink);
            isExpanded &= GeneralPage.IsElementVisible(GeneralPage.ID.helpLink);
            isExpanded &= GeneralPage.IsElementVisible(GeneralPage.ID.logOffLink);
            return(isExpanded);
        }
예제 #5
0
        public void WhenIOpenTheNewestTicket()
        {
            GeneralPage.SwitchToFrame(TicketGrid.ID.mainGridFrame);
            string old = GeneralPage.GetCurrentWindow();

            TicketGrid.DoubleClickTicketInGrid(1);
            log.Info("Double clicked the top most ticket");
            GeneralPage.SwitchToNewWindow(old);
            log.Info("Switched to ticket window.");
        }
예제 #6
0
        public void WhenIClickOnTheButtonInTheActionBarAndSelect(string action, string srType)
        {
            GeneralPage.SwitchToFrame(ModuleActionBar.ID.mainGridFrame);
            string old = GeneralPage.GetCurrentWindow();

            ModuleActionBar.ClickNew(srType);
            log.Info("New button clicked and type selectd.");
            GeneralPage.SwitchToNewWindow(old);
            log.Info("Switched to new window.");
        }
        public void IE_Edge_DA_DP_TC067_Verify_that_Data_Profiles_are_listed_alphabetically()
        {
            generalPage = loginPage.LoginDashBoard(Constant.Respos_SampleRepository, Constant.UsernameAdmin, Constant.PasswordAdmin);

            dataProfileManagerPage = generalPage.GotoDataProfileManagerPage();

            dataProfileManagerPage.VerifyDataProfileInAlphabeticalOrder();

            //post-condition
            dataProfileManagerPage.LogOut();
        }
예제 #8
0
        public void WhenIClickOnTheButtonInTheActionBar(string action)
        {
            GeneralPage.SwitchToFrame(ModuleActionBar.ID.mainGridFrame);
            string old = GeneralPage.GetCurrentWindow();

            //Hard coded to click on "New" action. Need to change this to accomodate other actions.
            ModuleActionBar.ClickNew();
            log.Info("New button clicked");
            GeneralPage.SwitchToNewWindow(old);
            log.Info("Switched to new window");
        }
        public void IE_Edge_DA_DP_TC065_Verify_that_all_Preset_Data_Profiles_are_populated_correctly()
        {
            generalPage = loginPage.LoginDashBoard(Constant.Respos_SampleRepository, Constant.UsernameAdmin, Constant.PasswordAdmin);

            dataProfileManagerPage = generalPage.GotoDataProfileManagerPage();

            dataProfileManagerPage.VerifyPreDataProfile(Constant.PreSetDataProfile, dataProfileManagerPage.GetActualPreDataProfile());

            //post-condition
            dataProfileManagerPage.LogOut();
        }
예제 #10
0
 public void GivenIAmLoggedInToChangeGearWeb()
 {
     GeneralPage.NavigateToCGWebMain();
     //Test if it didn't log you in automatically with your windows credential.
     //This part logs you in if you didn't get logged in automatically
     if (!LoginPage.AmILoggedIn())
     {
         LoginPage.InputLogInCredentials(@"qalab\administrator", @"qatest04");
         LoginPage.ClickLoginBtn();
     }
 }
예제 #11
0
파일: NavBar.cs 프로젝트: y8x/CGSpecflowBVT
 //No longer used
 private static void Collapse()
 {
     if (IsNavBarExpanded())
     {
         log.Info("Collapsing Module Navigation Bar...");
         GeneralPage.ClickOnObject(GeneralPage.ID.navbarTriggerBtn);
     }
     else
     {
         log.Info("Tried to collapse the module navigation bar but it was already collapsed.");
     }
 }
예제 #12
0
파일: NavBar.cs 프로젝트: y8x/CGSpecflowBVT
 private static void ClickToExpandNavBar()
 {
     if (!IsNavBarExpanded())
     {
         log.Info("Expanding Module Navigation Bar...");
         GeneralPage.ClickOnObject(GeneralPage.ID.navbarTriggerBtn);
     }
     else
     {
         log.Info("Tried to expand the module navigation bar but it was already open.");
     }
 }
예제 #13
0
파일: NavBar.cs 프로젝트: y8x/CGSpecflowBVT
 //No longer used. This was when we hovered to expand Nav bar
 private static void HoverToExpandNavBar()
 {
     if (!IsNavBarExpanded())
     {
         log.Info("Hovering to expand Navigation Bar...");
         GeneralPage.HoverOverElement(GeneralPage.ID.navbarHoverArea);
     }
     else
     {
         log.Info("Tried to hover to expand module navigation bar but it was already open.");
     }
 }
예제 #14
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     if (!this.IsPostBack)
     {
         // Databind is required to bind the localized resources.
         this.DataBind();
     }
     if (this.Page is GeneralPage)
     {
         this._page = (GeneralPage)this.Page;
     }
 }
예제 #15
0
 private static void Collapse()
 {
     if (IsUserConfigMenuExpanded())
     {
         log.Info("Collapsing User Config Menu...");
         GeneralPage.ClickOnObject(GeneralPage.ID.userConfigCog);
     }
     else
     {
         log.Info("Tried to collapse the User Config Menu but it was already collapsed.");
     }
 }
예제 #16
0
 private static void Expand()
 {
     if (!IsUserConfigMenuExpanded())
     {
         log.Info("Expanding User Config Menu...");
         GeneralPage.ClickOnObject(GeneralPage.ID.userConfigCog);
     }
     else
     {
         log.Info("Tried to expand the User Config Menu but it was already open.");
     }
 }
예제 #17
0
        public async Task <IActionResult> InsertGeneralPageConfirm(GeneralPageViewModel model)
        {
            string nvm;

            if (ModelState.IsValid == false)
            {
                nvm = NotificationHandler.SerializeMessage <string>(NotificationHandler.Wrong_Values, contentRootPath);
                return(RedirectToAction("ShowGeneralPage", new { notification = nvm }));
            }
            GeneralPage generalPage = new GeneralPage()
            {
                Title        = model.Title,
                Description  = model.Description,
                RegdDateTime = DateTime.Now,
                ContentHtml  = model.ContentHtml,
                ShowOrder    = model.ShowOrder,
                Status       = model.Status
            };

            try
            {
                //Save File in wwwroot
                string folderPath = "";
                string savePath   = "";
                folderPath = configuration.GetSection("DefaultPaths").GetSection("PagesFiles").Value;
                savePath   = await FileManager.ReadAndSaveFile(contentRootPath, folderPath, model.MainImage);

                generalPage.MainImagePath = savePath;
                if (model.MovieFile != null)
                {
                    folderPath = configuration.GetSection("DefaultPaths").GetSection("PagesFiles").Value;
                    savePath   = await FileManager.ReadAndSaveFile(contentRootPath, folderPath, model.MovieFile);

                    generalPage.MoviePath = savePath;
                }
                if (model.DocumentFile != null)
                {
                    folderPath = configuration.GetSection("DefaultPaths").GetSection("PagesFiles").Value;
                    savePath   = await FileManager.ReadAndSaveFile(contentRootPath, folderPath, model.DocumentFile);

                    generalPage.DocumentPath = savePath;
                }
                dbGeneralPage.Insert(generalPage);
                nvm = NotificationHandler.SerializeMessage <string>(NotificationHandler.Success_Insert, contentRootPath);
                return(RedirectToAction("ShowGeneralPage", new { notification = nvm }));
            }
            catch (Exception)
            {
                nvm = NotificationHandler.SerializeMessage <string>(NotificationHandler.Failed_Insert, contentRootPath);
                return(RedirectToAction("ShowGeneralPage", new { notification = nvm }));
            }
        }
예제 #18
0
        public void AddProductsToCartAndDeleteInCrome()
        {
            OnlineStorePage onlineStorePage = new OnlineStorePage();
            ProductPage     productPage     = new ProductPage();
            Product         product         = new Product();
            GeneralPage     generalPage     = new GeneralPage();
            CheckoutPage    checkoutPage    = new CheckoutPage();

            onlineStorePage.Open(driver, wait);
            onlineStorePage.AddProductsToCart(driver, wait, "Most Popular", 3);
            generalPage.ClickCheckout(driver, wait);
            checkoutPage.RemoveAllProducts(driver, wait);
        }
        //   [TestMethod]
        public void IE_Edge_DA_PANEL_TC029_Verify_that_user_is_unable_to_create_new_panel_when_required_field_is_not_filled()
        {
            generalPage = loginPage.LoginDashBoard(Constant.Respos_SampleRepository, Constant.UsernameAdmin, Constant.PasswordAdmin);

            newPanelPage = generalPage.GotoPanelPage();

            newPanelPage.ClickOK();

            newPanelPage.VerifyTextInAlertPopup(Constant.MsgRequiredFieldPanel);

            //post-condition
            generalPage.LogOut();
        }
예제 #20
0
        public void FormLoad(string directoryPath)
        {
            this.hdnInitFilePath.Value = directoryPath;

            this.fexUploadFiles.HdnRootDirectoryValue = this.hdnInitFilePath.Value;
            this.fexUploadFiles.FormLoad(this.fexUploadFiles.HdnRootDirectoryValue);


            //            CurrentDirectoryPath = directoryPath;
            IList <Directories> res = new List <Directories>();


            try
            {
                if (string.IsNullOrEmpty(directoryPath))
                {
                    this.gvExplorer.DataSource = null;
                    this.gvExplorer.DataBind();

                    return;
                }

                DirectoryInfo directory = new DirectoryInfo(directoryPath);

                if (!directory.Exists)
                {
                    this.gvExplorer.DataSource = null;
                    this.gvExplorer.DataBind();

                    return;
                }

                SelectDataFromDirectory(res, directory);

                if (res.Count != 0)
                {
                    this.gvExplorer.DataSource = res;
                    this.gvExplorer.DataBind();
                }
                else
                {
                    this.gvExplorer.DataSource = null;
                    this.gvExplorer.DataBind();
                }
            }
            catch (Exception ex)
            {
                GeneralPage.LogDebug("Грешка при зареждане на списък с прикачени файлове - метод 'FormLoad', форма 'FileExplorer.ascx'!" + ex.ToString());
                GeneralPage.LogError("Грешка при зареждане на списък с прикачени файлове - метод 'FormLoad', форма 'FileExplorer.ascx'!" + ex.ToString());
            }
        }
예제 #21
0
        //Overload of ClickNew() for Service Request types
        public static void ClickNew(string ticketType)
        {
            string xPathType = "";

            switch (ticketType)
            {
            case "Access Request":
            {
                xPathType = "AccessRequest";
                break;
            }

            case "General Request":
            {
                xPathType = "GeneralRequest";
                break;
            }

            case "Hardware Request":
            {
                xPathType = "HardwareRequest";
                break;
            }

            case "Move Request":
            {
                xPathType = "MoveRequest";
                break;
            }

            case "Software Request":
            {
                xPathType = "SoftwareRequest";
                break;
            }

            case "Training Request":
            {
                xPathType = "TrainingRequest";
                break;
            }

            default:
            {
                Assert.Fail("Unknown Service request Type. Check the feature file for errors.");
                break;
            }
            }
            GeneralPage.ClickOnObject(ID.newBtn);
            GeneralPage.ClickOnObject(ID.GenerateSRNewTypeXPath(xPathType));
        }
        protected void btnDownloadImportTemplate_Click(object sender, EventArgs e)
        {
            string appFolder       = Server.MapPath("/" + GeneralPage.GetSettingByCode(ETEMEnums.AppSettings.WebApplicationName).SettingValue);
            string resourcesFolder = GeneralPage.GetSettingByCode(ETEMEnums.AppSettings.ResourcesFolderName).SettingValue;
            string templateFolder  = GeneralPage.GetSettingByCode(ETEMEnums.AppSettings.FolderTemplates).SettingValue;
            string templateName    = GeneralPage.GetSettingByCode(ETEMEnums.AppSettings.Template_SAP_ProductivityAndScrap).SettingValue;

            string templatePath = string.Empty;

            if (Directory.Exists(appFolder + "\\" + templateFolder))
            {
                templatePath = appFolder + "\\" + templateFolder;
            }
            else if (Directory.Exists(resourcesFolder + "\\" + templateFolder))
            {
                templatePath = resourcesFolder + "\\" + templateFolder;
            }
            else
            {
                this.ownerPage.ShowMSG("Template folder not found!", false);
                return;
            }

            string templateFullName = templatePath + "\\" + templateName;

            DirectoryInfo dirInfoTemplates = new DirectoryInfo(resourcesFolder + "\\" + templateFolder + "\\Downloads");

            if (!Directory.Exists(dirInfoTemplates.FullName))
            {
                Directory.CreateDirectory(dirInfoTemplates.FullName);
            }

            string fileNameOnly = Path.GetFileNameWithoutExtension(templateFullName);

            string fileFullNameToDownload = dirInfoTemplates.FullName + "\\" + fileNameOnly + "_" + DateTime.Now.ToString(Constants.DATE_PATTERN_FOR_FILE_SUFFIX) + Constants.FILE_XLSX_EXTENSION;

            File.Copy(templateFullName, fileFullNameToDownload);

            FileInfo fiFileToDownload = new FileInfo(fileFullNameToDownload);

            if (fiFileToDownload.Exists)
            {
                fiFileToDownload.IsReadOnly = false;
            }

            string param = "FilePath=" + fileFullNameToDownload + "&ContentType=" + BaseHelper.GetMimeType(Constants.FILE_XLSX_EXTENSION) + "&Delete=true";

            this.ownerPage.OpenPageForDownloadFile(Constants.DOWNLOAD_PAGE_PATH, param);
        }
예제 #23
0
        public IActionResult About(string notification)
        {
            var entity = dbGeneralPage.GetAll().Where(e => e.Title == "AboutUs").FirstOrDefault();

            if (entity == null)
            {
                GeneralPage generalPage = new GeneralPage()
                {
                    Title = "AboutUs"
                };
                dbGeneralPage.Insert(generalPage);
            }
            ViewData["AboutUs"] = dbGeneralPage.GetAll().Where(e => e.Title == "AboutUs").FirstOrDefault();
            return(View());
        }
        public void DA_MP_TC012_Verify_that_user_can_add_additional_pages_besides_Overview_page_successfully()
        {
            string pageName = "TC12" + Constant.TimeSystem;

            generalPage = loginPage.LoginDashBoard(Constant.Respos_SampleRepository, Constant.UsernameAdmin, Constant.PasswordAdmin);

            newPage = generalPage.GotoNewPage();

            generalPage = newPage.CreateNewPage(Constant.DefaultValue, pageName, Constant.DefaultValue, Constant.DefaultValue, Constant.DefaultValue, Constant.DefaultValue);

            generalPage.VerifyPageDisplayedBesideAnotherPage(Constant.Overview, pageName);

            //post-condition
            generalPage.DeletePage(pageName);
            generalPage.LogOut();
        }
        public void IE_Edge_DA_DP_TC076_Verify_that_for_newly_created_data_profile_user_is_able_to_navigate_through_other_setting_pages_on_the_left_navigation_panel()
        {
            NewDataProfilePage  newDataProfilePage;
            EditDataProfilePage editDataProfilePage;
            string dataProfileName = "TC76" + Constant.TimeSystem;

            generalPage = loginPage.LoginDashBoard(Constant.Respos_SampleRepository, Constant.UsernameAdmin, Constant.PasswordAdmin);

            dataProfileManagerPage = generalPage.GotoDataProfileManagerPage();

            newDataProfilePage = dataProfileManagerPage.GotoNewDataProfilePage();

            dataProfileManagerPage = newDataProfilePage.AddADataProfile(dataProfileName, Constant.ItemType, Constant.RelatedData);

            editDataProfilePage = dataProfileManagerPage.GotoEditDataProfilePage(dataProfileName);

            editDataProfilePage.ClickTab("display fields tab");
            editDataProfilePage.VerifyPageDisplay("Display Fields");

            editDataProfilePage.ClickTab("sort fields tab");
            editDataProfilePage.VerifyPageDisplay("Sort Fields");

            editDataProfilePage.ClickTab("filter fields tab");
            editDataProfilePage.VerifyPageDisplay("Filter Fields");

            editDataProfilePage.ClickTab("statistic fields tab");
            editDataProfilePage.VerifyPageDisplay("Statistic Fields");

            editDataProfilePage.ClickTab("display sub fields tab");
            editDataProfilePage.VerifyPageDisplay("Display Sub-Fields");

            editDataProfilePage.ClickTab("sort sub fields tab");
            editDataProfilePage.VerifyPageDisplay("Sort Sub-Fields");

            editDataProfilePage.ClickTab("filter sub fields tab");
            editDataProfilePage.VerifyPageDisplay("Filter Sub-Fields");

            editDataProfilePage.ClickTab("statistic sub fields tab");
            editDataProfilePage.VerifyPageDisplay("Statistic Sub-Fields");

            //post-condition
            // dataProfileManagerPage = editDataProfilePage.GotoDataProfileManagerPage();
            //dataProfileManagerPage.DeleteCreatedDataProfile(dataProfileName);
            editDataProfilePage.LogOut();
        }
예제 #26
0
        private static bool IsDropDownViewActive(string viewName)
        {
            GeneralPage.SwitchToFrame(ID.mainGridFrame);
            //Commenting this because you dont have to click dropdown in order to se the DD list
            //GeneralPage.ClickOnObject(ID.viewChooser);
            bool visible = GeneralPage.IsElementVisible(ID.GenerateViewDropdownXpath(viewName));

            if (!visible)
            {
                log.Error(viewName + " dropdown option was not found.");
            }
            else
            {
                log.Info("View dropdown option was found.");
            }
            GeneralPage.SwitchToDefaultFrame();
            return(visible);
        }
예제 #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        GeneralPage sPage = (GeneralPage)Page;

        if (sPage.CurrentUser != null)
        {
            PnlUser.Style["display"]    = "block";
            PnlNonUser.Style["display"] = "none";
            PnlUser.HeaderText          = "Welcome " + sPage.CurrentUser.UserID + "!";
        }
        else
        {
            PnlUser.Style["display"]    = "none";
            PnlNonUser.Style["display"] = "block";
        }
        saveLibraryButton.Visible = sPage.CurrentUser != null;
        GetTopEdits();
    }
        public void DA_MP_TC017_Verify_that_user_can_remove_any_main_parent_page_without_children_and_except_Overview_page()
        {
            string parentPage = "TC17" + Constant.TimeSystem;
            string childPage  = "TC17" + Constant.TimeSystem + "1";

            generalPage = loginPage.LoginDashBoard(Constant.Respos_SampleRepository, Constant.UsernameAdmin, Constant.PasswordAdmin);

            newPage     = generalPage.GotoNewPage();
            generalPage = newPage.CreateNewPage(Constant.StatusPublic, parentPage, Constant.DefaultValue, Constant.DefaultValue, Constant.DefaultValue, Constant.DefaultValue);

            newPage     = generalPage.GotoNewPage();
            generalPage = newPage.CreateNewPage(Constant.StatusPublic, childPage, parentPage, Constant.DefaultValue, Constant.DefaultValue, Constant.DefaultValue);


            generalPage.SelectDeletePage(parentPage);

            generalPage.VerifyAlertMessage(Constant.MsgDeletePage);
            generalPage.AcceptAlert();

            generalPage.VerifyAlertMessage("Cannot delete page '" + parentPage + "' since it has child page(s).");
            generalPage.AcceptAlert();

            generalPage.SelectDeletePage(parentPage + "/" + childPage);
            generalPage.VerifyAlertMessage(Constant.MsgDeletePage);
            generalPage.AcceptAlert();


            generalPage.VerifyPageNotExist(parentPage + "/" + childPage);

            generalPage.SelectDeletePage(parentPage);

            generalPage.VerifyAlertMessage(Constant.MsgDeletePage);
            generalPage.AcceptAlert();

            generalPage.VerifyPageNotExist(parentPage);

            generalPage.GotoPage(Constant.Overview);

            generalPage.VerifyControlNotExistInGlobalSetting("Delete");

            //post-condition
            generalPage.LogOut();
        }
예제 #29
0
        private void registerObjectToButton(Canvas obj)
        {
            obj.MouseEnter += (sender, eventargs) =>
            {
                horvredcanvas = obj;
            };
            obj.MouseLeave += (sender, eventargs) =>
            {
                horvredcanvas = null;
            };
            obj.MouseDown += (sender, eventargs) =>
            {
                checkedobj = obj;
                string name = obj.Name;
                Page   p    = null;
                if (name == "General")
                {
                    p = new GeneralPage(username);
                }
                if (name == "Chat")
                {
                    p = new ChatPage(username);
                }
                if (name == "Notice")
                {
                    p = new NoticePage(username);
                }
                if (name == "SharedFile")
                {
                    p = new SharedFilePage(username);
                }
                if (name == "ToDoList")
                {
                    p = new ToDoListPage(username);
                }
                TestFrame.Source = new Uri("zPageList/" + name + "Page.xaml", UriKind.Relative);

                TestFrame.NavigationService.Navigate(p);

                click_sound_player.Play();
            };
        }
예제 #30
0
        void Session_Start(object sender, EventArgs e)
        {
            Dictionary <string, HttpSessionState> sessionData =
                (Dictionary <string, HttpSessionState>)Application[Constants.APPLICATION_ALL_SESSIONS];

            if (sessionData.Keys.Contains(HttpContext.Current.Session.SessionID))
            {
                sessionData.Remove(HttpContext.Current.Session.SessionID);
                sessionData.Add(HttpContext.Current.Session.SessionID, HttpContext.Current.Session);
            }
            else
            {
                sessionData.Add(HttpContext.Current.Session.SessionID, HttpContext.Current.Session);
            }

            GeneralPage.LogDebug("Session_Start at " + DateTime.Now + " SessionID = " + HttpContext.Current.Session.SessionID);


            Application[Constants.APPLICATION_ALL_SESSIONS] = sessionData;
        }