class ParameterizedCartRow extends Module {
def nameIndex
def quantityIndex
def priceIndex
static content = {
cell { $("td", it) }
productName { cell(nameIndex).text() }
quantity { cell(quantityIndex).text().toInteger() }
price { cell(priceIndex).text().toBigDecimal() }
}
}
class CheckoutPageWithParametrizedCart extends Page {
static content = {
cartItems {
$("table tr").tail().moduleList {
new ParameterizedCartRow(nameIndex: it, quantityIndex: it+1, priceIndex: it+2)
}
}
}
}
Can i call this as
cartItems[0].productName.displayed
When i tried to call the parameterized moduleList
I got an error stating :
Condition not satisfied:
null+1