示例#1
0
        public void SlTab_SelectedIndex_Succeeds()
        {
            BrowserWindowUnderTest b = BrowserWindowUnderTest.Launch(silverlightApplicationHtmlPageUrl);

            b.SetFocus();
            SilverlightTab oTab = b.Find <SilverlightTab>(By.AutomationId("tabControl1"));

            oTab.SelectedIndex = 1;
            Assert.IsTrue(oTab.SourceControl.Items[0].Name == "tabItem1");
            b.Close();
        }
示例#2
0
        public void SlTab_SelectedIndex_Succeeds()
        {
            BrowserWindowUnderTest b = BrowserWindowUnderTest.Launch(testSilverlightApplicationHtmlPageUrl, "Home");

            b.SetFocus();
            SilverlightTab oTab = b.Get <SilverlightTab>("AutomationId=tabControl1");

            oTab.SelectedIndex = 1;
            Assert.IsTrue(oTab.UnWrap().Items[0].Name == "tabItem1");
            b.Close();
        }
示例#3
0
        public void SlTab_TraverseSiblingsAndChildren_Succeeds()
        {
            BrowserWindowUnderTest b = BrowserWindowUnderTest.Launch(silverlightApplicationHtmlPageUrl);

            b.SetFocus();
            SilverlightTab oTab = b.Find <SilverlightTab>(By.AutomationId("tabControl1"));

            oTab.SelectedIndex = 0;
            var btnOK = b.Find <SilverlightButton>(By.AutomationId("OKButtonInTabItem1"));

            ((SilverlightEdit)(btnOK.PreviousSibling)).Text = "blah blah hurray";
            foreach (ControlBase control in oTab.GetChildren())
            {
                if (control.GetType() == typeof(SilverlightEdit))
                {
                    ((SilverlightEdit)control).Text = "Text Changed";
                    break;
                }
            }
            Assert.IsTrue(((SilverlightTab)btnOK.Parent).SelectedItem == "tabItem1");
            b.Close();
        }