-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getDriver method is not available in Page class #92
Comments
Umh,
Are you sure you're extending right |
I extended class use SensioLabs\Behat\PageObjectExtension\PageObject\Page; I look through the all extends and I think it's problem in Mink version 1.5. In this version Element class really doesn't have a Probably it would be better to add minimal stability version to documentation or to composer if it possible? |
@RebOOter Take a look to https://github.com/sensiolabs/BehatPageObjectExtension/tree/v2.1.0 It has mink 1.6 https://github.com/sensiolabs/BehatPageObjectExtension/blob/v2.1.0/composer.json#L11 Alternatively master has 1.7 Don't know if older versions need to be fixed /cc @jakzal |
Yes, I see, but this requirement doesn't work if in your project will be requirement of another version. Composer doesn't tell you to use another version of Mink when it's needed. |
@RebOOter that's not true because if a dependency like |
Maybe I'm mistaken but
Another version of what? Of this bundle or of Mink? |
@RebOOter can you paste relevant bits of |
In composer file I have: As you can see composer not prevent me from installing old version of Mink that doesn't have For now I trying to use The same code. Changes are only in composer.json. That the reason why I use 1.5@stable version. Maybe I have some mistakes somewhere, but this behavior is still strange for me. |
As I told you, My suggestion is to upgrade to |
Indeed, mink dependency wasn't explicit in I recommend updating the page object extension to the latest version.
If you prepared a project to reproduce this problem I could have a look. |
Here the project with this issue https://github.com/RebOOter/page-object-bug But, I notice that in my composer file was the line with Sorry for misunderstanding and thanks for advices. |
I managed to pin point the problem to |
By the way, you should create page objects/elements with the factory rather than calling their constructors directly. |
When I trying to use
open()
function then I see error message:"getDriver" method is not available on the LoginPage (BadMethodCallException)
I noticed that it's true, Page class doesn't have this method. I use
$this->getSession()->getDriver();
instead of$this->getDriver();
and it's works.Maybe this is a simple mistake?
The text was updated successfully, but these errors were encountered: