Skip to content

[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

Conversation

joweecaquicla
Copy link

Description (*)

This PR will introduce the modifications to parameterized AdminAssertCategoryGridPageDetailsActionGroup

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes [MFTF] Make AdminAssertCategoryGridPageDetailsActionGroup parametrized adobe-stock-integration#1775

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

…GridPageDetailsActionGroup parametrized - initial modification
@m2-assistant
Copy link

m2-assistant bot commented Aug 20, 2020

Hi @joweecaquicla. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

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.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 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

@sidolov sidolov added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Aug 20, 2020
joweecaquicla added 2 commits August 22, 2020 00:12
…GridPageDetailsActionGroup parametrized - fix merge conflict
…GridPageDetailsActionGroup parametrized - modifications on enabled and in menu columns and mftf files
@joweecaquicla
Copy link
Author

@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
@joweecaquicla
Copy link
Author

@magento run all tests

@rogyar rogyar self-assigned this Aug 24, 2020
@@ -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">
Copy link
Contributor

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
@joweecaquicla
Copy link
Author

@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>';
Copy link
Member

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)

@ghost ghost assigned sivaschenko Aug 24, 2020
joweecaquicla added 3 commits August 25, 2020 01:34
…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
Copy link
Member

@sivaschenko sivaschenko left a 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-->
Copy link
Member

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']"/>
Copy link
Member

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"/>
Copy link
Member

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


<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"/>
Copy link
Member

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-->
Copy link
Member

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"/>
Copy link
Member

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>
Copy link
Member

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
@joweecaquicla joweecaquicla changed the title [WIP] #1775: [MFTF] Make AdminAssertCategoryGridPageDetailsActionGroup parametrized #1775: [MFTF] Make AdminAssertCategoryGridPageDetailsActionGroup parametrized Aug 26, 2020
…GridPageDetailsActionGroup parametrized - fix merge conflict
…GridPageDetailsActionGroup parametrized - modified mftf test file
@joweecaquicla
Copy link
Author

@magento run all tests

…GridPageDetailsActionGroup parametrized - fix conflict
@joweecaquicla
Copy link
Author

@magento run all tests

@joweecaquicla
Copy link
Author

@magento run WebAPI Tests, Functional Tests EE, Functional Tests B2B

@sivaschenko sivaschenko added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Aug 28, 2020
@sivaschenko
Copy link
Member

@joweecaquicla great job!

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-8095 has been created to process this Pull Request

@sivaschenko sivaschenko changed the title #1775: [MFTF] Make AdminAssertCategoryGridPageDetailsActionGroup parametrized [MFTF] Make AdminAssertCategoryGridPageDetailsActionGroup parametrized Aug 31, 2020
@magento-engcom-team magento-engcom-team merged commit 0de468d into magento:2.4-develop Sep 2, 2020
@m2-assistant
Copy link

m2-assistant bot commented Sep 2, 2020

Hi @joweecaquicla, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-8401 has been created to process this Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: MediaGalleryCatalogUi Component: MediaGalleryUi Priority: P3 May be fixed according to the position in the backlog. Progress: accept Project: ASI Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[MFTF] Make AdminAssertCategoryGridPageDetailsActionGroup parametrized
5 participants