Skip to content

Commit 8983fba

Browse files
committed
B2B-1645: Add MFTF test for MC-38325 & MC-38947
- Adding MFTF tests for importing Downloadable products
1 parent 63434d2 commit 8983fba

File tree

29 files changed

+899
-3
lines changed

29 files changed

+899
-3
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AwsS3AdminImportDownloadableProductsWithFileLinksTest" extends="AdminImportDownloadableProductsWithFileLinksTest">
12+
<annotations>
13+
<features value="AwsS3"/>
14+
<stories value="Import Products"/>
15+
<title value="S3 - Import Downloadable Products with File Links"/>
16+
<description value="Imports a .csv file containing a downloadable product with file links. Verifies that
17+
products are imported successfully."/>
18+
<severity value="MAJOR"/>
19+
<group value="importExport"/>
20+
<group value="remote_storage_aws_s3"/>
21+
<skip>
22+
<issueId value="MC-39280"/>
23+
</skip>
24+
</annotations>
25+
26+
<before>
27+
<!-- Enable AWS S3 Remote Storage -->
28+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/>
29+
</before>
30+
31+
<after>
32+
<!-- Disable AWS S3 Remote Storage -->
33+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
34+
</after>
35+
</test>
36+
</tests>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AwsS3AdminImportDownloadableProductsWithUrlLinksTest" extends="AdminImportDownloadableProductsWithUrlLinksTest">
12+
<annotations>
13+
<features value="AwsS3"/>
14+
<stories value="Import Products"/>
15+
<title value="S3 - Import Downloadable Products with Url Links"/>
16+
<description value="Imports a .csv file containing a downloadable product with url links. Verifies that
17+
products are imported successfully."/>
18+
<severity value="MAJOR"/>
19+
<group value="importExport"/>
20+
<group value="remote_storage_aws_s3"/>
21+
<skip>
22+
<issueId value="MC-39280"/>
23+
</skip>
24+
</annotations>
25+
26+
<before>
27+
<!-- Enable AWS S3 Remote Storage -->
28+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/>
29+
</before>
30+
31+
<after>
32+
<!-- Disable AWS S3 Remote Storage -->
33+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
34+
</after>
35+
</test>
36+
</tests>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="StorefrontNavigateToCategoryUrlActionGroup">
10+
<annotations>
11+
<description>Goes to the Storefront Category page for the provided Category URL.</description>
12+
</annotations>
13+
<arguments>
14+
<argument name="categoryUrl" type="string"/>
15+
</arguments>
16+
<amOnPage url="{{StorefrontCategoryPage.url(categoryUrl)}}" stepKey="goToStorefrontCategoryPage"/>
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml

