Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behat testing #29

Closed
wants to merge 6 commits into from
Closed

Conversation

eric-s-richer
Copy link

@eric-s-richer eric-s-richer commented Aug 8, 2024

I wanted to introduce some Behat tests to validate user experieinces. I've started with a simple Behat test tests/behat/navigation.feature and addressed the root cause of various failures and errors observed.

…e_behat_core_auth.php as they are not required to log out.
…e behat_theme_adaptable_behat_navigation context. Without this, Behat will report failures like:

Step "i should see :name is active in navigation" is already defined in behat_theme_adaptable_behat_navigation::i_should_see_is_active_in_navigation()

    behat_theme_adaptable_behat_navigation::i_should_see_is_active_in_navigation()
    behat_theme_boost_behat_navigation::i_should_see_is_active_in_navigation()
…rent_page_administration and \behat_theme_adaptable_behat_navigation::i_follow_in_the_user_menu as they are not required because the core steps work fine with the theme.
…i_set_the_following_system_permissions_of_role otherwise Behat will fail with errors like:

Step "/^I set the following system permissions of "(?P<rolefullname_string>(?:[^"]|\\")*)" role:$/" is already defined in behat_theme_adaptable_behat_permissions::i_set_the_following_system_permissions_of_role()

        behat_theme_adaptable_behat_permissions::i_set_the_following_system_permissions_of_role()
        behat_theme_adaptable_behat_permissions::i_set_the_following_system_permissions_of_role()

This is inspired by Moodle's hanlding of a similar situation in \behat_theme_boost_behat_navigation.
… following alert is reported in the browser when viewing the course index page:

Error updating user preference 'drawer-open-index' using ajax. Clicking this link will repeat the Ajax call that failed so you can see the error:
@gjb2048
Copy link
Collaborator

gjb2048 commented Aug 8, 2024

@eric-s-richer

Interesting. Please note:

  1. Error updating user preference 'drawer-open-index' using ajax #28 - as you've fixed something that is already fixed.
  2. This should be considered to be a 'read only' repository and changes are made in another.
  3. Changes need to be in the 'main' branch initially then backported.
  4. I will consider changes but am under no obligation to accept them.
  5. Any such pull request must be self contained within the scope (related to only one thing - you have two, a bug fix and Behat).
  6. A pull request must only contain one commit - to allow ease of integration and backporting. This is in line with Moodle HQ's Tracker process.
  7. You've mentioned failures / errors but provided no evidence. Thus I cannot validate or verify that your proposed changes are valid.

G

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants