Skip to content

Commit 3d81581

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-90367' into 2.2-develop-pr30
2 parents ed98984 + 9b3f071 commit 3d81581

11 files changed

+65
-38
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<th scope="row" class="cell label remove"><span><?= /* @escapeNotVerified */ __('Remove Product') ?></span></th>
3131
<?php endif; ?>
3232
<td class="cell remove product hidden-print">
33-
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
33+
<?php $compareHelper = $this->helper(\Magento\Catalog\Helper\Product\Compare::class);?>
3434
<a href="#" data-post='<?= /* @escapeNotVerified */ $compareHelper->getPostDataRemove($item) ?>'
3535
class="action delete" title="<?= /* @escapeNotVerified */ __('Remove Product') ?>">
3636
<span><?= /* @escapeNotVerified */ __('Remove Product') ?></span>
@@ -42,7 +42,7 @@
4242
<tbody>
4343
<tr>
4444
<?php $index = 0; ?>
45-
<?php $helper = $this->helper('Magento\Catalog\Helper\Output'); ?>
45+
<?php $helper = $this->helper(\Magento\Catalog\Helper\Output::class); ?>
4646
<?php /** @var $item \Magento\Catalog\Model\Product */ ?>
4747
<?php foreach ($block->getItems() as $item): ?>
4848
<?php if ($index++ == 0): ?>
@@ -62,7 +62,7 @@
6262
<div class="product-item-actions hidden-print">
6363
<div class="actions-primary">
6464
<?php if ($item->isSaleable()): ?>
65-
<form data-role="tocart-form" action="<?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddToCartUrl($item) ?>" method="post">
65+
<form data-role="tocart-form" action="<?= /* @escapeNotVerified */ $this->helper(\Magento\Catalog\Helper\Product\Compare::class)->getAddToCartUrl($item) ?>" method="post">
6666
<?= $block->getBlockHtml('formkey') ?>
6767
<button type="submit" class="action tocart primary">
6868
<span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
@@ -76,7 +76,7 @@
7676
<?php endif; ?>
7777
<?php endif; ?>
7878
</div>
79-
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?>
79+
<?php if ($this->helper(\Magento\Wishlist\Helper\Data::class)->isAllow()) : ?>
8080
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
8181
<a href="#" data-post='<?= /* @escapeNotVerified */ $block->getAddToWishlistParams($item) ?>' class="action towishlist" data-action="add-to-wishlist">
8282
<span><?= /* @escapeNotVerified */ __('Add to Wish List') ?></span>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/StorefrontCompareActionGroup.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@
3434
<arguments>
3535
<argument name="productVar"/>
3636
</arguments>
37-
<waitForElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName(productVar.name)}}" stepKey="waitForProduct"/>
37+
<waitForElement selector="{{StorefrontComparisonSidebarSection.productTitleByName(productVar.name)}}" stepKey="waitForProduct"/>
3838
</actionGroup>
3939

4040
<!-- Open and check comparison page -->
4141
<actionGroup name="StorefrontOpenAndCheckComparisionActionGroup">
42-
<click selector="{{StorefrontComparisonSidebarSection.Compare}}" stepKey="clickCompare"/>
42+
<click selector="{{StorefrontComparisonSidebarSection.compare}}" stepKey="clickCompare"/>
4343
<waitForLoadingMaskToDisappear stepKey="waitForComparePageloaded" />
4444
<seeInCurrentUrl url="{{StorefrontProductComparePage.url}}" stepKey="checkUrl"/>
4545
<seeInTitle userInput="Products Comparison List" stepKey="assertPageNameInTitle"/>
46-
<see userInput="Compare Products" selector="{{StorefrontProductCompareMainSection.PageName}}" stepKey="assertPageName"/>
46+
<see userInput="Compare Products" selector="{{StorefrontProductCompareMainSection.pageName}}" stepKey="assertPageName"/>
4747
</actionGroup>
4848

4949
<!-- Check the simple product in comparison page -->
5050
<actionGroup name="StorefrontCheckCompareSimpleProductActionGroup">
5151
<arguments>
5252
<argument name="productVar"/>
5353
</arguments>
54-
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}" stepKey="assertProductName"/>
55-
<see userInput="${{productVar.price}}.00" selector="{{StorefrontProductCompareMainSection.ProductPriceByName(productVar.name)}}" stepKey="assertProductPrice1"/>
56-
<see userInput="{{productVar.sku}}" selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName('SKU', productVar.name)}}" stepKey="assertProductPrice2"/>
57-
<seeElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartByName(productVar.name)}}" stepKey="assertProductAddToCart"/>
54+
<seeElement selector="{{StorefrontProductCompareMainSection.productLinkByName(productVar.name)}}" stepKey="assertProductName"/>
55+
<see userInput="${{productVar.price}}.00" selector="{{StorefrontProductCompareMainSection.productPriceByName(productVar.name)}}" stepKey="assertProductPrice1"/>
56+
<see userInput="{{productVar.sku}}" selector="{{StorefrontProductCompareMainSection.productAttributeByCodeAndProductName('SKU', productVar.name)}}" stepKey="assertProductPrice2"/>
57+
<seeElement selector="{{StorefrontProductCompareMainSection.productAddToCartByName(productVar.name)}}" stepKey="assertProductAddToCart"/>
5858
</actionGroup>
5959

