Add product variants scenarios, use lower case btn labels

This commit is contained in:
Paweł Jędrzejewski 2013-01-29 00:04:38 +01:00
parent 3b0c4710d4
commit 6eb1afc1e4
15 changed files with 381 additions and 120 deletions

282
composer.lock generated
View file

@ -503,6 +503,65 @@
"rest"
]
},
{
"name": "fsc/hateoas-bundle",
"version": "dev-master",
"target-dir": "FSC/HateoasBundle",
"source": {
"type": "git",
"url": "https://github.com/TheFootballSocialClub/FSCHateoasBundle",
"reference": "b658e186b74da95d0ce7a0f862f48bfd70bc338d"
},
"dist": {
"type": "zip",
"url": "https://github.com/TheFootballSocialClub/FSCHateoasBundle/archive/b658e186b74da95d0ce7a0f862f48bfd70bc338d.zip",
"reference": "b658e186b74da95d0ce7a0f862f48bfd70bc338d",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"jms/metadata": ">=1.1.0,<1.3-dev",
"symfony/framework-bundle": ">=2.1,<2.3-dev",
"jms/serializer": "1.0.x",
"jms/serializer-bundle": "*",
"symfony/property-access": "2.2.*"
},
"require-dev": {
"pagerfanta/pagerfanta": "*",
"symfony/class-loader": "*",
"symfony/yaml": "*",
"symfony/browser-kit": "*",
"symfony/form": "*",
"symfony/validator": "*"
},
"suggest": {
"symfony/form": ">=2.1,<2.3-dev",
"symfony/validator": ">=2.1,<2.3-dev",
"pagerfanta/pagerfanta": "*"
},
"time": "2013-01-26 15:58:40",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "0.3-dev"
}
},
"autoload": {
"psr-0": {
"FSC\\HateoasBundle": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Adrien Brault",
"email": "adrien.brault@gmail.com"
}
]
},
{
"name": "fzaninotto/faker",
"version": "dev-master",
@ -919,12 +978,12 @@
"source": {
"type": "git",
"url": "git://github.com/schmittjoh/serializer",
"reference": "b491427df28d1992997f78ab80a34a163ac6552c"
"reference": "3982db57770f84d264c87674edd334e889b81cec"
},
"dist": {
"type": "zip",
"url": "https://github.com/schmittjoh/serializer/archive/b491427df28d1992997f78ab80a34a163ac6552c.zip",
"reference": "b491427df28d1992997f78ab80a34a163ac6552c",
"url": "https://github.com/schmittjoh/serializer/archive/3982db57770f84d264c87674edd334e889b81cec.zip",
"reference": "3982db57770f84d264c87674edd334e889b81cec",
"shasum": ""
},
"require": {
@ -940,13 +999,13 @@
"symfony/yaml": "2.*",
"symfony/translation": ">=2.0,<2.2-dev",
"symfony/validator": ">=2.0,<2.2-dev",
"symfony/form": ">=2.0,<2.2-dev",
"symfony/filesystem": "2.*"
"symfony/filesystem": "2.*",
"symfony/form": ">=2.1,<2.2-dev"
},
"suggest": {
"symfony/yaml": "Required if you'd like to serialize data to YAML format."
},
"time": "2013-01-24 21:54:46",
"time": "2013-01-28 16:45:30",
"type": "library",
"extra": {
"branch-alias": {
@ -1667,12 +1726,12 @@
"source": {
"type": "git",
"url": "https://github.com/Sylius/SyliusAssortmentBundle.git",
"reference": "8505b2265c18c1d41ee76fb22a131a8bf255f766"
"reference": "764fbbcfa6cf07441738d254208b6f5e56dd26c2"
},
"dist": {
"type": "zip",
"url": "https://github.com/Sylius/SyliusAssortmentBundle/archive/8505b2265c18c1d41ee76fb22a131a8bf255f766.zip",
"reference": "8505b2265c18c1d41ee76fb22a131a8bf255f766",
"url": "https://github.com/Sylius/SyliusAssortmentBundle/archive/764fbbcfa6cf07441738d254208b6f5e56dd26c2.zip",
"reference": "764fbbcfa6cf07441738d254208b6f5e56dd26c2",
"shasum": ""
},
"require": {
@ -1689,7 +1748,7 @@
"suggest": {
"friendsofsymfony/rest-bundle": "*"
},
"time": "2013-01-25 17:43:42",
"time": "2013-01-28 21:54:46",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
@ -1732,12 +1791,12 @@
"source": {
"type": "git",
"url": "https://github.com/Sylius/SyliusCoreBundle.git",
"reference": "bbebdbd7c056136b26fa1119d38b8228ce6be40c"
"reference": "1e04b3f2a3fada73f29f4e322ec8ec28bceec549"
},
"dist": {
"type": "zip",
"url": "https://github.com/Sylius/SyliusCoreBundle/archive/bbebdbd7c056136b26fa1119d38b8228ce6be40c.zip",
"reference": "bbebdbd7c056136b26fa1119d38b8228ce6be40c",
"url": "https://github.com/Sylius/SyliusCoreBundle/archive/1e04b3f2a3fada73f29f4e322ec8ec28bceec549.zip",
"reference": "1e04b3f2a3fada73f29f4e322ec8ec28bceec549",
"shasum": ""
},
"require": {
@ -1748,13 +1807,14 @@
"fzaninotto/faker": "1.1.*",
"sylius/addressing-bundle": "0.1.*",
"sylius/shipping-bundle": "0.1.*",
"sylius/assortment-bundle": "0.1.*"
"sylius/assortment-bundle": "0.1.*",
"fsc/hateoas-bundle": "0.3.x-dev"
},
"require-dev": {
"phpspec/phpspec2": "dev-develop",
"symfony/form": ">=2.1,<3.0"
},
"time": "2013-01-25 16:43:08",
"time": "2013-01-28 21:56:27",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
@ -1798,12 +1858,12 @@
"source": {
"type": "git",
"url": "https://github.com/Sylius/SyliusResourceBundle.git",
"reference": "c646106a8c2d473b15eb15b7817811ce137e594b"
"reference": "e6c4acf58b3e5c5e1a4315a5d82089ff5f96bbd6"
},
"dist": {
"type": "zip",
"url": "https://github.com/Sylius/SyliusResourceBundle/archive/c646106a8c2d473b15eb15b7817811ce137e594b.zip",
"reference": "c646106a8c2d473b15eb15b7817811ce137e594b",
"url": "https://github.com/Sylius/SyliusResourceBundle/archive/e6c4acf58b3e5c5e1a4315a5d82089ff5f96bbd6.zip",
"reference": "e6c4acf58b3e5c5e1a4315a5d82089ff5f96bbd6",
"shasum": ""
},
"require": {
@ -1825,7 +1885,7 @@
"fsc/hateoas-bundle": "0.3.x-dev",
"doctrine/mongodb-odm": "1.0.*@dev"
},
"time": "2013-01-20 12:27:05",
"time": "2013-01-28 22:27:46",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
@ -2054,12 +2114,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/AsseticBundle",
"reference": "128d3aa1ea65f0615339f20f15f154bd2e7224bb"
"reference": "f65ce4736fa79c60fdfc9805abb38aaaef728e95"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/AsseticBundle/archive/128d3aa1ea65f0615339f20f15f154bd2e7224bb.zip",
"reference": "128d3aa1ea65f0615339f20f15f154bd2e7224bb",
"url": "https://github.com/symfony/AsseticBundle/archive/f65ce4736fa79c60fdfc9805abb38aaaef728e95.zip",
"reference": "f65ce4736fa79c60fdfc9805abb38aaaef728e95",
"shasum": ""
},
"require": {
@ -2079,7 +2139,7 @@
"suggest": {
"symfony/twig-bundle": ">=2.1.0,<2.3-dev"
},
"time": "2013-01-19 21:58:23",
"time": "2013-01-26 01:02:24",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
@ -2117,26 +2177,26 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/MonologBundle",
"reference": "v2.2.0-BETA1"
"reference": "253fcda1128a0301aa68d040302cade65095f2c6"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/MonologBundle/archive/v2.2.0-BETA1.zip",
"reference": "v2.2.0-BETA1",
"url": "https://github.com/symfony/MonologBundle/archive/253fcda1128a0301aa68d040302cade65095f2c6.zip",
"reference": "253fcda1128a0301aa68d040302cade65095f2c6",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"symfony/monolog-bridge": ">=2.1.0,<2.3-dev",
"symfony/dependency-injection": ">=2.1.0,<2.3-dev",
"symfony/config": ">=2.1.0,<2.3-dev",
"monolog/monolog": ">=1.0,<1.3-dev"
"monolog/monolog": ">=1.0,<1.3-dev",
"symfony/monolog-bridge": "2.1.*"
},
"require-dev": {
"symfony/yaml": ">=2.1.0,<2.3-dev",
"symfony/config": ">=2.1.0,<2.3-dev"
},
"time": "2013-01-07 10:57:41",
"time": "2013-01-28 10:06:42",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
@ -2169,6 +2229,64 @@
"logging"
]
},
{
"name": "symfony/property-access",
"version": "dev-master",
"target-dir": "Symfony/Component/PropertyAccess",
"source": {
"type": "git",
"url": "https://github.com/symfony/PropertyAccess",
"reference": "v2.2.0-BETA2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/PropertyAccess/archive/v2.2.0-BETA2.zip",
"reference": "v2.2.0-BETA2",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2013-01-10 08:49:43",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\PropertyAccess\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony PropertyAccess Component",
"homepage": "http://symfony.com",
"keywords": [
"reflection",
"array",
"injection",
"object",
"access",
"extraction",
"index",
"property",
"property path"
]
},
{
"name": "symfony/swiftmailer-bundle",
"version": "2.1.x-dev",
@ -2230,12 +2348,12 @@
"source": {
"type": "git",
"url": "git://github.com/symfony/symfony.git",
"reference": "bdc7e91865b4633b01e79ff91aadb58efccfa981"
"reference": "6f7194802359559a6b37e1d2fe940ac902cf26cf"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/symfony/archive/bdc7e91865b4633b01e79ff91aadb58efccfa981.zip",
"reference": "bdc7e91865b4633b01e79ff91aadb58efccfa981",
"url": "https://github.com/symfony/symfony/archive/6f7194802359559a6b37e1d2fe940ac902cf26cf.zip",
"reference": "6f7194802359559a6b37e1d2fe940ac902cf26cf",
"shasum": ""
},
"require": {
@ -2284,7 +2402,7 @@
"propel/propel1": "dev-master",
"monolog/monolog": ">=1.0,<1.3-dev"
},
"time": "2013-01-22 07:14:57",
"time": "2013-01-27 16:12:43",
"type": "library",
"autoload": {
"psr-0": {
@ -2365,18 +2483,18 @@
"source": {
"type": "git",
"url": "git://github.com/fabpot/Twig.git",
"reference": "93c6a8dedc46c73ccdd61342de3d5e761e4412f6"
"reference": "eaadcca54b888db779a355e449a16dd8c7760e11"
},
"dist": {
"type": "zip",
"url": "https://github.com/fabpot/Twig/archive/93c6a8dedc46c73ccdd61342de3d5e761e4412f6.zip",
"reference": "93c6a8dedc46c73ccdd61342de3d5e761e4412f6",
"url": "https://github.com/fabpot/Twig/archive/eaadcca54b888db779a355e449a16dd8c7760e11.zip",
"reference": "eaadcca54b888db779a355e449a16dd8c7760e11",
"shasum": ""
},
"require": {
"php": ">=5.2.4"
},
"time": "2013-01-18 09:58:04",
"time": "2013-01-27 16:32:04",
"type": "library",
"extra": {
"branch-alias": {
@ -2455,39 +2573,44 @@
"packages-dev": [
{
"name": "behat/behat",
"version": "v2.4.4",
"version": "dev-develop",
"source": {
"type": "git",
"url": "git://github.com/Behat/Behat.git",
"reference": "v2.4.4"
"reference": "4472c4214f908460eadc9290009726d9fc1b09f4"
},
"dist": {
"type": "zip",
"url": "https://github.com/Behat/Behat/zipball/v2.4.4",
"reference": "v2.4.4",
"url": "https://github.com/Behat/Behat/archive/4472c4214f908460eadc9290009726d9fc1b09f4.zip",
"reference": "4472c4214f908460eadc9290009726d9fc1b09f4",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"behat/gherkin": ">=2.2.4,<2.3.0-dev",
"symfony/console": ">=2.0.0,<2.2.0-dev",
"symfony/config": ">=2.0.0,<2.2.0-dev",
"symfony/dependency-injection": ">=2.0.0,<2.2.0-dev",
"symfony/event-dispatcher": ">=2.0.0,<2.2.0-dev",
"symfony/translation": ">=2.0.0,<2.2.0-dev",
"symfony/yaml": ">=2.0.0,<2.2.0-dev",
"symfony/finder": ">=2.0.0,<2.2.0-dev"
"behat/gherkin": ">=2.2.4,<2.3-dev",
"symfony/console": ">=2.0,<2.3-dev",
"symfony/config": ">=2.0,<2.3-dev",
"symfony/dependency-injection": ">=2.0,<2.3-dev",
"symfony/event-dispatcher": ">=2.0,<2.3-dev",
"symfony/translation": ">=2.0,<2.3-dev",
"symfony/yaml": ">=2.0,<2.3-dev",
"symfony/finder": ">=2.0,<2.3-dev"
},
"suggest": {
"behat/symfony2-extension": "for integration with Symfony2 web framework",
"behat/yii-extension": "for integration with Yii web framework",
"behat/mink-extension": "for integration with Mink testing framework"
},
"time": "2012-09-04 07:59:18",
"time": "2013-01-28 22:41:43",
"bin": [
"bin/behat"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "2.4-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Behat": "src/"
@ -2514,34 +2637,39 @@
},
{
"name": "behat/gherkin",
"version": "v2.2.5",
"version": "dev-develop",
"source": {
"type": "git",
"url": "git://github.com/Behat/Gherkin.git",
"reference": "v2.2.5"
"reference": "f88e765e16eee1566e9942d1457912dd7202e0e6"
},
"dist": {
"type": "zip",
"url": "https://github.com/Behat/Gherkin/zipball/v2.2.5",
"reference": "v2.2.5",
"url": "https://github.com/Behat/Gherkin/archive/f88e765e16eee1566e9942d1457912dd7202e0e6.zip",
"reference": "f88e765e16eee1566e9942d1457912dd7202e0e6",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/finder": ">=2.0,<2.2-dev"
"symfony/finder": ">=2.0,<2.3-dev"
},
"require-dev": {
"symfony/yaml": ">=2.0,<2.2-dev",
"symfony/translation": ">=2.0,<2.2-dev",
"symfony/config": ">=2.0,<2.2-dev"
"symfony/yaml": ">=2.0,<2.3-dev",
"symfony/translation": ">=2.0,<2.3-dev",
"symfony/config": ">=2.0,<2.3-dev"
},
"suggest": {
"symfony/yaml": "If you want to parse features, represented in YAML files",
"symfony/translation": "If you want to use Symfony2 translations adapter",
"symfony/config": "If you want to use Config component to manage resources"
},
"time": "2012-09-26 03:03:21",
"time": "2013-01-26 23:59:16",
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Gherkin": "src/"
@ -2574,17 +2702,17 @@
"source": {
"type": "git",
"url": "git://github.com/Behat/Mink.git",
"reference": "8bb5473b9bc79cc742772d07ed70cf5e0a523c78"
"reference": "8c138509002de0639a50c7f047a44c0db8bc23e2"
},
"dist": {
"type": "zip",
"url": "https://github.com/Behat/Mink/archive/8bb5473b9bc79cc742772d07ed70cf5e0a523c78.zip",
"reference": "8bb5473b9bc79cc742772d07ed70cf5e0a523c78",
"url": "https://github.com/Behat/Mink/archive/8c138509002de0639a50c7f047a44c0db8bc23e2.zip",
"reference": "8c138509002de0639a50c7f047a44c0db8bc23e2",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/css-selector": ">=2.0.0,<2.3-dev"
"symfony/css-selector": ">=2.0,<2.3-dev"
},
"require-dev": {
"behat/mink-goutte-driver": "*",
@ -2592,7 +2720,7 @@
"behat/mink-selenium-driver": "*",
"behat/mink-selenium2-driver": "*",
"behat/mink-zombie-driver": "*",
"symfony/finder": ">=2.0.0,<2.2.0-dev"
"symfony/finder": ">=2.0,<2.3-dev"
},
"suggest": {
"behat/mink-goutte-driver": "to enable Goutte support",
@ -2601,7 +2729,7 @@
"behat/mink-selenium2-driver": "to enable Selenium2 (webdriver support)",
"behat/mink-zombie-driver": "to enable Zombie.js support"
},
"time": "2013-01-22 10:29:00",
"time": "2013-01-27 15:34:58",
"type": "library",
"extra": {
"branch-alias": {
@ -2683,23 +2811,23 @@
"source": {
"type": "git",
"url": "git://github.com/Behat/MinkExtension.git",
"reference": "63ca078ecd8285972c6cb35c657e6df5fbfdf695"
"reference": "de6bd8dba0bbaaaf9ddfa81195423c7989dd0c2b"
},
"dist": {
"type": "zip",
"url": "https://github.com/Behat/MinkExtension/archive/63ca078ecd8285972c6cb35c657e6df5fbfdf695.zip",
"reference": "63ca078ecd8285972c6cb35c657e6df5fbfdf695",
"url": "https://github.com/Behat/MinkExtension/archive/de6bd8dba0bbaaaf9ddfa81195423c7989dd0c2b.zip",
"reference": "de6bd8dba0bbaaaf9ddfa81195423c7989dd0c2b",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"behat/behat": ">=2.4.0,<2.5.0",
"behat/mink": ">=1.4.0,<1.5.0"
"behat/behat": ">=2.4,<2.5-dev",
"behat/mink": ">=1.4,<1.5-dev"
},
"require-dev": {
"behat/mink-goutte-driver": "*"
},
"time": "2013-01-11 16:42:03",
"time": "2013-01-27 15:32:41",
"type": "behat-extension",
"autoload": {
"psr-0": {
@ -2780,18 +2908,18 @@
"source": {
"type": "git",
"url": "git://github.com/Behat/Symfony2Extension.git",
"reference": "f8326e8ca5e583ffe475a363ff4f2a7d63789182"
"reference": "af142f441fb83e5ea4c02a136ed582a99d23e409"
},
"dist": {
"type": "zip",
"url": "https://github.com/Behat/Symfony2Extension/archive/f8326e8ca5e583ffe475a363ff4f2a7d63789182.zip",
"reference": "f8326e8ca5e583ffe475a363ff4f2a7d63789182",
"url": "https://github.com/Behat/Symfony2Extension/archive/af142f441fb83e5ea4c02a136ed582a99d23e409.zip",
"reference": "af142f441fb83e5ea4c02a136ed582a99d23e409",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"behat/behat": ">=2.4.0,<2.5.0-dev",
"symfony/framework-bundle": ">=2.0.0,<2.3-dev"
"behat/behat": ">=2.4,<2.5-dev",
"symfony/framework-bundle": ">=2.0,<2.3-dev"
},
"require-dev": {
"symfony/symfony": "dev-master",
@ -2799,7 +2927,7 @@
"behat/mink-browserkit-driver": "dev-master",
"behat/mink": "1.4@stable"
},
"time": "2012-10-16 09:38:57",
"time": "2013-01-27 15:31:10",
"type": "behat-extension",
"autoload": {
"psr-0": {

View file

@ -62,8 +62,9 @@ class DataContext extends BehatContext implements KernelAwareInterface
$repository = $this->getRepository('product');
$product = $repository->createNew();
$product->setName($data['name']);
$product->setName(trim($data['name']));
$product->setDescription('...');
$product->getMasterVariant()->setPrice($data['price']);
if (!empty($data['options'])) {
foreach (explode(',', $data['options']) as $option) {
@ -88,6 +89,10 @@ class DataContext extends BehatContext implements KernelAwareInterface
$this->getService('sylius.variant_generator')->generate($product);
foreach ($product->getVariants() as $variant) {
$variant->setPrice($product->getMasterVariant()->getPrice());
}
$manager->persist($product);
$manager->flush();
}

View file

@ -14,7 +14,9 @@ namespace Context;
use Behat\Gherkin\Node\TableNode;
use Behat\MinkExtension\Context\RawMinkContext;
use Behat\Mink\Driver\Selenium2Driver;
use Behat\Mink\Exception\ExpectationException;
use Behat\Symfony2Extension\Context\KernelAwareInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Locale\Locale;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
@ -169,6 +171,27 @@ class WebUser extends RawMinkContext implements KernelAwareInterface
$this->assertStatusCodeEquals(200);
}
/**
* @Given /^I am creating variant of "([^""]*)"$/
*/
public function iAmCreatingVariantOf($name)
{
$product = $this->getDataContext()->findOneByName('product', $name);
$this->getSession()->visit($this->generatePageUrl('sylius_backend_variant_create', array('productId' => $product->getId())));
}
/**
* @Given /^I should be creating variant of "([^""]*)"$/
*/
public function iShouldBeCreatingVariantOf($name)
{
$product = $this->getDataContext()->findOneByName('product', $name);
$this->assertSession()->addressEquals($this->generatePageUrl('sylius_backend_variant_create', array('productId' => $product->getId())));
$this->assertStatusCodeEquals(200);
}
/**
* @Then /^I should see "([^"]*)"$/
* @Then /^(?:.* )?"([^"]*)" should appear on the page$/
@ -234,7 +257,7 @@ class WebUser extends RawMinkContext implements KernelAwareInterface
);
if (null === $tr) {
throw new NotFoundHttpException(sprintf('Table row with value "%s" does not exist', $value));
throw new ExpectationException(sprintf('Table row with value "%s" does not exist', $value), $this->getSession());
}
if ($tr->findButton($button)) {

View file

@ -62,12 +62,12 @@ Feature: Countries and provinces
Scenario: Accessing the country editing form
Given I am on the page of country "France"
When I follow "Edit"
When I follow "edit"
Then I should be editing country "France"
Scenario: Accessing the editing form from the list
Given I am on the country index page
When I click "Edit" near "China"
When I click "edit" near "China"
Then I should be editing country "China"
Scenario: Updating the country and province
@ -80,18 +80,18 @@ Feature: Countries and provinces
Scenario: Deleting country
Given I am on the page of country "China"
When I follow "Delete"
When I follow "delete"
Then I should be on the country index page
And I should see "Country has been successfully deleted."
Scenario: Deleted country disappears from the list
Given I am on the page of country "France"
When I follow "Delete"
When I follow "delete"
Then I should be on the country index page
And I should not see country with name "France" in that list
Scenario: Deleting province
Given I am on the page of country "France"
When I click "Delete" near "Toulouse"
When I click "delete" near "Toulouse"
Then I should be on the page of country "France"
And "Toulouse" should not appear on the page

View file

@ -94,7 +94,7 @@ Feature: Product options
Scenario: Accessing the editing form from the list
Given I am on the option index page
When I click "Edit" near "T-Shirt color"
When I click "edit" near "T-Shirt color"
Then I should be editing option "T-Shirt color"
Scenario: Updating the option
@ -106,6 +106,6 @@ Feature: Product options
Scenario: Deleted option disappears from the list
Given I am on the option index page
When I click "Delete" near "T-Shirt color"
When I click "delete" near "T-Shirt color"
Then I should be on the option index page
And I should not see option with name "T-Shirt color" in that list

View file

@ -56,7 +56,7 @@ Feature: Product properties
Scenario: Accessing the editing form from the list
Given I am on the property index page
When I click "Edit" near "T-Shirt collection"
When I click "edit" near "T-Shirt collection"
Then I should be editing property "T-Shirt collection"
Scenario: Updating the property
@ -68,7 +68,7 @@ Feature: Product properties
Scenario: Deleted property disappears from the list
Given I am on the property index page
When I click "Delete" near "T-Shirt fabric"
When I click "delete" near "T-Shirt fabric"
Then I should still be on the property index page
And I should see "Property has been successfully deleted."
And I should not see property with name "T-Shirt fabric" in that list

View file

@ -64,7 +64,7 @@ Feature: Product prototypes
Scenario: Accessing the editing form from the list
Given I am on the prototype index page
When I click "Edit" near "T-Shirt"
When I click "edit" near "T-Shirt"
Then I should be editing prototype "T-Shirt"
Scenario: Updating the prototype
@ -76,6 +76,6 @@ Feature: Product prototypes
Scenario: Deleted prototype disappears from the list
Given I am on the prototype index page
When I click "Delete" near "T-Shirt"
When I click "delete" near "T-Shirt"
Then I should be on the prototype index page
And I should see "There are no prototypes defined"

View file

@ -0,0 +1,85 @@
Feature: Product variants
As a store owner
I want to be able to manage product variants
In order to add different product variations to my offer
Background:
Given I am logged in as administrator
And there are following options:
| name | presentation | values |
| T-Shirt color | Color | Red, Blue, Green |
| T-Shirt size | Size | S, M, L |
And there are following properties:
| name | presentation |
| T-Shirt fabric | T-Shirt |
And the following products exist:
| name | price | options | properties |
| Super T-Shirt | 19.99 | T-Shirt size, T-Shirt color | T-Shirt fabric: Wool |
| Black T-Shirt | 19.99 | T-Shirt size | T-Shirt fabric: Cotton |
| Sylius T-Shirt | 12.99 | T-Shirt size, T-Shirt color | T-Shirt fabric: Cotton |
| Mug | 5.99 | | |
| Sticker | 10.00 | | |
And product "Super T-Shirt" is available in all variations
Scenario: Viewing a product without options
Given I am on the page of product "Mug"
Then I should see "There are no options for this product"
Scenario: Viewing a product with options but without variants
Given I am on the page of product "Black T-Shirt"
Then I should not see "There are no options for this product"
But I should see "There are no variants to display"
Scenario: Accessing the variant creation form
Given I am on the page of product "Black T-Shirt"
When I follow "Create variant"
Then I should be creating variant of "Black T-Shirt"
Scenario: Submitting form without the price
Given I am creating variant of "Black T-Shirt"
When I press "Create"
Then I should see "Please enter the price."
Scenario: Trying to create variant with existing options combination
Given I am creating variant of "Super T-Shirt"
When I press "Create"
Then I should see "Variant with this option set already exists."
Scenario: Trying to create product variant with invalid price
Given I am creating variant of "Black T-Shirt"
When I fill in "Price" with "0.00"
And I press "Create"
Then I should see "Price must be greater than 0.01"
Scenario: Creating a product variant by selecting option
Given I am creating variant of "Black T-Shirt"
When I fill in "Price" with "19.99"
And I select "L" from "T-Shirt size"
And I press "Create"
Then I should be on the page of product "Black T-Shirt"
And I should see "Variant has been successfully created."
Scenario: Creating a product variant by selecting multiple options
Given I am creating variant of "Sylius T-Shirt"
When I fill in "Price" with "19.99"
And I select "L" from "T-Shirt size"
And I select "Red" from "T-Shirt color"
And I press "Create"
Then I should be on the page of product "Sylius T-Shirt"
And I should see "Variant has been successfully created."
Scenario: Updating the variant price
Given product "Black T-Shirt" is available in all variations
And I am on the page of product "Black T-Shirt"
When I click "edit" near "T-Shirt size: L"
And I fill in "Price" with "33.99"
And I press "Save changes"
Then I should be on the page of product "Black T-Shirt"
And I should see "Variant has been successfully updated."
Scenario: Deleting product variant
Given product "Black T-Shirt" is available in all variations
And I am on the page of product "Black T-Shirt"
When I click "delete" near "T-Shirt size: L"
Then I should be on the page of product "Black T-Shirt"
And I should see "Variant has been successfully deleted."

View file

@ -26,6 +26,11 @@ Feature: Products
Then I should be on the product index page
And I should see 4 products in the list
Scenario: Listing only simple product prices
Given I am on the product index page
Then I should see product with price "5.99" in that list
But I should not see product with price "19.99" in that list
Scenario: Seeing empty index of products
Given there are no products
When I am on the product index page
@ -46,10 +51,25 @@ Feature: Products
Scenario: Trying to create product without description
Given I am on the product creation page
When I fill in "Name" with "Bag"
When I press "Create"
And I press "Create"
Then I should still be on the product creation page
And I should see "Please enter product description."
Scenario: Trying to create product without the price
Given I am on the product creation page
When I fill in "Name" with "Bag"
And I press "Create"
Then I should still be on the product creation page
And I should see "Please enter the price."
Scenario: Trying to create product with invalid price
Given I am on the product creation page
When I fill in "Name" with "Bag"
And I fill in "Price" with "0.00"
And I press "Create"
Then I should still be on the product creation page
And I should see "Price must be greater than 0.01"
Scenario: Creating simple product without any properties and options
Given I am on the product creation page
When I fill in the following:
@ -101,12 +121,12 @@ Feature: Products
Scenario: Accessing the product editing form
Given I am on the page of product "Super T-Shirt"
When I follow "Edit"
When I follow "edit"
Then I should be editing product "Super T-Shirt"
Scenario: Accessing the editing form from the list
Given I am on the product index page
When I click "Edit" near "Mug"
When I click "edit" near "Mug"
Then I should be editing product "Mug"
Scenario: Updating the product name
@ -125,17 +145,17 @@ Feature: Products
Scenario: Deleting product
Given I am on the page of product "Mug"
When I follow "Delete"
When I follow "delete"
Then I should be on the product index page
And I should see "Product has been successfully deleted."
Scenario: Deleted product disappears from the list
Given I am on the page of product "Sticker"
When I follow "Delete"
When I follow "delete"
Then I should be on the product index page
And I should not see product with name "Sticker" in that list
Scenario: Accessing the product details page from list
Given I am on the product index page
When I click "Details" near "Mug"
When I click "details" near "Mug"
Then I should be on the page of product "Mug"

View file

@ -48,12 +48,12 @@ Feature: Shipping categories
Scenario: Accessing the shipping category editing form
Given I am on the page of shipping category "Regular"
When I follow "Edit"
When I follow "edit"
Then I should be editing shipping category "Regular"
Scenario: Accessing the editing form from the list
Given I am on the shipping category index page
When I click "Edit" near "Heavy"
When I click "edit" near "Heavy"
Then I should be editing shipping category "Heavy"
Scenario: Updating the shipping category
@ -65,12 +65,12 @@ Feature: Shipping categories
Scenario: Deleting shipping category
Given I am on the page of shipping category "Regular"
When I follow "Delete"
When I follow "delete"
Then I should be on the shipping category index page
And I should see "Category has been successfully deleted."
Scenario: Deleted shipping category disappears from the list
Given I am on the page of shipping category "Regular"
When I follow "Delete"
When I follow "delete"
Then I should be on the shipping category index page
And I should not see shipping category with name "Regular" in that list

View file

@ -95,12 +95,12 @@ Feature: Shipping methods
Scenario: Accessing the shipping method editing form
Given I am on the page of shipping method "DHL"
When I follow "Edit"
When I follow "edit"
Then I should be editing shipping method "DHL"
Scenario: Accessing the editing form from the list
Given I am on the shipping method index page
When I click "Edit" near "FedEx"
When I click "edit" near "FedEx"
Then I should be editing shipping method "FedEx"
@javascript
@ -112,12 +112,12 @@ Feature: Shipping methods
Scenario: Deleting shipping method
Given I am on the page of shipping method "FedEx"
When I follow "Delete"
When I follow "delete"
Then I should be on the shipping method index page
And I should see "Method has been successfully deleted."
Scenario: Deleted shipping method disappears from the list
Given I am on the page of shipping method "FedEx"
When I follow "Delete"
When I follow "delete"
Then I should be on the shipping method index page
And I should not see shipping method with name "FedEx" in that list

View file

@ -48,12 +48,12 @@ Feature: Tax categories
Scenario: Accessing the tax category editing form
Given I am on the page of tax category "Clothing"
When I follow "Edit"
When I follow "edit"
Then I should be editing tax category "Clothing"
Scenario: Accessing the editing form from the list
Given I am on the tax category index page
When I click "Edit" near "Clothing"
When I click "edit" near "Clothing"
Then I should be editing tax category "Clothing"
Scenario: Updating the tax category
@ -65,17 +65,17 @@ Feature: Tax categories
Scenario: Deleting tax category
Given I am on the page of tax category "Clothing"
When I follow "Delete"
When I follow "delete"
Then I should be on the tax category index page
And I should see "Category has been successfully deleted."
Scenario: Deleted tax category disappears from the list
Given I am on the page of tax category "Clothing"
When I follow "Delete"
When I follow "delete"
Then I should be on the tax category index page
And I should not see tax category with name "Clothing" in that list
Scenario: Accessing the tax category details page from list
Given I am on the tax category index page
When I click "Details" near "Clothing"
When I click "details" near "Clothing"
Then I should be on the page of tax category "Clothing"

View file

@ -69,30 +69,30 @@ Feature: Tax rates
Scenario: Accessing the tax rate editing form
Given I am on the page of tax rate "US Clothing Tax"
And I follow "Edit"
And I follow "edit"
Then I should be editing tax rate "US Clothing Tax"
Scenario: Accessing the editing form from the list
Given I am on the tax rate index page
And I click "Edit" near "US Clothing Tax"
And I click "edit" near "US Clothing Tax"
Then I should be editing tax rate "US Clothing Tax"
Scenario: Updating the tax rate
Given I am on the page of tax rate "UK+DE Clothing Tax"
And I follow "Edit"
And I follow "edit"
When I fill in "Name" with "General Tax"
And I press "Save changes"
Then I should be on the page of tax rate "General Tax"
Scenario: Deleting tax rate
Given I am on the page of tax rate "US Clothing Tax"
When I follow "Delete"
When I follow "delete"
Then I should be on the tax rate index page
And I should see "Rate has been successfully deleted."
Scenario: Deleted tax rate disappears from the list
Given I am on the page of tax rate "US Electronics Tax"
When I follow "Delete"
When I follow "delete"
Then I should be on the tax rate index page
And I should not see tax rate with name "US Electronics Tax" in that list

View file

@ -62,12 +62,12 @@ Feature: Zones
Scenario: Accessing the zone edit form
Given I am on the page of zone "USA GMT-8"
When I follow "Edit"
When I follow "edit"
Then I should be editing zone "USA GMT-8"
Scenario: Accessing the editing form from list
Given I am on the zone index page
When I click "Edit" near "USA GMT-8"
When I click "edit" near "USA GMT-8"
Then I should be editing zone "USA GMT-8"
Scenario: Updating the zone
@ -90,18 +90,18 @@ Feature: Zones
Scenario: Deleting zone
Given I am on the page of zone "USA GMT-8"
When I click "Delete"
When I click "delete"
Then I should be on the zone index page
And I should see "Zone has been successfully deleted."
Scenario: Deleting zone from list
Given I am on the zone index page
When I click "Delete" near "USA GMT-8"
When I click "delete" near "USA GMT-8"
Then I should still be on the zone index page
And I should see "Zone has been successfully deleted."
Scenario: Deleted zone disappears from the list
Given I am on the page of zone "Germany"
When I click "Delete"
When I click "delete"
Then I should be on the zone index page
But I should not see zone with name "Germany" in that list

View file

@ -63,7 +63,7 @@ sylius_assortment:
classes:
product:
model: Sylius\Bundle\CoreBundle\Entity\Product
form: Sylius\Bundle\AssortmentBundle\Form\Type\CustomizableProductType
form: Sylius\Bundle\CoreBundle\Form\Type\ProductType
variant:
model: Sylius\Bundle\CoreBundle\Entity\Variant
form: Sylius\Bundle\CoreBundle\Form\Type\VariantType