Issue 257 was a long pending task and it is fixed now on the trunk-udl-0.7.0
branch with the changes in the StandardTable object

http://code.google.com/p/aost/wiki/Tellurium070Update#Standard_Table

and the addition of the "self" attribute to UI object.

http://code.google.com/p/aost/wiki/Tellurium070Update#self_attribute

This issue is to address the problem from one user to create a UI module for
the following html snippet.

<div id="table">
   <div>
       <div id="name">
           <div>Data</div>
           <div>
               <img/>
           </div>
       </div>
       <div id="shortname">
           <div>Bezeichnung</div>
           <div>
               <img/>
           </div>
       </div>
       <div id="type">
           <div>Typ</div>
           <div>
               <img/>
           </div>
       </div>
   </div>
   <div id="client-area">
       <div>
           <div>Bildsystem</div>
           <div>Bildsystem</div>
           <div>Bildserver</div>
       </div>
       <div>
           <div>Partner</div>
           <div>Partner</div>
           <div>Bestandssystem</div>
       </div>
       <div>
           <div>MS</div>
           <div>MS</div>
           <div>MS</div>
       </div>
   </div>
</div>

Now, it can be described using the following UI module.

class TwoDimModule  extends DslContext {
  public void defineUi(){
    ui.StandardTable(uid: "Table", clocator: [id: "table"], bt: "div", brt:
"div", bct: "div"){
      TextBox(uid: "tbody: 1, row: *, column: 1", clocator: [tag: "div"],
self: "true")
      Image(uid: "tbody: 1, row: *, column: 2", clocator: [:])
      TextBox(uid: "tbody: 2, row: *, column: 1", clocator: [tag: "div"],
self: "true")
      TextBox(uid: "tbody: 2, row: *, column: 2", clocator: [tag: "div"],
self: "true")
      TextBox(uid: "tbody: 2, row: *, column: 3", clocator: [tag: "div"],
self: "true")
    }
  }
}

I tested it with the following code

public class TwoDimJUnitTestCase extends TelluriumMockJUnitTestCase {
    private static TwoDimModule tdm;

    @BeforeClass
    public static void initUi() {
        registerHtmlBody("TwoDim");

        tdm = new TwoDimModule();
        tdm.defineUi();
        useCssSelector(true);
        useTelluriumEngine(true);
        useTrace(true);
        useEngineLog(true);
    }

    @Before
    public void connectToLocal() {
        connect("TwoDim");
    }

    @Test
    public void testValidateUiModule(){
        tdm.validate("Table");
    }

    @Test
    public void testGetHTMLSource(){
        tdm.getHTMLSource("Table");
    }

    @AfterClass
    public static void tearDown(){
        showTrace();
    }
}

The tests work fine.

I will merge the changes back to trunk some time later.

Thanks,

Jian

-- 
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en.

Reply via email to