Skip to content

Native Firefox support (through geckodriver) #14

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

Merged
merged 6 commits into from
Feb 20, 2020
Merged

Native Firefox support (through geckodriver) #14

merged 6 commits into from
Feb 20, 2020

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Apr 9, 2018

Allow to use Firefox as browser. The only requirement is to have Firefox installed.

Usage:

$client = \Panthere\Client::createFirefoxClient();

// Use Panthère as usual

Or in a test case:

$client = self::createPanthereClient(self::FIREFOX);

Needs php-webdriver/php-webdriver#560.

@@ -85,6 +85,9 @@ This listener will start the web server on demand like previously, but it will s
require __DIR__.'/vendor/autoload.php'; // Composer's autoloader

$client = \Symfony\Component\Panther\Client::createChromeClient();
// Or, if you care about the open web and prefer to use Firefox
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@@ -54,6 +55,6 @@ protected function setNode(\DOMElement $node)

protected function getRawUri()
{
return $this->element->getAttribute('href');
return $this->element->getAttribute('href') ?? '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it return the current URI?

Suggested change
return $this->element->getAttribute('href') ?? '';
return $this->element->getAttribute('href') ?: $this->currentUri;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don't know.

@@ -80,6 +80,7 @@ trait PantherTestCaseTrait
'router' => '',
'external_base_uri' => null,
'readinessPath' => '',
'browser' => self::CHROME,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not firefox as base? 🦊

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's a huge BC break, and because Chrome is more used (unfortunately): 64% for Chrome, 5% for Firefox.

@dunglas
Copy link
Member Author

dunglas commented Feb 19, 2020

For an unknown reason, Travis uses an outdated version of .travis.yml for the PR build. It's why PR tests are red. As this branch is rebased against master, it's ok to merge as is.

@dunglas dunglas merged commit c7000b0 into master Feb 20, 2020
@dunglas dunglas deleted the geckodriver branch February 20, 2020 09:36
dunglas added a commit that referenced this pull request Dec 28, 2020
* Native Firefox support (through geckodriver)

* Fix CS

* Remove VCS repo

* Cleanup

* Fix lint

* Use cast instead of the null coalescing operator
nicolas-grekas pushed a commit that referenced this pull request Jan 18, 2021
* Native Firefox support (through geckodriver)

* Fix CS

* Remove VCS repo

* Cleanup

* Fix lint

* Use cast instead of the null coalescing operator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants