Пример #1
0
        public void TestAcceptModalBrowserDialog()
        {
            var home = Start();

            var mainLabel = home.GetLabel().ByID("MainLabel");

            AssertPostBackSequenceNumber(mainLabel, 1);

            var frameLabel = home.Frame.GetLabel().ByID("FrameLabel");

            AssertPostBackSequenceNumber(frameLabel, 1);

            home.Frame.GetTextBox().ByLocalID("MyTextBox").FillWith("MyText", FinishInput.Promptly);

            var loadFrameFunctionInFrameButton = home.GetWebButton().ByID("LoadFrameFunctionInFrame");

            loadFrameFunctionInFrameButton.Click(Opt.ContinueWhen(Wxe.ResetIn(home.Frame)).AcceptModalDialog());
            AssertPostBackSequenceNumber(frameLabel, 1);
            AssertPostBackSequenceNumber(mainLabel, 2);

            // Ensure that page can still be used
            var navigatieAwayButton = home.GetWebButton().ByID("NavigateAway");
            var defaultPage         = navigatieAwayButton.Click().Expect <WxePageObject>();

            Assert.That(defaultPage.GetTitle(), Is.EqualTo("Web.Development.WebTesting.TestSite"));
        }
Пример #2
0
        public void TestMultiFrameActions()
        {
            var home = Start();

            var mainLabel = home.GetLabel().ByID("MainLabel");

            AssertPostBackSequenceNumber(mainLabel, 1);

            var frameLabel = home.Frame.GetLabel().ByID("FrameLabel");

            AssertPostBackSequenceNumber(frameLabel, 1);

            var simplePostBackButton = home.GetWebButton().ByID("SimplePostBack");

            simplePostBackButton.Click();
            AssertPostBackSequenceNumber(frameLabel, 1);
            AssertPostBackSequenceNumber(mainLabel, 2);

            var loadFrameFunctionAsSubInFrameButton = home.GetWebButton().ByID("LoadFrameFunctionAsSubInFrame");

            loadFrameFunctionAsSubInFrameButton.Click(Opt.ContinueWhen(Wxe.PostBackCompletedIn(home.Frame)));
            AssertPostBackSequenceNumber(frameLabel, 2);
            AssertPostBackSequenceNumber(mainLabel, 3);

            var loadFrameFunctionInFrameButton = home.GetWebButton().ByID("LoadFrameFunctionInFrame");

            loadFrameFunctionInFrameButton.Click(Opt.ContinueWhen(Wxe.ResetIn(home.Frame)));
            AssertPostBackSequenceNumber(frameLabel, 1);
            AssertPostBackSequenceNumber(mainLabel, 4);

            var simplePostBackButtonInFrameButton = home.Frame.GetWebButton().ByID("SimplePostBack");

            simplePostBackButtonInFrameButton.Click();
            AssertPostBackSequenceNumber(frameLabel, 2);
            AssertPostBackSequenceNumber(mainLabel, 4);

            var refreshMainUpdatePanelButton = home.Frame.GetWebButton().ByID("RefreshMainUpdatePanel");

            refreshMainUpdatePanelButton.Click(Opt.ContinueWhen(Wxe.PostBackCompletedIn(home)));
            AssertPostBackSequenceNumber(frameLabel, 3);
            AssertPostBackSequenceNumber(mainLabel, 5);

            var loadMainAutoRefreshingFrameFunctionInFrameButton = home.GetWebButton().ByID("LoadMainAutoRefreshingFrameFunctionInFrame");

            loadMainAutoRefreshingFrameFunctionInFrameButton.Click(Opt.ContinueWhen(Wxe.ResetIn(home.Frame)));
            AssertPostBackSequenceNumber(frameLabel, 1);
            AssertPostBackSequenceNumber(mainLabel, 6);

            simplePostBackButtonInFrameButton.Click(Opt.ContinueWhenAll(Wxe.PostBackCompleted, Wxe.PostBackCompletedIn(home)));
            AssertPostBackSequenceNumber(frameLabel, 2);
            AssertPostBackSequenceNumber(mainLabel, 7);
        }