Skip to content

Support navigating to page instances in addition to classes #310

Description

@geb-bot

Originally created by Luke Daley.

it should be possible to do:


class ProductPage extends Page {
  String productId

  ProductPage(String productId) {
    this.productId = productId 
  } 

  static at = { title == "Product '$productId'" }
}

to new ProductPage("myId")

After this change, to(SomePage) becomes just shorthand for to(new SomePage()).

We will have to add some formal kind of notion of initialised to Pages. Initialisation is performed by Geb (in Browser) which is where the backing navigator is attached to the Page instance.

If a user tries to use Geb functionality (e.g. Navigator method) on an uninitialised page they should get an appropriate error.

If they try to initialise an already initialised page they should get an appropriate error message (e.g. to(to(new SomePage())).

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions