Exemplo n.º 1
0
 public void CloseBrowser()
 {
     PropertyCollection.ChildTest = PropertyCollection.ExtentTest.CreateNode(GetActions.GetMyMethodName());
     SeleniumReporting.WriteResults(true, "Browser Close");
     PropertyCollection.ExtentReports.Flush();
     //PropertyCollection.Driver.Quit();
     PropertyCollection.Driver.Close();
 }
Exemplo n.º 2
0
 public MetaTriggerData(string name, List <MetaActionData> allowedActions, System.Type triggerType, GetCreator creator, AddAction addAction, GetActions getActions)
 {
     this.name           = name;
     this.triggerType    = triggerType;
     this.allowedActions = allowedActions;
     this.creator        = creator;
     this.addAction      = addAction;
     this.getActions     = getActions;
 }
        public static string TakeScreenshot()
        {
            ITakesScreenshot screenshot = PropertyCollection.Driver as ITakesScreenshot;
            var screen = screenshot.GetScreenshot();
            //string fileName = System.Configuration.ConfigurationManager.AppSettings["ScreenshotPath"] + DateTime.Now.ToString("yyyy-dd-MM--HH-mm-ss")+".png";
            string fileName = GetActions.GetFileName("ScreenshotPath", ".png");

            screen.SaveAsFile(fileName);
            return(fileName);
        }
Exemplo n.º 4
0
        public void StartReports()
        {
            //string reportPath = System.Configuration.ConfigurationManager.AppSettings["ReportPath"] + "\\GACtrackTestReport.html";
            string reportPath = GetActions.GetFileName("ReportPath", ".html");

            PropertyCollection.HTMLReporter = new ExtentHtmlReporter(reportPath);
            PropertyCollection.HTMLReporter.Configuration().Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            PropertyCollection.HTMLReporter.Configuration().ReportName    = "Automated Sanity Report";
            PropertyCollection.HTMLReporter.Configuration().DocumentTitle = "GACShip Agent Sanity Testing Report";

            PropertyCollection.ExtentReports = new ExtentReports();
            PropertyCollection.ExtentReports.AddSystemInfo("Host Name", "SGIT-MASH-NB.group.gac");
            PropertyCollection.ExtentReports.AddSystemInfo("Environment", "QA");
            PropertyCollection.ExtentReports.AddSystemInfo("UserName", "Majeeth Shaik");
            PropertyCollection.ExtentReports.AttachReporter(PropertyCollection.HTMLReporter);
        }
Exemplo n.º 5
0
//******INNER_METHODS*****************************************************************************************************************************************

        public GACShip_Agent_LandingPage GACShipLoginToApplication()
        {
            GACShip_Agent_LoginPage loginPage = new GACShip_Agent_LoginPage();
            Excel excel = new Excel(@"C:\Users\edqu01\Documents\GAC Automation\GACShip Agent Automation - August-31\ConsoleApp1\TestData\GACShipTestData.xlsx", "LogIn");

            PropertyCollection.ChildTest = PropertyCollection.ExtentTest.CreateNode(GetActions.GetMyMethodName());

            //Checks first if element is present then type in the Username
            if (InitialAssertion.ifElementIsPresentandVisible(loginPage.Username) == true)
            {
                SetActions.FillInTextField((excel.ReadDatabyColumnName("GACShip", "UserName")), loginPage.Username);
                SeleniumReporting.ElementPresentVerification(true, "UserName Text Field");
                SeleniumReporting.WriteMessageOnTheReport("Username was typed in the text field.");
            }
            else
            {
                SeleniumReporting.ElementPresentVerification(false, "UserName Text Field");
            }

            //Checks first if element is present then type in the Password
            if (InitialAssertion.ifElementIsPresentandVisible(loginPage.Password) == true)
            {
                SetActions.FillInTextField((excel.ReadDatabyColumnName("GACShip", "Password")), loginPage.Password);
                SeleniumReporting.ElementPresentVerification(true, "PassWord Text Field");
                SeleniumReporting.WriteMessageOnTheReport("Password was typed in the text field.");
            }
            else
            {
                SeleniumReporting.ElementPresentVerification(false, "PassWord Text Field");
            }

            SetActions.ClickButton(loginPage.LogInButton, "LogIn");
            excel.Close();

            GACShip_Agent_LandingPage landingPage = new GACShip_Agent_LandingPage();

            InitialAssertion.WaitForElementLoad(By.XPath(LandingPageHeader), 30);

            return(new GACShip_Agent_LandingPage());

//************************************************************************************************************************************************************************
        }