Our framework uses complex modelling such as (example cooked up for this post)
class Table{
$container: Locator;
constructor($container: Locator){
this.$container = $container;
}
getRow(index: number):TableRow{
return new TableRow(this.$container, index);
}
}
class TableRow{
$container: Locator;
constructor($container: Locator, index: number){
this.$container = $container.locator(`tr >> nth=${index}`);
}
async getCellValue(cellIndex: number):string{
return await this.$container.locator(`td >> nth=${cellIndex}`).innerText();
}
}
As we've recently found that there are some idiosyncrasies with chaining (e.g. chaining does not result in direct child selectors), it would be good to get the selector from a locator and use it to build the next locator.
Our framework uses complex modelling such as (example cooked up for this post)
As we've recently found that there are some idiosyncrasies with chaining (e.g. chaining does not result in direct child selectors), it would be good to get the selector from a locator and use it to build the next locator.