Prepared admin buttons#5511
Draft
sreichel wants to merge 33 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds stable data-test attributes to common admin form elements and admin buttons to make Cypress/e2e selectors resilient, and introduces a helper for adding standardized admin buttons.
Changes:
- Introduce
Mage_Adminhtml_Block_Widget_Container::_addPreparedButton()plus button type constants, and refactor multiple admin blocks to use it.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Varien/Data/Form/Element/Abstract.php | Add computed test id and render it into default <input> elements. |
| lib/Varien/Data/Form/Element/Textarea.php | Add data-test to textarea elements. |
| lib/Varien/Data/Form/Element/Select.php | Add data-test to select elements. |
| lib/Varien/Data/Form/Element/Multiselect.php | Add data-test to multiselect elements. |
| lib/Varien/Data/Form/Element/Editor.php | Add data-test to WYSIWYG textarea output. |
| lib/Varien/Data/Form/Element/Date.php | Add data-test to date input element. |
| app/design/adminhtml/openmage/default/template/login.phtml | Add data-test selectors to login fields. |
| app/design/adminhtml/base/default/template/login.phtml | Add data-test selectors to login fields. |
| app/code/core/Mage/Adminhtml/Block/Widget/Container.php | Add button type constants, auto test_id, and _addPreparedButton() helper. |
| app/code/core/Mage/Adminhtml/Block/Widget/Button.php | Render data-test attribute on admin buttons. |
| app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php | Use _addPreparedButton() for standard form container buttons. |
| app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php | Use _addPreparedButton() for back button. |
| app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php | Use _addPreparedButton() for back button. |
| app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php | Replace custom save+edit button with prepared button. |
| app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php | Replace back/cancel buttons with prepared buttons. |
| app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php | Replace back/cancel button handling with prepared buttons/constants. |
| app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php | Replace save+edit button and standard button ids with constants. |
| app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php | Use constants for standard button ids. |
| app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php | Use prepared back button and constants for updates. |
| app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php | Replace save+continue button with prepared button. |
| app/code/core/Mage/Adminhtml/Block/Tag/Edit.php | Replace save+continue with prepared button and constants. |
| app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php | Replace save+continue with prepared button and constants. |
| app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php | Use constants for save/delete/reset button operations. |
| app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php | Use constants and prepared cancel button in footer. |
| app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php | Replace save+continue with prepared button and constants. |
| app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php | Replace save+continue with prepared button and constants. |
| app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php | Use constant for delete removal. |
| app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php | Replace back button with prepared button. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php | Use constants for standard button removals. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php | Use constants for save/update and delete removal. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php | Use constants for save/update and delete removal. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php | Use constants and prepared print button. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php | Use constants for standard button removals. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php | Use constants and prepared cancel/void/print buttons. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php | Use constants for standard button removals. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php | Use constants and prepared cancel/void/print buttons. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php | Use constants for standard button removals. |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php | Use constants for save/update and delete removal. |
| app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php | Replace save+continue with prepared button. |
| app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php | Replace save+continue with prepared button. |
| app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php | Use constant for delete removal. |
| app/code/core/Mage/Adminhtml/Block/Customer/Edit.php | Use constants and prepared save+continue button. |
| app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php | Use constants and prepared save+continue button. |
| app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php | Use constants and prepared save+continue button. |
| app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php | Replace close/save+continue with prepared buttons and constants. |
sreichel
commented
Apr 22, 2026
# Conflicts: # app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php # app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php # app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php # app/code/core/Mage/Adminhtml/Block/Customer/Edit.php # app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php # app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php # app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php # app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php # app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php # app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php # app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php # app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php # app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php # app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php # app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php # app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php # app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php # app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php # app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php # app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php # app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php # dev/rector/Migration/Mage/Adminhtml.php
Hanmac
reviewed
Apr 23, 2026
|
Contributor
|
Maybe for another issue, we should UNIFY the SAVE_EDIT onClick actions
|
Contributor
Author
|
This is the right PR to fix it. Already started that in another one ...
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description (*)
_addPreparedButton()for easier adding buttonsRelated Pull Requests