-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[MFTF] Make AdminAssertCategoryGridPageDetailsActionGroup parametrized #29705
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
[MFTF] Make AdminAssertCategoryGridPageDetailsActionGroup parametrized #29705
Conversation
…GridPageDetailsActionGroup parametrized - initial modification
Hi @joweecaquicla. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
…GridPageDetailsActionGroup parametrized - fix merge conflict
…GridPageDetailsActionGroup parametrized - modifications on enabled and in menu columns and mftf files
@magento run Functional Tests CE, Functional Tests EE, Functional Tests B2B |
…GridPageDetailsActionGroup parametrized - additional modifications for in menu and enabled column renderer and mftf files
@magento run all tests |
@@ -8,16 +8,19 @@ | |||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | |||
<actionGroup name="AdminAssertCategoryGridPageDetailsActionGroup"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
I would suggest to use this opportunity and rename the action group to match the best practices:
Assert{Admin or Storefront}{Functionality}ActionGroup.xml
So the new name will be AssertAdminCategoryGridPageDetailsActionGroup
(see section 11.3.5 in the tech guidelines)
Thank you!
…GridPageDetailsActionGroup parametrized - renamed action group based on requested change
@magento run all tests |
@@ -24,9 +24,9 @@ public function prepareDataSource(array $dataSource) | |||
$fieldName = $this->getData('name'); | |||
foreach ($dataSource['data']['items'] as & $item) { | |||
if (isset($item[$fieldName]) && $item[$fieldName] == 1) { | |||
$item[$fieldName] = 'Yes'; | |||
$item[$fieldName] = '<span class="1">Yes</span>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joweecaquicla is there a way to go without the HTML in the column value? (changing only the MFTF part)
…75-parameterize-admin-assert-category-grid-page-details-action-group
…GridPageDetailsActionGroup parametrized - modified ui component and mftf files, additional action group for search by category name on category grid page
…GridPageDetailsActionGroup parametrized - introduced new ActionGroup and modified related mftf files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @joweecaquicla ! Please see my comments
@@ -9,14 +9,17 @@ | |||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | |||
<section name="AdminMediaGalleryCatalogUiCategoryGridSection"> | |||
<!--Search by category name element--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to adjust the element names or introduce appropriate sections for the naming to be self-explanatory instead of using comments.
@@ -9,14 +9,17 @@ | |||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | |||
<section name="AdminMediaGalleryCatalogUiCategoryGridSection"> | |||
<!--Search by category name element--> | |||
<element name="search" type="input" selector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] input[placeholder='Search by category name']"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use data-bind
in a selector, that is part of the functionality implementation that can be changed
<argument name="categoryName" value="$$category.name$$"/> | ||
</actionGroup> | ||
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetAdminDataGridToDefaultView"/> | ||
<grabTextFrom selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.columnValue('Name')}}" stepKey="grabCategoryNameFromGrid"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to use the AssertAdminCategoryGridPageNumberOfRecordsActionGroup
and AssertAdminCategoryGridPageDetailsActionGroup
instead of custom verification
...lleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiVerifyUsedInLinkCategoryGridTest.xml
Show resolved
Hide resolved
...ediaGalleryCatalogUi/Test/Mftf/Test/AdminMediaGalleryCatalogUiVerifyCategoryGridPageTest.xml
Show resolved
Hide resolved
|
||
<conditionalClick selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.clearFilters}}" dependentSelector="{{AdminMediaGalleryCatalogUiCategoryGridSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> | ||
<fillField selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.search}}" userInput="{{categoryName}}" stepKey="fillKeywordSearchField"/> | ||
<click selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.submitSearch}}" stepKey="clickKeywordSearch"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably waiting for loader would be needed after applying the filter
|
||
<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.image(imageName)}}" stepKey="assertImageColumn"/> | ||
|
||
<!--Name Column--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use stepKey
for description of steps instead of comments
<actionGroup name="AssertAdminCategoryGridPageDetailsActionGroup"> | ||
<arguments> | ||
<argument name="category"/> | ||
<argument name="imageName" type="string" defaultValue="magento"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move the image verification to a separate action group to have granular assets
<!--Products Column--> | ||
<grabTextFrom selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.columnValue('Products')}}" stepKey="grabProductsColumnValue"/> | ||
<assertEquals stepKey="assertProductsColumn"> | ||
<expectedResult type="string">0</expectedResult> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move the hardcoded verification to a separate action group with a proper name as this verification does not really depend on the category provided for this action group
…GridPageDetailsActionGroup parametrized - requested changes
…GridPageDetailsActionGroup parametrized - fix merge conflict
…GridPageDetailsActionGroup parametrized - modified mftf test file
@magento run all tests |
…GridPageDetailsActionGroup parametrized - fix conflict
@magento run all tests |
@magento run WebAPI Tests, Functional Tests EE, Functional Tests B2B |
@joweecaquicla great job! |
Hi @sivaschenko, thank you for the review. |
Hi @joweecaquicla, thank you for your contribution! |
Hi @rogyar, thank you for the review. |
Description (*)
This PR will introduce the modifications to parameterized
AdminAssertCategoryGridPageDetailsActionGroup
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)