Skip to content

Commit

Permalink
[Behat] Fix the wrong prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMilek committed May 15, 2024
1 parent c5252da commit b3542e4
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 59 deletions.
22 changes: 11 additions & 11 deletions src/Sylius/Behat/Element/Admin/CatalogPromotion/FormElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,20 @@ protected function getDefinedElements(): array
return array_merge(parent::getDefinedElements(), [
'add_action_button' => '[data-test-actions] [data-test-add-%type%]',
'add_scope_button' => '[data-test-scopes] [data-test-add-%type%]',
'channels' => '#sylius_catalog_promotion_channels',
'description' => '[name="sylius_catalog_promotion[translations][%locale_code%][description]"]',
'enabled' => '#sylius_catalog_promotion_enabled',
'end_date_date' => '#sylius_catalog_promotion_endDate_date',
'end_date_time' => '#sylius_catalog_promotion_endDate_time',
'exclusive' => '#sylius_catalog_promotion_exclusive',
'channels' => '#sylius_admin_catalog_promotion_channels',
'description' => '[name="sylius_admin_catalog_promotion[translations][%locale_code%][description]"]',
'enabled' => '#sylius_admin_catalog_promotion_enabled',
'end_date_date' => '#sylius_admin_catalog_promotion_endDate_date',
'end_date_time' => '#sylius_admin_catalog_promotion_endDate_time',
'exclusive' => '#sylius_admin_catalog_promotion_exclusive',
'form' => '[data-live-name-value="sylius_admin:catalog_promotion:form"]',
'label' => '[name="sylius_catalog_promotion[translations][%locale_code%][label]"]',
'label' => '[name="sylius_admin_catalog_promotion[translations][%locale_code%][label]"]',
'last_action' => '[data-test-actions] [data-test-entry-row]:last-child',
'last_scope' => '[data-test-scopes] [data-test-entry-row]:last-child',
'name' => '#sylius_catalog_promotion_name',
'priority' => '#sylius_catalog_promotion_priority',
'start_date_date' => '#sylius_catalog_promotion_startDate_date',
'start_date_time' => '#sylius_catalog_promotion_startDate_time',
'name' => '#sylius_admin_catalog_promotion_name',
'priority' => '#sylius_admin_catalog_promotion_priority',
'start_date_date' => '#sylius_admin_catalog_promotion_startDate_date',
'start_date_time' => '#sylius_admin_catalog_promotion_startDate_time',
]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getPeriod(): int
protected function getDefinedElements(): array
{
return array_merge(parent::getDefinedElements(), [
'discounted_products_checking_period' => '#sylius_channel_channelPriceHistoryConfig_lowestPriceForDiscountedProductsCheckingPeriod',
'discounted_products_checking_period' => '#sylius_admin_channel_channelPriceHistoryConfig_lowestPriceForDiscountedProductsCheckingPeriod',
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ public function hasBillingAddress(string $street, string $postcode, string $city
protected function getDefinedElements(): array
{
return array_merge(parent::getDefinedElements(), [
'city' => '#sylius_channel_shopBillingData_city',
'company' => '#sylius_channel_shopBillingData_company',
'country_code' => '#sylius_channel_shopBillingData_countryCode',
'postcode' => '#sylius_channel_shopBillingData_postcode',
'street' => '#sylius_channel_shopBillingData_street',
'tax_id' => '#sylius_channel_shopBillingData_taxId',
'city' => '#sylius_admin_channel_shopBillingData_city',
'company' => '#sylius_admin_channel_shopBillingData_company',
'country_code' => '#sylius_admin_channel_shopBillingData_countryCode',
'postcode' => '#sylius_admin_channel_shopBillingData_postcode',
'street' => '#sylius_admin_channel_shopBillingData_street',
'tax_id' => '#sylius_admin_channel_shopBillingData_taxId',
]);
}
}
18 changes: 9 additions & 9 deletions src/Sylius/Behat/Element/Admin/ShippingMethod/FormElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@ protected function getDefinedElements(): array
{
return [
'add_rule_button' => '[data-test-rules] [data-test-add-%type%]',
'calculator' => '#sylius_shipping_method_calculator',
'calculator_configuration_amount' => '#sylius_shipping_method_configuration_%channelCode%_amount',
'calculator' => '#sylius_admin_shipping_method_calculator',
'calculator_configuration_amount' => '#sylius_admin_shipping_method_configuration_%channelCode%_amount',
'calculator_configuration_channel_tab' => '[data-test-calculator-configuration] [data-test-channel-tab="%channelCode%"]',
'calculator_configuration_channel_tab_content' => '[data-test-calculator-configuration] [data-test-channel-tab-content="%channelCode%"]',
'channel' => '[name="sylius_shipping_method[channels][]"][value="%channelCode%"]',
'code' => '#sylius_shipping_method_code',
'description' => '#sylius_shipping_method_translations_%localeCode%_description',
'enabled' => '#sylius_shipping_method_enabled',
'channel' => '[name="sylius_admin_shipping_method[channels][]"][value="%channelCode%"]',
'code' => '#sylius_admin_shipping_method_code',
'description' => '#sylius_admin_shipping_method_translations_%localeCode%_description',
'enabled' => '#sylius_admin_shipping_method_enabled',
'form' => '[data-live-name-value="sylius_admin:shipping_method:form"]',
'last_rule' => '[data-test-rules] [data-test-entry-row]:last-child',
'last_rule_amount' => '[data-test-rules] [data-test-entry-row]:last-child [id$="_configuration_%channelCode%_amount"]',
'last_rule_weight' => '[data-test-rules] [data-test-entry-row]:last-child [id$="_configuration_weight"]',
'name' => '#sylius_shipping_method_translations_%localeCode%_name',
'position' => '#sylius_shipping_method_position',
'zone' => '#sylius_shipping_method_zone',
'name' => '#sylius_admin_shipping_method_translations_%localeCode%_name',
'position' => '#sylius_admin_shipping_method_position',
'zone' => '#sylius_admin_shipping_method_zone',
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Sylius/Behat/Page/Admin/CatalogPromotion/CreatePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class CreatePage extends BaseCreatePage implements CreatePageInterface
protected function getDefinedElements(): array
{
return array_merge(parent::getDefinedElements(), [
'code' => '#sylius_catalog_promotion_code',
'name' => '#sylius_catalog_promotion_name',
'code' => '#sylius_admin_catalog_promotion_code',
'name' => '#sylius_admin_catalog_promotion_name',
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected function getCodeElement(): NodeElement
protected function getDefinedElements(): array
{
return array_merge(parent::getDefinedElements(), [
'code' => '#sylius_catalog_promotion_code',
'code' => '#sylius_admin_catalog_promotion_code',
]);
}
}
6 changes: 3 additions & 3 deletions src/Sylius/Behat/Page/Admin/Channel/FormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public function getDefinedFormElements(): array
'color' => '[data-test-color]',
'contact_email' => '[data-test-contact-email]',
'contact_phone_number' => '[data-test-contact-phone-number]',
'countries' => '#sylius_channel_countries',
'currencies' => '#sylius_channel_currencies',
'default_locale' => '#sylius_channel_defaultLocale',
'countries' => '#sylius_admin_channel_countries',
'currencies' => '#sylius_admin_channel_currencies',
'default_locale' => '#sylius_admin_channel_defaultLocale',
'default_tax_zone' => '[data-test-default-tax-zone]',
'discounted_products_checking_period' => '[data-test-lowest-price-for-discounted-products-checking-period]',
'enabled' => '[data-test-enabled]',
Expand Down
32 changes: 16 additions & 16 deletions src/Sylius/Behat/Page/Admin/Order/UpdatePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,23 @@ private function getOptionTextsFor(NodeElement $element): array
protected function getDefinedElements(): array
{
return array_merge(parent::getDefinedElements(), [
'billing_city' => '#sylius_order_billingAddress_city',
'billing_country' => '#sylius_order_billingAddress_countryCode',
'billing_first_name' => '#sylius_order_billingAddress_firstName',
'billing_last_name' => '#sylius_order_billingAddress_lastName',
'billing_postcode' => '#sylius_order_billingAddress_postcode',
'billing_province_name' => '#sylius_order_billingAddress_provinceName',
'billing_province_code' => '#sylius_order_billingAddress_provinceCode',
'billing_street' => '#sylius_order_billingAddress_street',
'billing_city' => '#sylius_admin_order_billingAddress_city',
'billing_country' => '#sylius_admin_order_billingAddress_countryCode',
'billing_first_name' => '#sylius_admin_order_billingAddress_firstName',
'billing_last_name' => '#sylius_admin_order_billingAddress_lastName',
'billing_postcode' => '#sylius_admin_order_billingAddress_postcode',
'billing_province_name' => '#sylius_admin_order_billingAddress_provinceName',
'billing_province_code' => '#sylius_admin_order_billingAddress_provinceCode',
'billing_street' => '#sylius_admin_order_billingAddress_street',
'live_form' => '[data-live-name-value="sylius_admin:order:form"]',
'shipping_city' => '#sylius_order_shippingAddress_city',
'shipping_country' => '#sylius_order_shippingAddress_countryCode',
'shipping_first_name' => '#sylius_order_shippingAddress_firstName',
'shipping_last_name' => '#sylius_order_shippingAddress_lastName',
'shipping_postcode' => '#sylius_order_shippingAddress_postcode',
'shipping_province_name' => '#sylius_order_shippingAddress_provinceName',
'shipping_province_code' => '#sylius_order_shippingAddress_provinceCode',
'shipping_street' => '#sylius_order_shippingAddress_street',
'shipping_city' => '#sylius_admin_order_shippingAddress_city',
'shipping_country' => '#sylius_admin_order_shippingAddress_countryCode',
'shipping_first_name' => '#sylius_admin_order_shippingAddress_firstName',
'shipping_last_name' => '#sylius_admin_order_shippingAddress_lastName',
'shipping_postcode' => '#sylius_admin_order_shippingAddress_postcode',
'shipping_province_name' => '#sylius_admin_order_shippingAddress_provinceName',
'shipping_province_code' => '#sylius_admin_order_shippingAddress_provinceCode',
'shipping_street' => '#sylius_admin_order_shippingAddress_street',
]);
}

Expand Down
14 changes: 7 additions & 7 deletions src/Sylius/Behat/Page/Admin/Product/FormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public function getDefinedFormElements(): array
'attribute_value' => '[data-test-attribute-value][data-test-locale-code="%localeCode%"][data-test-attribute-name="%attributeName%"]',
'channel_tab' => '[data-test-channel-tab="%channelCode%"]',
'form' => '[data-live-name-value="sylius_admin:product:form"]',
'field_associations' => '[name="sylius_product[associations][%association%][]"]',
'field_name' => '[name="sylius_product[translations][%localeCode%][name]"]',
'field_slug' => '[name="sylius_product[translations][%localeCode%][slug]"]',
'field_price' => '[name="sylius_product[variant][channelPricings][%channelCode%][price]"]',
'field_original_price' => '[name="sylius_product[variant][channelPricings][%channelCode%][originalPrice]"]',
'field_shipping_category' => '[name="sylius_product[variant][shippingCategory]"]',
'field_shipping_required' => '[name="sylius_product[variant][shippingRequired]"]',
'field_associations' => '[name="sylius_admin_product[associations][%association%][]"]',
'field_name' => '[name="sylius_admin_product[translations][%localeCode%][name]"]',
'field_slug' => '[name="sylius_admin_product[translations][%localeCode%][slug]"]',
'field_price' => '[name="sylius_admin_product[variant][channelPricings][%channelCode%][price]"]',
'field_original_price' => '[name="sylius_admin_product[variant][channelPricings][%channelCode%][originalPrice]"]',
'field_shipping_category' => '[name="sylius_admin_product[variant][shippingCategory]"]',
'field_shipping_required' => '[name="sylius_admin_product[variant][shippingRequired]"]',
'generate_product_slug_button' => '[data-test-generate-product-slug-button="%localeCode%"]',
'images' => '[data-test-images]',
'image_subform' => '[data-test-image-subform]',
Expand Down
6 changes: 3 additions & 3 deletions src/Sylius/Behat/Page/Admin/ProductVariant/GeneratePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ protected function getDefinedElements(): array
{
return array_merge(parent::getDefinedElements(), [
'generate_button' => '[data-test-generate-button]',
'delete_button' => '#sylius_product_generate_variants_variants_%position% [data-test-delete-button]',
'code' => '#sylius_product_generate_variants_variants_%position% [data-test-code]',
'channel_pricings' => '#sylius_product_generate_variants_variants_%position% [data-test-channel-pricings]',
'delete_button' => '#sylius_admin_product_generate_variants_variants_%position% [data-test-delete-button]',
'code' => '#sylius_admin_product_generate_variants_variants_%position% [data-test-code]',
'channel_pricings' => '#sylius_admin_product_generate_variants_variants_%position% [data-test-channel-pricings]',
'form' => '[data-live-name-value="sylius_admin:product:generate_product_variants_form"]',
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,9 @@ public function getParent(): string
{
return BaseCatalogPromotionType::class;
}

public function getBlockPrefix(): string
{
return 'sylius_admin_catalog_promotion';
}
}
5 changes: 5 additions & 0 deletions src/Sylius/Bundle/AdminBundle/Form/Type/ChannelType.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ public function getParent(): string
{
return BaseChannelType::class;
}

public function getBlockPrefix(): string
{
return 'sylius_admin_channel';
}
}
5 changes: 5 additions & 0 deletions src/Sylius/Bundle/AdminBundle/Form/Type/OrderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ public function getParent(): string
{
return BaseOrderType::class;
}

public function getBlockPrefix(): string
{
return 'sylius_admin_order';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ public function getParent(): string
{
return BaseProductGenerateVariantsType::class;
}

public function getBlockPrefix(): string
{
return 'sylius_admin_product_generate_variants';
}
}
5 changes: 5 additions & 0 deletions src/Sylius/Bundle/AdminBundle/Form/Type/ProductType.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@ public function getParent(): string
{
return BaseProductType::class;
}

public function getBlockPrefix(): string
{
return 'sylius_admin_product';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ public function getParent(): string
{
return BaseShippingMethodType::class;
}

public function getBlockPrefix(): string
{
return 'sylius_admin_shipping_method';
}
}

0 comments on commit b3542e4

Please sign in to comment.