class TypifiedPageFactory extends PageFactory (View source)

Factory class to make using Page Objects simpler and easier.

Properties

private Session $_session Instance of Mink session. from PageFactory
protected AnnotationManager $annotationManager Annotation manager. from PageFactory
protected array $annotationRegistry Supported annotation class map. from PageFactory
protected IUrlFactory $urlFactory The url builder factory. from PageFactory
protected Normalizer $urlNormalizer The url normalizer. from PageFactory
protected IPageLocator $pageLocator The page locator. from PageFactory
protected PageUrlMatcherRegistry $pageUrlMatcherRegistry The page url matcher registry. from PageFactory
protected IConfig $config The current config. from PageFactory

Methods

__construct(Session $session, Container|Config|null $container_or_config = null)

Creates TypifiedPageFactory instance.

_createContainer(Config $config = null)

Creates containerorconfig object.

_setAnnotationManager(AnnotationManager $manager)

Sets annotation manager.

createDecorator(ISearchContext $search_context)

Creates default decorator.

_setSession(Session $session)

Sets session.

Session
getSession()

Returns session.

initPage(Page $page)

Initializes the page.

boolean
opened(Page $page)

Checks if the given page is currently opened in browser.

initElementContainer(IElementContainer $element_container)

Initializes AbstractElementContainer.

initElements(ISearchContext $search_context, IPropertyDecorator $property_decorator)

Initializes elements in given search context.

proxyFields(ISearchContext $search_context, IPropertyDecorator $property_decorator)

Initializes fields within given search context.

getProperties(ISearchContext $search_context)

Returns class properties, that can potentially become proxies.

getPage(string $class_name)

Creates page by given class name.

Expectation
shouldReceive(string $name)

No description

Details

__construct(Session $session, Container|Config|null $container_or_config = null)

Creates TypifiedPageFactory instance.

Parameters

Session $session Mink session.
Container|Config|null $container_or_config Dependency injection containerorconfig or Config.

private Container _createContainer(Config $config = null)

Creates containerorconfig object.

Parameters

Config $config Config.

Return Value

Container

private PageFactory _setAnnotationManager(AnnotationManager $manager)

Sets annotation manager.

Parameters

AnnotationManager $manager Annotation manager.

Return Value

PageFactory

IPropertyDecorator createDecorator(ISearchContext $search_context)

Creates default decorator.

Parameters

ISearchContext $search_context Search context.

Return Value

IPropertyDecorator

private PageFactory _setSession(Session $session)

Sets session.

Parameters

Session $session Session.

Return Value

PageFactory

Session getSession()

Returns session.

Return Value

Session

IPageFactory initPage(Page $page)

Initializes the page.

Parameters

Page $page Page to initialize.

Return Value

IPageFactory

boolean opened(Page $page)

Checks if the given page is currently opened in browser.

Parameters

Page $page Page to check.

Return Value

boolean

IPageFactory initElementContainer(IElementContainer $element_container)

Initializes AbstractElementContainer.

Parameters

IElementContainer $element_container AbstractElementContainer to be initialized.

Return Value

IPageFactory

IPageFactory initElements(ISearchContext $search_context, IPropertyDecorator $property_decorator)

Initializes elements in given search context.

Parameters

ISearchContext $search_context Context, to be used for element initialization.
IPropertyDecorator $property_decorator Element locator factory.

Return Value

IPageFactory

protected PageFactory proxyFields(ISearchContext $search_context, IPropertyDecorator $property_decorator)

Initializes fields within given search context.

Parameters

ISearchContext $search_context Search context.
IPropertyDecorator $property_decorator Property decorator.

Return Value

PageFactory

protected Property[] getProperties(ISearchContext $search_context)

Returns class properties, that can potentially become proxies.

Parameters

ISearchContext $search_context Search context.

Return Value

Property[]

Page getPage(string $class_name)

Creates page by given class name.

Parameters

string $class_name Page class name.

Return Value

Page

Expectation shouldReceive(string $name)

Parameters

string $name

Return Value

Expectation