6060
<!-- Clear the compare list -->

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductAttributeSetGridPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
10-
<page name="AdminProductAttributeSetGridPage" url="catalog/product_set/" area="admin" module="ProductAttributeSet">
10+
<page name="AdminProductAttributeSetGridPage" url="catalog/product_set/" area="admin" module="Magento_Catalog">
1111
<section name="AdminProductAttributeSetGridSection"/>
1212
</page>
1313
</pages>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminProductAttributeGroupSection">
12+
<element name="folderName" type="text" selector="//span[text()='{{var1}}']" parameterized="true"/>
13+
</section>
14+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductAttributeSetGridSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductAttributeSetGridSection">
12-
<element name="AttributeSetName" type="text" selector="//td[contains(text(), '{{var1}}')]" parameterized="true"/>
12+
<element name="attributeSetName" type="text" selector="//td[contains(text(), '{{var1}}')]" parameterized="true"/>
1313
</section>
1414
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductAttributeSetSection.xml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11-
<section name="AttributeSetSection">
12-
<element name="Save" type="button" selector="button[title='Save']" />
11+
<section name="AdminProductAttributeSetSection">
12+
<element name="save" type="button" selector="button[title='Save']" />
1313
</section>
14-
<section name="UnassignedAttributes">
15-
<element name="ProductAttributeName" type="text" selector="//span[text()='{{var1}}']" parameterized="true"/>
16-
</section>
17-
<section name="Group">
18-
<element name="FolderName" type="text" selector="//span[text()='{{var1}}']" parameterized="true"/>
19-
</section>
20-
</sections>
14+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminProductAttributeUnassignedSection">
12+
<element name="productAttributeName" type="text" selector="//span[text()='{{var1}}']" parameterized="true"/>
13+
</section>
14+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontComparisonSidebarSection.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="StorefrontComparisonSidebarSection">
12-
<element name="Compare" type="button" selector="//main//div[contains(@class, 'block-compare')]//a[contains(@class, 'action compare')]"/>
13-
<element name="ClearAll" type="button" selector="//main//div[contains(@class, 'block-compare')]//a[contains(@class, 'action clear')]"/>
14-
<element name="ProductTitleByName" type="button" selector="//main//ol[@id='compare-items']//a[@class='product-item-link'][text()='{{var1}}']" parameterized="true"/>
15-
<element name="NoItemsMessage" type="text" selector="//main//div[contains(@class, 'block-compare')]//div[@class='empty']"/>
12+
<element name="compare" type="button" selector="div.block-compare a.compare"/>
13+
<element name="clearAll" type="button" selector="div.block-compare a.clear"/>
14+
<element name="productTitleByName" type="button" selector="//main//ol[@id='compare-items']//a[@class='product-item-link'][text()='{{var1}}']" parameterized="true"/>
15+
<element name="noItemsMessage" type="text" selector="div.block-compare div.empty"/>
1616
</section>
1717
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontProductCompareMainSection.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="StorefrontProductCompareMainSection">
12-
<element name="PageName" type="text" selector="//*[@id='maincontent']//h1//span"/>
13-
<element name="ProductLinkByName" type="button" selector="//*[@id='product-comparison']//tr//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]" parameterized="true"/>
14-
<element name="ProductPriceByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//span[@class='price']" parameterized="true"/>
15-
<element name="ProductImageByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//img[@class='product-image-photo']" parameterized="true"/>
16-
<element name="ProductAttributeByCodeAndProductName" type="text" selector="//*[@id='product-comparison']//tr[.//th[./span[contains(text(), '{{var1}}')]]]//td[count(//*[@id='product-comparison']//tr//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var2}}')]]/preceding-sibling::td)+1]/div" parameterized="true"/>
12+
<element name="pageName" type="text" selector="#maincontent h1 span"/>
13+
<element name="productLinkByName" type="button" selector="//*[@id='product-comparison']//tr//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]" parameterized="true"/>
14+
<element name="productPriceByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//span[@class='price']" parameterized="true"/>
15+
<element name="productImageByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//img[@class='product-image-photo']" parameterized="true"/>
16+
<element name="productAttributeByCodeAndProductName" type="text" selector="//*[@id='product-comparison']//tr[.//th[./span[contains(text(), '{{var1}}')]]]//td[count(//*[@id='product-comparison']//tr//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var2}}')]]/preceding-sibling::td)+1]/div" parameterized="true"/>
17+
<element name="productAttributeByName" type="text" selector="//table[@id='product-comparison']/tbody/tr/th/*[contains(text(),'{{name}}')]" parameterized="true"/>
1718
</section>
1819
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<description value="Product attribute should not be visible on the product compare page if it is empty for all products that are being compared, not even displayed as N/A"/>
1515
<severity value="MAJOR"/>
1616
<testCaseId value="MAGETWO-92271"/>
17-
<group value="productCompare1"/>
17+
<group value="productCompare"/>
1818
</annotations>
1919
<before>
2020
<createData entity="productAttributeWithDropdownTwoOptions" stepKey="createProductAttribute"/>
@@ -33,14 +33,16 @@
3333
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
3434
</after>
3535
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
36+
<waitForPageLoad stepKey="waitLoginAsAdmin"/>
3637
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/>
37-
<click selector="{{AdminProductAttributeSetGridSection.AttributeSetName('Default')}}" stepKey="chooseDefaultAttributeSet"/>
38+
<click selector="{{AdminProductAttributeSetGridSection.attributeSetName('Default')}}" stepKey="chooseDefaultAttributeSet"/>
3839
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
39-
<dragAndDrop selector1="{{UnassignedAttributes.ProductAttributeName('testattribute')}}" selector2="{{Group.FolderName('Product Details')}}" stepKey="moveProductAttributeToGroup"/>
40-
<click selector="{{AttributeSetSection.Save}}" stepKey="saveAttributeSet"/>
40+
<dragAndDrop selector1="{{AdminProductAttributeUnassignedSection.productAttributeName('testattribute')}}" selector2="{{AdminProductAttributeGroupSection.folderName('Product Details')}}" stepKey="moveProductAttributeToGroup"/>
41+
<click selector="{{AdminProductAttributeSetSection.save}}" stepKey="saveAttributeSet"/>
4142
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear" />
4243
<seeElement selector=".message-success" stepKey="assertSuccess"/>
4344
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCache"/>
45+
<waitForPageLoad stepKey="waitClearCache"/>
4446
<amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront1"/>
4547
<!-- View Simple Product 1 -->
4648
<comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="goProductPageOnStorefront1"/>
@@ -49,6 +51,7 @@
4951
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="compareAddSimpleProduct1ToCompare">
5052
<argument name="productVar" value="$$createSimpleProduct1$$"/>
5153
</actionGroup>
54+
<waitForPageLoad stepKey="waitAddSimpleProduct1AddedToCompare"/>
5255
<amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront2"/>
5356
<!-- View Simple Product 2 -->
5457
<comment userInput="View simple product 2" stepKey="commentViewSimpleProduct2" after="goProductPageOnStorefront2"/>
@@ -57,6 +60,7 @@
5760
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="compareAddSimpleProduct2ToCompare">
5861
<argument name="productVar" value="$$createSimpleProduct2$$"/>
5962
</actionGroup>
63+
<waitForPageLoad stepKey="waitAddSimpleProduct2AddedToCompare"/>
6064
<amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront3"/>
6165
<!-- Check products in comparison sidebar -->
6266
<!-- Check simple product 1 in comparison sidebar -->
@@ -75,7 +79,7 @@
7579
<actionGroup ref="StorefrontCheckCompareSimpleProductActionGroup" stepKey="compareAssertSimpleProduct1InComparison" after="compareOpenComparePage">
7680
<argument name="productVar" value="$$createSimpleProduct1$$"/>
7781
</actionGroup>
78-
<seeElement selector="//table[@id='product-comparison']/tbody/tr/th/*[contains(text(),'SKU')]" stepKey="seeCompareAttribute1"/>
79-
<dontSeeElement selector="//table[@id='product-comparison']/tbody/tr/th/*[contains(text(),'testattribute')]" stepKey="seeCompareAttribute2"/>
82+
<seeElement selector="{{StorefrontProductCompareMainSection.productAttributeByName('SKU')}}" stepKey="seeCompareAttributeSku"/>
83+
<dontSeeElement selector="{{StorefrontProductCompareMainSection.productAttributeByName('testattribute')}}" stepKey="dontSeeCompareTestAttribute"/>
8084
</test>
8185
</tests>

0 commit comments

Comments
 (0)