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

I should not see step fails with exception not caught correctly.

XMLWordPrintable

    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • wip-mdl-58056
    • Hide

      Test 1: Check webdriver exception is caught

      1. Apply following patch

        diff --git a/admin/tool/lp/tests/behat/framework_crud.feature b/admin/tool/lp/tests/behat/framework_crud.feature
        index 998a950..85f15f6 100644
        --- a/admin/tool/lp/tests/behat/framework_crud.feature
        +++ b/admin/tool/lp/tests/behat/framework_crud.feature
        @@ -64,7 +64,7 @@ Feature: Manage competency frameworks
             And I click on "Cancel" "button"
             And I click on "Delete" of edit menu in the "Science Year-4" row
             And "Confirm" "dialogue" should be visible
        -    When I click on "Delete" "button"
        +    #When I click on "Delete" "button"
             Then I should not see "Science Year-4"
             And I should not see "sc-y-4"
         
        diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php
        index d3e44f8..766fe55 100644
        --- a/lib/tests/behat/behat_general.php
        +++ b/lib/tests/behat/behat_general.php
        @@ -619,6 +619,8 @@ class behat_general extends behat_base {
                     throw new ExpectationException('"' . $text . '" text was found in the page', $this->getSession());
                 }
         
        +        $this->i_click_on("Delete", "button");
        +
                 // If the element is there we should be sure that it is not visible.
                 $this->spin(
                     function($context, $args) {
        @@ -640,7 +642,7 @@ class behat_general extends behat_base {
                         return true;
                     },
                     array('nodes' => $nodes, 'text' => $text),
        -            self::REDUCED_TIMEOUT,
        +            self::EXTENDED_TIMEOUT,
                     false,
                     true
                 );
        

      2. Before patch admin/tool/lp/tests/behat/framework_crud.feature:53 will fail.
      3. After patch admin/tool/lp/tests/behat/framework_crud.feature:53 should pass.

      Test 2:

      1. Run message/tests/behat/reply_message.feature in a loop for few hours and ensure it don't fail.
      Show
      Test 1: Check webdriver exception is caught Apply following patch diff --git a/admin/tool/lp/tests/behat/framework_crud.feature b/admin/tool/lp/tests/behat/framework_crud.feature index 998a950..85f15f6 100644 --- a/admin/tool/lp/tests/behat/framework_crud.feature +++ b/admin/tool/lp/tests/behat/framework_crud.feature @@ -64,7 +64,7 @@ Feature: Manage competency frameworks And I click on "Cancel" "button" And I click on "Delete" of edit menu in the "Science Year-4" row And "Confirm" "dialogue" should be visible - When I click on "Delete" "button" + #When I click on "Delete" "button" Then I should not see "Science Year-4" And I should not see "sc-y-4" diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php index d3e44f8..766fe55 100644 --- a/lib/tests/behat/behat_general.php +++ b/lib/tests/behat/behat_general.php @@ -619,6 +619,8 @@ class behat_general extends behat_base { throw new ExpectationException('"' . $text . '" text was found in the page', $this->getSession()); } + $this->i_click_on("Delete", "button"); + // If the element is there we should be sure that it is not visible. $this->spin( function($context, $args) { @@ -640,7 +642,7 @@ class behat_general extends behat_base { return true; }, array('nodes' => $nodes, 'text' => $text), - self::REDUCED_TIMEOUT, + self::EXTENDED_TIMEOUT, false, true ); Before patch admin/tool/lp/tests/behat/framework_crud.feature:53 will fail. After patch admin/tool/lp/tests/behat/framework_crud.feature:53 should pass. Test 2: Run message/tests/behat/reply_message.feature in a loop for few hours and ensure it don't fail.

      I should not see "" (behat_general::assert_page_not_contains_text) fails when the element is removed from the dom.

      Consider a case on deleting a framework

      1. You click on dialogue
      2. Element still being there will first check in assert_page_not_contains_text
      3. Then while we are spinning JS remove dom element after deleting it and in spin we end up with a selenium driver error WebDriver\Exception\NoSuchElement
      1. Failure 1
      2. Failure 2

            rajeshtaneja Rajesh Taneja
            rajeshtaneja Rajesh Taneja
            Simey Lameze Simey Lameze
            Dan Poltawski Dan Poltawski
            Jake Dallimore Jake Dallimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.