minkphp / minkphp/Mink

Allow accessing selectors handler in Session

Open
#602 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.0 branch
Dominant language
PHP
Stars
1.6k
Forks
286
PR merge metrics
No merged PRs in 30d

Description

In the 1.x versions it was possible to use Session::getSelectorsHandler() method to get selectors handler and change it (e.g. add new selectors to it).

In the 2-architecture-changes branch things have changed considerably and now we have (see https://github.com/Behat/Mink/blob/2-architecture-changes/src/Behat/Mink/Session.php#L46):

(DriverInterface + SelectorsHandler + Manipulator) = ElementFinder
(DriverInterface + ElementFinder) = Session

As you can see the SelectorsHandler is now created deep within ElementFinder and ElementFinder itself is created within Session.

If developer has full control over Session creation then of course he can create ElementFinder as he see fits and in the process obtain reference to SelectorsHandler.

However within Behat developer gets already created session via ->getSession() method that he can't change anymore.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/Behat/Mink/Session.php and trace how Session creates or receives ElementFinder and its SelectorsHandler. Compare that path with Behat's getSession() entry point; done means the selectors handler can be accessed and modified through the session Behat provides without requiring control over Session construction.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.