Skip to content
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

FRW-6354 Fixed Edit Category page so that any store can be assigned to a category. #958

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

aleksandr-velikanov
Copy link
Collaborator

Change log

Improvements

  • Added Zed: assign store to category step.
  • Included it into the Dynamic_multistore test

@aleksandr-velikanov aleksandr-velikanov self-assigned this Sep 26, 2024
@aleksandr-velikanov aleksandr-velikanov changed the title Bugfix/frw 6354/dms cannot assign category to a new store FRW-6354 Fix Edit Category page so that any store can be assigned to a category. Sep 26, 2024
@aleksandr-velikanov aleksandr-velikanov changed the title FRW-6354 Fix Edit Category page so that any store can be assigned to a category. FRW-6354 Fixed Edit Category page so that any store can be assigned to a category. Sep 26, 2024
@annakotiuk
Copy link
Collaborator

robot - files - is it about tests?

annakotiuk
annakotiuk previously approved these changes Sep 26, 2024
Copy link
Collaborator

@AntonShopin AntonShopin left a comment

Choose a reason for hiding this comment

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

Please add tests for all 5 applications and not only for suite.

@@ -16,7 +16,7 @@ ${zed_variant_search_field_locator} xpath=//*[@id='product-variant-table_fil
${zed_processing_block_locator} xpath=//div[contains(@id,'processing')][contains(@class,'dataTables_processing')]
${zed_merchants_dropdown_locator} xpath=//select[@name='id-merchant']
${zed_attribute_access_denied_header} xpath=//div[@class='wrapper wrapper-content']//div[@class='flash-messages']//following-sibling::h1

${zed_category_save_button} xpath=//button[contains(@class,'safe-submit')]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like this locator is specific to Edit Category page, but locators in this file are general for many pages in Zed.
In this case please create a new zed_edit_category_page.robot file in https://github.com/spryker/robotframework-suite-tests/tree/master/resources/pages/zed and move it there

@@ -54,6 +54,8 @@ Zed: create new Store:
END
END
Click ${zed_store_save_button}
wait until element is visible ${zed_success_flash_message}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
wait until element is visible ${zed_success_flash_message}
Wait Until Element Is Visible ${zed_success_flash_message}

@@ -296,6 +297,7 @@ Dynamic_multistore
Zed: login on Zed with provided credentials: ${zed_admin_email}
Zed: assigned store to cms block: ${random_str_store}_${random_str_store} customer-registration_token--html
Zed: assigned store to cms block: ${random_str_store}_${random_str_store} customer-registration_token--text
Zed: assign store to category: ${random_str_store}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You assign a category to the newly created store, but there is no assertion that this new Category is available on the newly created store.

So for this case you need to

  • Assign category to store in Zed
  • Trigger P&S as in CI env we don't have Jenkins. Trigger can be done by Trigger multistore p&s keyword (see above in this test)
  • Check that the category is available in the store, to which it was assigned. Here I advice you to check through the API call and not though the UI

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here I'm not sure this is within the scope of the ticket (https://spryker.atlassian.net/browse/FRW-6354). The adjustment was only concerning the UI, and I'd rather not widen the scope to include the API

Copy link
Collaborator

Choose a reason for hiding this comment

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

Disagree.
Previously it was not possible to assign category to a newly created store, so we didn't know if it works at all.
The score of the bug ticket is not just to fix the UI but also to check that category is available for the customers after store assignment.

Imagine if UI in the back-office is fixed but the category is still not accessible on the storefront/API - what is the value of this fix in such case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, will update accordingly

@@ -296,6 +297,7 @@ Dynamic_multistore
Zed: login on Zed with provided credentials: ${zed_admin_email}
Zed: assigned store to cms block: ${random_str_store}_${random_str_store} customer-registration_token--html
Zed: assigned store to cms block: ${random_str_store}_${random_str_store} customer-registration_token--text
Zed: assign store to category: ${random_str_store}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You assign a category to the newly created store, but there is no assertion that this new Category is available on the newly created store.

So for this case you need to

  • Assign category to store in Zed
  • Trigger P&S as in CI env we don't have Jenkins. Trigger can be done by Trigger multistore p&s keyword (see above in this test)
  • Check that the category is available in the store, to which it was assigned. Here I advice you to check through the API call and not though the UI

[Arguments] ${store}
Zed: go to second navigation item level: Catalog Category
Zed: click Action Button in a table for row that contains: cables Edit
Click xpath=//body/ul[@class='dropdown-menu']/li/a[contains(.,'Edit')]
Copy link
Collaborator

Choose a reason for hiding this comment

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

xpath=//body/ul[@class='dropdown-menu']/li/a[contains(.,'Edit')] looks like a static locator. Don't hardcode it right in the keyword. Please move it to a separate page that describes elements of this page and use a variable in your keyword

Zed: click Action Button in a table for row that contains: cables Edit
Click xpath=//body/ul[@class='dropdown-menu']/li/a[contains(.,'Edit')]
Set Browser Timeout ${browser_timeout}
Wait Until Element Is Visible xpath=//select[@id="category_store_relation_id_stores"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, don't hardcode static locators in keywords. Thanks

Zed: assign store to category:
[Arguments] ${store}
Zed: go to second navigation item level: Catalog Category
Zed: click Action Button in a table for row that contains: cables Edit
Copy link
Collaborator

Choose a reason for hiding this comment

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

cables is hardcoded inside the keyword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants