Commit Graph

59 Commits

Author SHA1 Message Date
Kamil Kokot
41bac3c5b7 Remove inline @var annotations; fix spec session name; fix @var placement
- Replace all local-variable @var annotations with proper type guards:
  - MinkExtension configure closure: build inner array directly
    ($sessions[$driverType] = [$driverType => ...]) to avoid mixed offset access
  - MinkExtension loadSessions: add is_array($session) guard inside foreach
    so PHPStan narrows $session from mixed to array before key() call
  - DriverFactory::buildDriver @param broadened from array<string, mixed>
    to array<mixed> — is_array() only narrows to array<mixed> (key type
    unknown), so array<string, mixed> was unreachable at the call site
  - MinkAwareInitializer: move @var from inside constructor parameter list
    to a proper @param on the method docblock
- SessionsListenerSpec: replace 'goutte' (deleted driver) with
  'browserkit_http' as the example default session name

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-12 18:04:18 +02:00
Kamil Kokot
2947994733 Simplify: fix fallback bug, reduce redundancy, restore step PHPDocs
- FailureShowListener: fix show_tmp_dir fallback '' -> sys_get_temp_dir()
  (bug introduced by duplication with MinkContext::showLastResponse)
- SauceLabsFactory: simplify `is_bool($x) ? $x : (bool) $x` -> `(bool) $x`
- MinkExtension::load: extract $baseUrl/$browserName locals to avoid
  evaluating the same `?? ''` expression twice per line
- EnvironmentCapabilities: store TRAVIS_JOB_NUMBER and JENKINS_HOME
  getenv() results before the switch to avoid double calls per match
- MinkContext: restore PHPDoc comments on all step methods (Example lines
  for discoverability); keep PHP attributes, no @Given/@When/@Then tags

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-12 17:50:42 +02:00
Kamil Kokot
47a9d45cd1 Add PHP CS Fixer and PHPStan max to CI; remove abandoned GoutteFactory
- Add friendsofphp/php-cs-fixer ^3.75 and phpstan/phpstan ^2.0 to
  require-dev; add .php-cs-fixer.dist.php (@Symfony ruleset with
  phpdoc_to_comment ignored_tags) and phpstan.neon (level max,
  treatPhpDocTypesAsCertain: false)
- Run CS Fixer and PHPStan in every CI matrix job alongside tests
- Add composer scripts: cs, cs-check, phpstan
- Add .php-cs-fixer.cache to .gitignore
- Fix all PHPStan max violations across src/: add return/param types,
  narrow mixed config values with is_string()/is_array() guards,
  use TaggedNodeInterface for scenario tag access in SessionsListener
- Remove GoutteFactory and its spec — the goutte driver and its
  underlying client library are abandoned

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-12 17:43:01 +02:00
Kamil Kokot
a1355134df Add behat-version matrix dimension, fix Behat 4 type errors, unify config
CI matrix now has a behat-version dimension (stable / 4.x-dev) so both
Behat 3.31 and Behat 4 are tested explicitly. Symfony 8.x rows always
use Behat 4; Symfony 7.4 rows test both versions.

behat.dist.php works with Behat 3.31 too (Behat\Config\Config exists as
a bridge since 3.31), so drop behat.yml.dist and always use the PHP
config — removes the if/else branch from CI and unifies local dev too.

SessionsListener: fix type hint on prepareDefaultMinkSession from
ScenarioLikeTested to ScenarioTested — the method uses getSuite() which
is on LifecycleEvent (not ScenarioLikeTested), and the dispatched events
are ScenarioTested subclasses. Also remove now-unused ScenarioLikeTested
import.

