MDL-78251 tiny: Reduce use of UI for setting test expectations

This commit is contained in:
Andrew Nicols 2023-08-09 13:46:35 +08:00
parent 24ce17d13e
commit c7b1cf2651
No known key found for this signature in database
GPG key ID: 6D1E3157C8CFBF14
4 changed files with 56 additions and 26 deletions

View file

@ -1,21 +1,15 @@
@editor @editor_tiny @filter @filter_codehighlighter
@filter @filter_codehighlighter
Feature: Render text content using a codehighliter filter
To display code to be well-styled - I need to render text content.
@javascript
Scenario: Update admin profile description with a code content
Given the "codehighlighter" filter is "on"
And I log in as "admin"
And I follow "Profile" in the user menu
When I click on "Edit profile" "link" in the "region-main" "region"
And I click on "//span[@class='tox-mbtn__select-label'][contains(text(), 'Insert')]" "xpath_element"
And I click on "//div[@class='tox-collection__item-label'][contains(text(), 'Code sample...')]" "xpath_element"
And I set the field with xpath "//div[@class='tox-selectfield']/select" to "PHP"
And I set the field with xpath "//textarea" to "<pre class=\"language-php\"><code>$t = date();</code></pre>"
And I click on "//button[@class='tox-button'][contains(text(), 'Save')]" "xpath_element"
And I click on "Update profile" "button"
Then I should see "Changes saved"
And "//span[@class='token variable'][contains(text(),'$t')]" "xpath_element" should exist
And the following "user" exists:
| username | example |
| description | <pre class="language-php"><code>$t = date();</code></language> |
And I am on the Profile page logged in as "example"
Then "//span[@class='token variable'][contains(text(),'$t')]" "xpath_element" should exist
And "//span[@class='token operator'][contains(text(),'=')]" "xpath_element" should exist
And "//span[@class='token punctuation'][contains(text(),'(')]" "xpath_element" should exist
And "//span[@class='token punctuation'][contains(text(),')')]" "xpath_element" should exist