CMSActionGroup.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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="navigateToCreatedCMSPage">
  11. <arguments>
  12. <argument name="CMSPage" defaultValue=""/>
  13. </arguments>
  14. <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/>
  15. <waitForPageLoad stepKey="waitForPageLoad1"/>
  16. <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/>
  17. <waitForPageLoad stepKey="waitForPageLoad2"/>
  18. <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/>
  19. <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish" />
  20. <!-- Conditional Click again in case it goes from default state to ascending on first click -->
  21. <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/>
  22. <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish" />
  23. <click selector="{{CmsPagesPageActionsSection.select(CMSPage.identifier)}}" stepKey="clickSelectCreatedCMSPage" />
  24. <click selector="{{CmsPagesPageActionsSection.edit(CMSPage.identifier)}}" stepKey="navigateToCreatedCMSPage" />
  25. <waitForPageLoad stepKey="waitForPageLoad3"/>
  26. <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/>
  27. <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection" />
  28. </actionGroup>
  29. <actionGroup name="navigateToCreatedCMSBlockPage">
  30. <arguments>
  31. <argument name="CMSBlockPage" defaultValue=""/>
  32. </arguments>
  33. <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/>
  34. <waitForPageLoad stepKey="waitForPageLoad1"/>
  35. <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/>
  36. <waitForPageLoad stepKey="waitForPageLoad2"/>
  37. <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/>
  38. <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish" />
  39. <!-- Conditional Click again in case it goes from default state to ascending on first click -->
  40. <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/>
  41. <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish" />
  42. <click selector="{{BlockPageActionsSection.select(CMSBlockPage.identifier)}}" stepKey="clickSelectCreatedCMSBlock" />
  43. <click selector="{{BlockPageActionsSection.edit(CMSBlockPage.identifier)}}" stepKey="navigateToCreatedCMSBlock" />
  44. <waitForPageLoad stepKey="waitForPageLoad3"/>
  45. <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection" />
  46. </actionGroup>
  47. <actionGroup name="DeleteCMSBlockActionGroup">
  48. <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSPagesGrid"/>
  49. <waitForPageLoad stepKey="waitForPageLoad"/>
  50. <click selector="{{CmsPagesPageActionsSection.select(_defaultBlock.title)}}" stepKey="ClickOnSelect"/>
  51. <click selector="{{CmsPagesPageActionsSection.delete(_defaultBlock.title)}}" stepKey="ClickOnEdit"/>
  52. <waitForPageLoad stepKey="waitForPageLoad3"/>
  53. <click selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="ClickToConfirm"/>
  54. <waitForPageLoad stepKey="waitForPageLoad4"/>
  55. <see userInput="You deleted the block." stepKey="VerifyBlockIsDeleted"/>
  56. </actionGroup>
  57. <actionGroup name="AddStoreViewToCmsPage" extends="navigateToCreatedCMSPage">
  58. <arguments>
  59. <argument name="storeViewName" type="string"/>
  60. </arguments>
  61. <remove keyForRemoval="clickExpandContentTabForPage"/>
  62. <remove keyForRemoval="waitForLoadingMaskOfStagingSection"/>
  63. <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites" after="waitForPageLoad3"/>
  64. <waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="waitForStoreGridReload"/>
  65. <clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="clickStoreView"/>
  66. <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/>
  67. <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/>
  68. <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/>
  69. <waitForPageLoad stepKey="waitForPageLoad"/>
  70. <see userInput="You saved the page." stepKey="seeMessage"/>
  71. </actionGroup>
  72. <actionGroup name="saveAndCloseCMSBlockWithSplitButton">
  73. <waitForElementVisible selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForExpandSplitButtonToBeVisible" />
  74. <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/>
  75. <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/>
  76. <waitForPageLoad stepKey="waitForPageLoadAfterClickingSave" />
  77. <see userInput="You saved the block." stepKey="assertSaveBlockSuccessMessage"/>
  78. </actionGroup>
  79. <actionGroup name="navigateToStorefrontForCreatedPage">
  80. <arguments>
  81. <argument name="page" type="string"/>
  82. </arguments>
  83. <amOnPage url="{{page}}" stepKey="goToStorefront"/>
  84. <waitForPageLoad stepKey="waitForPageLoad"/>
  85. </actionGroup>
  86. <actionGroup name="saveCMSBlock">
  87. <waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/>
  88. <click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/>
  89. <waitForPageLoad stepKey="waitForPageLoad"/>
  90. <see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/>
  91. </actionGroup>
  92. <actionGroup name="saveAndContinueEditCmsPage">
  93. <waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveAndContinueVisibility"/>
  94. <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveAndContinueEditCmsPage"/>
  95. <waitForPageLoad stepKey="waitForCmsPageLoad"/>
  96. <waitForElementVisible time="1" selector="{{CmsNewPagePageActionsSection.cmsPageTitle}}" stepKey="waitForCmsPageSaveButton"/>
  97. <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
  98. </actionGroup>
  99. <actionGroup name="saveCmsPage">
  100. <waitForElementVisible selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForSplitButton"/>
  101. <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/>
  102. <waitForElementVisible selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="waitForSaveCmsPage"/>
  103. <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSaveCmsPage"/>
  104. <waitForElementVisible time="1" selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="waitForCmsPageSaveButton"/>
  105. <see userInput="You saved the page." selector="{{CmsPagesPageActionsSection.savePageSuccessMessage}}" stepKey="assertSavePageSuccessMessage"/>
  106. </actionGroup>
  107. <actionGroup name="setLayout">
  108. <arguments>
  109. <argument name="designSection"/>
  110. <argument name="layoutOption"/>
  111. </arguments>
  112. <waitForElementVisible selector="{{designSection.DesignTab}}" stepKey="waitForDesignTabVisible"/>
  113. <conditionalClick selector="{{designSection.DesignTab}}" dependentSelector="{{designSection.LayoutDropdown}}" visible="false" stepKey="clickOnDesignTab"/>
  114. <waitForPageLoad stepKey="waitForPageLoadDesignTab"/>
  115. <waitForElementVisible selector="{{designSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown" />
  116. <selectOption selector="{{designSection.LayoutDropdown}}" userInput="{{layoutOption}}" stepKey="selectLayout"/>
  117. </actionGroup>
  118. </actionGroups>