public void SetFeature(string featureName) { feature = extent.CreateTest <Feature>(featureName); }
public static void BeforeFeature() { //Create dynamic feature name featureName = extent.CreateTest <Feature>(FeatureContext.Current.FeatureInfo.Title); }
public void searchFlightMultiCity(Actions act, String destination1, String departDate1, String destination2, String departDate2, String destination3, String departDate3, String airLine, String gds, ExtentTest test) { presenceOfElement(Browser.driver, "//div[text()='New Air ']"); newAirQuote.Click(); presenceOfElement(Browser.driver, "//label[@class='btn btn-default label-normal one-way-label']/following-sibling::label"); multiCity.Click(); //segment 1 from1.SendKeys(destination1); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); to1.SendKeys(destination2); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); calanderPopup(departDate1, depart1); //segment 2 //from2.SendKeys(destination2); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); to2.SendKeys(destination3); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); calanderPopup(departDate2, depart2); //segment 3 //from3.SendKeys(destination3); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); to3.SendKeys(destination1); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); calanderPopup(departDate3, depart3); IJavaScriptExecutor jse = (IJavaScriptExecutor)Browser.driver; jse.ExecuteScript("window.scrollBy(0,250)", ""); airlinesAndAlliances.Click(); airlinesAndAlliances.SendKeys(airLine); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); selectFromDropdown(inventorySourceGDS, gds); flightsearch.Click(); waitForPageToLoad(); test.Log(Status.Info, "Got the MultiCity trip flight result"); }
public void SetupTests() { // Relevantcodes extent Report 2.41 //******************************************************************************************* // //To obtain the current solution path/project path // string pth = System.Reflection.Assembly.GetCallingAssembly().CodeBase; // string actualPath = pth.Substring(0, pth.LastIndexOf("bin")); // string projectPath = new Uri(actualPath).LocalPath; // Console.WriteLine(projectPath); // //Append the html report file to current project path // string reportPath = projectPath + "Report\\TestRunReport.html"; // Console.WriteLine(reportPath); // //Boolean value for replacing exisisting report //extent = new ExtentReports(reportPath, true); // //Add QA system info to html report // extent.AddSystemInfo("Host Name", "Shwetabh") // .AddSystemInfo("Environment", "Stage") // .AddSystemInfo("Username", "shwetabh123"); // //Adding config.xml file // extent.LoadConfig(projectPath + "extent-config.xml"); //Get the config.xml file from http://extentreports.com //****************************************** //aventstack extentreport 3.0.0 //**************************************************** //To obtain the current solution path/project path //string pth = System.Reflection.Assembly.GetCallingAssembly().CodeBase; // string pth = System.Environment.CurrentDirectory; // string pth = AppDomain.CurrentDomain.BaseDirectory; string pth = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; string actualPath = pth.Substring(0, pth.LastIndexOf("bin")); string projectPath = new Uri(actualPath).LocalPath; Console.WriteLine(projectPath); //Append the html report file to current project path string reportPath = projectPath + "Report\\TestRunReport.html"; //string reportPath = "TestRunReport.html"; Console.WriteLine(reportPath); //aventstack // ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(reportPath); //Boolean value for replacing exisisting report //relevent codes extent = new ExtentReports(); //aventstack // extent = new ExtentReports(); //// report title // htmlReporter.Config.DocumentTitle = "aventstack - ExtentReports"; //// encoding, default = UTF-8 // htmlReporter.Config.Encoding = "UTF-8"; // htmlReporter.Config.Theme = Theme.Standard; //// report or build name // htmlReporter.Config.ReportName = "Build-1224"; //// chart location - top, bottom //htmlReporter.Configuration().ChartLocation = ChartLocation.Top; //// theme - standard, dark ////htmlReporter.Configuration().Theme = Theme.Dark; //// add custom css //htmlReporter.Configuration().CSS = "css-string"; //// add custom javascript //htmlReporter.Configuration().JS = "js-string"; //// create ExtentReports and attach reporter(s) //aventstack extent.AttachReporter(htmlReporter); extent.AddSystemInfo("Platform", "Windows"); extent.AddSystemInfo("Host Name", "localhost"); extent.AddSystemInfo("Environment", "QA"); extent.AddSystemInfo("User Name", "testUser"); //************ //Gives full path package---class name---test name // parentTest = extent.CreateTest(TestContext.CurrentContext.Test.ClassName); //Gives only class name----use this //aventstack parentTest = extent.CreateTest(TestContext.CurrentContext.Test.Name); childTest = parentTest.CreateNode(TestContext.CurrentContext.Test.Name); // parenttest = extent.StartTest("Parent", "Test Started"); }
/// <summary> /// Initialize asserts class with ExtentX reporting /// </summary> /// <param name="extest"></param> public DatePicker(ExtentTest extest) { this.extest = extest; }
public static void beforeScenario() { scenario = featureName.CreateNode <Scenario>(ScenarioContext.Current.ScenarioInfo.Title); }
public void BeforeScenario() { webDriver = DetermineBrowserType(); ScenarioContext.Current.Add("webDriver", webDriver); scenario = featureName.CreateNode <Scenario>(ScenarioContext.Current.ScenarioInfo.Title); }
public void Initialize() { SelectBrowser(BrowserType.Firefox); scenario = featureName.CreateNode <Scenario>(ScenarioContext.Current.ScenarioInfo.Title); }
public static void CreateFeature() { _feature = _extent.CreateTest <Feature>(FeatureContext.Current.FeatureInfo.Title); }
public static void beforeTesst() { feature = extent.CreateTest <Feature>(FeatureContext.Current.FeatureInfo.Title); }
public void BeforeScenarioa() { String title = ScenarioContext.Current.ScenarioInfo.Title; scenario = feature.CreateNode <Scenario>(title); }
public static void AddTestCase(String testName, String testDescription) { test = extent.StartTest(testName, testDescription); }
public IdeaApprover(IWebDriver driver, ExtentTest test) : base(driver, test) { }
public void SetScenario(string scenarioName) { scenario = feature.CreateNode <Scenario>(scenarioName); }
/// <summary> /// Initializes the test for reporting. /// runs at the beginning of every test /// </summary> public void InitializeTest() { _test = _extent.StartTest(TestContext.CurrentContext.Test.Name); }
public static void CreateScenario() { _scenario = _feature.CreateNode <Scenario>(ScenarioContext.Current.ScenarioInfo.Title); }
public static void StartTest(string TestName, string TestDescription) { test = extent.StartTest(TestName, TestDescription); }
public static void CreateTestContext() { _test = _extent.CreateTest(TestContext.CurrentContext.Test.Name); }
public static void BeforeFeature(FeatureContext featureContext) { _featureName = _extent.CreateTest <Feature>(featureContext.FeatureInfo.Title); }
// [SetUp] public static void BeforeTest(String TestName) { _test = _extent.CreateTest(TestName); }
private static void BeforeFeature() { featureName = extent.CreateTest <AventStack.ExtentReports.Gherkin.Model.Feature>(FeatureContext.Current.FeatureInfo.Title); }
public void InitWebDriver(BrowserType browsertype) { ObjectRepository.Config = new AppConfigReader(); if (browsertype == BrowserType.Chrome) { O.Driver = GetChromeDriver(); } else if (browsertype == BrowserType.IExplorer) { O.Driver = GetIEDriver(); } else if (browsertype == BrowserType.Firefox) { O.Driver = GetFirefoxDriver(); } //switch (ObjectRepository.Config.GetBrowser()) //{ // case BrowserType.Firefox: // ObjectRepository.Driver = GetFirefoxDriver(); // // Logger.Info(" Using Firefox Driver "); // break; // case BrowserType.Chrome: // ObjectRepository.Driver = GetChromeDriver(); // // Logger.Info(" Using Chrome Driver "); // break; // case BrowserType.IExplorer: // ObjectRepository.Driver = GetIEDriver(); // // Logger.Info(" Using Internet Explorer Driver "); // break; // default: // throw new NoSuitableDriverFound("Driver Not Found : " + ObjectRepository.Config.GetBrowser().ToString()); //} O.Driver.Manage() .Timeouts().PageLoad = TimeSpan.FromSeconds(ObjectRepository.Config.GetPageLoadTimeOut()); O.Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(ObjectRepository.Config.GetElementLoadTimeOut()); O.Driver.Manage().Window.Maximize(); //BrowserHelper.BrowserMaximize(); // creating nodes // creates a toggle for the given test, adds all log events under it //parentTest = extent.CreateTest("MyFirstTest","Sample description"); parentTest = extent.CreateTest(TestContext.CurrentContext.Test.ClassName); childTest = parentTest.CreateNode(TestContext.CurrentContext.Test.MethodName); childTestnew = childTest.CreateNode(TestContext.CurrentContext.Test.Name); }
public static void AddTestCaseMetadataToHtmlReport(TestContext testContext) { MyTestContext = testContext; CurrentTestCase = ReportManager.CreateTest(MyTestContext.TestName); }
public static void StartTest(string name) //set the name of the test { _test = Instance.CreateTest(name); }
public void BeforeTest() { _test = _extent.CreateTest(TestContext.CurrentContext.Test.Name); }
public void Uninitialize() { _extentTest = null; }
public void searchFlightRoundTrip(Actions act, String fromAir, String toAir, String departDate, String ReturnDate, String airLine, String gds, ExtentTest test) { Thread.Sleep(7000); newAirQuote.Click(); roundTrip.Click(); from.SendKeys(fromAir); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); to.SendKeys(toAir); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); calanderPopup(departDate, depart); calanderPopup(ReturnDate, Return); IJavaScriptExecutor jse = (IJavaScriptExecutor)Browser.driver; jse.ExecuteScript("window.scrollBy(0,250)", ""); airlinesAndAlliances.Click(); airlinesAndAlliances.SendKeys(airLine); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); selectFromDropdown(inventorySourceGDS, gds); flightsearch.Click(); waitForPageToLoad(); test.Log(Status.Info, "Got the round trip flight result"); }
public void BeforeTest() { _extentTest = ReportWrapper.ExtentReports.CreateTest(TestContext.CurrentContext.Test.Name); _extentTest.AssignCategory(TestContext.CurrentContext.Test.ClassName); }
public void searchFlightOneWay(Actions act, String fromAir, String toAir, String departDate, String airLine, String gds, ExtentTest test) { Thread.Sleep(7000); newAirQuote.Click(); presenceOfElement(Browser.driver, "//label[@class='btn btn-default label-normal one-way-label']"); oneWay.Click(); from.SendKeys(fromAir); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); to.SendKeys(toAir); Thread.Sleep(4000); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); calanderPopup(departDate, depart); airlinesAndAlliances.Click(); airlinesAndAlliances.SendKeys(airLine); act.SendKeys(Keys.ArrowDown); act.SendKeys(Keys.Enter).Perform(); selectFromDropdown(inventorySourceGDS, gds); flightsearch.Click(); waitForPageToLoad(); test.Log(Status.Info, "Got the oneWay flight result"); }
public void GetTestName() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name); }