Skip to content

Commit ff12921

Browse files
authored
Merge pull request #2 from magento-pangolin/MQE-683
MQE-683: [Deprecation] Only use more nested assertion syntax
2 parents 53de45d + 7066182 commit ff12921

File tree

5 files changed

+40
-16
lines changed

5 files changed

+40
-16
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeTabsActionGroup.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@
1717
<click selector="{{section.tabHeader(to)}}" stepKey="switchToTab"/>
1818
<waitForPageLoad stepKey="waitForPageLoad" time="30"/>
1919
<waitForElementVisible time="30" selector="{{section.tabHeaderItemActive(to)}}" stepKey="seeNewTabActive"/>
20-
<assertElementContainsAttribute selector="{{section.tabPanel(from)}}" attribute="aria-hidden" expectedValue="true" stepKey="assertOldTabHidden"/>
21-
<assertElementContainsAttribute selector="{{section.tabPanel(to)}}" attribute="aria-hidden" expectedValue="false" stepKey="assertNewTabVisible"/>
20+
<assertElementContainsAttribute stepKey="assertOldTabHidden">
21+
<expectedResult selector="{{section.tabPanel(from)}}" attribute="aria-hidden" type="string">true</expectedResult>
22+
</assertElementContainsAttribute>
23+
<assertElementContainsAttribute stepKey="assertNewTabVisible">
24+
<expectedResult selector="{{section.tabPanel(to)}}" attribute="aria-hidden" type="string">false</expectedResult>
25+
</assertElementContainsAttribute>
2226
</actionGroup>
2327
<actionGroup name="inlineEditTabItemName">
2428
<arguments>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderImageTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@
239239
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
240240
<waitForElementVisible selector="{{ImageOnStorefront.imageDisplay}}" stepKey="seeMainImageDisplayed"/>
241241
<waitForElementVisible selector="{{ImageOnStorefront.imageSource(PageBuilderImageProperty_JPG2.fileName)}}" stepKey="seeMainImageSource4"/>
242-
<assertElementContainsAttribute selector="{{ImageOnStorefront.imageElement('1')}}" attribute="style" expectedValue="max-width: 100%" stepKey="assertImageHasFullWidthStyle"/>
242+
<assertElementContainsAttribute stepKey="assertImageHasFullWidthStyle">
243+
<expectedResult selector="{{ImageOnStorefront.imageElement('1')}}" attribute="style" type="string">max-width: 100%</expectedResult>
244+
</assertElementContainsAttribute>
243245
<seeElementInDOM selector="{{ImageOnStorefront.imageLink('1', PageBuilderImageLinkProperty.value)}}" stepKey="seeImageLinkInDOM"/>
244246
<seeElementInDOM selector="{{ImageOnStorefront.imageLinkTarget('1', PageBuilderImageNewTab_True.stageValue)}}" stepKey="seeImageTargetInDOM"/>
245247
<seeElementInDOM selector="{{ImageOnStorefront.imageAltText('1', PageBuilderImageAltTextProperty.value)}}" stepKey="seeImageAltText"/>
@@ -250,7 +252,9 @@
250252
<resizeWindow width="767" height="1024" stepKey="resizeWindowToMobile"/>
251253
<dontSeeElement selector="{{ImageOnStorefront.imageElement('1')}}" stepKey="dontSeeMainImageOnMobile"/>
252254
<seeElement selector="{{ImageOnStorefront.imageElement('2')}}" stepKey="seeMobileImageElementOnMobile"/>
253-
<assertElementContainsAttribute selector="{{ImageOnStorefront.imageElement('2')}}" attribute="style" expectedValue="max-width: 100%" stepKey="assertMobileImageHasFullWidthStyle"/>
255+
<assertElementContainsAttribute stepKey="assertMobileImageHasFullWidthStyle">
256+
<expectedResult selector="{{ImageOnStorefront.imageElement('2')}}" attribute="style" type="string">max-width: 100%</expectedResult>
257+
</assertElementContainsAttribute>
254258
<see userInput="{{PageBuilderImageCaptionProperty.value}}" selector="{{ImageOnStorefront.imageCaption('1')}}" stepKey="seeCaptionDisplayedOnStorefrontMobile"/>
255259
<resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop"/>
256260
</test>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderSliderCommonTests.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,8 +1614,8 @@
16141614
<click selector="{{SliderOnStage.slideNavigationDot('1', '1')}}" stepKey="clickSlideOptionsMenu"/>
16151615
<waitForPageLoad stepKey="waitForPageLoadAfterClickingSlideNavigationDot" />
16161616
<seeElement selector="{{SlideOnBackend.optionsMenu('1')}}" stepKey="seeSlideOptionsMenu"/>
1617-
<assertElementContainsAttribute selector="{{SliderOnStage.slideNavigationDot('1', '1')}}" attribute="class" stepKey="assertFirstDotActive">
1618-
<expectedResult type="string">active</expectedResult>
1617+
<assertElementContainsAttribute stepKey="assertFirstDotActive">
1618+
<expectedResult selector="{{SliderOnStage.slideNavigationDot('1', '1')}}" attribute="class" type="string">active</expectedResult>
16191619
</assertElementContainsAttribute>
16201620
<see selector="{{SlideOnBackend.optionsMenu('1')}}" userInput="Slide 1" stepKey="seeSlideOptionsAppearWithSlide1DefaultTitle"/>
16211621
<!-- Update Slide 1 -->
@@ -1656,8 +1656,8 @@
16561656
<click selector="{{SliderOnStage.slideNavigationDot('1', '2')}}" stepKey="clickSlide2OptionsMenu"/>
16571657
<waitForPageLoad stepKey="waitForPageLoadAfterClickingSlideNavigationDot2" />
16581658
<seeElement selector="{{SlideOnBackend.optionsMenu('2')}}" stepKey="seeSlideOptionsMenu4"/>
1659-
<assertElementContainsAttribute selector="{{SliderOnStage.slideNavigationDot('1', '2')}}" attribute="class" stepKey="assertSecondDotActive">
1660-
<expectedResult type="string">active</expectedResult>
1659+
<assertElementContainsAttribute stepKey="assertSecondDotActive">
1660+
<expectedResult selector="{{SliderOnStage.slideNavigationDot('1', '2')}}" attribute="class" type="string">active</expectedResult>
16611661
</assertElementContainsAttribute>
16621662
<see userInput="Slide 2" selector="{{SlideOnBackend.optionsMenu('2')}}" stepKey="seeSlideOptionsAppearWithSlide2DefaultTitle"/>
16631663
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unFocusSlide2"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTabItemConfigurationTests.xml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@
5050
<see selector="{{TabOnStage.empty}}" userInput="Drag content types or columns here" stepKey="seeTabPlaceholder"/>
5151
<!-- User sees the first tab to be active and focused. -->
5252
<comment userInput="User sees the first tab to be active and focused." stepKey="AC4"/>
53-
<assertElementContainsAttribute selector="{{TabOnStage.tabPanel('1')}}" attribute="aria-expanded" expectedValue="true" stepKey="assertTab1ContentFocused"/>
54-
<assertElementContainsAttribute selector="{{TabOnStage.tabPanel('1')}}" attribute="aria-hidden" expectedValue="false" stepKey="assertTab1ContentVisible"/>
53+
<assertElementContainsAttribute stepKey="assertTab1ContentFocused">
54+
<expectedResult selector="{{TabOnStage.tabPanel('1')}}" attribute="aria-expanded" type="string">true</expectedResult>
55+
</assertElementContainsAttribute>
56+
<assertElementContainsAttribute stepKey="assertTab1ContentVisible">
57+
<expectedResult selector="{{TabOnStage.tabPanel('1')}}" attribute="aria-hidden" type="string">false</expectedResult>
58+
</assertElementContainsAttribute>
5559
<!-- User doesn't see the Tabs option panel -->
5660
<comment userInput="User doesn't see the Tabs option panel" stepKey="AC5"/>
5761
<dontSeeElement selector="{{TabsOnStage.tabsOptionsTitle}}" stepKey="dontSeeTabsOptionsAfterAddTabs"/>
@@ -595,8 +599,12 @@
595599
</actionGroup>
596600
<waitForElementVisible selector="{{TabOnStage.tabContent('2')}}" stepKey="waitForNewTabContent"/>
597601
<waitForElementVisible selector="{{TabOnStage.tabHeader('2')}}" stepKey="waitForNewTabHeader"/>
598-
<assertElementContainsAttribute selector="{{TabOnStage.tabPanel('1')}}" attribute="aria-hidden" expectedValue="true" stepKey="assertTab1ContentHidden"/>
599-
<assertElementContainsAttribute selector="{{TabOnStage.tabPanel('2')}}" attribute="aria-hidden" expectedValue="false" stepKey="assertTab2ContentVisible"/>
602+
<assertElementContainsAttribute stepKey="assertTab1ContentHidden">
603+
<expectedResult selector="{{TabOnStage.tabPanel('1')}}" attribute="aria-hidden" type="string">true</expectedResult>
604+
</assertElementContainsAttribute>
605+
<assertElementContainsAttribute stepKey="assertTab2ContentVisible">
606+
<expectedResult selector="{{TabOnStage.tabPanel('2')}}" attribute="aria-hidden" type="string">false</expectedResult>
607+
</assertElementContainsAttribute>
600608
<comment userInput="Update name, color, and min height for second tab" stepKey="AC6"/>
601609
<actionGroup ref="openPageBuilderEditPanelSmallByIndex" stepKey="openEditPanel2">
602610
<argument name="section" value="TabOnStage"/>
@@ -640,8 +648,12 @@
640648
<waitForElementVisible selector="{{TabOnStorefront.tabHeaderItemActive('1')}}" stepKey="waitForFirstTabHeader"/>
641649
<waitForPageLoad stepKey="waitForTabsInit" time="30"/>
642650
<waitForElementVisible selector="{{TabOnStorefront.container('1')}}" stepKey="waitForFirstTabContent"/>
643-
<assertElementContainsAttribute selector="{{TabOnStorefront.container('1')}}" attribute="aria-hidden" expectedValue="false" stepKey="assertTab1Visible"/>
644-
<assertElementContainsAttribute selector="{{TabOnStorefront.container('2')}}" attribute="aria-hidden" expectedValue="true" stepKey="assertTab2Hidden"/>
651+
<assertElementContainsAttribute stepKey="assertTab1Visible">
652+
<expectedResult selector="{{TabOnStorefront.container('1')}}" attribute="aria-hidden" type="string">false</expectedResult>
653+
</assertElementContainsAttribute>
654+
<assertElementContainsAttribute stepKey="assertTab2Hidden">
655+
<expectedResult selector="{{TabOnStorefront.container('2')}}" attribute="aria-hidden" type="string">true</expectedResult>
656+
</assertElementContainsAttribute>
645657
<comment userInput="User sees Tab 1 with background color and min height on Storefront" stepKey="AC14"/>
646658
<waitForElementVisible selector="{{TabOnStorefront.tabHeader('1')}}" stepKey="seeTabHeader1Storefront"/>
647659
<see selector="{{TabOnStorefront.tabHeader('1')}}" userInput="{{PageBuilderTabNameRandom1.value}}" stepKey="seeTab1TitleStorefront"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTabItemDeleteTests.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,12 @@
352352
<comment userInput="Second Tab becomes both active and focused" stepKey="AC3"/>
353353
<waitForPageLoad stepKey="waitForTabChangeAnimation" />
354354
<waitForElementVisible selector="{{TabOnStage.tabHeaderItemActive('2')}}" stepKey="seeTab2Active"/>
355-
<assertElementContainsAttribute selector="{{TabOnStage.tabPanel('1')}}" attribute="aria-hidden" expectedValue="true" stepKey="assertTab1Hidden"/>
356-
<assertElementContainsAttribute selector="{{TabOnStage.tabPanel('2')}}" attribute="aria-hidden" expectedValue="false" stepKey="assertTab2Visible"/>
355+
<assertElementContainsAttribute stepKey="assertTab1Hidden">
356+
<expectedResult selector="{{TabOnStage.tabPanel('1')}}" attribute="aria-hidden" type="string">true</expectedResult>
357+
</assertElementContainsAttribute>
358+
<assertElementContainsAttribute stepKey="assertTab2Visible">
359+
<expectedResult selector="{{TabOnStage.tabPanel('2')}}" attribute="aria-hidden" type="string">false</expectedResult>
360+
</assertElementContainsAttribute>
357361
</test>
358362
<test name="TabsDismissedCustomizedTabRemovalConfirmationPersistsSession">
359363
<annotations>

0 commit comments

Comments
 (0)