Пример #1
0
        public void documentForMeetingReplaceInvalidFile()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var    executionLog = new ExecutionLog();
            var    loginHelper  = new LoginHelper(GetWebDriver());
            var    officeActivities_MeetingHelper  = new OfficeActivities_MeetingHelper(GetWebDriver());
            var    officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("DocumentUpdateVersion", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("DocumentUpdateVersion", "Verify Page title");
                VerifyTitle("Dashboard");

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Go to meetings page");
                VisitOffice("meetings");

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Click On Meeting In Activity");
                officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Click On Add Document Btn");
                officeActivities_MeetingHelper.ClickElement("ClickOnAddDocumentBtn");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Enter Doc Name");
                var DocName = "Test Valid Doc" + GetRandomNumber();
                officeActivities_MeetingHelper.TypeText("EnterDocumentName", DocName);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Upload Invalid file(exe)");
                var InvalidFile = GetPathToFile() + "chrome.exe";
                officeActivities_MeetingHelper.Upload("BrowseDoc", InvalidFile);
                officeActivities_MeetingHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Replace with valid file(jpg)");
                var ValidFile = GetPathToFile() + "Up.jpg";
                officeActivities_MeetingHelper.Upload("BrowserDoc1", ValidFile);
                officeActivities_MeetingHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Click Save Of Doc Pop Up");
                officeActivities_MeetingHelper.ClickElement("ClickSaveOfDocPopUp");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Verify Confirmation");
                officeActivities_MeetingHelper.WaitForText("Documents successfully Added.", 10);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Redirect To Document Section Activities");
                VisitOffice("documents");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Search Document");
                officeActivities_MeetingHelper.TypeText("SearchSubject", DocName);
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Select All in owner field");
                officeActivities_MeetingHelper.SelectByText("OwnerField", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Verify Added Document Present");
                officeActivities_MeetingHelper.VerifyText("DoucumentFirstInList", DocName);
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Search Document");
                officeActivities_DocumentHelper.TypeText("SearchDocumet", DocName);
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Select document");
                officeActivities_DocumentHelper.ClickElement("CheckDocToDel");

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Click on delete.");
                officeActivities_DocumentHelper.ClickElement("ClickOndelete");

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Accept alert message.");
                officeActivities_DocumentHelper.AcceptAlert();

                executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Wait for success message.");
                officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("DocumentForMeetingReplaceInvalidFile");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Document For Meeting Replace InvalidFile");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("DocumentForMeetingReplaceInvalidFile", "Bug", "Medium", "Meeting page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Document For Meeting Replace InvalidFile");
                        TakeScreenshot("DocumentForMeetingReplaceInvalidFile");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\DocumentForMeetingReplaceInvalidFile.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("DocumentForMeetingReplaceInvalidFile");
                        string id            = loginHelper.getIssueID("Document For Meeting Replace InvalidFile");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\DocumentForMeetingReplaceInvalidFile.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Document For Meeting Replace InvalidFile"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Document For Meeting Replace InvalidFile");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("DocumentForMeetingReplaceInvalidFile");
                executionLog.WriteInExcel("Document For Meeting Replace InvalidFile", Status, JIRA, "Office Activities");
            }
        }
        public void editMeetingdeleteFileSave()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver());

            // Variable
            var    Filename = GetPathToFile() + "index.jpg";
            String JIRA     = "";
            String Status   = "Pass";

            try
            {
                executionLog.Log("EditMeetingdeleteFileSave", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("EditMeetingdeleteFileSave", "Verify Page title");
                VerifyTitle("Dashboard");

                executionLog.Log("EditMeetingdeleteFileSave", "Click On Admin");
                VisitOffice("admin");

                VisitOffice("meetings");
                officeActivities_MeetingHelper.WaitForWorkAround(5000);

                executionLog.Log("EditMeetingdeleteFileSave", "Verify title");
                VerifyTitle("Meetings");

                executionLog.Log("EditMeetingdeleteFileSave", "Click on Edit");
                officeActivities_MeetingHelper.ClickElement("Edit");
                officeActivities_MeetingHelper.WaitForWorkAround(5000);

                executionLog.Log("EditMeetingdeleteFileSave", "Verify page title.");
                VerifyTitle("Edit Meeting");

                executionLog.Log("EditMeetingdeleteFileSave", "Click on add attachment");
                officeActivities_MeetingHelper.ClickElement("AddAttachment");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("EditMeetingdeleteFileSave", "Upload File ");
                officeActivities_MeetingHelper.Upload("File_Upload", Filename);

                executionLog.Log("EditMeetingdeleteFileSave", "Enter attachment name.");
                officeActivities_MeetingHelper.TypeText("AttachName", "New Subject");

                executionLog.Log("EditMeetingdeleteFileSave", "Remove the uploaded file.");
                officeActivities_MeetingHelper.ClickElement("RemoveAttach");

                executionLog.Log("EditMeetingdeleteFileSave", "Click on save button.");
                officeActivities_MeetingHelper.ClickElement("SaveAttachment");
                officeActivities_MeetingHelper.WaitForWorkAround(5000);

                executionLog.Log("EditMeetingdeleteFileSave", "Verify validation text.");
                officeActivities_MeetingHelper.VerifyText("Attachmenterror", "This field is required.");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EditMeetingdeleteFileSave");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Edit Meeting delete File Save");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Edit Meeting delete File Save", "Bug", "Medium", "Meeting page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Edit Meeting delete File Save");
                        TakeScreenshot("EditMeetingdeleteFileSave");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditMeetingdeleteFileSave.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EditMeetingdeleteFileSave");
                        string id            = loginHelper.getIssueID("Edit Meeting delete File Save");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditMeetingdeleteFileSave.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Edit Meeting delete File Save"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Edit Meeting delete File Save");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EditMeetingdeleteFileSave");
                executionLog.WriteInExcel("Edit Meeting delete File Save", Status, JIRA, "Office Activities");
            }
        }
