Home » Php » Codeception Gherkin, defining the step implementation path

Codeception Gherkin, defining the step implementation path

Posted by: admin October 26, 2017 Leave a comment

Questions:

I’m new to php and codeception and I wanted to use Gherkin with Codeception, and I’ve already setup the bare minimum to make feature files run in Codeception. I now find myself trying to make a scalable structure and make use of the PageObject framework. I created a Steps Folder and I wanted my step implementations kept in that folder. By default running codecept run some.feature loads the class defined in the acceptance.suite.yml file.

Motivation: I want to be able keep my step implementations into it’s own separate folder

Given I have an acceptance.suite.yml file configuration of:

gherkin:
    contexts:
        default: 
            - AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: https://www.google.com/
            browser: chrome
        - \Helper\Acceptance

And I have a codeception.yml file configuration of:

paths:
    tests: tests
    output: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
actor_suffix: Tester
extensions:
    enabled:
        - Codeception\Extension\RunFailed

And I have my Steps folder under _support:

enter image description here

How do I change the configuration to allow my step implementation to be
called from the Steps folder?

Answers: