[wp-trac] [WordPress Trac] #47830: Something prevents code edition of the theme through HTML on the theme editor for test automation purposes

WordPress Trac noreply at wordpress.org
Sun Aug 4 10:04:15 UTC 2019


#47830: Something prevents code edition of the theme through HTML on the theme
editor for test automation purposes
--------------------------+-----------------------------
 Reporter:  xhat          |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  5.2.2
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This should be considered as a bug, because it's preventing code edition
 straight from the HTML source code of the page hence preventing test
 automation from working.

 I'm using Selenium with the Chrome webdriver for test automation purposes.

 This is a stock WordPress install with the default nineteen theme
 activated, with no plugins.

 The URL on which the problem is occurring is
 /wp-admin/theme-editor.php

 The fields are properly changed, whether it is the textarea
 id="newcontent" or the code mirror wrapper, but upon clicking on the save
 button the changes are reverted back BEFORE the Ajax request is sent to
 make the modifications, hence preventing any sort of modifications when
 it's made through HTML.

 To reproduce the error.

 [Optional] Use Google Chrome if possible
 1. Go to /wp-admin/theme-editor.php
 2. Make sure the style.css is loaded
 3. Inspect element and find the textarea id="newcontent"
 4. Remove a whole line
 5. Save
 6. Look at the textarea and see that the changes were reverted back

 You can see that the changes are reverted back before the submit button
 callback is called by placing a JS breakpoint at b.submit inside the file
 theme-plugin-editor.min.js

 Sadly I'm not experienced when it comes to Javascript at all so I just
 can't get further than that.

 Hope someone can get through this bug as our tool depends on this!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47830>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list