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

Behat: function scrollIntoView not working in the app

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-70727-311
    • MDL-70727-master
    • Hide

      Prerequisites

      • Follow the instructions in the documentation to configure your Moodle, Behat, and Moodle mobile environments. Docker is likely the easiest way to get it ready and running
      • Download the attached file, behat_app.feature, in lib/tests/behat.

      Test

      1. Run the behat test with the --tags=app command-line option (mobile tests only run in Chrome):

        # vendor/bin/behat --config /path_to_your_moodledata_behat/behatrun/behat/behat.yml --tags='@app'
        

      2. Confirm all the steps passed.
      Show
      Prerequisites Follow the instructions in the documentation to configure your Moodle, Behat, and Moodle mobile environments. Docker is likely the easiest way to get it ready and running Download the attached file, behat_app.feature , in lib/tests/behat . Test Run the behat test with the --tags=app command-line option (mobile tests only run in Chrome): # vendor/bin/behat --config /path_to_your_moodledata_behat/behatrun/behat/behat.yml --tags='@app' Confirm all the steps passed.

    Description

      When I run a simple behat test as below:

      @javascript @app
      Feature: Test behat press element in the app
        Background:
          Given the following "users" exist:
            | username | firstname | lastname | email                |
            | student1 | Student   | 1        | student1@example.com |
          And the following "courses" exist:
            | fullname | shortname |
            | Course 1 | C1        |
            | Course 2 | C2        |
          And the following "course enrolments" exist:
            | user    | course | role    |
            | student1 | C1     | student |
            | student1 | C2     | student |
       
        Scenario: Student has no subjects, but default links appear
          When I enter the app
          And I log in as "student1"
          And I press "Course 1" near "Course overview" in the app
          And I press "All sections" in the app
          And I press "Close" in the app
          And I should see "Contents"
          And I should see "Participants"
      

      After the step And I press "All sections" in the app, the tab bar (which include Contents, Participants, etc) disappears.

      Scenario: Student has no subjects, but default links appear # C:\xampp\htdocs\moodle\admin\tool\mobile\tests\behat\behat_app.feature:16
            And I should see "Contents"                               # C:\xampp\htdocs\moodle\admin\tool\mobile\tests\behat\behat_app.feature:24
              "Contents" text was found but was not visible (Behat\Mink\Exception\ExpectationException)

       
       

      Attachments

        1. After_press.png
          After_press.png
          28 kB
        2. before_press.png
          before_press.png
          30 kB
        3. behat_app.feature
          0.8 kB
        4. MDL-70727.jpg
          MDL-70727.jpg
          28 kB

        Issue Links

          Activity

            People

              thinhpham83 Thinh Pham Tien
              tiennguyenphuc Tien Nguyen
              Sam Marshall Sam Marshall
              Víctor Déniz Falcón Víctor Déniz Falcón
              Anna Carissa Sadia Anna Carissa Sadia
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                25/Mar/21

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 31 minutes
                  1d 31m