Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43461

Behat does not work in windows, with cygwin.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.4, 2.6.1
    • Fix Version/s: 2.5.5, 2.6.2
    • Labels:
    • Environment:
      Windows 7, 64 bit, cygwin for bash/commandline, but Apache & PHP installed using the respective windows installers. Note that PHPunit and Moodle itself work fine here.
    • Testing Instructions:
      Hide

      Using unix

      1. Run *php admin/tool/behat/cli/init.php in linux (or another unix-based system)
      2. Run *php admin/tool/behat/cli/util.php --enable
      3. You SHOULD see something like vendor/bin/behat --config /path/to/your/behat/config/file/behat/behat.yml

      Using cmd

      1. Run *php admin/tool/behat/cli/init.php in windows using cmd.exe
      2. Run *php admin/tool/behat/cli/util.php --enable
      3. You SHOULD see something like vendor\bin\behat --config C:\path\to\your\config\behat\behat.yml

      Using cygwin

      1. Run *php admin/tool/behat/cli/init.php in windows using cmd.exe
      2. Run *php admin/tool/behat/cli/util.php --enable
      3. You SHOULD see something like vendor/bin/behat.bat --config C:/path/to/your/config/behat/behat.yml

      Using MinGW (git bash)

      1. Run *php admin/tool/behat/cli/init.php in windows using cmd.exe
      2. Run *php admin/tool/behat/cli/util.php --enable
      3. You SHOULD see something like vendor/bin/behat --config C:/path/to/your/config/behat/behat.yml
      Show
      Using unix Run *php admin/tool/behat/cli/init.php in linux (or another unix-based system) Run *php admin/tool/behat/cli/util.php --enable You SHOULD see something like vendor/bin/behat --config /path/to/your/behat/config/file/behat/behat.yml Using cmd Run *php admin/tool/behat/cli/init.php in windows using cmd.exe Run *php admin/tool/behat/cli/util.php --enable You SHOULD see something like vendor\bin\behat --config C:\path\to\your\config\behat\behat.yml Using cygwin Run *php admin/tool/behat/cli/init.php in windows using cmd.exe Run *php admin/tool/behat/cli/util.php --enable You SHOULD see something like vendor/bin/behat.bat --config C:/path/to/your/config/behat/behat.yml Using MinGW (git bash) Run *php admin/tool/behat/cli/init.php in windows using cmd.exe Run *php admin/tool/behat/cli/util.php --enable You SHOULD see something like vendor/bin/behat --config C:/path/to/your/config/behat/behat.yml
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-43461_master

      Description

      I followed Dan's instructions, https://gist.github.com/danpoltawski/8036489 and I think I did everything there successfully, troubleshooting various probelms that are not mentioned there.

      However, at the final stage, when I run (and getting this right was one of the thing that required troubleshooting)

      vendor/behat/behat/bin/behat --config /cygdrive/c/Temp/moodle_head_data_beha
      t/behat/behat.yml

      I just get

        [RuntimeException]
        Context class not found.
        Maybe you have provided a wrong or no `bootstrap` path in your behat.yml:
        http://docs.behat.org/guides/7.config.html#paths
      

      Well, of course I have provided the correct bootstrap path, and class name, in behat.yml. That was auto-generated, and I have verified what is in there.

      Doing a bit of debugging, it seems that it is trying to load context class FeatureContext, when of course it should be using moodle's behat_init_context, but working out why it is doing that is beyond my debugging ability.

        Attachments

          Activity

            People

            Assignee:
            dmonllao David Monllaó
            Reporter:
            timhunt Tim Hunt
            Peer reviewer:
            Dan Poltawski Dan Poltawski
            Integrator:
            Damyon Wiese Damyon Wiese
            Tester:
            Damyon Wiese Damyon Wiese
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Mar/14