Skip to content

class attribute selector does not work in GEB 0.12.0 #390

@fabriziofortino

Description

@fabriziofortino

I am trying to migrate to 0.12.0 but I stumbled in a problem with the class attribute selector. I have a Module with the following content:

static content = {
  userMenuButton { $('a', class: 'user-menu-button') }
}

The above code works with GEB 0.10.0 but throws the following exception with 0.12.0:

geb.error.RequiredPageContentNotPresent: The required page content 'userMenuButton - SimplePageContent (owner: module.UserMenuModule@4c2d6108, args: [], value: null)' is not present
at geb.content.TemplateDerivedPageContent.require(TemplateDerivedPageContent.groovy:68)
at geb.content.PageContentTemplate.create_closure1(PageContentTemplate.groovy:67)
at geb.content.PageContentTemplate.create_closure1(PageContentTemplate.groovy)
at geb.content.PageContentTemplate.create(PageContentTemplate.groovy:86)
at geb.content.PageContentTemplate.get(PageContentTemplate.groovy:58)
at geb.content.DefaultPageContentSupport.getContent(DefaultPageContentSupport.groovy:42)
at geb.content.PageContentSupport.propertyMissing(PageContentSupport.groovy:39)
at geb.Module.propertyMissing(Module.groovy:101)
at module.UserMenuModule.logout(UserMenuModule.groovy:17)
at geb.content.TemplateDerivedPageContent.methodMissing(TemplateDerivedPageContent.groovy:128)
at spec.authentication.LoginLogoutSpec.can logout from MyApp(LoginLogoutSpec.groovy:37)

It works if I change the code without using the class attribute:

static content = {
  userMenuButton { $('a.user-menu-button') }
}

Please notice that the element has multiple classes.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions