Skip to content
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: Admin Delete CMS Block Test #30359

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminDeleteCMSBlockFromGridActionGroup">
<arguments>
<argument name="identifier" type="entity"/>
</arguments>
<click selector="{{BlockPageActionsSection.select(identifier)}}" stepKey="clickSelect"/>
<click selector="{{BlockPageActionsSection.delete(identifier)}}" stepKey="clickDelete"/>
<waitForElementVisible selector="{{BlockPageActionsSection.deleteConfirm}}" stepKey="waitForOkButtonToBeVisible"/>
<click selector="{{BlockPageActionsSection.deleteConfirm}}" stepKey="clickOkButton"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenCMSBlocksGridActionGroup">
<annotations>
<description>Navigate to the Admin Blocks Grid page.</description>
</annotations>

<amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSearchCMSBlockInGridByIdentifierActionGroup">
<arguments>
<argument name="identifier" type="string"/>
</arguments>
<click selector="{{BlockPageActionsSection.FilterBtn}}" stepKey="clickFilterButton"/>
<fillField selector="{{BlockPageActionsSection.URLKey}}" userInput="{{identifier}}" stepKey="fillIdentifierField"/>
<click selector="{{BlockPageActionsSection.ApplyFiltersBtn}}" stepKey="clickApplyFiltersButton"/>
<waitForPageLoad stepKey="waitForPageLoading"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertAdminCMSBlockIsNotInGridActionGroup">
<arguments>
<argument name="identifier" type="entity"/>
</arguments>
<dontSee userInput="{{identifier}}" selector="{{AdminBlockGridSection.gridDataRow}}" stepKey="dontSeeCmsBlockInGrid"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<element name="checkbox" type="checkbox" selector="//label[@class='data-grid-checkbox-cell-inner']//input[@class='admin__control-checkbox']"/>
<element name="select" type="select" selector="//tr[@class='data-row']//button[@class='action-select']"/>
<element name="editInSelect" type="text" selector="//a[contains(text(), 'Edit')]"/>
<element name="gridDataRow" type="input" selector=".data-row .data-grid-cell-content"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rely on data attributes instead of CSS classes/ID attribute in selectors (see http://devdocs.magento.com/guides/v2.0/coding-standards/code-standard-demarcation.html#business-logic-and-javascript).

</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@
<element name="URLKey" type="input" selector="//div[@class='admin__form-field-control']/input[@name='identifier']"/>
<element name="ApplyFiltersBtn" type="button" selector="//span[text()='Apply Filters']"/>
<element name="blockGridRowByTitle" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/>
<element name="delete" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Delete']" parameterized="true"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rely on data attributes instead of CSS classes/ID attribute in selectors (see http://devdocs.magento.com/guides/v2.0/coding-standards/code-standard-demarcation.html#business-logic-and-javascript).

<element name="deleteConfirm" type="button" selector=".action-primary.action-accept" timeout="60"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rely on data attributes instead of CSS classes/ID attribute in selectors (see http://devdocs.magento.com/guides/v2.0/coding-standards/code-standard-demarcation.html#business-logic-and-javascript).

</section>
</sections>
47 changes: 47 additions & 0 deletions app/code/Magento/Cms/Test/Mftf/Test/AdminDeleteCmsBlockTest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminDeleteCmsBlockTest">
<annotations>
<features value="Cms"/>
<stories value="CMS Blocks Deleting"/>
<title value="Admin should be able to delete CMS block from grid"/>
<description value="Admin should be able to delete CMS block from grid"/>
<group value="Cms"/>
<severity value="MINOR"/>
</annotations>
<before>
<createData entity="_defaultBlock" stepKey="createCMSBlock"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<actionGroup ref="AdminOpenCMSBlocksGridActionGroup" stepKey="navigateToCmsBlocksGrid"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridSearchFilters"/>
<actionGroup ref="AdminSearchCMSBlockInGridByIdentifierActionGroup" stepKey="findCreatedCmsBlock">
<argument name="identifier" value="$$createCMSBlock.identifier$$"/>
</actionGroup>
<actionGroup ref="AdminDeleteCMSBlockFromGridActionGroup" stepKey="deleteCmsBlockFromGrid">
<argument name="identifier" value="$$createCMSBlock.identifier$$"/>
</actionGroup>
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
<argument name="message" value="You deleted the block."/>
</actionGroup>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridSearchFiltersAfterBlockDeleting"/>
<actionGroup ref="AdminSearchCMSBlockInGridByIdentifierActionGroup" stepKey="searchDeletedCmsBlock">
<argument name="identifier" value="$$createCMSBlock.identifier$$"/>
</actionGroup>
<actionGroup ref="AssertAdminCMSBlockIsNotInGridActionGroup" stepKey="assertDeletedCMSBlockIsNotInGrid">
<argument name="identifier" value="$$createCMSBlock.identifier$$"/>
</actionGroup>
</test>
</tests>