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

Conversation

KevinBKozan
Copy link
Contributor

@KevinBKozan KevinBKozan commented Jun 21, 2018

Description

  • Removed duplicate elements (will cause generation error in future MFTF 2.3.0 release)

Related Issue

  1. MQE-1033

Jenkins Build

https://m2build-ur.devops.magento.com/job/All-User-Requested-Tests/833/

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

… Data, Metadata, Page)

- Removed duplicate elements (will cause generation error in future MFTF 2.3.0 release)
<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.

@@ -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!

… Data, Metadata, Page)

- un-delete slideLinkURL1
@tjwiebell tjwiebell added the next label Jun 29, 2018
@tjwiebell tjwiebell merged commit 65ae6e6 into magento:develop Jun 29, 2018
@cspruiell cspruiell deleted the MQE-1033 branch September 14, 2018 18:48
magento-cicd2 pushed a commit that referenced this pull request Jun 11, 2021
…2-page-builder-739

[Imported] [#733 API Changes Mark Blocks as API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants