Example #1
0
 public void ShouldBeAbleToGetTheMetaTags()
 {
     // GIVEN
     using (var browser = new IE(MainURI))
     {
         // WHEN
         var metaTags = browser.ElementsWithTag("meta");
         
         // THEN
         Assert.That(metaTags.Count, Is.EqualTo(1));
     }
 }
Example #2
0
        public void ShouldBeAbleToGetTheMetaTags()
        {
            // GIVEN
            using (var browser = new IE(MainURI))
            {
                // WHEN
                var metaTags = browser.ElementsWithTag("meta");

                // THEN
                Assert.That(metaTags.Count, Is.EqualTo(1));
            }
        }
Example #3
0
        private void HidePanels()
        {
            // WatinBrowser.Divs[0].Style.SetAttributeValue("display", "none");
            WatinBrowser.Tables[0].Style.SetAttributeValue("visibility", "collapse");
            WatinBrowser.Tables[1].Style.SetAttributeValue("visibility", "collapse");

            var t   = WatinBrowser.Table("center");
            var row = t.TableRows[0];

            row.TableCells[0].Style.SetAttributeValue("display", "none");
            // row.TableCells[2].Style.SetAttributeValue("display", "none");

            WatinBrowser.Div("footer").Style.SetAttributeValue("display", "none");
            WatinBrowser.ElementsWithTag("noindex")[0].Style.SetAttributeValue("display", "none");
        }
Example #4
0
        public void Should_add_three_visits()
        {
            new DatabaseTester().Clean();

            var url = "http://localhost:1234/";

            using (var ie = new IE(url))
            {
                ie.Button("submit").Click();
                Thread.Sleep(2000);
                ie.Button("submit").Click();
                Thread.Sleep(2000);
                ie.Button("submit").Click();
                Thread.Sleep(2000);

                ie.ElementsWithTag("hr").Count.ShouldEqual(3);
            }
        }
Example #5
0
        public void ParentShouldReturnAnInstanceOfTypeListItemWhenRegisteredWithElementFactory()
        {
            // GIVEN searching for WatiN on Google
            ElementFactory.RegisterElementType(typeof(ListItem));

            using (var ie = new IE("www.google.com"))
            {
                ie.TextField(Find.ByName("q")).TypeText("WatiN");
                ie.Button(Find.ByName("btnG")).Click();

                // Get the first li item on the page
                var firstListItem = ie.ElementsWithTag("li")[0];

                // get its first child (assuming it has a child)
                var firstChild = ((IElementContainer)firstListItem).Elements[0];

                // WHEN getting the parent of the child we should get the listitem again
                var parentListItem = firstChild.Parent;

                // THEN the returned item should be typed cause ElementFactory knows about ListItem
                Assert.IsInstanceOfType(parentListItem, typeof(ListItem));
            }
        }