HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/moodleAW/moodle10/admin/tool/behat/tests/behat/nasty_strings.feature
@tool @tool_behat
Feature: Transform steps arguments
  In order to write tests with complex nasty arguments
  As a tests writer
  I need to apply some transformations to the steps arguments

  Background:
    Given I am on homepage
    And the following "courses" exists:
      | fullname | shortname | category |
      | Course 1 | C1 | 0 |
    And I log in as "admin"
    And I navigate to "Edit profile" node in "My profile settings"

  Scenario: Use nasty strings on steps arguments
    When I fill in "Surname" with "$NASTYSTRING1"
    And I fill in "Description" with "$NASTYSTRING2"
    And I fill in "City/town" with "$NASTYSTRING3"
    And I press "Update profile"
    And I follow "Edit profile"
    Then I should not see "NASTYSTRING"
    And the "Surname" field should match "$NASTYSTRING1" value
    And the "City/town" field should match "$NASTYSTRING3" value

  Scenario: Use nasty strings on table nodes
    When I fill the moodle form with:
      | Surname | $NASTYSTRING1 |
      | Description | $NASTYSTRING2 |
      | City/town | $NASTYSTRING3 |
    And I press "Update profile"
    And I follow "Edit profile"
    Then I should not see "NASTYSTRING"
    And the "Surname" field should match "$NASTYSTRING1" value
    And the "City/town" field should match "$NASTYSTRING3" value

  Scenario: Use double quotes
    When I fill the moodle form with:
      | First name | va"lue1 |
      | Description | va\"lue2 |
    And I fill in "City/town" with "va\"lue3"
    And I press "Update profile"
    And I follow "Edit profile"
    Then I should not see "NASTYSTRING"
    And the "First name" field should match "va\"lue1" value
    And the "Description" field should match "va\\"lue2" value
    And the "City/town" field should match "va\"lue3" value

  @javascript
  Scenario: Nasty strings with other contents
    When I fill in "First name" with "My Firstname $NASTYSTRING1"
    And I fill the moodle form with:
      | Surname | My Surname $NASTYSTRING2 |
    And I press "Update profile"
    And I follow "Edit profile"
    Then I should not see "NASTYSTRING"
    And I should see "My Firstname"
    And I should see "My Surname"
    And the "First name" field should match "My Firstname $NASTYSTRING1" value
    And the "Surname" field should match "My Surname $NASTYSTRING2" value