Search code examples
selenium-webdrivercodeception

Codeception: PHP Fatal Error due to 'runStep not found'


acceptance.suite.yml: Webdriver using custom port

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver
        - PhpBrowser
        - \Helper\Acceptance
    config:
         WebDriver:
            url: 'http://website.co.uk/'
            browser: 'firefox'
            port: 5555
         PhpBrowser:
            url: http://www.website.co.uk/

Error in terminal:

PHP Fatal error:  Cannot redeclare _generated\AcceptanceTesterActions::switchToIframe() in /Users/myUser/tests/_support/_generated/AcceptanceTesterActions.php on line 2939

AcceptanceTesterActions.php, on line 2939 (switchToIframe):

"Method 'runStep' not found in \Codeception\Scenario"

This error is spread throughout the entire file.

I checked the Codeception/src/Codeception/Scenario.php file and 'runStep' is defined exactly as it is defined on the gitHub files.

This issue happened only after I added the WebDriver module.

Any ideas?


Solution

  • The problem came from attempting to use both PhpBrowser and WebDriver modules. After commenting out the PhpBrowser stuff, everything went on smoothly.