Skip to content

Commit

Permalink
Merge pull request #4 from magento/2.3-develop
Browse files Browse the repository at this point in the history
latest Pull 2.3 Develop
  • Loading branch information
niravkrish authored Jan 12, 2019
2 parents c1d987b + d1f9c6b commit 75d3b00
Show file tree
Hide file tree
Showing 97 changed files with 1,685 additions and 704 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminMainActionsSection">
<element name="save" type="button" selector="#save" timeout="30"/>
<element name="saveAndContinue" type="button" selector="button[id*=save_and_continue]" timeout="30"/>
<element name="delete" type="button" selector="#delete" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<element name="success" type="text" selector="#messages div.message-success"/>
<element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
<element name="error" type="text" selector="#messages div.message-error"/>
<element name="notice" type="text" selector=".message.message-notice.notice"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminSlideOutDialogSection">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
use Magento\Framework\EntityManager\MetadataPool;

/**
* Class FlatTableBuilder
* Class for building flat index
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class FlatTableBuilder
Expand Down Expand Up @@ -346,12 +347,21 @@ protected function _updateTemporaryTableByStoreValues(
}

//Update not simple attributes (eg. dropdown)
if (isset($flatColumns[$attributeCode . $valueFieldSuffix])) {
$select = $this->_connection->select()->joinInner(
['t' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
't.option_id = et.' . $attributeCode . ' AND t.store_id=' . $storeId,
[$attributeCode . $valueFieldSuffix => 't.value']
);
$columnName = $attributeCode . $valueFieldSuffix;
if (isset($flatColumns[$columnName])) {
$columnValue = $this->_connection->getIfNullSql('ts.value', 't0.value');
$select = $this->_connection->select();
$select->joinLeft(
['t0' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
't0.option_id = et.' . $attributeCode . ' AND t0.store_id = 0',
[]
)->joinLeft(
['ts' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
'ts.option_id = et.' . $attributeCode . ' AND ts.store_id = ' . $storeId,
[]
)->columns(
[$columnName => $columnValue]
)->where($columnValue . ' IS NOT NULL');
if (!empty($changedIds)) {
$select->where($this->_connection->quoteInto('et.entity_id IN (?)', $changedIds));
}
Expand All @@ -374,6 +384,8 @@ protected function _getTemporaryTableName($tableName)
}

/**
* Get metadata pool
*
* @return \Magento\Framework\EntityManager\MetadataPool
*/
private function getMetadataPool()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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="AdminAssignImageRolesActionGroup">
<arguments>
<argument name="image"/>
</arguments>
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggleState('closed')}}" dependentSelector="{{AdminProductImagesSection.productImagesToggleState('open')}}" visible="false" stepKey="clickSectionImage"/>
<click selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="clickProductImage"/>
<waitForElementVisible selector="{{AdminProductImagesSection.altText}}" stepKey="seeAltTextSection"/>
<checkOption selector="{{AdminProductImagesSection.roleBase}}" stepKey="checkRoleBase"/>
<checkOption selector="{{AdminProductImagesSection.roleSmall}}" stepKey="checkRoleSmall"/>
<checkOption selector="{{AdminProductImagesSection.roleThumbnail}}" stepKey="checkRoleThumbnail"/>
<checkOption selector="{{AdminProductImagesSection.roleSwatch}}" stepKey="checkRoleSwatch"/>
<click selector="{{AdminSlideOutDialogSection.closeButton}}" stepKey="clickCloseButton"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

<!--Save product and see success message-->
<actionGroup name="saveProductForm">
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
<click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/>
<click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled" parameterized="true"/>
<waitForPageLoad stepKey="waitForStatusToBeChanged"/>
<see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/>
<waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>
Expand Down
9 changes: 9 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,13 @@
<data key="name" unique="suffix">Product With Long Name And Sku - But not too long</data>
<data key="sku" unique="suffix">Product With Long Name And Sku - But not too long</data>
</entity>
<entity name="Magento3" type="image">
<data key="title" unique="suffix">Magento3</data>
<data key="price">1.00</data>
<data key="file_type">Upload File</data>
<data key="shareable">Yes</data>
<data key="file">magento3.jpg</data>
<data key="filename">magento3</data>
<data key="file_extension">jpg</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<element name="removeImageButton" type="button" selector=".action-remove"/>
<element name="modalOkBtn" type="button" selector="button.action-primary.action-accept"/>
<element name="uploadProgressBar" type="text" selector=".uploader .file-row"/>
<element name="productImagesToggleState" type="button" selector="[data-index='gallery'] > [data-state-collapsible='{{status}}']" parameterized="true"/>

