Skip to content

Commit e867a63

Browse files
MAGETWO-91974: [Testing] Create/Update Automated Tests
- change selectors and data names
1 parent 319f39b commit e867a63

File tree

5 files changed

+58
-117
lines changed

5 files changed

+58
-117
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/PageBuilder/ActionGroup/ButtonActionGroup.xml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@
7373
<arguments>
7474
<argument name="buttonGroupPage"/>
7575
<argument name="buttonItemPage"/>
76-
<argument name="index" defaultValue="1" type="string"/>
76+
<argument name="buttonGroupindex" defaultValue="1" type="string"/>
7777
<argument name="firstButtonIndex" defaultValue="1" type="string"/>
7878
<argument name="secondButtonIndex" defaultValue="2" type="string"/>
7979
</arguments>
80-
<waitForElementVisible selector="{{buttonGroupPage.base(index)}}" stepKey="waitForButtonGroup"/>
81-
<seeElementInDOM selector="{{buttonGroupPage.appearance(index, PageBuilderAppearancePropertyInline.value)}}" stepKey="seeButtonAppearance"/>
80+
<waitForElementVisible selector="{{buttonGroupPage.base(buttonGroupindex)}}" stepKey="waitForButtonGroup"/>
81+
<waitForElementVisible selector="{{buttonGroupPage.appearance(buttonGroupindex, PageBuilderButtonGroupAppearance_Inline.value)}}" stepKey="seeButtonAppearance"/>
8282
<waitForElementVisible selector="{{buttonItemPage.base(firstButtonIndex)}}" stepKey="waitForButton1"/>
83-
<executeJS function="{{buttonItemPage.xCoordinate(firstButtonIndex)}}" stepKey="xCoordinate1"/>
84-
<executeJS function="{{buttonItemPage.yCoordinate(firstButtonIndex)}}" stepKey="yCoordinate1"/>
83+
<executeJS function="return {{buttonItemPage.jsButtonSelector(firstButtonIndex)}}.getBoundingClientRect().x" stepKey="xCoordinate1"/>
84+
<executeJS function="return {{buttonItemPage.jsButtonSelector(firstButtonIndex)}}.getBoundingClientRect().y" stepKey="yCoordinate1"/>
8585
<waitForElementVisible selector="{{buttonItemPage.base(secondButtonIndex)}}" stepKey="waitForButton2"/>
86-
<executeJS function="{{buttonItemPage.xCoordinate(secondButtonIndex)}}" stepKey="xCoordinate2"/>
87-
<executeJS function="{{buttonItemPage.yCoordinate(secondButtonIndex)}}" stepKey="yCoordinate2"/>
86+
<executeJS function="return {{buttonItemPage.jsButtonSelector(secondButtonIndex)}}.getBoundingClientRect().x" stepKey="xCoordinate2"/>
87+
<executeJS function="return {{buttonItemPage.jsButtonSelector(secondButtonIndex)}}.getBoundingClientRect().y" stepKey="yCoordinate2"/>
8888
<assertGreaterThan stepKey="checkXCoordinates">
8989
<expectedResult type="variable">xCoordinate1</expectedResult>
9090
<actualResult type="variable">xCoordinate2</actualResult>
@@ -98,18 +98,18 @@
9898
<arguments>
9999
<argument name="buttonGroupPage"/>
100100
<argument name="buttonItemPage"/>
101-
<argument name="index" defaultValue="1" type="string"/>
101+
<argument name="buttonGroupindex" defaultValue="1" type="string"/>
102102
<argument name="firstButtonIndex" defaultValue="1" type="string"/>
103103
<argument name="secondButtonIndex" defaultValue="2" type="string"/>
104104
</arguments>
105-
<waitForElementVisible selector="{{buttonGroupPage.base(index)}}" stepKey="waitForButtonGroup"/>
106-
<seeElementInDOM selector="{{buttonGroupPage.appearance(index, PageBuilderAppearancePropertyInline.value)}}" stepKey="seeButtonAppearance"/>
105+
<waitForElementVisible selector="{{buttonGroupPage.base(buttonGroupindex)}}" stepKey="waitForButtonGroup"/>
106+
<waitForElementVisible selector="{{buttonGroupPage.appearance(buttonGroupindex, PageBuilderButtonGroupAppearance_Inline.value)}}" stepKey="seeButtonAppearance"/>
107107
<waitForElementVisible selector="{{buttonItemPage.base(firstButtonIndex)}}" stepKey="waitForButton1"/>
108-
<executeJS function="{{buttonItemPage.xCoordinate(firstButtonIndex)}}" stepKey="xCoordinate1"/>
109-
<executeJS function="{{buttonItemPage.yCoordinate(firstButtonIndex)}}" stepKey="yCoordinate1"/>
108+
<executeJS function="return {{buttonItemPage.jsButtonSelector(firstButtonIndex)}}.getBoundingClientRect().x" stepKey="xCoordinate1"/>
109+
<executeJS function="return {{buttonItemPage.jsButtonSelector(firstButtonIndex)}}.getBoundingClientRect().y" stepKey="yCoordinate1"/>
110110
<waitForElementVisible selector="{{buttonItemPage.base(secondButtonIndex)}}" stepKey="waitForButton2"/>
111-
<executeJS function="{{buttonItemPage.xCoordinate(secondButtonIndex)}}" stepKey="xCoordinate2"/>
112-
<executeJS function="{{buttonItemPage.yCoordinate(secondButtonIndex)}}" stepKey="yCoordinate2"/>
111+
<executeJS function="return {{buttonItemPage.jsButtonSelector(secondButtonIndex)}}.getBoundingClientRect().x" stepKey="xCoordinate2"/>
112+
<executeJS function="return {{buttonItemPage.jsButtonSelector(secondButtonIndex)}}.getBoundingClientRect().y" stepKey="yCoordinate2"/>
113113
<assertGreaterThanOrEqual stepKey="checkXCoordinates">
114114
<expectedResult type="variable">xCoordinate1</expectedResult>
115115
<actualResult type="variable">xCoordinate2</actualResult>
@@ -123,18 +123,18 @@
123123
<arguments>
124124
<argument name="buttonGroupPage"/>
125125
<argument name="buttonItemPage"/>
126-
<argument name="index" defaultValue="1" type="string"/>
126+
<argument name="buttonGroupindex" defaultValue="1" type="string"/>
127127
<argument name="firstButtonIndex" defaultValue="1" type="string"/>
128128
<argument name="secondButtonIndex" defaultValue="2" type="string"/>
129129
</arguments>
130-
<waitForElementVisible selector="{{buttonGroupPage.base(index)}}" stepKey="waitForButtonGroup"/>
131-
<seeElementInDOM selector="{{buttonGroupPage.appearance(index, PageBuilderAppearancePropertyStacked.value)}}" stepKey="seeButtonAppearance"/>
130+
<waitForElementVisible selector="{{buttonGroupPage.base(buttonGroupindex)}}" stepKey="waitForButtonGroup"/>
131+
<waitForElementVisible selector="{{buttonGroupPage.appearance(buttonGroupindex, PageBuilderButtonGroupAppearance_Stacked.value)}}" stepKey="seeButtonAppearance"/>
132132
<waitForElementVisible selector="{{buttonItemPage.base(firstButtonIndex)}}" stepKey="waitForButton1"/>
133-
<executeJS function="{{buttonItemPage.xCoordinate(firstButtonIndex)}}" stepKey="xCoordinate1"/>
134-
<executeJS function="{{buttonItemPage.yCoordinate(firstButtonIndex)}}" stepKey="yCoordinate1"/>
133+
<executeJS function="return {{buttonItemPage.jsButtonSelector(firstButtonIndex)}}.getBoundingClientRect().x" stepKey="xCoordinate1"/>
134+
<executeJS function="return {{buttonItemPage.jsButtonSelector(firstButtonIndex)}}.getBoundingClientRect().y" stepKey="yCoordinate1"/>
135135
<waitForElementVisible selector="{{buttonItemPage.base(secondButtonIndex)}}" stepKey="waitForButton2"/>
136-
<executeJS function="{{buttonItemPage.xCoordinate(secondButtonIndex)}}" stepKey="xCoordinate2"/>
137-
<executeJS function="{{buttonItemPage.yCoordinate(secondButtonIndex)}}" stepKey="yCoordinate2"/>
136+
<executeJS function="return {{buttonItemPage.jsButtonSelector(secondButtonIndex)}}.getBoundingClientRect().x" stepKey="xCoordinate2"/>
137+
<executeJS function="return {{buttonItemPage.jsButtonSelector(secondButtonIndex)}}.getBoundingClientRect().y" stepKey="yCoordinate2"/>
138138
<assertEquals stepKey="checkXCoordinates">
139139
<expectedResult type="variable">xCoordinate1</expectedResult>
140140
<actualResult type="variable">xCoordinate2</actualResult>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/PageBuilder/Data/ButtonData.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@
7575
<data key="fieldName">button_text</data>
7676
<data key="value">Last</data>
7777
</entity>
78-
<entity name="PageBuilderButtonItemText_Long" type="pagebuilder_button_item_text_property">
79-
<data key="name">Button Text</data>
80-
<data key="section">content</data>
81-
<data key="fieldName">button_text</data>
82-
<data key="value">Long button text Long button text Long button text</data>
83-
</entity>
8478
<!-- Button Type -->
8579
<entity name="PageBuilderButtonItemType_Primary" type="pagebuilder_button_item_type_property">
8680
<data key="name">Button Type</data>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/PageBuilder/Data/ButtonsData.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
1111
<!-- Button Group Appearance -->
12-
<entity name="PageBuilderAppearancePropertyInline" type="pagebuilder_appearance_property">
12+
<entity name="PageBuilderButtonGroupAppearance_Inline" type="pagebuilder_button_group_appearance">
1313
<data key="name">Appearance</data>
1414
<data key="section">appearance_fieldset</data>
1515
<data key="fieldName">appearance</data>
1616
<data key="value">inline</data>
1717
</entity>
18-
<entity name="PageBuilderAppearancePropertyStacked" type="pagebuilder_appearance_property">
18+
<entity name="PageBuilderButtonGroupAppearance_Stacked" type="pagebuilder_button_group_appearance">
1919
<data key="name">Appearance</data>
2020
<data key="section">appearance_fieldset</data>
2121
<data key="fieldName">appearance</data>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/PageBuilder/Section/PageBuilderButtonsSection.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
<element name="base" type="button" selector="(//div[contains(@class,'pagebuilder-button-item')])[{{arg1}}]//a[contains(@class,'pagebuilder-button')]" parameterized="true"/>
4949
<element name="emptyButtonItemElement" type="button" selector="(//div[contains(@class,'pagebuilder-button-item')])[{{arg1}}]//a[contains(@class,'pagebuilder-button')]//span[contains(@class,'placeholder-text') and not(text())]" parameterized="true"/>
5050
<element name="editableButtonItemElement" type="button" selector="(//div[contains(@class,'pagebuilder-button-item')])[{{arg1}}]//a[contains(@class,'pagebuilder-button')]//span[contains(@contenteditable,'true')]" parameterized="true"/>
51-
<element name="xCoordinate" type="text" selector="return document.querySelectorAll('.pagebuilder-button-item')[{{arg1}}-1].getBoundingClientRect().x" parameterized="true"/>
52-
<element name="yCoordinate" type="text" selector="return document.querySelectorAll('.pagebuilder-button-item')[{{arg1}}-1].getBoundingClientRect().y" parameterized="true"/>
51+
<element name="jsButtonSelector" type="text" selector="document.querySelectorAll('.pagebuilder-button-item')[{{arg1}}-1]" parameterized="true"/>
5352
<!-- Content Configuration -->
5453
<element name="buttonItemText" type="button" selector="(//div[contains(@class,'pagebuilder-button-item')])[{{arg1}}]//a[contains(@class,'pagebuilder-button')]//span[contains(.,'{{arg2}}')]" parameterized="true"/>
5554
<element name="buttonItemType" type="button" selector="(//div[contains(@class,'pagebuilder-button-item')])[{{arg1}}]//a[@class='{{arg2}}']" parameterized="true"/>
@@ -70,8 +69,7 @@
7069
<element name="allButtons" type="button" selector="//div[@data-role='button-item']"/>
7170
<element name="base" type="button" selector="(//div[@data-role='button-item'])[{{arg1}}]" parameterized="true"/>
7271
<element name="emptyButtonItemElement" type="button" selector="(//div[@data-role='button-item'])[{{arg1}}]//a//span[not(text())]" parameterized="true"/>
73-
<element name="xCoordinate" type="text" selector="return document.querySelectorAll('div[data-role=\'button-item\']')[{{arg1}}-1].getBoundingClientRect().x" parameterized="true"/>
74-
<element name="yCoordinate" type="text" selector="return document.querySelectorAll('div[data-role=\'button-item\']')[{{arg1}}-1].getBoundingClientRect().y" parameterized="true"/>
72+
<element name="jsButtonSelector" type="text" selector="document.querySelectorAll('div[data-role=\'button-item\']')[{{arg1}}-1]" parameterized="true"/>
7573
<!-- Content Configuration -->
7674
<element name="buttonItemText" type="button" selector="(//div[@data-role='button-item'])[{{arg1}}]//a//span[contains(.,'{{arg2}}')]" parameterized="true"/>
7775
<element name="buttonItemType" type="button" selector="(//div[@data-role='button-item'])[{{arg1}}]//a[@class='{{arg2}}']" parameterized="true"/>

0 commit comments

Comments
 (0)