mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
[Behat] Improve product pages methods and constructors annotations"
This commit is contained in:
parent
20651f5780
commit
aebe41f071
10 changed files with 32 additions and 30 deletions
|
|
@ -847,9 +847,7 @@ final readonly class ManagingPaymentMethodsContext implements Context
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
/** @return string[] */
|
||||
private function getPaymentMethodNamesFromCollection(): array
|
||||
{
|
||||
$paymentMethods = $this->responseChecker->getCollection($this->client->index(Resources::PAYMENT_METHODS));
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ class CreateConfigurableProductPage extends BaseCreatePage implements CreateConf
|
|||
{
|
||||
use NavigationTrait;
|
||||
|
||||
/**
|
||||
* @template TKey of array-key
|
||||
* @template TValue
|
||||
*
|
||||
* @param array<TKey, TValue>|\ArrayAccess<TKey, TValue> $minkParameters
|
||||
*/
|
||||
public function __construct(
|
||||
Session $session,
|
||||
$minkParameters,
|
||||
|
|
@ -65,9 +71,7 @@ class CreateConfigurableProductPage extends BaseCreatePage implements CreateConf
|
|||
$this->autocompleteHelper->selectByName($this->getDriver(), $productOptionsAutocomplete->getXpath(), $optionName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
/** @return array<string, string> */
|
||||
protected function getDefinedElements(): array
|
||||
{
|
||||
return array_merge(
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ class CreateSimpleProductPage extends BaseCreatePage implements CreateSimpleProd
|
|||
{
|
||||
use NavigationTrait;
|
||||
|
||||
/**
|
||||
* @template TKey of array-key
|
||||
* @template TValue
|
||||
*
|
||||
* @param array<TKey, TValue>|\ArrayAccess<TKey, TValue> $minkParameters
|
||||
*/
|
||||
public function __construct(
|
||||
Session $session,
|
||||
$minkParameters,
|
||||
|
|
@ -118,6 +124,7 @@ class CreateSimpleProductPage extends BaseCreatePage implements CreateSimpleProd
|
|||
return parent::getElement($name, $parameters);
|
||||
}
|
||||
|
||||
/** @return array<string, string> */
|
||||
protected function getDefinedElements(): array
|
||||
{
|
||||
return array_merge(
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ class IndexPage extends CrudIndexPage implements IndexPageInterface
|
|||
return (int) $this->getElement('page_number')->getText();
|
||||
}
|
||||
|
||||
/** @return array<string, string> */
|
||||
protected function getDefinedElements(): array
|
||||
{
|
||||
return array_merge(parent::getDefinedElements(), [
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class IndexPerTaxonPage extends CrudIndexPage implements IndexPerTaxonPageInterf
|
|||
$this->getDocument()->waitFor(5, fn () => null === $saveConfigurationButton->find('css', '.loading'));
|
||||
}
|
||||
|
||||
/** @return array<string, string> */
|
||||
protected function getDefinedElements(): array
|
||||
{
|
||||
return array_merge(parent::getDefinedElements(), [
|
||||
|
|
|
|||
|
|
@ -24,6 +24,12 @@ class ShowPage extends SymfonyPage implements ShowPageInterface
|
|||
{
|
||||
use NavigationTrait;
|
||||
|
||||
/**
|
||||
* @template TKey of array-key
|
||||
* @template TValue
|
||||
*
|
||||
* @param array<TKey, TValue>|\ArrayAccess<TKey, TValue> $minkParameters
|
||||
*/
|
||||
public function __construct(Session $session, $minkParameters, RouterInterface $router)
|
||||
{
|
||||
parent::__construct($session, $minkParameters, $router);
|
||||
|
|
@ -44,9 +50,7 @@ class ShowPage extends SymfonyPage implements ShowPageInterface
|
|||
return $this->getElement('show_product_button')->hasClass('disabled');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
/** @return string[] */
|
||||
public function getAppliedCatalogPromotionsLinks(string $variantName, string $channelName): array
|
||||
{
|
||||
$appliedPromotions = $this->getAppliedCatalogPromotions($variantName, $channelName);
|
||||
|
|
@ -54,9 +58,7 @@ class ShowPage extends SymfonyPage implements ShowPageInterface
|
|||
return array_map(fn (NodeElement $element): string => $element->getAttribute('href'), $appliedPromotions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
/** @return string[] */
|
||||
public function getAppliedCatalogPromotionsNames(string $variantName, string $channelName): array
|
||||
{
|
||||
$appliedPromotions = $this->getAppliedCatalogPromotions($variantName, $channelName);
|
||||
|
|
@ -94,9 +96,7 @@ class ShowPage extends SymfonyPage implements ShowPageInterface
|
|||
$this->getElement('edit_variant_button', ['%variant_code%' => $variant->getCode()])->click();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
/** @return array<string, string> */
|
||||
protected function getDefinedElements(): array
|
||||
{
|
||||
return array_merge(parent::getDefinedElements(), [
|
||||
|
|
@ -109,9 +109,7 @@ class ShowPage extends SymfonyPage implements ShowPageInterface
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NodeElement[]
|
||||
*/
|
||||
/** @return NodeElement[] */
|
||||
private function getAppliedCatalogPromotions(string $variantName, string $channelName): array
|
||||
{
|
||||
$pricingElement = $this->getPricingRow($variantName, $channelName);
|
||||
|
|
|
|||
|
|
@ -19,14 +19,10 @@ use Sylius\Component\Core\Model\ProductVariantInterface;
|
|||
|
||||
interface ShowPageInterface extends SymfonyPageInterface, ShowToEditPageSwitcherInterface
|
||||
{
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
/** @return string[] */
|
||||
public function getAppliedCatalogPromotionsLinks(string $variantName, string $channelName): array;
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
/** @return string[] */
|
||||
public function getAppliedCatalogPromotionsNames(string $variantName, string $channelName): array;
|
||||
|
||||
public function getName(): string;
|
||||
|
|
|
|||
|
|
@ -112,9 +112,7 @@ class UpdateConfigurableProductPage extends BaseUpdatePage implements UpdateConf
|
|||
return $this->getElement('code');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
/** @return array<string, string> */
|
||||
protected function getDefinedElements(): array
|
||||
{
|
||||
return array_merge(
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ class UpdateSimpleProductPage extends BaseUpdatePage implements UpdateSimpleProd
|
|||
return $this->getElement('code');
|
||||
}
|
||||
|
||||
/** @return array<string, string> */
|
||||
protected function getDefinedElements(): array
|
||||
{
|
||||
return array_merge(parent::getDefinedElements(), [
|
||||
|
|
|
|||
|
|
@ -322,9 +322,7 @@ class AddressPage extends SymfonyPage implements AddressPageInterface
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
/** @return string[] */
|
||||
private function getOptionsFromSelect(NodeElement $element): array
|
||||
{
|
||||
return array_map(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue