Skip to content

Commit

Permalink
feat: add text field
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Oct 15, 2022
1 parent 9676dad commit 2daa0bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class Payload{
private String layer;
private String name;
private String tag;
private String text;
private String texture;
private Integer _instanceId;
private Integer _ilayer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ private List<PocoElement> findElementsByAttr(PocoElement sourceElement, List<Poc
case "name":
p = value.equals(sourceElement.getPayload().getName());
break;
case "text":
p = value.equals(sourceElement.getPayload().getText());
break;
case "type":
p = value.equals(sourceElement.getPayload().getType());
break;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/cloud/sonic/driver/poco/PocoDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public void testPageSource() throws SonicRespException {

@Test
public void testFindElement() throws SonicRespException {
String expression = "poco(type=\"Node\",name=\"Canvas\").child(type=\"Image\")[1]";
String expression = "poco(type=\"Text\",text=\"Start\")";
PocoElement pocoElement = pocoDriver.findElement(expression);
Assert.assertTrue(pocoElement.getPayload().getType().equals("Image"));
Assert.assertTrue(pocoElement.getPayload().getType().equals("Text"));
}

@Test
Expand Down

0 comments on commit 2daa0bc

Please sign in to comment.