Exemplo n.º 1
0
        public void WindowSwitchToUrlContainingTest()
        {
            SwitchPage.Go();

            I.Click(SwitchPage.NewWindowSelector);

            I.Switch.Window("/Inp");
            I.Assert.Text("Input Controls Testbed").In("h2");
        }
Exemplo n.º 2
0
        public void SwitchPageObject()
        {
            SwitchPage.Go();

            var switchPage = InputsPage.Switch <SwitchPage>();

            Assert.True(switchPage.Url.EndsWith("Switch"));

            InputsPage.Go();

            // throw because we aren't on the SwitchPage and nothing is navigating us there
            Assert.Throws <FluentException>(() => InputsPage.Switch <SwitchPage>());
        }
Exemplo n.º 3
0
        public void FrameSwitchToNonexistantFrameThrowsTest()
        {
            SwitchPage.Go();

            I.Switch.Frame(SwitchPage.IFrameSelector)
            .Assert.Text("Alerts Testbed").In("h2");

            var ex = Assert.Throws <FluentException>(() => I.Switch.Frame("nonExistentFrame"));

            // actual message is "No frame element found with name or id non existent frame"
            // but not using that in case the format changes.
            StringAssert.Contains("nonExistentFrame", ex.InnerException.Message);
        }
Exemplo n.º 4
0
        public void FrameSwitchTest()
        {
            SwitchPage.Go();

            I.Switch.Frame(SwitchPage.IFrameSelector)
            .Assert.Text("Alerts Testbed").In("h2");

            I.Switch.Frame()
            .Assert.Text("Switch Testbed").In("h2");

            I.Switch.Frame(I.Find(SwitchPage.IFrameSelector))
            .Assert.Text("Alerts Testbed").In("h2");
        }
Exemplo n.º 5
0
        public void SwitchToPopupTest()
        {
            SwitchPage.Go();

            I.Expect.Text("Switch Testbed").In("h2");
            // open pop up
            I.Click(SwitchPage.new_popup);

            I.Switch.Window("Inputs").Expect.Text("Inputs - FluentAutomation Testbed").In("head > title");
            I.Enter("can you see me").In(InputsPage.TextControlSelector);

            // switch back to primary window
            I.Switch.Window().Expect.Text("Switch Testbed").In("h2");
        }
Exemplo n.º 6
0
        public void WindowSwitchTest()
        {
            SwitchPage.Go();

            I.Click(SwitchPage.NewWindowSelector);

            I.Switch.Window("Inputs - FluentAutomation Testbed");

            I.Assert.Text("Input Controls Testbed").In("h2");

            I.Switch.Window()
            .Assert.Text("Switch Testbed").In("h2");

            I.Switch.Window("/Inputs")
            .Assert.Text("Input Controls Testbed").In("h2");

            I.Switch.Window()
            .Assert.Text("Switch Testbed").In("h2");
        }
Exemplo n.º 7
0
 public void WindowSwitchToNonExistentThrowsTest()
 {
     SwitchPage.Go();
     Assert.Throws <FluentException>(() => I.Switch.Window("non existent window"));
 }
Exemplo n.º 8
0
 public SwitchTests()
 {
     SwitchPage.Go();
 }