Skip to content

Commit 6e8e096

Browse files
MacMac
authored andcommitted
Merge remote-tracking branch 'remotes/github/MAGETWO-96413' into EPAM-PR-28
2 parents 3c7ec06 + 0f527ca commit 6e8e096

File tree

5 files changed

+56
-1
lines changed

5 files changed

+56
-1
lines changed

app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebsiteAndStoreViewActionGroup.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,26 @@
4242
<click stepKey="saveAddress" selector="{{AdminCustomerAddressesSection.saveAddress}}"/>
4343
<waitForPageLoad stepKey="waitForAddressSave"/>
4444
</actionGroup>
45+
46+
<actionGroup name="AdminCreateCustomerWithWebSiteAndGroup">
47+
<arguments>
48+
<argument name="customerData" defaultValue="Simple_US_Customer"/>
49+
<argument name="website" type="string" defaultValue="customWebsite"/>
50+
<argument name="storeView" type="string" defaultValue="customStore"/>
51+
</arguments>
52+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
53+
<click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/>
54+
<selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/>
55+
<click selector="{{AdminCustomerAccountInformationSection.group}}" stepKey="ClickToExpandGroup"/>
56+
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption('Default (General)')}}" stepKey="waitForCustomerGroupExpand"/>
57+
<click selector="{{AdminCustomerAccountInformationSection.groupValue('Default (General)')}}" after="waitForCustomerGroupExpand" stepKey="ClickToSelectGroup"/>
58+
<fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/>
59+
<fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/>
60+
<fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/>
61+
<selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{storeView}}"/>
62+
<waitForElement selector="{{AdminCustomerAccountInformationSection.storeView}}" stepKey="waitForCustomerStoreViewExpand"/>
63+
<click stepKey="save" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/>
64+
<waitForPageLoad stepKey="waitForCustomersPage"/>
65+
<see stepKey="seeSuccessMessage" userInput="You saved the customer."/>
66+
</actionGroup>
4567
</actionGroups>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
6060
</actionGroup>
6161

62+
<!--Navigate to New Order Page for existing Customer And Store-->
63+
<actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer" >
64+
<arguments>
65+
<argument name="storeView" defaultValue="_defaultStore"/>
66+
</arguments>
67+
<click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectStoreView" after="waitForCreateOrderPageLoad"/>
68+
<waitForPageLoad stepKey="waitForLoad" after="selectStoreView"/>
69+
</actionGroup>
70+
6271
<!--Check the required fields are actually required-->
6372
<actionGroup name="checkRequiredFieldsNewOrderForm">
6473
<seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/>

app/code/Magento/Store/Model/Store.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,10 @@ public function setCurrentCurrencyCode($code)
897897
if (in_array($code, $this->getAvailableCurrencyCodes())) {
898898
$this->_getSession()->setCurrencyCode($code);
899899

900-
$defaultCode = $this->_storeManager->getWebsite()->getDefaultStore()->getDefaultCurrency()->getCode();
900+
$defaultCode = ($this->_storeManager->getStore() !== null)
901+
? $this->_storeManager->getStore()->getDefaultCurrency()->getCode()
902+
: $this->_storeManager->getWebsite()->getDefaultStore()->getDefaultCurrency()->getCode();
903+
901904
$this->_httpContext->setValue(Context::CONTEXT_CURRENCY, $code, $defaultCode);
902905
}
903906
return $this;

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,24 @@
2424
<waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/>
2525
<see userInput="You saved the store." stepKey="seeSavedMessage" />
2626
</actionGroup>
27+
28+
<actionGroup name="AdminAddCustomWebSiteToStoreGroup">
29+
<arguments>
30+
<argument name="storeGroup" defaultValue="customStoreGroup"/>
31+
<argument name="website" defaultValue="customWebsite"/>
32+
</arguments>
33+
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
34+
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/>
35+
<fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/>
36+
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/>
37+
<see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/>
38+
<click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/>
39+
<waitForPageLoad stepKey="waitForStoreGroupPageLoad" />
40+
<selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite" />
41+
<selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory" />
42+
<click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup" />
43+
<conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/>
44+
<waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/>
45+
<see userInput="You saved the store." stepKey="seeSavedMessage" />
46+
</actionGroup>
2747
</actionGroups>

app/code/Magento/Store/Test/Mftf/Section/AdminNewStoreGroupSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<element name="storeGrpNameTextField" type="input" selector="#group_name"/>
1212
<element name="storeGrpCodeTextField" type="input" selector="#group_code"/>
1313
<element name="storeRootCategoryDropdown" type="select" selector="#group_root_category_id"/>
14+
<element name="acceptNewStoreGroupCreation" type="button" selector=".action-primary.action-accept" />
1415
</section>
1516
</sections>

0 commit comments

Comments
 (0)