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
Open
1 change: 0 additions & 1 deletion resources/common/common_zed.robot
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ ${zed_processing_block_locator} xpath=//div[contains(@id,'processing')][cont
${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


*** Keywords ***
Zed: login on Zed with provided credentials:
[Arguments] ${email} ${password}=${default_password}
Expand Down
3 changes: 3 additions & 0 deletions resources/environments/environments_ui_b2b.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
"configurable_product_name": "CP steel cabinet, fire-resistant - 3 adjustable shelves - 1 locker - black gray / light gray",
"configurable_product_concrete_price": "1,826.54"
},
"categories":{
"category_name":"demoshop"
},
"misc":{
"grant_type":{
"password":"password",
Expand Down
8 changes: 5 additions & 3 deletions resources/environments/environments_ui_b2c.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
"guest_user_first_name":"Guest",
"guest_user_last_name":"martin"
},
"categories":{
"category_name":"demoshop"
},
"misc":{
"order_state":"New",
"default_header_content_type":"application/vnd.api+json",
Expand All @@ -168,12 +171,12 @@
},
"warehouse_user_assigment":{
"warehous_user":[
{
{
"admin_user_uuid":"c0e244d4-03e8-556f-aa8d-174be9d236e5",
"de_admin_user_uuid":"92cd431f-96e3-5259-91cb-ab9f6d14829f"
}],
"warehouse":[
{
{
"warehouse_uuid":"8e5f7bf2-ab97-595c-9b42-487392e2af9b",
"warehouse_uuid_budjet_cameras":"5bf5cc56-a50b-5029-9011-feeed83af180",
"warehouse_name":"Spryker MER000001 Warehouse 1",
Expand All @@ -185,4 +188,3 @@
}]
}
}

3 changes: 3 additions & 0 deletions resources/environments/environments_ui_mp_b2b.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
"configurable_product_name": "CP steel cabinet, fire-resistant - 3 adjustable shelves - 1 locker - black gray / light gray",
"configurable_product_concrete_price": "1,826.54"
},
"categories":{
"category_name":"demoshop"
},
"misc":{
"grant_type":{
"password":"password",
Expand Down
7 changes: 5 additions & 2 deletions resources/environments/environments_ui_mp_b2c.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
"configurable_product_concrete_one_price": "25.00",
"configurable_product_concrete_two_price": "310.19"
},
"categories":{
"category_name":"demoshop"
},
"misc":{
"grant_type":{
"password":"password",
Expand Down Expand Up @@ -196,12 +199,12 @@
},
"warehouse_user_assigment":{
"warehous_user":[
{
{
"admin_user_uuid":"c0e244d4-03e8-556f-aa8d-174be9d236e5",
"de_admin_user_uuid":"92cd431f-96e3-5259-91cb-ab9f6d14829f"
}],
"warehouse":[
{
{
"warehouse_uuid":"e84b3cb8-a94a-5a7e-9adb-cc5353f7a73f",
"warehouse_uuid_budjet_cameras":"5bf5cc56-a50b-5029-9011-feeed83af180",
"warehouse_name":"Spryker MER000001 Warehouse 1",
Expand Down
3 changes: 3 additions & 0 deletions resources/environments/environments_ui_suite.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@
"product_with_sale_price_concrete_sku": "006_30692993",
"product_with_sale_price_abstract_name": "Canon IXUS 175"
},
"categories":{
"category_name":"demoshop"
},
"misc":{
"grant_type":{
"password":"password",
Expand Down
5 changes: 5 additions & 0 deletions resources/pages/zed/zed_edit_category_page.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*** Variables ***
${zed_category_edit_button} xpath=//body/ul[@class='dropdown-menu']/li/a[contains(.,'Edit')]
${zed_category_store_select} xpath=//select[@id="category_store_relation_id_stores"]
${zed_category_store_select_search_field} xpath=//select[@id="category_store_relation_id_stores"]/following-sibling::*//input[contains(@class,'select2-search')]
${zed_category_save_button} xpath=//button[contains(@class,'safe-submit')]
40 changes: 40 additions & 0 deletions resources/steps/zed_catalog_category_steps.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
*** 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} ${category}
Zed: go to second navigation item level: Catalog Category
Zed: click Action Button in a table for row that contains: ${category} Edit
Click ${zed_category_edit_button}
Set Browser Timeout ${browser_timeout}
Wait Until Element Is Visible ${zed_category_store_select}
Type Text ${zed_category_store_select_search_field} ${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

@{items} = Get Elements xpath=//div[@id='tab-content-settings']//div[contains(@class, 'ibox') and contains(@class, 'collapsed')]//a[@class='collapse-link']
FOR ${item} IN @{items}
Click ${item}
END

${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}'' == '$EMPTY'"
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}
Trigger Multistore P&S
Trigger P&S 3 ${store}


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



Zed: perform store search by:
[Arguments] ${search_key}
Expand Down
12 changes: 11 additions & 1 deletion tests/ui/suite/multistore/mustistore.robot
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Resource ../../../../resources/steps/header_steps.robot
Resource ../../../../resources/common/common_yves.robot
Resource ../../../../resources/common/common_zed.robot
Resource ../../../../resources/common/common_mp.robot
Resource ../../../../resources/pages/zed/zed_edit_category_page.robot
Resource ../../../../resources/steps/pdp_steps.robot
Resource ../../../../resources/steps/shopping_lists_steps.robot
Resource ../../../../resources/steps/checkout_steps.robot
Expand All @@ -24,6 +25,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 @@ -242,7 +244,7 @@ Multistore_CMS

Dynamic_multistore
[Documentation] This test should exclusively run for dynamic multi-store scenarios. The test verifies that the user can successfully create a new store, assign a product and CMS page, and register a customer within the new store.
[Tags] dms-on
[Tags] dms-on bapi
Zed: login on Zed with provided credentials: ${zed_admin_email}
Zed: create new Store:
... || name | locale_iso_code | currency_iso_code | currency_code | currency_iso_code2 | currency_code2 |store_delivery_region |store_context_timezone ||
Expand Down Expand Up @@ -296,6 +298,14 @@ 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} ${category_name}
API_test_setup
I get access token by user credentials: ${zed_admin_email}
I set Headers: Content-Type=application/vnd.api+json Authorization=Bearer ${token}
I send a GET request: /categories/${category_name}
Response status code should be: 200
Response body parameter should contain: [data][attributes][stores] ${random_str_store}

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