Skip to content

Commit 7e744b8

Browse files
committed
MC-22132: MFTF tests stabilization - AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest MC-12656
1 parent 1de5f67 commit 7e744b8

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
<waitForElementVisible selector="{{AdminConfirmationModalSection.title}}" stepKey="waitingForWarningModal"/>
3030
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreDelete"/>
3131
<waitForPageLoad stepKey="waitForSuccessMessage"/>
32-
<see userInput="You deleted the store view." stepKey="seeDeleteMessage"/>
32+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessageAppears"/>
33+
<see selector="{{AdminMessagesSection.success}}" userInput="You deleted the store view." stepKey="seeDeleteMessage"/>
3334
</actionGroup>
3435

3536
<actionGroup name="DeleteCustomStoreViewBackupEnabledYesActionGroup">
@@ -72,4 +73,37 @@
7273
<waitForPageLoad stepKey="waitForStoreToLoad"/>
7374
<see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/>
7475
</actionGroup>
76+
77+
<actionGroup name="AdminDeleteStoreViewIfExistsActionGroup">
78+
<annotations>
79+
<description>Goes to the Admin Stores grid page. Deletes the provided Store (if exists) without creating a Backup. Validates that the Success Message is present and correct.</description>
80+
</annotations>
81+
<arguments>
82+
<argument name="storeViewName" type="string"/>
83+
</arguments>
84+
85+
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
86+
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/>
87+
<fillField selector="{{AdminStoresGridSection.storeFilterTextField}}" userInput="{{storeViewName}}" stepKey="fillSearchStoreViewField"/>
88+
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/>
89+
90+
<executeInSelenium function="function($webdriver) use ($I) {
91+
$items = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('.col-store_title>a'));
92+
if(!empty($items)) {
93+
$I->click('.col-store_title>a');
94+
$I->waitForPageLoad(10);
95+
$I->click('#delete');
96+
$I->waitForPageLoad(30);
97+
$I->selectOption('select#store_create_backup', 'No');
98+
$I->click('#delete');
99+
$I->waitForPageLoad(30);
100+
$I->waitForElementVisible('aside.confirm .modal-title', 10);
101+
$I->click('aside.confirm .modal-footer button.action-accept');
102+
$I->waitForPageLoad(60);
103+
$I->waitForElementVisible('#messages div.message-success', 10);
104+
$I->see('You deleted the store view.', '#messages div.message-success');
105+
}
106+
}" stepKey="deleteStoreViewIfExists"/>
107+
</actionGroup>
108+
75109
</actionGroups>

app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@
1818
<group value="urlRewrite"/>
1919
</annotations>
2020
<before>
21+
<createData entity="ApiCategory" stepKey="createCategory">
22+
<field key="name">category-admin</field>
23+
</createData>
2124
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
25+
<actionGroup ref="AdminDeleteStoreViewIfExistsActionGroup" stepKey="deleteENStoreViewIfExists">
26+
<argument name="storeViewName" value="{{customStoreENNotUnique.name}}"/>
27+
</actionGroup>
28+
<actionGroup ref="AdminDeleteStoreViewIfExistsActionGroup" stepKey="deleteNLStoreViewIfExists">
29+
<argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/>
30+
</actionGroup>
31+
2232
<!-- Create Store View EN -->
2333
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewEn">
2434
<argument name="customStore" value="customStoreENNotUnique"/>
@@ -27,9 +37,6 @@
2737
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewNl">
2838
<argument name="customStore" value="customStoreNLNotUnique"/>
2939
</actionGroup>
30-
<createData entity="ApiCategory" stepKey="createCategory">
31-
<field key="name">category-admin</field>
32-
</createData>
3340
</before>
3441
<after>
3542
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
@@ -44,6 +51,7 @@
4451
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewNl">
4552
<argument name="customStore" value="customStoreNLNotUnique"/>
4653
</actionGroup>
54+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreFilters"/>
4755
<actionGroup ref="logout" stepKey="logout"/>
4856
</after>
4957
<actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewEn">

0 commit comments

Comments
 (0)