Пример #1
0
        public void StartBrowser()
        {
            AllureExtensions.WrapSetUpTearDownParams(
                () => InitWebDriver(new ChromeDriver()), "Launching browser");

            Driver.Manage().Window.Maximize();
        }
Пример #2
0
 public void TearDown()
 {
     AllureExtensions.WrapSetUpTearDownParams(() =>
     {
         Thread.Sleep(750);
         Console.WriteLine("Example of wrapped TearDown");
     }, "Custom TearDown name here");
 }
Пример #3
0
 public void SetUp()
 {
     Environment.CurrentDirectory = Path.GetDirectoryName(GetType().Assembly.Location);
     AtataContext.GlobalConfiguration.ApplyJsonConfig <AppData>();
     AllureExtensions.WrapSetUpTearDownParams(() => { AllureLifecycle.Instance.CleanupResultDirectory(); });
     if (General.AppData.OneTimeDriverSetup && !General.AppData.CustomBuildDriver)
     {
         General.BuildContext().Build();
     }
 }
Пример #4
0
        public void After()
        {
            TestContext.Progress.WriteLine(
                $"!!! - {TestContext.CurrentContext.Test.FullName} - {TestContext.CurrentContext.Result.Outcome.Status}");
            if (TestContext.CurrentContext.Result.Outcome.Status != TestStatus.Passed)
            {
                AllureLifecycle.Instance.AddAttachment("ScreenShot", "image/png",
                                                       ((ITakesScreenshot)Driver).GetScreenshot().AsByteArray, ".png");
            }

            AllureExtensions.WrapSetUpTearDownParams(KillWebDriver, "Killing browser");
        }
Пример #5
0
 public void CleanupResultDirectory()
 {
     AllureExtensions.WrapSetUpTearDownParams(() => { AllureLifecycle.Instance.CleanupResultDirectory(); },
                                              "Cleanup Allure Results Directory");
 }