PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/src/test/java/org/sigmah/endtoend/xpath/XPathTest.java

http://sigma-h.googlecode.com/
Java | 40 lines | 26 code | 10 blank | 4 comment | 0 complexity | 0da0b19c105959c690253c822958b97a MD5 | raw file
 1/*
 2 * All Sigmah code is released under the GNU General Public License v3
 3 * See COPYRIGHT.txt and LICENSE.txt.
 4 */
 5
 6package org.sigmah.endtoend.xpath;
 7
 8import org.junit.Test;
 9
10import static org.hamcrest.CoreMatchers.is;
11import static org.hamcrest.core.IsEqual.equalTo;
12import static org.junit.Assert.assertThat;
13import static org.sigmah.endtoend.xpath.XPath.*;
14import static org.sigmah.endtoend.xpath.ext.GxtXPath.*;
15
16public class XPathTest {
17
18    @Test
19    public void within() {
20        System.err.println(
21                relative(
22                  descendant(isAPanel().withHeaderText("Monthly Reports")),
23                  descendant(isAGrid())));
24    }
25
26    @Test
27    public void grid() {
28        System.err.println(relative(gridRow(3), gridCell(1)));
29    }
30
31    @Test
32    public void multiplePredicates() {
33
34        String xpath = XPath.relative(
35                descendant(attribute("visible").equalTo("true"), position(3)));
36
37        assertThat(xpath, is(equalTo("descendant::*[@visible = 'true'][position() = 3]")));
38
39    }
40}