<element name="nthProductImage" type="button" selector="#media_gallery_content > div:nth-child({{var}}) img.product-image" parameterized="true"/>
<element name="nthRemoveImageBtn" type="button" selector="#media_gallery_content > div:nth-child({{var}}) button.action-remove" parameterized="true"/>
Expand All @@ -32,4 +33,4 @@
<element name="isThumbnailSelected" type="button" selector="//div[contains(@class, 'field-image-role')]//ul/li[contains(@class, 'selected')]/label[normalize-space(.) = 'Thumbnail']"/>
<element name="isSwatchSelected" type="button" selector="//div[contains(@class, 'field-image-role')]//ul/li[contains(@class, 'selected')]/label[normalize-space(.) = 'Swatch']"/>
</section>
</sections>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontProductMediaSection">
<element name="imageFile" type="text" selector="//*[@class='product media']//img[contains(@src, '{{filename}}')]" parameterized="true"/>
<element name="productImageActive" type="text" selector=".product.media div[data-active=true] > img[src*='{{filename}}']" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<!--Create website, Sore adn Store View-->
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="adminCreateWebsite">
<argument name="newWebsiteName" value="secondWebsite"/>
<argument name="websiteCode" value="second_website"/>
<!--Create website, Store and Store View-->
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite">
<argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/>
<argument name="websiteCode" value="{{secondCustomWebsite.code}}"/>
</actionGroup>
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="adminCreateStore">
<argument name="website" value="secondWebsite"/>
<argument name="storeGroupName" value="secondStore"/>
<argument name="storeGroupCode" value="second_store"/>
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStoreGroup">
<argument name="website" value="{{secondCustomWebsite.name}}"/>
<argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/>
<argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/>
</actionGroup>
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="adminCreateStoreView">
<argument name="StoreGroup" value="customStoreTierPrice"/>
<argument name="customStore" value="customStoreView"/>
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView">
<argument name="StoreGroup" value="SecondStoreGroupUnique"/>
<argument name="customStore" value="SecondStoreUnique"/>
</actionGroup>

<!--Create Simple Product and Category -->
Expand Down Expand Up @@ -60,9 +60,7 @@
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickToOpenWebsiteSection"/>
<waitForPageLoad stepKey="waitForToOpenedWebsiteSection"/>
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
stepKey="seeSuccessMessage"/>
<actionGroup ref="saveProductForm" stepKey="saveProduct1"/>

<!-- Set filter to product name and product2 in website 2 only -->
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct2">
Expand All @@ -72,12 +70,10 @@
<argument name="product" value="$$createProduct2$$"/>
</actionGroup>
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{secondCustomWebsite.name}}"/>
</actionGroup>
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite1"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct1"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
stepKey="seeSuccessMessage1"/>
<actionGroup ref="saveProductForm" stepKey="saveProduct2"/>

<!-- Set filter to product name and product12 assigned to both websites 1 and 2 -->
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct12">
Expand All @@ -87,15 +83,13 @@
<argument name="product" value="$$createProduct12$$"/>
</actionGroup>
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites1">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{secondCustomWebsite.name}}"/>
</actionGroup>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct2"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
stepKey="seeSuccessMessage2"/>
<actionGroup ref="saveProductForm" stepKey="saveProduct3"/>
</before>
<after>
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
<argument name="websiteName" value="secondWebsite"/>
<argument name="websiteName" value="{{secondCustomWebsite.name}}"/>
</actionGroup>
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/>
<deleteData createDataKey="createProduct0" stepKey="deleteProduct"/>
Expand All @@ -107,7 +101,6 @@
</after>
<!-- Step 1-2: Open Category page and Set scope selector to All Store Views-->
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}"
stepKey="clickCategoryName"/>
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection"/>
Expand All @@ -126,17 +119,9 @@

<!-- Step 3: Set scope selector to Website1( Storeview for the Website 1) -->
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}"
stepKey="clickStoresList"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad1"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption('Default Store View')}}"
stepKey="clickStoreView"/>
<waitForElementVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="waitForPopup1"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="clickActionAccept"/>
<waitForElementNotVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="waitForNotVisibleModalAccept"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad2"/>
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="swichToDefaultStoreView">
<argument name="storeView" value="_defaultStore.name"/>
</actionGroup>
<grabTextFrom selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}"
stepKey="grabTextFromCategory1"/>
<assertRegExp expected="/\(2\)$/" expectedType="string" actual="$grabTextFromCategory1" actualType="variable"
Expand All @@ -154,18 +139,9 @@

<!-- Step 4: Set scope selector to Website2 ( StoreView for Website 2) -->
<scrollToTopOfPage stepKey="scrollToTopOfPage1"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}"
stepKey="clickStoresList1"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad3"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption('secondStoreView')}}"
stepKey="clickStoreView1"/>
<waitForElementVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="waitForPopup2"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="clickActionAccept1"/>
<waitForElementNotVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="waitForNotVisibleModalAccept1"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad4"/>
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="swichToSecondStoreView">
<argument name="storeView" value="SecondStoreUnique.name"/>
</actionGroup>
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection2"/>
<grabTextFrom selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}"
stepKey="grabTextFromCategory2"/>
Expand Down
Loading

0 comments on commit 75d3b00

Please sign in to comment.