Details

    • MOODLE_25_STABLE
    • MDL-37656_master
    • Hide

      You need PHP 5.4 to test this. The issue will be tested in MDL-37657, this tests are only to prevent regressions.

      • Upload a file to one of your courses (creating a folder resource with a file for example) and remember where it is
      • Install your behat testing environment
      • Run the tests
      • Browse to your $CFG->wwwroot and go to the course where you uploaded a file
      • The course SHOULD be there and you SHOULD be able to open the file and view it's contents
      • Browse to your $CFG->behat_wwwroot or if you haven't defined anything to http://localhost:8000
      • You SHOULD see a site with a course with fullname "Acceptance test site"
      • Install your phpunit testing environment if you don't have it installed yet
      • Run the whole set of unit tests: "phpunit"
      • They SHOULD all pass

      (Note that some tests can fail due to unavailable elements (the error would be something like "there is no element with id|label|title 'Username'") further work is being done in MDL-37750 to solve it.)

      Show
      You need PHP 5.4 to test this. The issue will be tested in MDL-37657 , this tests are only to prevent regressions. Upload a file to one of your courses (creating a folder resource with a file for example) and remember where it is Install your behat testing environment http://docs.moodle.org/dev/Acceptance_testing#Installation Run the tests http://docs.moodle.org/dev/Acceptance_testing#Running_tests You SHOULD see your CLI showing the tests execution progress Browse to your $CFG->wwwroot and go to the course where you uploaded a file The course SHOULD be there and you SHOULD be able to open the file and view it's contents Browse to your $CFG->behat_wwwroot or if you haven't defined anything to http://localhost:8000 You SHOULD see a site with a course with fullname "Acceptance test site" Install your phpunit testing environment if you don't have it installed yet Run the whole set of unit tests: "phpunit" They SHOULD all pass (Note that some tests can fail due to unavailable elements (the error would be something like "there is no element with id|label|title 'Username'") further work is being done in MDL-37750 to solve it.)

    Description

      Behat allows us to hook it's processes (http://docs.behat.org/guides/3.hooks.html) and inject code to fill our needs.

      • Each test has to run separately as it can not be affected by the data/garbage other tests left, also tests can be filtered and the data would not be the same every run and it would lead to inconsistencies, so we need to reset the database after each scenario.
      • Prevent parallel tests execution with a lock, related with the point above
      • Is very important to ensure that the database and the dataroot we are going to reset is not the production environment, so before the tests begins to run is important to check where are we going to write/read
      • Since it is a new tool the more info we can provide to the user more fast will be the adoption or the initial usage

      While we can we will be Selenium-independent and interact only with the Behat API so if we want to change to a faster driver in future (http://mink.behat.org/#different-browsers-drivers) we don't need to change our steps definitions; this seems contradictory with some messages (@see behat_hooks::before_scenario_javascript for example) that splicitly references to Selenium, this is to avoid adding more abstract nomenclature.

      Attachments

        Issue Links

          Activity

            People

              dmonllao David Monllaó
              dmonllao David Monllaó
              Dan Poltawski Dan Poltawski
              Michael de Raadt Michael de Raadt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/May/13