Skip to content

Commit

Permalink
Merge pull request #46 from magento-epam/2.3-develop
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
vital-pantsialeyeu authored Aug 11, 2018
2 parents a894b77 + 1cb9235 commit 36aec4b
Show file tree
Hide file tree
Showing 152 changed files with 1,915 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected function _prepareLayout()
{
$itemId = $this->getRequest()->getParam('group_id');

$this->setTemplate('system/store/delete_group.phtml');
$this->setTemplate('Magento_Backend::system/store/delete_group.phtml');
$this->setAction($this->getUrl('adminhtml/*/deleteGroupPost', ['group_id' => $itemId]));
$this->addChild(
'confirm_deletion_button',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected function _prepareLayout()
{
$itemId = $this->getRequest()->getParam('website_id');

$this->setTemplate('system/store/delete_website.phtml');
$this->setTemplate('Magento_Backend::system/store/delete_website.phtml');
$this->setAction($this->getUrl('adminhtml/*/deleteWebsitePost', ['website_id' => $itemId]));
$this->addChild(
'confirm_deletion_button',
Expand Down
33 changes: 13 additions & 20 deletions app/code/Magento/Backend/Helper/Dashboard/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @api
* @since 100.0.2
*/
class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard
class Order extends AbstractDashboard
{
/**
* @var \Magento\Reports\Model\ResourceModel\Order\Collection
Expand All @@ -29,32 +29,25 @@ class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard
/**
* @param \Magento\Framework\App\Helper\Context $context
* @param \Magento\Reports\Model\ResourceModel\Order\Collection $orderCollection
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
*/
public function __construct(
\Magento\Framework\App\Helper\Context $context,
\Magento\Reports\Model\ResourceModel\Order\Collection $orderCollection
\Magento\Reports\Model\ResourceModel\Order\Collection $orderCollection,
\Magento\Store\Model\StoreManagerInterface $storeManager = null
) {
$this->_orderCollection = $orderCollection;
parent::__construct($context);
}
$this->_storeManager = $storeManager ?: ObjectManager::getInstance()
->get(\Magento\Store\Model\StoreManagerInterface::class);

/**
* The getter function to get the new StoreManager dependency
*
* @return \Magento\Store\Model\StoreManagerInterface
*
* @deprecated 100.1.0
*/
private function getStoreManager()
{
if ($this->_storeManager === null) {
$this->_storeManager = ObjectManager::getInstance()->get(\Magento\Store\Model\StoreManagerInterface::class);
}
return $this->_storeManager;
parent::__construct($context);
}

/**
* @return void
*
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function _initCollection()
{
Expand All @@ -65,15 +58,15 @@ protected function _initCollection()
if ($this->getParam('store')) {
$this->_collection->addFieldToFilter('store_id', $this->getParam('store'));
} elseif ($this->getParam('website')) {
$storeIds = $this->getStoreManager()->getWebsite($this->getParam('website'))->getStoreIds();
$storeIds = $this->_storeManager->getWebsite($this->getParam('website'))->getStoreIds();
$this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
} elseif ($this->getParam('group')) {
$storeIds = $this->getStoreManager()->getGroup($this->getParam('group'))->getStoreIds();
$storeIds = $this->_storeManager->getGroup($this->getParam('group'))->getStoreIds();
$this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
} elseif (!$this->_collection->isLive()) {
$this->_collection->addFieldToFilter(
'store_id',
['eq' => $this->getStoreManager()->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()]
['eq' => $this->_storeManager->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()]
);
}
$this->_collection->load();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">

<actionGroup name="GoToUserRoles">
<click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/>
<waitForPageLoad stepKey="waitForSystemsPageToOpen"/>
<click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/>
<waitForPageLoad stepKey="waitForUserRolesPageToOpen"/>
</actionGroup>

<!--Create new role-->
<actionGroup name="AdminCreateRole">
<arguments>
<argument name="role" type="string" defaultValue=""/>
<argument name="resource" type="string" defaultValue="All"/>
<argument name="scope" type="string" defaultValue="Custom"/>
<argument name="websites" type="string" defaultValue="Main Website"/>
</arguments>
<click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/>
<fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/>
<fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
<click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/>
<waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/>
<click stepKey="checkSales" selector="//a[text()='Sales']"/>
<click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/>
<waitForPageLoad stepKey="waitForPageLoad" time="10"/>
<see userInput="You saved the role." stepKey="seeSuccessMessage" />
</actionGroup>


<!--Delete role-->
<actionGroup name="AdminDeleteRoleActionGroup">
<arguments>
<argument name="role" defaultValue=""/>
</arguments>
<click stepKey="clickOnRole" selector="{{AdminDeleteRoleSection.theRole}}"/>
<fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteRoleSection.current_pass}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
<click stepKey="clickToDeleteRole" selector="{{AdminDeleteRoleSection.delete}}"/>
<waitForAjaxLoad stepKey="waitForDeleteConfirmationPopup" time="5"/>
<click stepKey="clickToConfirm" selector="{{AdminDeleteRoleSection.confirm}}"/>
<waitForPageLoad stepKey="waitForPageLoad" time="10"/>
<see stepKey="seeSuccessMessage" userInput="You deleted the role."/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">

<!--Go to all users-->
<actionGroup name="GoToAllUsers">
<click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/>
<waitForPageLoad stepKey="waitForSystemsPageToOpen"/>
<click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/>
<waitForPageLoad stepKey="waitForUserRolesPageToOpen"/>
</actionGroup>

<!--Create new user with specified role-->
<actionGroup name="AdminCreateUser">
<click selector="{{AdminCreateUserSection.create}}" stepKey="clickToCreateNewUser"/>
<waitForPageLoad stepKey="waitForNewUserPageLoad" time="10"/>
<fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{NewAdmin.username}}" stepKey="enterUserName" />
<fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{NewAdmin.firstName}}" stepKey="enterFirstName" />
<fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{NewAdmin.lastName}}" stepKey="enterLastName" />
<fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{NewAdmin.email}}" stepKey="enterEmail" />
<fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{NewAdmin.password}}" stepKey="enterPassword" />
<fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{NewAdmin.password}}" stepKey="confirmPassword" />
<fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" />
<scrollToTopOfPage stepKey="scrollToTopOfPage" />
<click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole" />
<waitForAjaxLoad stepKey="waitForRoles" time="5"/>
<fillField selector="{{AdminCreateRoleSection.roleNameFilterTextField}}" userInput="{{role.name}}" stepKey="filterRole" />
<click selector="{{AdminCreateRoleSection.searchButton}}" stepKey="clickSearch" />
<waitForPageLoad stepKey="waitForSearch" time="10"/>
<click selector="{{AdminCreateRoleSection.searchResultFirstRow}}" stepKey="selectRole" />
<click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser" />
<waitForPageLoad stepKey="waitForSaveUser" time="10"/>
<see userInput="You saved the user." stepKey="seeSuccessMessage" />
</actionGroup>


<!--Delete User-->
<actionGroup name="AdminDeleteUserActionGroup">

<click stepKey="clickOnUser" selector="{{AdminDeleteUserSection.theUser}}"/>
<fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
<scrollToTopOfPage stepKey="scrollToTop"/>
<click stepKey="clickToDeleteUser" selector="{{AdminDeleteUserSection.delete}}"/>
<waitForPageLoad stepKey="waitForDeletePopupOpen" time="5"/>
<click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/>
<waitForPageLoad stepKey="waitForPageLoad" time="10"/>
<see userInput="You deleted the user." stepKey="seeSuccessMessage" />
</actionGroup>

</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">

<actionGroup name="ConfigureBraintree">
<!-- GoTo ConfigureBraintree fields -->
<click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/>
<waitForPageLoad stepKey="waitForConfiguration" time="2"/>
<click stepKey="clickOnConfigurations" selector="{{StoresSubmenuSection.configuration}}" />
<waitForPageLoad stepKey="waitForSales" time="2"/>
<click stepKey="clickOnSales" selector="{{ConfigurationListSection.sales}}" />
<waitForPageLoad stepKey="waitForPaymentMethods" time="2"/>
<click stepKey="clickOnPaymentMethods" selector="{{ConfigurationListSection.salesPaymentMethods}}" />
<waitForPageLoad stepKey="waitForConfigureButton" time="2"/>
<click stepKey="clickOnConfigureButtonForBraintree" selector="{{ConfigurationPaymentSection.configureButton}}" />
<waitForPageLoad stepKey="BraintreeSettings" time="2"/>

<!-- Fill Braintree fields -->
<fillField stepKey="fillTitleForBraintreeSettings" selector="{{BraintreeConfiguraionSection.titleForBraintreeSettings}}" userInput="{{BraintreeConfigurationData.title}}"/>
<click stepKey="openEnvironmentSelect" selector="{{BraintreeConfiguraionSection.environment}}"/>
<click stepKey="chooseEnvironment" selector="{{BraintreeConfiguraionSection.sandbox}}"/>
<click stepKey="openPaymentActionSelect" selector="{{BraintreeConfiguraionSection.paymentActionSelect}}"/>
<click stepKey="choosePaymentAction" selector="{{BraintreeConfiguraionSection.paymentAction}}"/>
<fillField stepKey="fillMerchantID" selector="{{BraintreeConfiguraionSection.merchantID}}" userInput="{{BraintreeConfigurationData.merchantID}}"/>
<fillField stepKey="fillPublicKey" selector="{{BraintreeConfiguraionSection.publicKey}}" userInput="{{BraintreeConfigurationData.publicKey}}"/>
<fillField stepKey="fillPrivateKey" selector="{{BraintreeConfiguraionSection.privateKey}}" userInput="{{BraintreeConfigurationData.privateKey}}"/>
<click stepKey="expandEnableThisSolution" selector="{{BraintreeConfiguraionSection.enableThisSolution}}"/>
<click stepKey="chooseYesForEnableThisSolution" selector="{{BraintreeConfiguraionSection.yesForEnable}}"/>
<click stepKey="expandEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintree}}"/>
<click stepKey="chooseYesForEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.yesForPayPalThroughBraintree}}"/>
<click stepKey="expandAdvancedBraintreeSettings" selector="{{BraintreeConfiguraionSection.advancedBraintreeSettings}}"/>
<fillField stepKey="fillMerchantAccountID" selector="{{BraintreeConfiguraionSection.merchantAccountID}}" userInput="{{BraintreeConfigurationData.merchantAccountID}}"/>
<click stepKey="expandCVVVerification" selector="{{BraintreeConfiguraionSection.CVVVerification}}"/>
<click stepKey="chooseYes" selector="{{BraintreeConfiguraionSection.yesForCVV}}"/>
<click stepKey="expandPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintreeSelector}}"/>
<fillField stepKey="fillTitleForPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.titleForPayPalThroughBraintree}}" userInput="{{BraintreeConfigurationData.titleForPayPalThroughBraintree}}"/>
<click stepKey="expandPaymentAction" selector="{{BraintreeConfiguraionSection.paymentActionInPayPal}}"/>
<click stepKey="chooseAuthorize" selector="{{BraintreeConfiguraionSection.actionAuthorize}}"/>
<click stepKey="save" selector="{{BraintreeConfiguraionSection.save}}"/>
<waitForElementVisible selector="{{BraintreeConfiguraionSection.successfulMessage}}" stepKey="waitForSuccessfullyConfigured" time="10"/>
</actionGroup>

</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="CreateCustomerActionGroup">
<click stepKey="openCustomers" selector="{{AdminMenuSection.customers}}"/>
<waitForAjaxLoad stepKey="waitForCatalogSubmenu" time="5"/>
<click stepKey="clickOnAllCustomers" selector="{{CustomersSubmenuSection.allCustomers}}"/>
<waitForPageLoad stepKey="waitForProductsPage" time="10"/>
<click stepKey="addNewCustomer" selector="{{CustomersPageSection.addNewCustomerButton}}"/>
<waitForPageLoad stepKey="waitForNewProductPage" time="10"/>
<click stepKey="AssociateToWebsite" selector="{{NewCustomerPageSection.associateToWebsite}}"/>
<click stepKey="Group" selector="{{NewCustomerPageSection.group}}"/>
<fillField stepKey="FillFirstName" selector="{{NewCustomerPageSection.firstName}}" userInput="{{NewCustomerData.FirstName}}"/>
<fillField stepKey="FillLastName" selector="{{NewCustomerPageSection.lastName}}" userInput="{{NewCustomerData.LastName}}"/>
<fillField stepKey="FillEmail" selector="{{NewCustomerPageSection.email}}" userInput="{{NewCustomerData.Email}}"/>
<scrollToTopOfPage stepKey="scrollToAddresses"/>
<click stepKey="goToAddresses" selector="{{NewCustomerPageSection.addresses}}"/>
<waitForAjaxLoad stepKey="waitForAddresses" time="5"/>
<click stepKey="AddNewAddress" selector="{{NewCustomerPageSection.addNewAddress}}"/>
<waitForPageLoad stepKey="waitForAddressFields" time="5"/>
<click stepKey="thickBillingAddress" selector="{{NewCustomerPageSection.defaultBillingAddress}}"/>
<click stepKey="thickShippingAddress" selector="{{NewCustomerPageSection.defaultShippingAddress}}"/>
<fillField stepKey="fillFirstNameForAddress" selector="{{NewCustomerPageSection.firstNameForAddress}}" userInput="{{NewCustomerData.AddressFirstName}}"/>
<fillField stepKey="fillLastNameForAddress" selector="{{NewCustomerPageSection.lastNameForAddress}}" userInput="{{NewCustomerData.AddressLastName}}"/>
<fillField stepKey="fillStreetAddress" selector="{{NewCustomerPageSection.streetAddress}}" userInput="{{NewCustomerData.StreetAddress}}"/>
<fillField stepKey="fillCity" selector="{{NewCustomerPageSection.city}}" userInput="{{NewCustomerData.City}}"/>
<click stepKey="openCountry" selector="{{NewCustomerPageSection.country}}"/>
<waitForAjaxLoad stepKey="waitForCountryList" time="5"/>
<click stepKey="chooseCountry" selector="{{NewCustomerPageSection.countryArmenia}}"/>
<fillField stepKey="fillZip" selector="{{NewCustomerPageSection.zip}}" userInput="{{NewCustomerData.Zip}}"/>
<fillField stepKey="fillPhoneNumber" selector="{{NewCustomerPageSection.phoneNumber}}" userInput="{{NewCustomerData.PhoneNumber}}"/>
<waitForPageLoad stepKey="wait" time="10"/>
<click stepKey="save" selector="{{NewCustomerPageSection.saveCustomer}}"/>
<waitForPageLoad stepKey="waitForCustomersPage" time="10"/>
<waitForElementVisible selector="{{NewCustomerPageSection.createdSuccessMessage}}" stepKey="waitForSuccessfullyCreatedMessage" time="20"/>

</actionGroup>
</actionGroups>
Loading

0 comments on commit 36aec4b

Please sign in to comment.