You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
4.2 KiB

  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"
  9. xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
  10. <actionGroup name="AdminAssertDownloadableLinkInformationActionGroup">
  11. <annotations>
  12. <description>Verifies the data for a downloadable link on the Edit Product page in admin.</description>
  13. </annotations>
  14. <arguments>
  15. <argument name="title" defaultValue="{{downloadableLink.title}}" type="string"/>
  16. <argument name="price" defaultValue="{{downloadableLink.price}}" type="string"/>
  17. <argument name="fileType" defaultValue="{{downloadableLink.file_type}}" type="string"/>
  18. <argument name="fileNameOrUrl" defaultValue="{{downloadableLink.file}}" type="string"/>
  19. <argument name="sampleType" defaultValue="{{downloadableLink.sample_type}}" type="string"/>
  20. <argument name="sampleFileNameOrUrl" defaultValue="{{downloadableLink.sample}}" type="string"/>
  21. <argument name="shareable" defaultValue="{{downloadableLink.shareable}}" type="string"/>
  22. <argument name="maxDownloads" defaultValue="0" type="string"/>
  23. <argument name="index" defaultValue="0" type="string"/>
  24. </arguments>
  25. <conditionalClick selector="{{AdminProductDownloadableSection.sectionHeader}}" dependentSelector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" visible="false" stepKey="expandDownloadableSection"/>
  26. <waitForElementVisible selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="waitForDownloadableLinks"/>
  27. <seeInField userInput="{{title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="seeTitle"/>
  28. <seeInField userInput="{{price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="seePrice"/>
  29. <seeInField userInput="{{fileType}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="seeFileType"/>
  30. <executeJS function="
  31. var element = document.evaluate(&quot;{{AdminProductDownloadableSection.linkFileNameOrUrl(index)}}&quot;, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  32. if ( typeof element.singleNodeValue.value !== &quot;undefined&quot; ) {
  33. return element.singleNodeValue.value; }
  34. else {
  35. return element.singleNodeValue.innerText; };"
  36. stepKey="grabFileNameOrUrl"/>
  37. <assertStringContainsString stepKey="assertFileNameOrUrl">
  38. <actualResult type="variable">grabFileNameOrUrl</actualResult>
  39. <expectedResult type="string">{{fileNameOrUrl}}</expectedResult>
  40. </assertStringContainsString>
  41. <seeInField userInput="{{sampleType}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="seeSampleType"/>
  42. <executeJS function="
  43. var element = document.evaluate(&quot;{{AdminProductDownloadableSection.linkSampleFileNameOrUrl(index)}}&quot;, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  44. if ( typeof element.singleNodeValue.value !== &quot;undefined&quot; ) {
  45. return element.singleNodeValue.value; }
  46. else {
  47. return element.singleNodeValue.innerText; };"
  48. stepKey="grabSampleFileNameOrUrl"/>
  49. <assertStringContainsString stepKey="assertSampleFileNameOrUrl">
  50. <actualResult type="variable">grabSampleFileNameOrUrl</actualResult>
  51. <expectedResult type="string">{{sampleFileNameOrUrl}}</expectedResult>
  52. </assertStringContainsString>
  53. <seeInField userInput="{{shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="seeShareable"/>
  54. <seeInField userInput="{{maxDownloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput(index)}}" stepKey="seeMaxDownloads"/>
  55. </actionGroup>
  56. </actionGroups>