Methods

Table of Contents

visitable

Parameters

  • path string Full path of the route to visit

Examples

const page = PageObject.create({
  visit: PageObject.visitable('/users')
});

// visits '/users'
page.visit();
const page = PageObject.create({
  visit: PageObject.visitable('/users/:user_id')
});

// visits '/users/10'
page.visit({ user_id: 10 });
const page = PageObject.create({
  visit: PageObject.visitable('/users')
});

// visits '/users?name=john'
page.visit({ name: 'john' });
const page = PageObject.create({
  visit: PageObject.visitable('/users/:user_id')
});

// visits '/users/1?name=john'
page.visit({ user_id: 1, name: 'john' });
  • Throws any Will throw an error if dynamic segments are not filled

Returns Descriptor