Beispiel #1
0
        public virtual void Setup()
        {
            fixture = new GoogleFixture();

            fixture.LaunchPageInBrowser(Urls.Google).ShouldPass();

            BeforeTest();
        }
Beispiel #2
0
        public virtual void TearDown()
        {
            try
            {
                string name = this.GetType().ToString() + ".jpg";

                if (!fixture.IsLocal)
                    name = "D:\\TestResults\\" + name;

                if (File.Exists(name))
                    File.Delete(name);

                fixture.GetBrowserScreen(name).ShouldPass();
            }
            catch (Exception e)
            {
                Console.WriteLine("BaseBrowserTest.TearDown: Attempt to capture screen threw exception " + e.Message + "\r\n" + e.ToString());
            }

            try
            {
                BeforeTeardown();
            }
            catch (Exception e)
            {
                Console.WriteLine("BaseBrowserTest.TearDown: BeforeTeardown threw exception " + e.Message + "\r\n" + e.ToString());
            }

            fixture.CloseBrowser(true).ShouldPass();

            AfterBrowserTeardown();

            fixture.Dispose();

            fixture = null;
        }