Lines changed: 6 additions & 1 deletion
Large diffs are not rendered by default.

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
<data key="disabled">false</data>
2121
<requiredEntity type="ImageContent">TestImageContent</requiredEntity>
2222
</entity>
23+
<entity name="ApiProductAttributeMediaGalleryEntryTestImage2" type="ProductAttributeMediaGalleryEntry">
24+
<data key="media_type">image</data>
25+
<data key="label" unique="suffix">Adobe Base </data>
26+
<data key="position">1</data>
27+
<array key="types">
28+
<item>image</item>
29+
<item>small_image</item>
30+
<item>thumbnail</item>
31+
</array>
32+
<data key="disabled">false</data>
33+
<requiredEntity type="ImageContent">AdobeBaseContent</requiredEntity>
34+
</entity>
2335
<entity name="ApiProductAttributeMediaGalleryEntryMagentoLogo" type="ProductAttributeMediaGalleryEntry">
2436
<data key="media_type">image</data>
2537
<data key="label" unique="suffix">Magento Logo </data>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<element name="imageFileUpload" type="input" selector="#fileupload"/>
1414
<element name="imageUploadButton" type="button" selector="div.image div.fileinput-button"/>
1515
<element name="imageFile" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]" parameterized="true"/>
16+
<element name="imageFileRoleByImage" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]/ancestor::div[@data-role='image']//*[@data-role-code='{{roleCode}}']" parameterized="true"/>
17+
<element name="imageElement" type="text" selector="#media_gallery_content img"/>
1618
<element name="removeImageButton" type="button" selector=".action-remove"/>
1719
<element name="removeImageButtonForExactImage" type="button" selector="[id='media_gallery_content'] img[src*='{{imageName}}'] + div[class='actions'] button[class='action-remove']" parameterized="true"/>
1820
<element name="modalOkBtn" type="button" selector="button.action-primary.action-accept"/>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
1717
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
18+
<waitForPageLoad stepKey="waitForCheckout"/>
1819
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
1920
</actionGroup>
2021
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertDownloadableLinkInformationActionGroup">
12+
<annotations>
13+
<description>Verifies the data in for a downloadable link on the Edit Product page in admin.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="title" defaultValue="{{downloadableLink.title}}" type="string"/>
17+
<argument name="price" defaultValue="{{downloadableLink.price}}" type="string"/>
18+
<argument name="fileType" defaultValue="{{downloadableLink.file_type}}" type="string"/>
19+
<argument name="fileNameOrUrl" defaultValue="{{downloadableLink.file}}" type="string"/>
20+
<argument name="sampleType" defaultValue="{{downloadableLink.sample_type}}" type="string"/>
21+
<argument name="sampleFileNameOrUrl" defaultValue="{{downloadableLink.sample}}" type="string"/>
22+
<argument name="shareable" defaultValue="{{downloadableLink.shareable}}" type="string"/>
23+
<argument name="maxDownloads" defaultValue="0" type="string"/>
24+
<argument name="index" defaultValue="0" type="string"/>
25+
</arguments>
26+
<conditionalClick selector="{{AdminProductDownloadableSection.sectionHeader}}" dependentSelector="{{AdminProductDownloadableSection.sectionLinkGrid}}" visible="false" stepKey="expandDownloadableSection"/>
27+
<waitForElementVisible selector="{{AdminProductDownloadableSection.sectionLinkGrid}}" stepKey="waitForDownloadableLinks"/>
28+
<seeInField userInput="{{title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="seeTitle"/>
29+
<seeInField userInput="{{price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="seePrice"/>
30+
<seeInField userInput="{{fileType}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="seeFileType"/>
31+
<executeJS function="
32+
var element = document.evaluate(&quot;{{AdminProductDownloadableSection.linkFileNameOrUrl(index)}}&quot;, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
33+
if ( typeof element.singleNodeValue.value !== &quot;undefined&quot; ) {
34+
return element.singleNodeValue.value; }
35+
else {
36+
return element.singleNodeValue.innerText; };"
37+
stepKey="grabFileNameOrUrl"/>
38+
<assertStringContainsString stepKey="assertFileNameOrUrl">
39+
<actualResult type="variable">grabFileNameOrUrl</actualResult>
40+
<expectedResult type="string">{{fileNameOrUrl}}</expectedResult>
41+
</assertStringContainsString>
42+
<seeInField userInput="{{sampleType}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="seeSampleType"/>
43+
<executeJS function="
44+
var element = document.evaluate(&quot;{{AdminProductDownloadableSection.linkSampleFileNameOrUrl(index)}}&quot;, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
45+
if ( typeof element.singleNodeValue.value !== &quot;undefined&quot; ) {
46+
return element.singleNodeValue.value; }
47+
else {
48+
return element.singleNodeValue.innerText; };"
49+
stepKey="grabSampleFileNameOrUrl"/>
50+
<assertStringContainsString stepKey="assertSampleFileNameOrUrl">
51+
<actualResult type="variable">grabSampleFileNameOrUrl</actualResult>
52+
<expectedResult type="string">{{sampleFileNameOrUrl}}</expectedResult>
53+
</assertStringContainsString>
54+
<seeInField userInput="{{shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="seeShareable"/>
55+
<seeInField userInput="{{maxDownloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput(index)}}" stepKey="seeMaxDownloads"/>
56+
</actionGroup>
57+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertDownloadableSampleLinkInformationActionGroup">
12+
<annotations>
13+
<description>Verifies the data in for a downloadable sample link on the Edit Product page in admin.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="title" defaultValue="{{downloadableSampleFile.title}}" type="string"/>
17+
<argument name="fileType" defaultValue="{{downloadableSampleFile.file_type}}" type="string"/>
18+
<argument name="fileNameOrUrl" defaultValue="{{downloadableSampleFile.file}}" type="string"/>
19+
<argument name="index" defaultValue="0" type="string"/>
20+
</arguments>
21+
<conditionalClick selector="{{AdminProductDownloadableSection.sectionHeader}}" dependentSelector="{{AdminProductDownloadableSection.sectionLinkGrid}}" visible="false" stepKey="expandDownloadableSection"/>
22+
<waitForElementVisible selector="{{AdminProductDownloadableSection.sectionLinkGrid}}" stepKey="waitForDownloadableLinks"/>
23+
<seeInField userInput="{{title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="seeTitle"/>
24+
<seeInField userInput="{{fileType}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector(index)}}" stepKey="seeFileType"/>
25+
<executeJS function="
26+
var element = document.evaluate(&quot;{{AdminProductDownloadableSection.sampleFileNameOrUrl(index)}}&quot;, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
27+
if ( typeof element.singleNodeValue.value !== &quot;undefined&quot; ) {
28+
return element.singleNodeValue.value; }
29+
else {
30+
return element.singleNodeValue.innerText; };"
31+
stepKey="grabFileNameOrUrl"/>
32+
<assertStringContainsString stepKey="assertFileNameOrUrl">
33+
<actualResult type="variable">grabFileNameOrUrl</actualResult>
34+
<expectedResult type="string">{{fileNameOrUrl}}</expectedResult>
35+
</assertStringContainsString>
36+
</actionGroup>
37+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontNavigateToCustomerDownloadableProductsPageActionGroup">
12+
<annotations>
13+
<description>Navigates to the storefront My Downloadable Products page. Must be signed in as a customer.</description>
14+
</annotations>
15+
<amOnPage url="{{StorefrontCustomerDownloadableProductsPage.url}}" stepKey="navigateToImportPage"/>
16+
<see userInput="My Downloadable Products" selector="{{StorefrontCustomerAccountMainSection.pageTitle}}" stepKey="seeTitle"/>
17+
</actionGroup>
18+
</actionGroups>

0 commit comments

Comments
 (0)