Пример #3
0
        public void verifyNoteWithExeForMeetingNotAdded()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var officeActivities_NotesHelper   = new OfficeActivities_NotesHelper(GetWebDriver());
            var officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver());

            // Random Variables
            var    DocName = "Notes Meeting Exe" + GetRandomNumber();
            var    ExeFile = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

            try
            {
                executionLog.Log("EquipmentShippingValidationDublicate", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("EquipmentShippingValidationDublicate", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Click to open client inf");
                VisitOffice("meetings");

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Click On Meeting");
                officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Click On Add Document Btn");
                officeActivities_MeetingHelper.ClickElement("ClickOnNoteMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Enter Doc Name");
                officeActivities_MeetingHelper.TypeText("EnterSubNote", DocName);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Uplaod exe file");
                officeActivities_MeetingHelper.Upload("DocumentFileNotesMeet", ExeFile);
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Click Save Of Doc Pop Up");
                officeActivities_MeetingHelper.ClickElement("SaveNoteMeeting");

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Verify Confirmation");
                officeActivities_MeetingHelper.WaitForText("Note successfully Created.", 10);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Redirect To  Notes Activities");
                VisitOffice("notes");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Search Document");
                officeActivities_NotesHelper.TypeText("EnterSubject", DocName);
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Select All in created by field");
                officeActivities_NotesHelper.SelectByText("CreatedbyField", "All");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                officeActivities_NotesHelper.ClickElement("ClickOnNote");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Verify Added Document not Present");
                officeActivities_NotesHelper.VerifyText("VerifyNoAttachment", "No Data Available.");
                officeActivities_NotesHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyNoteWithExeForMeetingNotAdded");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Note With Exe For Meeting Not Added");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("VerifyNoteWithExeForMeetingNotAdded", "Bug", "Medium", "Meeting page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Note With Exe For Meeting Not Added");
                        TakeScreenshot("VerifyNoteWithExeForMeetingNotAdded");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyNoteWithExeForMeetingNotAdded.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyNoteWithExeForMeetingNotAdded");
                        string id            = loginHelper.getIssueID("Verify Note With Exe For Meeting Not Added");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyNoteWithExeForMeetingNotAdded.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Note With Exe For Meeting Not Added"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Note With Exe For Meeting Not Added");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyNoteWithExeForMeetingNotAdded");
                executionLog.WriteInExcel("Verify Note With Exe For Meeting Not Added", Status, JIRA, "Office Activities");
            }
        }