pageobjects - Can you override content in the "static content" block when extending classes in geb? -




i have 2 classes 1 extends other listed below:

class tabledpage extends page {      static content ={         table {$(by.xpath("//tbody"))}         headers {$(by.xpath("//thead"))}     }      navigator gatallrows(){         return table.children()     }      navigator getrow(int index){         return table.children()[index]     }      navigator getrow(string name){         return table.children().find{it.text()==name}     }      navigator getcolumn(navigator row, int column){         return row.children()[column]     }   } 

and class extends above class:

class somepage extends tabledpage{     static content ={         table(required: false){$(by.xpath("//table[contains(@class,'w-100 table-striped wi-table-hover')]//tbody"))} // want overwrite table def in tabledpage     } } 

so in app testing of pages have 1 table, in cases there 2 tables (one hidden depending on screen size) want able override table definition in case point specific table, can without overriding getrow methods or need overridden well?

just give example of how calling alswell:

at somepage getrow(0) 

this works uses tabledpage definition of table navigator instead of somepage definition , wondering if there way me make use other definition

would work if changed content spec instead of page? how i'm using dynamic selectors in page:

static content= {     quantityfield{$("$quantityselector") }  void setselectors(tableindex, row) {     quantityselector="#offerdtos$tableindex\\.segments$row\\.quantity" } 

in spec, call setselectors appropriate values.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -