Skip to content

MQE-1033: Validate duplicate element names in the same file (Section, Data, Metadata, Page) #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<element name="openPageBuilderCatalog" type="button" selector="[data-index='description'] button.action-default"/>
<element name="openFullScreen" type="button" selector="//i[@class='icon-pagebuilder-fullscreen']"/>
<element name="exitFullScreen" type="button" selector="//i[@class='icon-pagebuilder-fullscreen-exit']"/>
<element name="stageLoading" type="button" selector="div.pagebuilder-stage-loading"/>
<element name="stageWrapper" type="button" selector="//div[@class='pagebuilder-stage-wrapper']"/>
<element name="stageWrapperFullScreen" type="button" selector="div.pagebuilder-stage-wrapper.stage-full-screen"/>
<element name="searchField" type="input" selector='//*[@id="pagebuilder-panel"]/div[1]/a'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@
<element name="panelFieldOptions" type="input" selector='//div[@data-index="{{arg1}}"]/descendant::*[@name="{{arg2}}"]/option' parameterized="true"/>
<element name="panelFieldPlaceholderText" type="text" selector='//div[@data-index="{{arg1}}"]/descendant::*[@name="{{arg2}}" and @placeholder="{{arg3}}"]' parameterized="true"/>
<element name="panelFieldNoPlaceholderText" type="input" selector='//div[@data-index="{{arg1}}"]/descendant::*[@name="{{arg2}}" and not(@placeholder)]' parameterized="true"/>
<element name="panelFieldAfterLabelText" type="text" selector="//div[@data-index='{{arg1}}']//span[@data-bind='text: addafter' and .='{{arg2}}']" parameterized="true"/>
<element name="panelFieldNoAfterLabelText" type="text" selector="//div[@data-index='{{arg1}}']//span[@data-bind='text: addafter']" parameterized="true"/>
<element name="panelFieldAfterLabelText" type="text" selector="//div[@data-index='{{arg1}}']//span[@data-bind='text: addafter' and .='{{arg2}}']" parameterized="true"/>
<element name="panelFieldAfterLabelText" type="text" selector="//div[@data-index='{{arg1}}']//span[@data-bind='text: addafter' and .='{{arg2}}']" parameterized="true"/>
<element name="fileUploadButton" type="button" selector='.file-uploader-button'/>
<element name="uploadBackgroundImage" type="input" selector='.admin__field-control .file-uploader-area input[name="{{arg1}}"]' parameterized="true"/>
<element name="panelFieldUploadSummary" type="input" selector='.file-uploader-summary .file-uploader-preview .preview-image.preview-link[title="{{arg1}}"] img' parameterized="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
<element name="DisclaimerMessage" type="text" selector="//aside[@data-type='popup']//div[@class='modal-inner-wrap']"/>
<element name="CancelBtn" type="button" selector=".action-pagebuilder-cancel"/>
<element name="TurnOffBtn" type="button" selector=".action-accept"/>
<element name="DisclaimerMessage" type="text" selector="//aside[@data-type='popup']//div[@class='modal-inner-wrap']"/>
<element name="CancelBtn" type="button" selector=".action-pagebuilder-cancel"/>
<element name="TurnOffBtn" type="button" selector=".action-accept"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,13 @@
<element name="posterOverlay" type="button" selector=".pagebuilder-poster-overlay"/>
</section>
<section name="SlideOnFrontend">
<element name="slide" type="button" selector="(//div[@data-role='slide'])[{{arg1}}]" parameterized="true"/>
<element name="slideWithArg" type="button" selector="(//div[@data-role='slide'])[{{arg1}}]" parameterized="true"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinBKozan why was the above deleted & this one added but no tests or action groups that use the parameterized selectors updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted all exact duplicates, and renamed this one as it had its own selector.
I can delete it as well if you think I should.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinBKozan no I'm saying you renamed the selector but did not update the tests that were using this selector (tests that were passing an argument to "slide". I think if you do a Find In Path for ".slide(" you should find all the elements that need to be updated to use this new element name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. This is weird, as this contradicts how I understood MFTF to read elements (it's supposed to read sequentially, so the second slide element should overwrite this one).
Let me go back and investigate this.

Copy link
Contributor Author

@KevinBKozan KevinBKozan Jun 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhaecker So yes, my assumption is correct. The second slide overwrites the first slide, and all of the actions that use SlideOnFrontend.slide('1') resolve to the slide with no parameters (meaning my changes have no effect on the test's execution). It doesn't seem MFTF has a check if you're passing in params to an unparameterized argument (just the other way around).

My goal in this PR is simply to make sure you guys don't have dupes, which would cause generation errors in MFTF 2.3.0, so I wanted to keep my changes as concise as possible so as to not affect test execution (and leave that to you guys, who know how and what should be going on in these tests).

In light of that wall of text, what do you want me to do here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok no worries. i'll create a jira ticket for pagebuilder people to fix the issue so you dont have to worry about tests failing ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thank you very much!

<element name="slideName" type="text" selector="[data-slick-index='{{arg1}}'] div.pagebuilder-mobile-hidden.pagebuilder-slide-wrapper div div h3" parameterized="true"/>
<element name="slideContent" type="text" selector="[data-slick-index='{{arg1}}'] div.pagebuilder-mobile-hidden.pagebuilder-slide-wrapper div div div p" parameterized="true"/>
<element name="slideButtonText" type="text" selector="[data-slick-index='{{arg1}}'] div.pagebuilder-mobile-hidden div div button.pagebuilder-slide-button" parameterized="true"/>
<element name="slideLinkURL1" type="text" selector="[data-slick-index='0'] a[href*='{{arg1}}']" parameterized="true"/>
<element name="slideHasOverlay1" type="text" selector="[data-slick-index='0'] [data-role='slide'] .pagebuilder-content.has-overlay-background"/>
<element name="slide1" type="text" selector="[data-slick-index='0'] [data-role='slide'] div.pagebuilder-poster-content > h3:nth-child(1)"/>
<element name="slideContent1" type="text" selector="[data-slick-index='0'] [data-role='slide'] div.pagebuilder-poster-content div:nth-child(2) > p:nth-child(1)"/>
<element name="slideButtonText1" type="text" selector="[data-slick-index='0'] [data-role='slide'] div.pagebuilder-poster-content > button.pagebuilder-slide-button"/>
<element name="slideLinkURL1" type="text" selector="[data-slick-index='0'] a[href*='{{arg1}}']" parameterized="true"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinBKozan why are both "slideLinkURL1" elements deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, this was done on accident. Added one of the slideLinkURL1 back.

<element name="slideHasOverlay1" type="text" selector="[data-slick-index='0'] [data-role='slide'] .pagebuilder-content.has-overlay-background"/>
<element name="slide2" type="button" selector="[data-slick-index='1'] [data-role='slide']"/>
<element name="slideName2" type="text" selector="[data-slick-index='1'] [data-role='slide'] div.pagebuilder-poster-content > h3:nth-child(1)" />
Expand Down