Details

    • Testing Instructions:
      Hide

      Test 1

      1. Check that behat master passes (you can ask integrators for the CI server status)

      Test 2

      1. From dirroot, php admin/tool/behat/cli/init.php
      2. Ensure you didn't set $CFG->behat_usedeprecated = true; in your config.php
      3. Write a new .feature file using one of the deprecated methods (https://tracker.moodle.org/browse/MDL-43236?focusedCommentId=272647&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-272647)
      4. From dirroot type php admin/tool/behat/util.php --enable
      5. Run vendor/bin/behat --config /asd/asd/asd/as/behat/behat.yml /absolute/path/to/the/feature/file/you/created/file.feature
      6. You SHOULD see a failure stating that that step was deprecated and proposing you an alternative
      7. Set $CFG->behat_usedeprecated = true; in your config.php
      8. Run vendor/bin/behat --config /asd/asd/asd/as/behat/behat.yml /absolute/path/to/the/feature/file/you/created/file.feature
      9. It SHOULD pass
      Show
      Test 1 Check that behat master passes (you can ask integrators for the CI server status) Test 2 From dirroot, php admin/tool/behat/cli/init.php Ensure you didn't set $CFG->behat_usedeprecated = true; in your config.php Write a new .feature file using one of the deprecated methods ( https://tracker.moodle.org/browse/MDL-43236?focusedCommentId=272647&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-272647 ) From dirroot type php admin/tool/behat/util.php --enable Run vendor/bin/behat --config /asd/asd/asd/as/behat/behat.yml /absolute/path/to/the/feature/file/you/created/file.feature You SHOULD see a failure stating that that step was deprecated and proposing you an alternative Set $CFG->behat_usedeprecated = true; in your config.php Run vendor/bin/behat --config /asd/asd/asd/as/behat/behat.yml /absolute/path/to/the/feature/file/you/created/file.feature It SHOULD pass
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-43236_master

      Description

      Behat has some slight grammar errors with the word exists.

      Update steps/features so combinations of should and does with the word exist does not have a plural

      Correct: "X should|does (not) exist"
      Incorrect: "X should|does (not) exists"

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            dmonllao David Monllaó added a comment -

            Copied from the duplicated MDL-42488

            After MDL-42170 gets integrated we can probably change a few steps definitions, at least the following "whatever" exists as commented by Marina in https://tracker.moodle.org/browse/MDL-42170?focusedCommentId=251556&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-251556

            Also new steps definitions have been included in the codebase without finishing with _STRING or _NUMBER (http://docs.moodle.org/dev/Acceptance_testing#Providing_values_to_steps) we should change them to provide more info for test writers.
            Only master is affected.

            Show
            dmonllao David Monllaó added a comment - Copied from the duplicated MDL-42488 After MDL-42170 gets integrated we can probably change a few steps definitions, at least the following "whatever" exists as commented by Marina in https://tracker.moodle.org/browse/MDL-42170?focusedCommentId=251556&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-251556 Also new steps definitions have been included in the codebase without finishing with _STRING or _NUMBER ( http://docs.moodle.org/dev/Acceptance_testing#Providing_values_to_steps ) we should change them to provide more info for test writers. Only master is affected.
            Hide
            dmonllao David Monllaó added a comment -

            Here we are deprecating the following methods:

            • "ELEMENT" "SELECTOR" should exists
            • "ELEMENT" "SELECTOR" should not exists
            • the following "ENTITIES" exists:
            Show
            dmonllao David Monllaó added a comment - Here we are deprecating the following methods: "ELEMENT" "SELECTOR" should exists "ELEMENT" "SELECTOR" should not exists the following "ENTITIES" exists:
            Hide
            cibot CiBoT added a comment -

            Results for MDL-43236

            • Remote repository: git://github.com/dmonllao/moodle.git
            Show
            cibot CiBoT added a comment - Results for MDL-43236 Remote repository: git://github.com/dmonllao/moodle.git Remote branch MDL-43236 _master to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1748 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1748/artifact/work/smurf.html
            Hide
            dmonllao David Monllaó added a comment -

            Raising priority as we are deprecating widely used steps and each week new scenarios are being integrated so it needs to be rebased every week.

            Show
            dmonllao David Monllaó added a comment - Raising priority as we are deprecating widely used steps and each week new scenarios are being integrated so it needs to be rebased every week.
            Hide
            fred Frédéric Massart added a comment -

            Ah ah... I remember mentioning that to you during my first review of Behat .

            The patch looks good to me David. I grepped a bit and did not find anything else that you could have missed. Feel free to push for integration whenever you like.

            Cheers,
            Fred

            Show
            fred Frédéric Massart added a comment - Ah ah... I remember mentioning that to you during my first review of Behat . The patch looks good to me David. I grepped a bit and did not find anything else that you could have missed. Feel free to push for integration whenever you like. Cheers, Fred
            Hide
            dmonllao David Monllaó added a comment -

            Thanks Fred, true true Yesterday I was looking for your comment. I will wait a bit in case the next weekly is released soon so I can rebase on top of it and ensure that this last week there are no new uses of the deprecated steps.

            Show
            dmonllao David Monllaó added a comment - Thanks Fred, true true Yesterday I was looking for your comment. I will wait a bit in case the next weekly is released soon so I can rebase on top of it and ensure that this last week there are no new uses of the deprecated steps.
            Hide
            dmonllao David Monllaó added a comment -

            Pushing for integration, I've rebased and updated on top of integration as the cycle is almost finished and no new scenarios are expected.

            Show
            dmonllao David Monllaó added a comment - Pushing for integration, I've rebased and updated on top of integration as the cycle is almost finished and no new scenarios are expected.
            Hide
            dmonllao David Monllaó added a comment -

            I've added pull branches for 2.6 and 2.5, backporting the new (master) step definitions to ease backporting future new scenarios and to help 3rd parties when creating their own scenarios as they can use the new steps and they will not need to change the tests when upgrading to 2.7.

            To let test writers know about which one is better and avoid confusing them when listing the steps I've updated the step definition description of the "old" ones (also changed the ones backported in MDL-43738)

            Show
            dmonllao David Monllaó added a comment - I've added pull branches for 2.6 and 2.5, backporting the new (master) step definitions to ease backporting future new scenarios and to help 3rd parties when creating their own scenarios as they can use the new steps and they will not need to change the tests when upgrading to 2.7. To let test writers know about which one is better and avoid confusing them when listing the steps I've updated the step definition description of the "old" ones (also changed the ones backported in MDL-43738 )
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            cibot CiBoT added a comment -

            Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

            Show
            cibot CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
            Hide
            poltawski Dan Poltawski added a comment -

            Hi David,

            Its a trivial thing, but I don't like the phpdoc on the backport branches:

            '* This method is added to make backports easier and to help 3rd parties working on new scenarios so they don't need to update their scenarios when they upgrade to 2.7'

            That statement assumes that the reader of the comment knows that the 'improved grammar' selectors are new. Trying to think of a way of making this clearer. Perhaps just mentioning that they replace the old selectors in 2.7 and are new.

            Show
            poltawski Dan Poltawski added a comment - Hi David, Its a trivial thing, but I don't like the phpdoc on the backport branches: '* This method is added to make backports easier and to help 3rd parties working on new scenarios so they don't need to update their scenarios when they upgrade to 2.7' That statement assumes that the reader of the comment knows that the 'improved grammar' selectors are new. Trying to think of a way of making this clearer. Perhaps just mentioning that they replace the old selectors in 2.7 and are new.
            Hide
            poltawski Dan Poltawski added a comment -

            Also there are a few long lines added, e.g. I fill the moodle form with: phpdoc comment

            Show
            poltawski Dan Poltawski added a comment - Also there are a few long lines added, e.g. I fill the moodle form with: phpdoc comment
            Hide
            dmonllao David Monllaó added a comment -

            Hi,

            About your HEAD~ comment, thanks, done; About HEAD, the first line of a step definition comments block is the only one that is used as a step description, that's why it is that long, as we already checked it looks ok when listing step definition, I think is worth to add that text so people writing tests knows that they are "better" than the other ones.

            Show
            dmonllao David Monllaó added a comment - Hi, About your HEAD~ comment, thanks, done; About HEAD, the first line of a step definition comments block is the only one that is used as a step description, that's why it is that long, as we already checked it looks ok when listing step definition, I think is worth to add that text so people writing tests knows that they are "better" than the other ones.
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks David, I like your improved phpdoc and wasn't aware of the other behaviour being restricted to a line, so it seems ok here.

            Integrated to master, 25 and 26

            (NOTE THE FIX VERSIONS ON THIS ISSUE ARE A BIT WEIRD.. possibly this should've been split up into two issues)

            Show
            poltawski Dan Poltawski added a comment - Thanks David, I like your improved phpdoc and wasn't aware of the other behaviour being restricted to a line, so it seems ok here. Integrated to master, 25 and 26 (NOTE THE FIX VERSIONS ON THIS ISSUE ARE A BIT WEIRD.. possibly this should've been split up into two issues)
            Hide
            rajeshtaneja Rajesh Taneja added a comment - - edited

            This is causing behat failure, in course/tests/behat/course_controls.feature, seems some of the exits (s) still present.
            And "#section-2" "css_element" <should_see_other_sections> exists. There are 6 steps which are failing.
            Also, mod/workshop/tests/behat/workshop_assessment.feature is failing for "And the following "course enrolment" exist:"

            Show
            rajeshtaneja Rajesh Taneja added a comment - - edited This is causing behat failure, in course/tests/behat/course_controls.feature, seems some of the exits (s) still present. And "#section-2" "css_element" <should_see_other_sections> exists. There are 6 steps which are failing. Also, mod/workshop/tests/behat/workshop_assessment.feature is failing for "And the following "course enrolment" exist:"
            Hide
            dmonllao David Monllaó added a comment -

            Thanks Raj and CI server, attaching patch on top of integration (only for master):

            git pull git://github.com/dmonllao/moodle.git MDL-43236_master-fix-failures

            Show
            dmonllao David Monllaó added a comment - Thanks Raj and CI server, attaching patch on top of integration (only for master): git pull git://github.com/dmonllao/moodle.git MDL-43236 _master-fix-failures
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks, pulled - back to testing

            Show
            poltawski Dan Poltawski added a comment - Thanks, pulled - back to testing
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Sorry David,

            I am failing this because I am getting following exception, while running step with usedeprecated = true.

            01. Catchable Fatal Error: Argument 2 passed to behat_deprecated::the_following_exists() must be an instance of TableNode, instance of Behat\Gherkin\Node\TableNode given in /home/rajesht/moodles/im/moodle/lib/tests/behat/behat_deprecated.php 
            

            Simple namespace issue...
            Thanks...

            Show
            rajeshtaneja Rajesh Taneja added a comment - Sorry David, I am failing this because I am getting following exception, while running step with usedeprecated = true. 01. Catchable Fatal Error: Argument 2 passed to behat_deprecated::the_following_exists() must be an instance of TableNode, instance of Behat\Gherkin\Node\TableNode given in /home/rajesht/moodles/im/moodle/lib/tests/behat/behat_deprecated.php Simple namespace issue... Thanks...
            Hide
            marina Marina Glancy added a comment -

            please correct another one in the same file about moodle forms introduced in MDL-43738

            Show
            marina Marina Glancy added a comment - please correct another one in the same file about moodle forms introduced in MDL-43738
            Hide
            dmonllao David Monllaó added a comment -

            Thanks Rajesh and Marina, working on a patch

            Show
            dmonllao David Monllaó added a comment - Thanks Rajesh and Marina, working on a patch
            Hide
            dmonllao David Monllaó added a comment -

            Patch on top of integration (only master):
            git pull git://github.com/dmonllao/moodle.git MDL-43236_master-fix-tablenode

            Show
            dmonllao David Monllaó added a comment - Patch on top of integration (only master): git pull git://github.com/dmonllao/moodle.git MDL-43236 _master-fix-tablenode
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks, back to testing (again)

            Show
            poltawski Dan Poltawski added a comment - Thanks, back to testing (again)
            Hide
            dmonllao David Monllaó added a comment -

            I'm going to make tons of friends with this issue, including HQ staff

            Show
            dmonllao David Monllaó added a comment - I'm going to make tons of friends with this issue, including HQ staff
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Seems something is wrong,

            I am getting deprecated message when behat_usedeprecated=false, which is correct, but getting following undefined error when using behat_usedeprecated=true

            You can implement step definitions for undefined steps with these snippets:
             
                /**
                 * @Given /^the following "([^"]*)" exist$/
                 */
                public function theFollowingExist($arg1, TableNode $table)
                {
                    throw new PendingException();
                }

            In addition to above, mod/quiz/tests/behat/add_quiz.feature is still failing...

            Show
            rajeshtaneja Rajesh Taneja added a comment - Seems something is wrong, I am getting deprecated message when behat_usedeprecated=false, which is correct, but getting following undefined error when using behat_usedeprecated=true You can implement step definitions for undefined steps with these snippets:   /** * @Given /^the following "([^"]*)" exist$/ */ public function theFollowingExist($arg1, TableNode $table) { throw new PendingException(); } In addition to above, mod/quiz/tests/behat/add_quiz.feature is still failing...
            Hide
            dmonllao David Monllaó added a comment -

            I amended the patch with a second fix but I forgot to push it before commenting about it... I have a second commit to add, sorry all to the involved people.

            git pull git://github.com/dmonllao/moodle.git MDL-44236_master-fix-tablenode-2

            Show
            dmonllao David Monllaó added a comment - I amended the patch with a second fix but I forgot to push it before commenting about it... I have a second commit to add, sorry all to the involved people. git pull git://github.com/dmonllao/moodle.git MDL-44236 _master-fix-tablenode-2
            Hide
            poltawski Dan Poltawski added a comment -

            pulled...

            Show
            poltawski Dan Poltawski added a comment - pulled...
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Thanks for fixing this David,

            Works awesomely awesome... Congrats you just added one more friend to your list

            Passing...

            Show
            rajeshtaneja Rajesh Taneja added a comment - Thanks for fixing this David, Works awesomely awesome... Congrats you just added one more friend to your list Passing...
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            The price of success is hard work,
            dedication to the job at hand,
            and the determination that whether we win or lose,
            we have applied the best of ourselves to the task at hand.

            Vince Lombardi

            This is now part of Moodle, your favorite non-frameworkial LMS, LOL. Thanks, closing!

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - The price of success is hard work, dedication to the job at hand, and the determination that whether we win or lose, we have applied the best of ourselves to the task at hand. Vince Lombardi This is now part of Moodle, your favorite non-frameworkial LMS, LOL. Thanks, closing! Ciao
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Multiple behat steps where deprecated as part of this, however a @TODO was not added in the phpdocs of those issues. Can someone familiar with this issue comment on MDL-42862 if the following should be removed in 2.9 :-
            the_following_exists
            should_not_exists
            should_exists

            Show
            ankit_frenz Ankit Agarwal added a comment - Multiple behat steps where deprecated as part of this, however a @TODO was not added in the phpdocs of those issues. Can someone familiar with this issue comment on MDL-42862 if the following should be removed in 2.9 :- the_following_exists should_not_exists should_exists
            Hide
            dmonllao David Monllaó added a comment -

            Thanks for pointing me here Ankit; yes, they should be removed in 2.9 as they were introduced in 2.7, probably I forgot to add the @todo

            Show
            dmonllao David Monllaó added a comment - Thanks for pointing me here Ankit; yes, they should be removed in 2.9 as they were introduced in 2.7, probably I forgot to add the @todo

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

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