-
Notifications
You must be signed in to change notification settings - Fork 91
MFTF Automation for: User locates licensed and uploaded image inside Media Gallery #639
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
Conversation
Hi @drpayyne, thanks for your contribution.
Have you seen this before?
|
@diazwatson No I haven't got that error. Let me try in my local once again. |
@diazwatson I think it's due to the Locate button image fix not being present here. (#637 (comment)) Testing with the fix in my local now. |
Hi @diazwatson. I've fixed it now, thanks. Also note that I've changed environment variable name for more clarity due to multiple similar MFTF tests present for Adobe Stock image licensing. |
Great! thanks for your effort @drpayyne I am going to re test it now |
Just ran the test and it complete successfully.
While during the test I noticed few repetitive and maybe unnecessary (for the purpose of this test) steps, I believe this is a side effect of the action groups. Other than that, I think is all fine. @filmaj @sivaschenko can you spot any way this can be improved? |
Damn @diazwatson , you also have long test run times, and you have the same "JS error severe" in your MFTF output as others. You should check in on #652 as that JS error may be the root of slow test runs on certain systems. |
@diazwatson thank you, but which parts in the action group are unnecessary? Just for the sake of knowledge. Maybe I can improve it if possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as we've discussed in different issues / PRs, I think this test needs modification to expand the before
and after
clauses:
- before the test assertions execute, we'll need to save a licensed image to the media gallery
- after the test, we'll need to delete the saved + licensed image from the media gallery
Hey @filmaj, I have added the necessary modifications. Thanks! |
Hmm.. for me, in the
.. then explodes in the |
@filmaj, a probable test fail at that particular button click might be that the image isn't licensed, so the button text was License and Save, or maybe the image was already saved, so only Locate button was present. |
@drpayyne I was looking at the test as it was running, can confirm the button text was just 'Save'... I'm going to need to comment out the Will report back when I have time to look into this.. not sure if I'll get to it this weekend, may have to wait until Monday. |
@filmaj, no issues. I shall try on my local too asap. |
Hi @filmaj, I ran the test and yes I can confirm the button text is Save but this is the actual error thrown: |
Can also confirm that local media gallery was empty in my runs here, that is, no images were saved before the test ran. |
AdobeStockImageAdminUi/Test/Mftf/Section/AdobeStockImagePreviewSection.xml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The before
bits now save the image locally, which is great, but extracting the saved file name using the Locate span's name
attribute fails for me - see my comments below. So this still needs a little more work.
<argument name="query" value="{{AdobeStockConfigDataLicensedImage.value}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminAdobeStockExpandImagePreviewActionGroup" stepKey="expandLicensedImage"/> | ||
<grabAttributeFrom selector="{{AdobeStockImagePreviewSection.locateImage}}" userInput="name" stepKey="grabImageFileName"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line returns the empty string in my local test r un, as the span element containing the Locate text does not have a name
attribute. This results in the rest of the test being unable to compare against the file name. Here's a snippet of this happening in my test run locally (note the empty string used with the alt
attribute):
[searchForLicensedImage] AdminSearchImagesOnModalActionGroup
[fillQueryInput] fill secret field "input.data-grid-search-control","84Gol3inT8K17CaG7uHIhg=="
[applySearch] click "#words + button.action-submit"
[waitForSearchForQuery] wait for loading mask to disappear
[expandLicensedImage] AdminAdobeStockExpandImagePreviewActionGroup
[clickOnThumbnail] click "aside.adobe-stock-modal [data-role=grid-wrapper] img[data-role=thumbnail]"
[waitForImagePreviewToExpand] wait for loading mask to disappear
[grabImageFileName] grab attribute from "//button[@class='action-secondary']//span[text()='Locate']","name"
[clickLocate] click "//button[@class='action-secondary']//span[text()='Locate']"
[waitForMediaGalleryOpen] wait for page load 10
[assertSavedImage] see element "//img[contains(@alt,'')]"
[deleteImageActionGroup] AdminMediaGalleryDeleteImage
[seeImageToDelete] see element "//img[contains(@alt,'')]"
[clickImageToDelete] click "//img[contains(@alt,'')]"
[saveScreenshot] save screenshot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @filmaj, I just tested it locally and can confirm that this test just passed and the name
attribute with the filename is present in the Locate button. 🤔 Could you check if actions.js
file in this PR is loaded in your browser with the method getImageName()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you pointed out to me on Slack, I must not be in developer mode and client side assets a re being cached in my system. After doing that song and dance, I get a different error around finding the image in the media gallery once clicking the Locate button:
1) AdminAdobeStockSavedLicensedImageLocateTestCest: Admin adobe stock saved licensed image locate test
Test tests/functional/Magento/FunctionalTest/_generated/adobe_stock_integration_suite/AdminAdobeStockSavedLicensedImageLocateTestCest.php:AdminAdobeStockSavedLicensedImageLocateTest
Step See element "//img[contains(@alt,'hygge-concept-with-cat-book-and.jpeg')]"
Fail Failed asserting that an array is not empty.
I think it may be an issue with my environment. When clicking the Locate button, it takes a long time for the media gallery to load up on my local instance...
AdobeStockImageAdminUi/Test/Mftf/Section/AdobeStockImagePreviewSection.xml
Show resolved
Hide resolved
Hi @drpayyne, thank you for your contribution! |
Description
Fixed Issues
Manual testing scenarios
magento/ADOBE_STOCK_LICENSED_IMAGE
credential with the image ID of a licensed image$ vendor/bin/mftf run:test AdminAdobeStockSavedLicensedImageLocateTest --remove