[feature request] Avoid anonymous sections in case section defined with a block #70
Labels
Awaiting Response
Feature Request
Needs Investigation
Further information is required to act on this
It will be useful currently anonymous sections defined with block argument to have a class name.
Proposed solution:
deduce_section_class
to be rewritten similar to this:where
@_last_section_name
is a name parameter fromsection/sections
call.Why?
I'm currently working on an internal framework (going to make it public someday) for mobile automation based on site_prism which identify arguments based on element/section name and section/page class name
For example, I have a page object classes defined like this
This DSL extension identifies locator based on class name and element name. For example, a locator for
column1
,column2
and default search args for sectionRow
will be looked in YAML filerow.yml
;header
,rows1
androws2
inhome.yml
;column3
will be defined inhome.yml
but nestedThis allows to extract locators to another abstract layer and use config overlay to define locators based on device or platform (iOS and Android) without defining separate page object for same page structure in case locator differ for specific platform/device.
The logic of mapping depends on the class name. If the page class name is Home it will be looking for locators in home.yml. If section class name is Row it will be looking for locators in row.yml etc.
The problem arise for section definitions like rows2 with section name as well as a block. The actual class won't have a name (anonymous). Finding superclass of this class may slightly help, but will create another issue -
row.yml
will have to hold locators for all the possible extensions of Row section and it will hold no binding to the parent section/page. To avoid this problem 2 things are needed:For example, for our case, it can be
Home::Rows2 < Row
andHome::Rows3 < Row
This should not be a breaking change as it only changes internal implementation.
The text was updated successfully, but these errors were encountered: