Example #1
0
        public void Test_ParsePageInfo(string[] tokens)
        {
            PageObjectParser parser = new PageObjectParser();

            PageObjects.Parser.PageInfo page = parser.ParsePageInfo(tokens);
            Assert.Equal(page.Name, tokens[1]);
            Assert.Equal(page.Url, tokens[2]);
        }
Example #2
0
        public void Test_ParsePageInfoWithElementInfo()
        {
            string[]         tokens   = new string[] { "page", "Index", "/index.html", "SignInButton", "#login" };
            ElementInfo      expected = new ElementInfo(tokens[3], tokens[4]);
            PageObjectParser parser   = new PageObjectParser();

            PageObjects.Parser.PageInfo page = parser.ParsePageInfo(tokens);
            Assert.Equal(page.Name, tokens[1]);
            Assert.Equal(page.Url, tokens[2]);
            Assert.Equal(page.Elements[0].Name, expected.Name);
        }
Example #3
0
        public void Test_ParsePageInfoWithElementInfo2()
        {
            string[] tokens = new string[] {
                "page", "SignIn", "/signin.html",
                "Email", "#email",
                "Password", "#password"
            };
            ElementInfo expected1 = new ElementInfo(
                tokens[3], tokens[4]);
            ElementInfo expected2 = new ElementInfo(
                tokens[5], tokens[6]);
            PageObjectParser parser = new PageObjectParser();

            PageObjects.Parser.PageInfo page =
                parser.ParsePageInfo(tokens);
            Assert.Equal(page.Name, tokens[1]);
            Assert.Equal(page.Url, tokens[2]);
            Assert.Equal(page.Elements[0].Name, expected1.Name);
            Assert.Equal(page.Elements[1].Name, expected2.Name);
        }