Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
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
2 changes: 1 addition & 1 deletion resources/common/common_zed.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Contributor

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


*** Keywords ***
Zed: login on Zed with provided credentials:
Expand Down
33 changes: 33 additions & 0 deletions resources/steps/zed_catalog_category_steps.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
*** Settings ***
Resource ../pages/zed/zed_cms_page_page.robot
Resource ../common/common_zed.robot
Resource ../common/common.robot

*** Keywords ***

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
Contributor

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.

Click xpath=//body/ul[@class='dropdown-menu']/li/a[contains(.,'Edit')]
Copy link
Contributor

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

Set Browser Timeout ${browser_timeout}
Wait Until Element Is Visible xpath=//select[@id="category_store_relation_id_stores"]
Copy link
Contributor

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

Type Text xpath=//select[@id="category_store_relation_id_stores"]/following-sibling::*//input[contains(@class,'select2-search')] ${store} delay=50ms
Wait Until Element Is Visible xpath=//*[contains(@class,'select2-results')][contains(@class,'options')]//li[contains(text(),'${store}')]
Click xpath=//*[contains(@class,'select2-results')][contains(@class,'options')]//li[contains(text(),'${store}')]
Sleep 1s

${iterations}= Get Element Count xpath=//input[contains(concat(' ',@id,' '), 'category_localized_attributes_') and contains(@id,'_name') and @type='text' and @required='required']
FOR ${index} IN RANGE 0 ${iterations}
${currentInput}= Set Variable xpath=//input[@id='category_localized_attributes_${index}_name']
${value}= Get Text ${currentInput}
IF '${value}' == '${EMPTY}'
Click ${currentInput}//ancestor::div[contains(@class, 'ibox') and contains(@class, 'collapsed')]//a[@class='collapse-link']
Type Text ${currentInput} 'test' delay=50ms
END
END

Wait Until Element Is Visible ${zed_category_save_button}
Click ${zed_category_save_button}
Wait until element is visible ${zed_success_flash_message}

2 changes: 2 additions & 0 deletions resources/steps/zed_store_steps.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Contributor

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}



Zed: perform store search by:
[Arguments] ${search_key}
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/suite/multistore/mustistore.robot
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Resource ../../../../resources/steps/orders_management_steps.robot
Resource ../../../../resources/steps/zed_customer_steps.robot
Resource ../../../../resources/steps/zed_discount_steps.robot
Resource ../../../../resources/steps/zed_availability_steps.robot
Resource ../../../../resources/steps/zed_catalog_category_steps.robot
Resource ../../../../resources/steps/zed_cms_page_steps.robot
Resource ../../../../resources/steps/merchant_profile_steps.robot
Resource ../../../../resources/steps/zed_marketplace_steps.robot
Expand Down Expand Up @@ -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
Contributor

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
Contributor 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
Contributor

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
Contributor 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

Copy link
Contributor

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

## register new customer in the new store on YVES
Yves: go to AT store 'Home' page if other store not specified: ${random_str_store}_${random_str_store}
Register a new customer with data:
Expand Down