A collapsible variant of an existing non-collapsible nav object that parses YAML can now be created using a subclass. E.g.:
python
class PrimaryNav(prototypes.NavObject):
Path to YAML file representing the object
YAML_FILE = os.path.join(os.path.dirname(__file__), 'primary_nav.yml')
Used for internal methods (do not modify)
SITE_CONFIG = SiteConfig
class MobilePrimaryNav(PrimaryNav):
COLLAPSIBLE = True
MENU_LOCATOR = (By.ID, 'nav-menu')
EXPAND_BUTTON_LOCATOR = (By.ID, 'navbar-toggle')
Details
`NavObject.parse_yaml()` now only retrieves 'menu_locator', 'expand_button_locator', and (optionally) 'collapse_button_locator' if the corresponding attributes aren't explicitly set in the class. This allows code to be reused from a non-collapsible nav to create a collapsible variant