ServiceContainer/MinkExtension: add missing return types (: string,
: void) to all interface method overrides to satisfy Behat 4's stricter
interface signatures.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-12 17:15:15 +02:00
Matthias Pigulla
f5bd8e3d1f Mark Goutte, Selenium, Sahi and Zombie driver/support as abandoned (#39)
* Mark Goutte, Selenium, Sahi and Zombie driver/support as abandoned

This marks the four drivers as abandoned where the driver implementations are no longer maintained.

* Correctly indent notes so they don't break the enumeration list

* Indent a few more notes that are part of a numerated list
2026-01-14 18:30:58 +01:00
Matthias Pigulla
37e6a53e9d Soft-finalize classes that might need to be changed in the future (#41)
* Soft-finalize classes that might need to be changed in the future

* Leave a note in the UPGRADING document

* @internal-ize listener classes
2025-12-19 10:43:53 +01:00
Christian Sciberras
ea2d7bd352 Apply fix to Selenium4Factory too 2024-08-06 19:28:01 +02:00
Christian Sciberras
4073c2bb38 Respect/prefer user-overriden capabilities 2024-08-06 18:23:05 +02:00
Christian Sciberras
0876261a41 Fix capabilities array bug 2024-08-06 18:21:33 +02:00
Christian Sciberras
aa631e6b67 Use underscore for driver key 2024-04-12 23:13:30 +02:00
Christian Sciberras
18a3f770db Implement WebdriverClassicDriver factory 2024-04-06 14:14:22 +02:00
Bastien GARCIA
19d2e002d5 Correct BrowserKitFactory to support the 'http_client_parameters' option 2023-09-15 11:52:47 +02:00
Yozhef
b1ccaef913 Merge pull request #22 from BastienGarcia/master
Added support for client configuration when using BrowserKit
2023-09-12 12:50:10 +03:00
Bastien GARCIA
6477bb6a2f Added support for client configuration when using BrowserKit 2023-07-21 14:27:05 +02:00
Shu Chen
4f03302762 Update 2023-07-10 16:35:29 +08:00
Shu Chen
a846a31b58 Update 2023-07-10 15:43:15 +08:00
Shu Chen
59f3cf104a Support selenium4 2023-07-10 14:19:57 +08:00
Yozhef
412bdc3d0f Merge pull request #16 from SwenVanZanten/goutte-client-4-compatibility
Add goutte/client 4 compatibility
2022-10-17 10:22:47 +03:00
Swen van Zanten
98e9aa9266 change the way http client is initiated 2022-10-10 11:51:06 +02:00
Christophe Coevoet
015dcafdbd Remove empty chrome prefs from the capabilities 2022-07-01 10:39:23 +02:00
Christophe Coevoet
8a96a79972 Fix the config structure for chrome prefs
This is a map node, not a list node.
2022-07-01 10:39:23 +02:00
Swen van Zanten
c0aa3e776e add goutte/client 4 compatibility 2022-04-11 15:02:41 +02:00
thePanz
760868b9e5 Add support for BrowserKit driver 2022-03-04 15:17:34 +01:00
Yozhef
c33a3fbcf1 marionette capability should be optional 2021-12-13 12:27:56 +02:00
Alexandre Vinet
c686055f15 Fix deprecated use of ReflectionParameter::getClass for php 8 2021-05-21 10:52:54 +02:00
regnier kevin
c9bc6c9999 add prefs node to chrome configuration 2020-02-27 17:12:30 +01:00
Karl Fritsche
4b6d5f1ea5 Fix Behat/MinkExtension#309 Firefox starts instead of Chrome 2017-11-28 17:41:23 +01:00
Bas Stottelaar
390f237f25 Add marionette capability for Selenium2Driver 2016-06-17 11:36:48 +02:00
Ciaran McNulty
b22984beb7 Merge pull request #190 from Shashikant86/master
Appium support for behat mink extension.
2016-04-15 13:56:56 +01:00
Andrew Holgate
46818da343 Added support for acceptSslCert capability in BrowserStack
Ref. #237
2016-03-03 10:37:27 +01:00
Christophe Coevoet
c9adb32301 Merge pull request #236 from Evoke-PHP/master
Fixed guzzle client building for different guzzle versions.
2016-02-26 13:15:40 +01:00
Paul Young
d153ae7158 Fixed guzzle client with check for guzzle 6 and reverted guzzle 4 and 5 to their correct building. 2016-02-18 09:10:41 +10:30
Doru Muntean
80681dd1a7 added overlappingCheckDisabled capability 2016-02-16 14:26:48 +02:00
James Lee
7f0c691d24 fixed guzzle parameter passing
Guzzle does not expect 'default' array to be passed to the constructor. If passed as a default key, guzzle will not updates it's defaults.
2016-02-05 16:06:30 -06:00
Shashikant
f982c9e959 used 4 space per indentation 2015-03-31 21:18:34 +01:00
gries
a15cff9445 Add emulator option to BrowserStack capabilities. 2015-03-10 09:20:26 +01:00
Shashikant
141c8151cb Removed ENV variables and added Appium default server and port 2015-03-07 10:28:55 +00:00
Shashikant
a22995541d Added Appium host and port config 2015-03-02 20:37:05 +00:00
Shashikant
976f9c32da Refactoring as per stof 's sugestions 2015-03-02 19:34:10 +00:00
Shashikant
4f3c1a6ae5 removing default values as it may cause issue 2015-02-11 20:05:49 +00:00
Shashikant
78b0a2f0fa Added AppiumFactory to MinkExtension file 2015-01-31 23:42:08 +00:00
Shashikant
b145b0d853 Created Appium Factory to support Appium capabilities
Appium capabilities are added to Mink extension to execute native, hybrid and web mobile tests.
2015-01-31 23:40:32 +00:00
Christophe Coevoet
ba5329be65 Merge pull request #187 from csarrazi/master
[Easy-Pick] Fixed Selenium2 ignoreZoomSetting configuration in Selenium2Factory
2015-01-23 01:01:18 +01:00
Christophe Coevoet
f1df9a0207 Merge pull request #186 from stof/remove_config_defaults
Remove default values for capabilities
2015-01-23 00:59:31 +01:00
Charles Sarrazin
c909592691 Fixed configuration for Selenium2 factory
Changing the scalarNode to a booleanNode actually fixes a bug in the latest version of IEDriverServer + Selenium2, which triggers a segmentation fault if the value given for ignoreZoomSetting is a string and not a boolean (which is the case currently).
A simple check for this is to try launching Behat + mink + Selenium2 with Selenium2 + IEDriverServer, with the following defaults:

```yml
default:
  suites:
    default:
      contexts:
        - Behat\MinkExtension\Context\MinkContext
  extensions:
    Behat\MinkExtension:
      javascript_session: default
        sessions:
          default:
            selenium2:
              browser: "internet explorer"
```

Adding the capabilities with ignoreZoomSetting set to true or false also fixes the issue, but not at the source of the problem.
2015-01-21 14:45:58 +01:00
Christophe Coevoet
819063c58b Unset the custom-data node when it is empty
Closes #179
2015-01-19 02:01:08 +01:00
Christophe Coevoet
0bb80effb3 Remove default values for capabilities
This lets Selenium choose its own default values without duplicating
them.
Replaces #183
Refs #179
2015-01-19 01:49:01 +01:00
gggeek
a0bd5412c1 Fix issue 184: user not allowed to set tags sent to selenium 2015-01-08 18:17:02 +00:00
Christophe Coevoet
652f0e22a5 Added the support of Goutte 2.0 2014-05-15 21:59:46 +02:00
Christophe Coevoet
14d3596895 Renamed the extension class to follow the Behat shortcut convention 2014-05-08 13:45:26 +02:00