diff --git a/.gitignore b/.gitignore index aea69601e..4354fbd92 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,9 @@ npm-debug.log /tests/_support/_generated/* !/tests/_support/_generated/.gitkeep +/tests/PyzTest/*/*/_output +/tests/PyzTest/*/*/_support/_generated + # propel classes /src/Propel/Base/* /src/Propel/Map/* @@ -80,3 +83,4 @@ npm-debug.log # tools composer.phar c3.php + diff --git a/codeception.yml b/codeception.yml index 82fadfa3d..bfcceb6ce 100644 --- a/codeception.yml +++ b/codeception.yml @@ -1,6 +1,8 @@ actor: Tester include: + - tests/PyzTest/Yves/* + - tests/PyzTest/Zed/* - vendor/spryker/spryker/Bundles/* paths: diff --git a/composer.json b/composer.json index 101c7453c..e45d9d3ac 100644 --- a/composer.json +++ b/composer.json @@ -83,16 +83,24 @@ }, "autoload": { "psr-0": { - "": "src", - "Unit": "tests", - "YvesUnit": "tests", - "Functional": "tests", - "Acceptance": "tests" + "": "src" }, "files": [ "vendor/spryker/spryker/autoload.php" ] }, + "autoload-dev": { + "psr-0": { + "PyzTest": "tests" + }, + "psr-4": { + "PyzTest\\Shared\\Testify\\Helper\\": "tests/PyzTest/Shared/Testify/_support/Helper", + "PyzTest\\Yves\\Customer\\Helper\\": "tests/PyzTest/Yves/Customer/_support/Helper", + "PyzTest\\Yves\\Customer\\PageObject\\": "tests/PyzTest/Yves/Customer/_support/PageObject", + "PyzTest\\Yves\\Product\\PageObject\\": "tests/PyzTest/Yves/Product/_support/PageObject", + "PyzTest\\Zed\\Console\\Helper\\": "tests/PyzTest/Zed/Console/_support/Helper" + } + }, "minimum-stability": "dev", "prefer-stable": true, "config": { diff --git a/composer.lock b/composer.lock index a58db5687..fbcc08f79 100644 --- a/composer.lock +++ b/composer.lock @@ -6708,7 +6708,7 @@ "source": { "type": "git", "url": "git@github.com:spryker/git-hook.git", - "reference": "2cc8ca4b76469ff0bbbf91100212f4bdf7b45c0a" + "reference": "9d82700557e1b94128193b9d6e579c7e52ac63a2" }, "require": { "php": ">=5.4.16", @@ -6759,7 +6759,7 @@ "support": { "source": "https://github.com/spryker/git-hook" }, - "time": "2017-07-31T09:27:06+00:00" + "time": "2017-07-30T19:53:34+00:00" }, { "name": "squizlabs/php_codesniffer", diff --git a/tests/Acceptance.suite.yml b/tests/Acceptance.suite.yml deleted file mode 100644 index 3a4f4f3b7..000000000 --- a/tests/Acceptance.suite.yml +++ /dev/null @@ -1,20 +0,0 @@ -class_name: AcceptanceTester -modules: - enabled: - - WebDriver: - url: '' - browser: chrome - window_size: 1920x1080 - - - \SprykerTest\Shared\Testify\Helper\Environment - - \SprykerTest\Shared\Propel\Helper\ConnectionHelper - - \Application\Module\Yves - - \Application\Module\Zed - - \SprykerTest\Shared\Testify\Helper\LocatorHelper - - \SprykerTest\Shared\Testify\Helper\DependencyHelper - - \Module\Customer - - Cli - - Asserts - -coverage: - enabled: false diff --git a/tests/Acceptance/Availability/PageObject/AvailabilityPageTester.php b/tests/Acceptance/Availability/PageObject/AvailabilityPageTester.php deleted file mode 100644 index 33573ca0a..000000000 --- a/tests/Acceptance/Availability/PageObject/AvailabilityPageTester.php +++ /dev/null @@ -1,12 +0,0 @@ -getScenario()); - $checkoutTester->processAllCheckoutSteps(); - } - -} diff --git a/tests/Acceptance/Checkout/Tester/CheckoutTester.php b/tests/Acceptance/Checkout/Tester/CheckoutTester.php deleted file mode 100644 index f4e8a2f4f..000000000 --- a/tests/Acceptance/Checkout/Tester/CheckoutTester.php +++ /dev/null @@ -1,137 +0,0 @@ -see('Create account'); - - $this->fillField('//*[@id="registerForm_customer_first_name"]', 'first-name-test' . rand(100, 999)); - $this->fillField('//*[@id="registerForm_customer_last_name"]', 'last-name-test' . rand(100, 999)); - $this->fillField('//*[@id="registerForm_customer_email"]', 'email-test@domain-' . rand(100, 999) . '.tld'); - $this->fillField('//*[@id="registerForm_customer_password_pass"]', 'as'); - $this->fillField('//*[@id="registerForm_customer_password_confirm"]', 'as'); - $this->click('//*[@id="registerForm_customer_accept_terms"]'); - - return $this; - } - - /** - * @return $this - */ - public function clickRegisterButton() - { - $this->click('/html/body/div[2]/main/div/div[1]/div[3]/form/div/div/button'); - - return $this; - } - - /** - * @return $this - */ - public function processAddressStep() - { - $this->see('Shipping Address'); - - $this->fillField('//*[@id="addressesForm_shippingAddress_first_name"]', 'first-name-test' . rand(100, 999)); - $this->fillField('//*[@id="addressesForm_shippingAddress_last_name"]', 'last-name-test' . rand(100, 999)); - $this->fillField('//*[@id="addressesForm_shippingAddress_company"]', 'company-test' . rand(100, 999)); - $this->fillField('//*[@id="addressesForm_shippingAddress_phone"]', '123456789'); - $this->fillField('//*[@id="addressesForm_shippingAddress_address1"]', 'address1'); - $this->fillField('//*[@id="addressesForm_shippingAddress_address2"]', '15'); - $this->fillField('//*[@id="addressesForm_shippingAddress_address3"]', 'address3'); - $this->fillField('//*[@id="addressesForm_shippingAddress_zip_code"]', '10405'); - $this->fillField('//*[@id="addressesForm_shippingAddress_city"]', 'city'); - - return $this; - } - - /** - * @return $this - */ - public function processShipmentStep() - { - $this->see('Shipment'); - - $this->click('//*[@id="shipmentForm_idShipmentMethod_1"]'); - - return $this; - } - - /** - * @return $this - */ - public function processOverviewStep() - { - $this->see('Overview'); - - return $this; - } - - /** - * @return $this - */ - public function processSuccessStep() - { - $this->see('Your order has been placed successfully!'); - - return $this; - } - - /** - * @return $this - */ - public function processPaymentStep() - { - $this->see('Payment'); - - $this->click('//*[@id="paymentForm_paymentSelection_1"]'); - $this->fillField('//*[@id="paymentForm_dummyPaymentInvoice_date_of_birth"]', '01.07.1985'); - - return $this; - } - - /** - * @return $this - */ - public function nextStep() - { - $this->click('//*[contains(@class, "success")]'); - - return $this; - } - - /** - * @return $this - */ - public function processAllCheckoutSteps() - { - $this->processCustomerStep() - ->clickRegisterButton() - ->processAddressStep() - ->nextStep() - ->processShipmentStep() - ->nextStep() - ->processPaymentStep() - ->nextStep() - ->processOverviewStep() - ->nextStep() - ->processSuccessStep(); - - return $this; - } - -} diff --git a/tests/Acceptance/Console/Tester/ConsoleTester.php b/tests/Acceptance/Console/Tester/ConsoleTester.php deleted file mode 100644 index d67fc033d..000000000 --- a/tests/Acceptance/Console/Tester/ConsoleTester.php +++ /dev/null @@ -1,29 +0,0 @@ -run(); - $output = $process->getOutput(); - - return $output; - } - -} diff --git a/tests/Acceptance/Customer/Yves/Tester/CustomerAddressTester.php b/tests/Acceptance/Customer/Yves/Tester/CustomerAddressTester.php deleted file mode 100644 index ec6941d7c..000000000 --- a/tests/Acceptance/Customer/Yves/Tester/CustomerAddressTester.php +++ /dev/null @@ -1,12 +0,0 @@ -submitForm(['name' => 'loginForm'], [ - CustomerLoginPage::FORM_FIELD_SELECTOR_EMAIL => $customerTransfer->getEmail(), - CustomerLoginPage::FORM_FIELD_SELECTOR_PASSWORD => $customerTransfer->getPassword(), - ]); - } - -} diff --git a/tests/Acceptance/Customer/Yves/Tester/CustomerNewsletterTester.php b/tests/Acceptance/Customer/Yves/Tester/CustomerNewsletterTester.php deleted file mode 100644 index 686b39d19..000000000 --- a/tests/Acceptance/Customer/Yves/Tester/CustomerNewsletterTester.php +++ /dev/null @@ -1,12 +0,0 @@ -selectOption(CustomerRegistrationPage::FORM_FIELD_SELECTOR_SALUTATION, $customerTransfer->getSalutation()); - $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_FIRST_NAME, $customerTransfer->getFirstName()); - $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_LAST_NAME, $customerTransfer->getLastName()); - $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_EMAIL, $customerTransfer->getEmail()); - $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_PASSWORD, $customerTransfer->getPassword()); - $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_PASSWORD_CONFIRM, $customerTransfer->getPassword()); - $i->checkOption(CustomerRegistrationPage::FORM_FIELD_SELECTOR_ACCEPT_TERMS); - } - -} diff --git a/tests/Acceptance/Customer/Yves/Tester/CustomerTester.php b/tests/Acceptance/Customer/Yves/Tester/CustomerTester.php deleted file mode 100644 index bdba6ce52..000000000 --- a/tests/Acceptance/Customer/Yves/Tester/CustomerTester.php +++ /dev/null @@ -1,14 +0,0 @@ -bootstrap(SystemUnderTestBootstrap::APPLICATION_ZED); diff --git a/tests/Console.suite.yml b/tests/Console.suite.yml deleted file mode 100644 index 54d59c54f..000000000 --- a/tests/Console.suite.yml +++ /dev/null @@ -1,6 +0,0 @@ -class_name: ConsoleTester -modules: - enabled: - - Cli - - Filesystem - - \Helper\Console diff --git a/tests/Console/GenerateBundleCest.php b/tests/Console/GenerateBundleCest.php deleted file mode 100644 index cdfdc6459..000000000 --- a/tests/Console/GenerateBundleCest.php +++ /dev/null @@ -1,27 +0,0 @@ -runSprykerCommand('code:generate:module:zed Acme -vvv'); - $i->seeInShellOutput('Generated: Pyz/Zed/Acme/AcmeConfig.php'); - $i->seeInShellOutput('Generated: ZedBundleCodeGenerator'); - $bundleDir = codecept_data_dir() . Console::SANDBOX_DIR . 'src/Pyz/Zed/Acme'; - $i->seeFileFound('AcmeConfig.php', $bundleDir); - $i->seeFileFound('AcmeDependencyProvider.php', $bundleDir); - $i->seeFileFound('AcmeFacade.php', $bundleDir . '/Business'); - } - -} diff --git a/tests/Console/GenerateDataBuildersCest.php b/tests/Console/GenerateDataBuildersCest.php deleted file mode 100644 index 63e1bafa0..000000000 --- a/tests/Console/GenerateDataBuildersCest.php +++ /dev/null @@ -1,22 +0,0 @@ -runSprykerCommand('transfer:databuilder:generate -vvv'); - $i->seeInShellOutput('CustomerBuilder.php was generated'); - $i->seeFileFound(codecept_data_dir() . 'cli_sandbox/src/Generated/Shared/DataBuilder/CustomerBuilder.php'); - } - -} diff --git a/tests/Console/_bootstrap.php b/tests/Console/_bootstrap.php deleted file mode 100644 index b3d9bbc7f..000000000 --- a/tests/Console/_bootstrap.php +++ /dev/null @@ -1 +0,0 @@ -bootstrap(SystemUnderTestBootstrap::APPLICATION_ZED); diff --git a/tests/PyzTest/Shared/Testify/_support/Helper/Environment.php b/tests/PyzTest/Shared/Testify/_support/Helper/Environment.php new file mode 100644 index 000000000..1c3cdb868 --- /dev/null +++ b/tests/PyzTest/Shared/Testify/_support/Helper/Environment.php @@ -0,0 +1,31 @@ +wantTo('See that i can open the homepage'); $i->amOnPage(Homepage::URL); diff --git a/tests/_support/FunctionalTester.php b/tests/PyzTest/Yves/Application/_support/ApplicationAcceptanceTester.php similarity index 55% rename from tests/_support/FunctionalTester.php rename to tests/PyzTest/Yves/Application/_support/ApplicationAcceptanceTester.php index 90de0144c..fa4d4b52a 100644 --- a/tests/_support/FunctionalTester.php +++ b/tests/PyzTest/Yves/Application/_support/ApplicationAcceptanceTester.php @@ -1,4 +1,8 @@ amYves(); + } } diff --git a/tests/Acceptance/Homepage/Yves/PageObject/Homepage.php b/tests/PyzTest/Yves/Application/_support/PageObject/Homepage.php similarity index 83% rename from tests/Acceptance/Homepage/Yves/PageObject/Homepage.php rename to tests/PyzTest/Yves/Application/_support/PageObject/Homepage.php index aaaadf970..13e2a79fc 100644 --- a/tests/Acceptance/Homepage/Yves/PageObject/Homepage.php +++ b/tests/PyzTest/Yves/Application/_support/PageObject/Homepage.php @@ -5,7 +5,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\Homepage\Yves\PageObject; +namespace PyzTest\Yves\Application\PageObject; class Homepage { diff --git a/tests/PyzTest/Yves/Application/codeception.yml b/tests/PyzTest/Yves/Application/codeception.yml new file mode 100644 index 000000000..f86f0fd95 --- /dev/null +++ b/tests/PyzTest/Yves/Application/codeception.yml @@ -0,0 +1,28 @@ +namespace: PyzTest\Yves\Application + +paths: + tests: . + data: _data + support: _support + log: _output + +coverage: + enabled: true + remote: false + whitelist: { include: ['../../../../src/*'] } + +suites: + Acceptance: + path: . + class_name: ApplicationAcceptanceTester + modules: + enabled: + - \PyzTest\Shared\Testify\Helper\Environment + - \Config\Module\ConfigInit + - \Propel\Module\PropelInstall + - WebDriver: + url: '' + browser: chrome + window_size: 1920x1080 + - \SprykerTest\Shared\Testify\Helper\DataCleanupHelper + - \SprykerTest\Shared\Application\Helper\YvesHelper diff --git a/tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/AssetUrlBuilderTest.php b/tests/PyzTest/Yves/Assets/Communication/Model/AssetUrlBuilderTest.php similarity index 88% rename from tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/AssetUrlBuilderTest.php rename to tests/PyzTest/Yves/Assets/Communication/Model/AssetUrlBuilderTest.php index 21cf46d41..c27a08cec 100644 --- a/tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/AssetUrlBuilderTest.php +++ b/tests/PyzTest/Yves/Assets/Communication/Model/AssetUrlBuilderTest.php @@ -5,22 +5,23 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Assets\Communication\Model; +namespace PyzTest\Yves\Assets\Communication\Model; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Yves\Twig\Model\AssetUrlBuilder; use Pyz\Yves\Twig\Model\CacheBusterInterface; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Assets * @group Communication * @group Model * @group AssetUrlBuilderTest + * Add your own group annotations below this line */ -class AssetUrlBuilderTest extends PHPUnit_Framework_TestCase +class AssetUrlBuilderTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/MediaUrlBuilderTest.php b/tests/PyzTest/Yves/Assets/Communication/Model/MediaUrlBuilderTest.php similarity index 82% rename from tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/MediaUrlBuilderTest.php rename to tests/PyzTest/Yves/Assets/Communication/Model/MediaUrlBuilderTest.php index 7b05fff38..b0d0ca594 100644 --- a/tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/MediaUrlBuilderTest.php +++ b/tests/PyzTest/Yves/Assets/Communication/Model/MediaUrlBuilderTest.php @@ -5,21 +5,22 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Assets\Communication\Model; +namespace PyzTest\Yves\Assets\Communication\Model; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Yves\Twig\Model\MediaUrlBuilder; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Assets * @group Communication * @group Model * @group MediaUrlBuilderTest + * Add your own group annotations below this line */ -class MediaUrlBuilderTest extends PHPUnit_Framework_TestCase +class MediaUrlBuilderTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/UrlParameterCacheBusterTest.php b/tests/PyzTest/Yves/Assets/Communication/Model/UrlParameterCacheBusterTest.php similarity index 80% rename from tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/UrlParameterCacheBusterTest.php rename to tests/PyzTest/Yves/Assets/Communication/Model/UrlParameterCacheBusterTest.php index f3f26ee46..cc1a1abff 100644 --- a/tests/YvesUnit/Pyz/Yves/Assets/Communication/Model/UrlParameterCacheBusterTest.php +++ b/tests/PyzTest/Yves/Assets/Communication/Model/UrlParameterCacheBusterTest.php @@ -5,21 +5,22 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Assets\Communication\Model; +namespace PyzTest\Yves\Assets\Communication\Model; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Yves\Twig\Model\UrlParameterCacheBuster; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Assets * @group Communication * @group Model * @group UrlParameterCacheBusterTest + * Add your own group annotations below this line */ -class UrlParameterCacheBusterTest extends PHPUnit_Framework_TestCase +class UrlParameterCacheBusterTest extends Unit { /** diff --git a/tests/PyzTest/Yves/Assets/_support/AssetsCommunicationTester.php b/tests/PyzTest/Yves/Assets/_support/AssetsCommunicationTester.php new file mode 100644 index 000000000..7e3c47c0d --- /dev/null +++ b/tests/PyzTest/Yves/Assets/_support/AssetsCommunicationTester.php @@ -0,0 +1,30 @@ +wantTo('Open product page, and add item to cart with larger quantity than available'); $i->expectTo('Display error message'); - $i->amOnPage(AvailabilityTester::FUJITSU2_PRODUCT_PAGE); + $i->amOnPage(AvailabilityAcceptanceTester::FUJITSU2_PRODUCT_PAGE); $i->click(ProductDetailPage::ADD_TO_CART_XPATH); @@ -38,7 +42,7 @@ public function testAddToCartWhenBiggerQuantityIsUsed(AvailabilityTester $i) $i->fillField(CartListPage::FIRST_CART_ITEM_QUANTITY_INPUT_XPATH, 50); $i->click(CartListPage::FIRST_CART_ITEM_CHANGE_QUANTITY_BUTTON_XPATH); - $i->see(AvailabilityTester::CART_PRE_CHECK_AVAILABILITY_ERROR_MESSAGE); + $i->see(AvailabilityAcceptanceTester::CART_PRE_CHECK_AVAILABILITY_ERROR_MESSAGE); } } diff --git a/tests/Acceptance/Availability/CheckoutAvailabilityCest.php b/tests/PyzTest/Yves/Availability/Acceptance/CheckoutAvailabilityCest.php similarity index 70% rename from tests/Acceptance/Availability/CheckoutAvailabilityCest.php rename to tests/PyzTest/Yves/Availability/Acceptance/CheckoutAvailabilityCest.php index 73ffad137..9decaf3f0 100644 --- a/tests/Acceptance/Availability/CheckoutAvailabilityCest.php +++ b/tests/PyzTest/Yves/Availability/Acceptance/CheckoutAvailabilityCest.php @@ -4,35 +4,39 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\Availability; +namespace PyzTest\Yves\Availability\Acceptance; -use Acceptance\Availability\PageObject\AvailabilityViewPage; -use Acceptance\Availability\Tester\AvailabilityTester; -use Acceptance\Cart\PageObject\CartListPage; -use Acceptance\Product\PageObject\ProductDetailPage; -use Acceptance\Sales\PageObject\OrderDetailPage; -use Acceptance\Sales\PageObject\OrderListPage; -use ZedAcceptanceTester; +use PyzTest\Yves\Availability\AvailabilityAcceptanceTester; +use PyzTest\Yves\Cart\PageObject\CartListPage; +use PyzTest\Yves\Product\PageObject\ProductDetailPage; +use PyzTest\Zed\Availability\AvailabilityPresentationTester; +use PyzTest\Zed\Availability\PageObject\AvailabilityViewPage; +use PyzTest\Zed\Sales\PageObject\OrderDetailPage; +use PyzTest\Zed\Sales\PageObject\OrderListPage; /** - * @group Acceptance + * Auto-generated group annotations + * @group PyzTest + * @group Yves * @group Availability + * @group Acceptance * @group CheckoutAvailabilityCest + * Add your own group annotations below this line */ class CheckoutAvailabilityCest { /** - * @param \Acceptance\Availability\Tester\AvailabilityTester $i + * @param \PyzTest\Yves\Availability\AvailabilityAcceptanceTester $i * * @return void */ - public function testCheckoutItemWithAvailability(AvailabilityTester $i) + public function testCheckoutItemWithAvailability(AvailabilityAcceptanceTester $i) { $i->wantTo('Checkout item with stock'); $i->expectTo('Availability changed during SM processing.'); - $i->amOnPage(AvailabilityTester::FUJITSU_PRODUCT_PAGE); + $i->amOnPage(AvailabilityAcceptanceTester::FUJITSU_PRODUCT_PAGE); $i->click(ProductDetailPage::ADD_TO_CART_XPATH); @@ -41,9 +45,9 @@ public function testCheckoutItemWithAvailability(AvailabilityTester $i) $i->processCheckout(); - $zedTester = $i->haveFriend('zedTester', ZedAcceptanceTester::class); + $zedTester = $i->haveFriend('zedTester', AvailabilityPresentationTester::class); - $zedTester->does(function (ZedAcceptanceTester $i) { + $zedTester->does(function (AvailabilityPresentationTester $i) { $i->amLoggedInUser(); $idProductFujitsu = 118; diff --git a/tests/PyzTest/Yves/Availability/_support/AvailabilityAcceptanceTester.php b/tests/PyzTest/Yves/Availability/_support/AvailabilityAcceptanceTester.php new file mode 100644 index 000000000..94d4cb114 --- /dev/null +++ b/tests/PyzTest/Yves/Availability/_support/AvailabilityAcceptanceTester.php @@ -0,0 +1,53 @@ +amYves(); + } + + /** + * @return void + */ + public function processCheckout() + { + $checkoutTester = new CheckoutAcceptanceTester($this->getScenario()); + $checkoutTester->processAllCheckoutSteps(); + } + +} diff --git a/tests/PyzTest/Yves/Availability/codeception.yml b/tests/PyzTest/Yves/Availability/codeception.yml new file mode 100644 index 000000000..28610e459 --- /dev/null +++ b/tests/PyzTest/Yves/Availability/codeception.yml @@ -0,0 +1,30 @@ +namespace: PyzTest\Yves\Availability + +paths: + tests: . + data: _data + support: _support + log: _output + +coverage: + enabled: true + remote: false + whitelist: { include: ['../../../../src/*'] } + +suites: + Acceptance: + path: Acceptance + class_name: AvailabilityAcceptanceTester + modules: + enabled: + - \PyzTest\Shared\Testify\Helper\Environment + - \Config\Module\ConfigInit + - \Propel\Module\PropelInstall + - WebDriver: + url: '' + browser: chrome + window_size: 1920x1080 + host: 0.0.0.0 + restart: false + - \SprykerTest\Shared\Testify\Helper\DataCleanupHelper + - \SprykerTest\Shared\Application\Helper\YvesHelper diff --git a/tests/Acceptance/Cart/PageObject/CartListPage.php b/tests/PyzTest/Yves/Cart/_support/PageObject/CartListPage.php similarity index 93% rename from tests/Acceptance/Cart/PageObject/CartListPage.php rename to tests/PyzTest/Yves/Cart/_support/PageObject/CartListPage.php index ffa1ca64f..eae9dccec 100644 --- a/tests/Acceptance/Cart/PageObject/CartListPage.php +++ b/tests/PyzTest/Yves/Cart/_support/PageObject/CartListPage.php @@ -5,7 +5,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\Cart\PageObject; +namespace PyzTest\Yves\Cart\PageObject; class CartListPage { diff --git a/tests/YvesFunctional/Pyz/Yves/Checkout/Controller/CheckoutControllerTest.php b/tests/PyzTest/Yves/Checkout/Controller/CheckoutControllerTest.php similarity index 97% rename from tests/YvesFunctional/Pyz/Yves/Checkout/Controller/CheckoutControllerTest.php rename to tests/PyzTest/Yves/Checkout/Controller/CheckoutControllerTest.php index a754bf30c..bbd0107ce 100644 --- a/tests/YvesFunctional/Pyz/Yves/Checkout/Controller/CheckoutControllerTest.php +++ b/tests/PyzTest/Yves/Checkout/Controller/CheckoutControllerTest.php @@ -5,8 +5,9 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesFunctional\Pyz\Yves\Checkout\Controller; +namespace PyzTest\Yves\Checkout\Controller; +use Codeception\Test\Unit; use Generated\Shared\Transfer\AddressTransfer; use Generated\Shared\Transfer\CustomerTransfer; use Generated\Shared\Transfer\ExpenseTransfer; @@ -15,7 +16,6 @@ use Generated\Shared\Transfer\QuoteTransfer; use Generated\Shared\Transfer\ShipmentTransfer; use Generated\Shared\Transfer\TotalsTransfer; -use PHPUnit_Framework_TestCase; use Pyz\Yves\Checkout\Controller\CheckoutController; use Pyz\Yves\Checkout\Form\Steps\PaymentForm; use Pyz\Yves\Checkout\Plugin\Provider\CheckoutControllerProvider; @@ -33,16 +33,18 @@ use Symfony\Component\Form\FormView; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Session\Session; /** - * @group YvesFunctional - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Controller * @group CheckoutControllerTest + * Add your own group annotations below this line */ -class CheckoutControllerTest extends PHPUnit_Framework_TestCase +class CheckoutControllerTest extends Unit { const CUSTOMER_URL = '/checkout/customer'; @@ -87,13 +89,12 @@ class CheckoutControllerTest extends PHPUnit_Framework_TestCase */ protected function setUp() { + $this->markTestSkipped('Move this to function controller tests'); $this->skipIfCi(); $this->controller = new CheckoutController(); $sessionClient = new SessionClient(); - $pimple = new Pimple(); - $sessionContainer = $pimple->getApplication()['session']; - $sessionClient->setContainer($sessionContainer); + $sessionClient->setContainer(new Session()); } /** diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/StepFactoryTest.php b/tests/PyzTest/Yves/Checkout/Process/StepFactoryTest.php similarity index 85% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/StepFactoryTest.php rename to tests/PyzTest/Yves/Checkout/Process/StepFactoryTest.php index f021cd59c..64aecc731 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/StepFactoryTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/StepFactoryTest.php @@ -5,22 +5,23 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process; +namespace PyzTest\Yves\Checkout\Process; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Yves\Checkout\CheckoutDependencyProvider; use Pyz\Yves\Checkout\Process\StepFactory; use Spryker\Yves\Kernel\Container; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group StepFactoryTest + * Add your own group annotations below this line */ -class StepFactoryTest extends PHPUnit_Framework_TestCase +class StepFactoryTest extends Unit { const EXPECTED_DEPENDENCY = 'expected dependency'; diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/AddressStepTest.php b/tests/PyzTest/Yves/Checkout/Process/Steps/AddressStepTest.php similarity index 97% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/AddressStepTest.php rename to tests/PyzTest/Yves/Checkout/Process/Steps/AddressStepTest.php index f51cc72cb..7772734da 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/AddressStepTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/Steps/AddressStepTest.php @@ -5,27 +5,28 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process\Steps; +namespace PyzTest\Yves\Checkout\Process\Steps; use Generated\Shared\Transfer\AddressesTransfer; use Generated\Shared\Transfer\AddressTransfer; use Generated\Shared\Transfer\CustomerTransfer; use Generated\Shared\Transfer\QuoteTransfer; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Client\Customer\CustomerClientInterface; use Pyz\Yves\Checkout\Process\Steps\AddressStep; use Symfony\Component\HttpFoundation\Request; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group Steps * @group AddressStepTest + * Add your own group annotations below this line */ -class AddressStepTest extends PHPUnit_Framework_TestCase +class AddressStepTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/CustomerStepTest.php b/tests/PyzTest/Yves/Checkout/Process/Steps/CustomerStepTest.php similarity index 95% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/CustomerStepTest.php rename to tests/PyzTest/Yves/Checkout/Process/Steps/CustomerStepTest.php index e46e57b33..c10c48af6 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/CustomerStepTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/Steps/CustomerStepTest.php @@ -5,26 +5,27 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process\Steps; +namespace PyzTest\Yves\Checkout\Process\Steps; use Generated\Shared\Transfer\CustomerTransfer; use Generated\Shared\Transfer\QuoteTransfer; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Client\Customer\CustomerClientInterface; use Pyz\Yves\Checkout\Process\Steps\CustomerStep; use Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginInterface; use Symfony\Component\HttpFoundation\Request; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group Steps * @group CustomerStepTest + * Add your own group annotations below this line */ -class CustomerStepTest extends PHPUnit_Framework_TestCase +class CustomerStepTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/EntryStepTest.php b/tests/PyzTest/Yves/Checkout/Process/Steps/EntryStepTest.php similarity index 88% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/EntryStepTest.php rename to tests/PyzTest/Yves/Checkout/Process/Steps/EntryStepTest.php index 7d8149467..a8479bc2f 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/EntryStepTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/Steps/EntryStepTest.php @@ -5,24 +5,25 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process\Steps; +namespace PyzTest\Yves\Checkout\Process\Steps; use Generated\Shared\Transfer\QuoteTransfer; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Client\Customer\CustomerClient; use Pyz\Yves\Checkout\Process\Steps\EntryStep; use Symfony\Component\HttpFoundation\Request; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group Steps * @group EntryStepTest + * Add your own group annotations below this line */ -class EntryStepTest extends PHPUnit_Framework_TestCase +class EntryStepTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/PaymentStepTest.php b/tests/PyzTest/Yves/Checkout/Process/Steps/PaymentStepTest.php similarity index 94% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/PaymentStepTest.php rename to tests/PyzTest/Yves/Checkout/Process/Steps/PaymentStepTest.php index 87fee1d99..3c67ea289 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/PaymentStepTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/Steps/PaymentStepTest.php @@ -5,11 +5,11 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process\Steps; +namespace PyzTest\Yves\Checkout\Process\Steps; use Generated\Shared\Transfer\PaymentTransfer; use Generated\Shared\Transfer\QuoteTransfer; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Yves\Checkout\Process\Steps\PaymentStep; use Spryker\Yves\Messenger\FlashMessenger\FlashMessengerInterface; use Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginCollection; @@ -17,15 +17,16 @@ use Symfony\Component\HttpFoundation\Request; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group Steps * @group PaymentStepTest + * Add your own group annotations below this line */ -class PaymentStepTest extends PHPUnit_Framework_TestCase +class PaymentStepTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/PlaceOrderStepTest.php b/tests/PyzTest/Yves/Checkout/Process/Steps/PlaceOrderStepTest.php similarity index 96% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/PlaceOrderStepTest.php rename to tests/PyzTest/Yves/Checkout/Process/Steps/PlaceOrderStepTest.php index adb39112d..9749ddb69 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/PlaceOrderStepTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/Steps/PlaceOrderStepTest.php @@ -5,13 +5,13 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process\Steps; +namespace PyzTest\Yves\Checkout\Process\Steps; +use Codeception\Test\Unit; use Generated\Shared\Transfer\CheckoutErrorTransfer; use Generated\Shared\Transfer\CheckoutResponseTransfer; use Generated\Shared\Transfer\QuoteTransfer; use Generated\Shared\Transfer\SaveOrderTransfer; -use PHPUnit_Framework_TestCase; use Pyz\Yves\Checkout\Process\Steps\PlaceOrderStep; use Spryker\Client\Checkout\CheckoutClientInterface; use Spryker\Yves\Messenger\FlashMessenger\FlashMessengerInterface; @@ -19,15 +19,16 @@ use Symfony\Component\HttpFoundation\Request; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group Steps * @group PlaceOrderStepTest + * Add your own group annotations below this line */ -class PlaceOrderStepTest extends PHPUnit_Framework_TestCase +class PlaceOrderStepTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/ShipmentStepTest.php b/tests/PyzTest/Yves/Checkout/Process/Steps/ShipmentStepTest.php similarity index 94% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/ShipmentStepTest.php rename to tests/PyzTest/Yves/Checkout/Process/Steps/ShipmentStepTest.php index 46b2813fc..66556b381 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/ShipmentStepTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/Steps/ShipmentStepTest.php @@ -5,12 +5,12 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process\Steps; +namespace PyzTest\Yves\Checkout\Process\Steps; use Generated\Shared\Transfer\ExpenseTransfer; use Generated\Shared\Transfer\QuoteTransfer; use Generated\Shared\Transfer\ShipmentTransfer; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Yves\Checkout\CheckoutDependencyProvider; use Pyz\Yves\Checkout\Process\Steps\ShipmentStep; use Spryker\Client\Calculation\CalculationClientInterface; @@ -20,15 +20,16 @@ use Symfony\Component\HttpFoundation\Request; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group Steps * @group ShipmentStepTest + * Add your own group annotations below this line */ -class ShipmentStepTest extends PHPUnit_Framework_TestCase +class ShipmentStepTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/SuccessStepTest.php b/tests/PyzTest/Yves/Checkout/Process/Steps/SuccessStepTest.php similarity index 93% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/SuccessStepTest.php rename to tests/PyzTest/Yves/Checkout/Process/Steps/SuccessStepTest.php index 2340d9ec9..85fc1afe9 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/SuccessStepTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/Steps/SuccessStepTest.php @@ -5,26 +5,27 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process\Steps; +namespace PyzTest\Yves\Checkout\Process\Steps; +use Codeception\Test\Unit; use Generated\Shared\Transfer\ItemTransfer; use Generated\Shared\Transfer\QuoteTransfer; -use PHPUnit_Framework_TestCase; use Pyz\Client\Customer\CustomerClientInterface; use Pyz\Yves\Checkout\Process\Steps\SuccessStep; use Spryker\Client\Cart\CartClientInterface; use Symfony\Component\HttpFoundation\Request; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group Steps * @group SuccessStepTest + * Add your own group annotations below this line */ -class SuccessStepTest extends PHPUnit_Framework_TestCase +class SuccessStepTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/SummaryStepTest.php b/tests/PyzTest/Yves/Checkout/Process/Steps/SummaryStepTest.php similarity index 93% rename from tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/SummaryStepTest.php rename to tests/PyzTest/Yves/Checkout/Process/Steps/SummaryStepTest.php index 45982c6a9..ae7359157 100644 --- a/tests/YvesUnit/Pyz/Yves/Checkout/Process/Steps/SummaryStepTest.php +++ b/tests/PyzTest/Yves/Checkout/Process/Steps/SummaryStepTest.php @@ -5,13 +5,13 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Checkout\Process\Steps; +namespace PyzTest\Yves\Checkout\Process\Steps; use Generated\Shared\Transfer\AddressTransfer; use Generated\Shared\Transfer\PaymentTransfer; use Generated\Shared\Transfer\QuoteTransfer; use Generated\Shared\Transfer\ShipmentTransfer; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Yves\Checkout\Process\Steps\SummaryStep; use Spryker\Client\Cart\CartClientInterface; use Spryker\Yves\ProductBundle\Grouper\ProductBundleGrouperInterface; @@ -19,15 +19,16 @@ use Symfony\Component\HttpFoundation\Request; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Checkout * @group Process * @group Steps * @group SummaryStepTest + * Add your own group annotations below this line */ -class SummaryStepTest extends PHPUnit_Framework_TestCase +class SummaryStepTest extends Unit { /** diff --git a/tests/PyzTest/Yves/Checkout/_support/CheckoutBusinessTester.php b/tests/PyzTest/Yves/Checkout/_support/CheckoutBusinessTester.php new file mode 100644 index 000000000..32a7b682b --- /dev/null +++ b/tests/PyzTest/Yves/Checkout/_support/CheckoutBusinessTester.php @@ -0,0 +1,30 @@ +amLoggedInCustomer(); $i->amOnPage(CustomerAddressPage::URL); diff --git a/tests/Acceptance/Customer/Yves/CustomerAddressesCest.php b/tests/PyzTest/Yves/Customer/Acceptance/CustomerAddressesCest.php similarity index 53% rename from tests/Acceptance/Customer/Yves/CustomerAddressesCest.php rename to tests/PyzTest/Yves/Customer/Acceptance/CustomerAddressesCest.php index 4586bf7cf..dc51edd57 100644 --- a/tests/Acceptance/Customer/Yves/CustomerAddressesCest.php +++ b/tests/PyzTest/Yves/Customer/Acceptance/CustomerAddressesCest.php @@ -5,27 +5,30 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves; +namespace PyzTest\Yves\Customer\Yves; -use Acceptance\Customer\Yves\PageObject\CustomerAddressesPage; -use Acceptance\Customer\Yves\PageObject\CustomerAddressPage; -use Acceptance\Customer\Yves\Tester\CustomerAddressesTester; +use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\PageObject\CustomerAddressesPage; +use PyzTest\Yves\Customer\PageObject\CustomerAddressPage; /** - * @group Acceptance + * Auto-generated group annotations + * @group PyzTest + * @group Yves * @group Customer * @group Yves * @group CustomerAddressesCest + * Add your own group annotations below this line */ class CustomerAddressesCest { /** - * @param \Acceptance\Customer\Yves\Tester\CustomerAddressesTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanOpenAddAddressPage(CustomerAddressesTester $i) + public function testICanOpenAddAddressPage(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerAddressesPage::URL); diff --git a/tests/Acceptance/Customer/Yves/CustomerLoginCest.php b/tests/PyzTest/Yves/Customer/Acceptance/CustomerLoginCest.php similarity index 53% rename from tests/Acceptance/Customer/Yves/CustomerLoginCest.php rename to tests/PyzTest/Yves/Customer/Acceptance/CustomerLoginCest.php index e2345e9e3..dc0996090 100644 --- a/tests/Acceptance/Customer/Yves/CustomerLoginCest.php +++ b/tests/PyzTest/Yves/Customer/Acceptance/CustomerLoginCest.php @@ -5,39 +5,42 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves; +namespace PyzTest\Yves\Customer\Yves; -use Acceptance\Customer\Yves\PageObject\CustomerLoginPage; -use Acceptance\Customer\Yves\PageObject\CustomerOverviewPage; -use Acceptance\Customer\Yves\PageObject\CustomerPasswordForgottenPage; -use Acceptance\Customer\Yves\Tester\CustomerLoginTester; +use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\PageObject\CustomerLoginPage; +use PyzTest\Yves\Customer\PageObject\CustomerOverviewPage; +use PyzTest\Yves\Customer\PageObject\CustomerPasswordForgottenPage; /** - * @group Acceptance + * Auto-generated group annotations + * @group PyzTest + * @group Yves * @group Customer * @group Yves * @group CustomerLoginCest + * Add your own group annotations below this line */ class CustomerLoginCest { /** - * @param \Acceptance\Customer\Yves\Tester\CustomerLoginTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanOpenLoginPage(CustomerLoginTester $i) + public function testICanOpenLoginPage(CustomerAcceptanceTester $i) { $i->amOnPage(CustomerLoginPage::URL); $i->see(CustomerLoginPage::TITLE_LOGIN, 'h4'); } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerLoginTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanOpenForgotPasswordPage(CustomerLoginTester $i) + public function testICanOpenForgotPasswordPage(CustomerAcceptanceTester $i) { $i->amOnPage(CustomerLoginPage::URL); $i->click(CustomerLoginPage::FORGOT_PASSWORD_LINK); @@ -45,11 +48,11 @@ public function testICanOpenForgotPasswordPage(CustomerLoginTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerLoginTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanLoginWithValidData(CustomerLoginTester $i) + public function testICanLoginWithValidData(CustomerAcceptanceTester $i) { $i->amOnPage(CustomerLoginPage::URL); $i->haveRegisteredCustomer(CustomerLoginPage::NEW_CUSTOMER_EMAIL); diff --git a/tests/Acceptance/Customer/Yves/CustomerLogoutCest.php b/tests/PyzTest/Yves/Customer/Acceptance/CustomerLogoutCest.php similarity index 54% rename from tests/Acceptance/Customer/Yves/CustomerLogoutCest.php rename to tests/PyzTest/Yves/Customer/Acceptance/CustomerLogoutCest.php index b8cf40f88..3843e588e 100644 --- a/tests/Acceptance/Customer/Yves/CustomerLogoutCest.php +++ b/tests/PyzTest/Yves/Customer/Acceptance/CustomerLogoutCest.php @@ -5,28 +5,31 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves; +namespace PyzTest\Yves\Customer\Yves; -use Acceptance\Customer\Yves\PageObject\CustomerLoginPage; -use Acceptance\Customer\Yves\PageObject\CustomerLogoutPage; -use Acceptance\Customer\Yves\PageObject\CustomerOverviewPage; -use Acceptance\Customer\Yves\Tester\CustomerLoginTester; +use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\PageObject\CustomerLoginPage; +use PyzTest\Yves\Customer\PageObject\CustomerLogoutPage; +use PyzTest\Yves\Customer\PageObject\CustomerOverviewPage; /** - * @group Acceptance + * Auto-generated group annotations + * @group PyzTest + * @group Yves * @group Customer * @group Yves * @group CustomerLogoutCest + * Add your own group annotations below this line */ class CustomerLogoutCest { /** - * @param \Acceptance\Customer\Yves\Tester\CustomerLoginTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanLogoutWhenLoggedIn(CustomerLoginTester $i) + public function testICanLogoutWhenLoggedIn(CustomerAcceptanceTester $i) { $i->amOnPage(CustomerLoginPage::URL); $i->haveRegisteredCustomer(CustomerLoginPage::NEW_CUSTOMER_EMAIL); diff --git a/tests/Acceptance/Customer/Yves/CustomerNewsletterCest.php b/tests/PyzTest/Yves/Customer/Acceptance/CustomerNewsletterCest.php similarity index 73% rename from tests/Acceptance/Customer/Yves/CustomerNewsletterCest.php rename to tests/PyzTest/Yves/Customer/Acceptance/CustomerNewsletterCest.php index 87ae703d3..5a3bb562b 100644 --- a/tests/Acceptance/Customer/Yves/CustomerNewsletterCest.php +++ b/tests/PyzTest/Yves/Customer/Acceptance/CustomerNewsletterCest.php @@ -5,29 +5,32 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves; +namespace PyzTest\Yves\Customer\Yves; -use Acceptance\Customer\Yves\PageObject\CustomerNewsletterPage; -use Acceptance\Customer\Yves\Tester\CustomerLoginTester; use Codeception\Util\Stub; +use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\PageObject\CustomerNewsletterPage; use Spryker\Zed\Newsletter\Dependency\Facade\NewsletterToMailInterface; use Spryker\Zed\Newsletter\NewsletterDependencyProvider; /** - * @group Acceptance + * Auto-generated group annotations + * @group PyzTest + * @group Yves * @group Customer * @group Yves * @group CustomerNewsletterCest + * Add your own group annotations below this line */ class CustomerNewsletterCest { /** - * @param \Acceptance\Customer\Yves\Tester\CustomerLoginTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanSubscribeNewsletter(CustomerLoginTester $i) + public function testICanSubscribeNewsletter(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerNewsletterPage::URL); @@ -40,11 +43,11 @@ public function testICanSubscribeNewsletter(CustomerLoginTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerLoginTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanUnSubscribeNewsletter(CustomerLoginTester $i) + public function testICanUnSubscribeNewsletter(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); diff --git a/tests/Acceptance/Customer/Yves/CustomerOverviewCest.php b/tests/PyzTest/Yves/Customer/Acceptance/CustomerOverviewCest.php similarity index 70% rename from tests/Acceptance/Customer/Yves/CustomerOverviewCest.php rename to tests/PyzTest/Yves/Customer/Acceptance/CustomerOverviewCest.php index 7caccbe5f..673e960b5 100644 --- a/tests/Acceptance/Customer/Yves/CustomerOverviewCest.php +++ b/tests/PyzTest/Yves/Customer/Acceptance/CustomerOverviewCest.php @@ -5,30 +5,32 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves; +namespace PyzTest\Yves\Customer\Yves; -use Acceptance\Customer\Yves\PageObject\CustomerAddressesPage; -use Acceptance\Customer\Yves\PageObject\CustomerNewsletterPage; -use Acceptance\Customer\Yves\PageObject\CustomerOrdersPage; -use Acceptance\Customer\Yves\PageObject\CustomerOverviewPage; -use Acceptance\Customer\Yves\PageObject\CustomerProfilePage; -use Acceptance\Customer\Yves\Tester\CustomerOverviewTester; +use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\PageObject\CustomerAddressesPage; +use PyzTest\Yves\Customer\PageObject\CustomerNewsletterPage; +use PyzTest\Yves\Customer\PageObject\CustomerOrdersPage; +use PyzTest\Yves\Customer\PageObject\CustomerOverviewPage; +use PyzTest\Yves\Customer\PageObject\CustomerProfilePage; /** + * Auto-generated group annotations * @group Acceptance * @group Customer * @group Yves * @group CustomerOverviewCest + * Add your own group annotations below this line */ class CustomerOverviewCest { /** - * @param \Acceptance\Customer\Yves\Tester\CustomerOverviewTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanOpenOverviewPage(CustomerOverviewTester $i) + public function testICanOpenOverviewPage(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -41,11 +43,11 @@ public function testICanOpenOverviewPage(CustomerOverviewTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerOverviewTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testCustomerWithoutAddressShouldSeeAddAddressInfoText(CustomerOverviewTester $i) + public function testCustomerWithoutAddressShouldSeeAddAddressInfoText(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -55,11 +57,11 @@ public function testCustomerWithoutAddressShouldSeeAddAddressInfoText(CustomerOv } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerOverviewTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testCustomerWithAddressShouldNotSeeAddressInfoText(CustomerOverviewTester $i) + public function testCustomerWithAddressShouldNotSeeAddressInfoText(CustomerAcceptanceTester $i) { $i->haveRegisteredCustomer(CustomerOverviewPage::NEW_CUSTOMER_EMAIL); $i->addAddressToCustomer(CustomerOverviewPage::NEW_CUSTOMER_EMAIL, CustomerAddressesPage::ADDRESS_A); @@ -73,11 +75,11 @@ public function testCustomerWithAddressShouldNotSeeAddressInfoText(CustomerOverv } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerOverviewTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanGoFromOverviewToProfilePage(CustomerOverviewTester $i) + public function testICanGoFromOverviewToProfilePage(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -86,11 +88,11 @@ public function testICanGoFromOverviewToProfilePage(CustomerOverviewTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerOverviewTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanGoFromOverviewToAddressesPage(CustomerOverviewTester $i) + public function testICanGoFromOverviewToAddressesPage(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -99,11 +101,11 @@ public function testICanGoFromOverviewToAddressesPage(CustomerOverviewTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerOverviewTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanGoFromOverviewToOrdersPage(CustomerOverviewTester $i) + public function testICanGoFromOverviewToOrdersPage(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -112,11 +114,11 @@ public function testICanGoFromOverviewToOrdersPage(CustomerOverviewTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerOverviewTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanGoFromOverviewToNewsletterPage(CustomerOverviewTester $i) + public function testICanGoFromOverviewToNewsletterPage(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); diff --git a/tests/Acceptance/Customer/Yves/CustomerProfileCest.php b/tests/PyzTest/Yves/Customer/Acceptance/CustomerProfileCest.php similarity index 83% rename from tests/Acceptance/Customer/Yves/CustomerProfileCest.php rename to tests/PyzTest/Yves/Customer/Acceptance/CustomerProfileCest.php index 45fcb2c26..e93285e4d 100644 --- a/tests/Acceptance/Customer/Yves/CustomerProfileCest.php +++ b/tests/PyzTest/Yves/Customer/Acceptance/CustomerProfileCest.php @@ -5,26 +5,28 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves; +namespace PyzTest\Yves\Customer\Yves; -use Acceptance\Customer\Yves\PageObject\CustomerProfilePage; -use Acceptance\Customer\Yves\Tester\CustomerProfileTester; +use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\PageObject\CustomerProfilePage; /** + * Auto-generated group annotations * @group Acceptance * @group Customer * @group Yves * @group CustomerProfileCest + * Add your own group annotations below this line */ class CustomerProfileCest { /** - * @param \Acceptance\Customer\Yves\Tester\CustomerProfileTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanUpdateProfileData(CustomerProfileTester $i) + public function testICanUpdateProfileData(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerProfilePage::URL); @@ -40,11 +42,11 @@ public function testICanUpdateProfileData(CustomerProfileTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerProfileTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanUpdateEmail(CustomerProfileTester $i) + public function testICanUpdateEmail(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerProfilePage::URL); @@ -56,11 +58,11 @@ public function testICanUpdateEmail(CustomerProfileTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerProfileTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanNotUpdateEmailToAnAlreadyUsedOne(CustomerProfileTester $i) + public function testICanNotUpdateEmailToAnAlreadyUsedOne(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->haveRegisteredCustomer(CustomerProfilePage::REGISTERED_CUSTOMER_EMAIL); @@ -73,11 +75,11 @@ public function testICanNotUpdateEmailToAnAlreadyUsedOne(CustomerProfileTester $ } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerProfileTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanChangePassword(CustomerProfileTester $i) + public function testICanChangePassword(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerProfilePage::URL); @@ -98,11 +100,11 @@ public function testICanChangePassword(CustomerProfileTester $i) } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerProfileTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanNotChangePasswordWhenNewPasswordsNotMatch(CustomerProfileTester $i) + public function testICanNotChangePasswordWhenNewPasswordsNotMatch(CustomerAcceptanceTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerProfilePage::URL); diff --git a/tests/Acceptance/Customer/Yves/CustomerRegistrationCest.php b/tests/PyzTest/Yves/Customer/Acceptance/CustomerRegistrationCest.php similarity index 56% rename from tests/Acceptance/Customer/Yves/CustomerRegistrationCest.php rename to tests/PyzTest/Yves/Customer/Acceptance/CustomerRegistrationCest.php index f84a2d393..7c146482f 100644 --- a/tests/Acceptance/Customer/Yves/CustomerRegistrationCest.php +++ b/tests/PyzTest/Yves/Customer/Acceptance/CustomerRegistrationCest.php @@ -5,38 +5,41 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves; +namespace PyzTest\Yves\Customer\Yves; -use Acceptance\Customer\Yves\PageObject\CustomerOverviewPage; -use Acceptance\Customer\Yves\PageObject\CustomerRegistrationPage; -use Acceptance\Customer\Yves\Tester\CustomerRegistrationTester; +use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\PageObject\CustomerOverviewPage; +use PyzTest\Yves\Customer\PageObject\CustomerRegistrationPage; /** - * @group Acceptance + * Auto-generated group annotations + * @group PyzTest + * @group Yves * @group Customer * @group Yves * @group CustomerRegistrationCest + * Add your own group annotations below this line */ class CustomerRegistrationCest { /** - * @param \Acceptance\Customer\Yves\Tester\CustomerRegistrationTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanOpenRegistrationPage(CustomerRegistrationTester $i) + public function testICanOpenRegistrationPage(CustomerAcceptanceTester $i) { $i->amOnPage(CustomerRegistrationPage::URL); $i->see(CustomerRegistrationPage::TITLE_CREATE_ACCOUNT, 'h4'); } /** - * @param \Acceptance\Customer\Yves\Tester\CustomerRegistrationTester $i + * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i * * @return void */ - public function testICanRegisterWithValidData(CustomerRegistrationTester $i) + public function testICanRegisterWithValidData(CustomerAcceptanceTester $i) { $i->amOnPage(CustomerRegistrationPage::URL); $i->fillOutRegistrationForm(); diff --git a/tests/YvesUnit/Pyz/Yves/Customer/CustomerDependencyProviderTest.php b/tests/PyzTest/Yves/Customer/Customer/CustomerDependencyProviderTest.php similarity index 90% rename from tests/YvesUnit/Pyz/Yves/Customer/CustomerDependencyProviderTest.php rename to tests/PyzTest/Yves/Customer/Customer/CustomerDependencyProviderTest.php index 006e5b25e..471b42d1c 100644 --- a/tests/YvesUnit/Pyz/Yves/Customer/CustomerDependencyProviderTest.php +++ b/tests/PyzTest/Yves/Customer/Customer/CustomerDependencyProviderTest.php @@ -5,9 +5,9 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Customer; +namespace PyzTest\Yves\Customer\Customer; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Client\Customer\CustomerClientInterface; use Pyz\Client\Newsletter\NewsletterClientInterface; use Pyz\Yves\Customer\CustomerDependencyProvider; @@ -19,13 +19,14 @@ use Spryker\Yves\Messenger\FlashMessenger\FlashMessengerInterface; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Customer * @group CustomerDependencyProviderTest + * Add your own group annotations below this line */ -class CustomerDependencyProviderTest extends PHPUnit_Framework_TestCase +class CustomerDependencyProviderTest extends Unit { /** diff --git a/tests/YvesUnit/Pyz/Yves/Customer/CustomerFactoryTest.php b/tests/PyzTest/Yves/Customer/Customer/CustomerFactoryTest.php similarity index 73% rename from tests/YvesUnit/Pyz/Yves/Customer/CustomerFactoryTest.php rename to tests/PyzTest/Yves/Customer/Customer/CustomerFactoryTest.php index f9b218e81..d038df748 100644 --- a/tests/YvesUnit/Pyz/Yves/Customer/CustomerFactoryTest.php +++ b/tests/PyzTest/Yves/Customer/Customer/CustomerFactoryTest.php @@ -5,20 +5,21 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace YvesUnit\Pyz\Yves\Customer; +namespace PyzTest\Yves\Customer\Customer; -use PHPUnit_Framework_TestCase; +use Codeception\Test\Unit; use Pyz\Client\Newsletter\NewsletterClientInterface; use Pyz\Yves\Customer\CustomerFactory; /** - * @group YvesUnit - * @group Pyz + * Auto-generated group annotations + * @group PyzTest * @group Yves * @group Customer * @group CustomerFactoryTest + * Add your own group annotations below this line */ -class CustomerFactoryTest extends PHPUnit_Framework_TestCase +class CustomerFactoryTest extends Unit { /** diff --git a/tests/PyzTest/Yves/Customer/_support/CustomerAcceptanceTester.php b/tests/PyzTest/Yves/Customer/_support/CustomerAcceptanceTester.php new file mode 100644 index 000000000..0be3c717b --- /dev/null +++ b/tests/PyzTest/Yves/Customer/_support/CustomerAcceptanceTester.php @@ -0,0 +1,70 @@ +amYves(); + } + + /** + * @return void + */ + public function submitLoginForm() + { + $i = $this; + $customerTransfer = CustomerLoginPage::getCustomerData(CustomerLoginPage::NEW_CUSTOMER_EMAIL); + + $i->submitForm(['name' => 'loginForm'], [ + CustomerLoginPage::FORM_FIELD_SELECTOR_EMAIL => $customerTransfer->getEmail(), + CustomerLoginPage::FORM_FIELD_SELECTOR_PASSWORD => $customerTransfer->getPassword(), + ]); + } + + /** + * @return void + */ + public function fillOutRegistrationForm() + { + $i = $this; + $customerTransfer = CustomerRegistrationPage::getCustomerData(CustomerRegistrationPage::NEW_CUSTOMER_EMAIL); + + $i->selectOption(CustomerRegistrationPage::FORM_FIELD_SELECTOR_SALUTATION, $customerTransfer->getSalutation()); + $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_FIRST_NAME, $customerTransfer->getFirstName()); + $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_LAST_NAME, $customerTransfer->getLastName()); + $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_EMAIL, $customerTransfer->getEmail()); + $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_PASSWORD, $customerTransfer->getPassword()); + $i->fillField(CustomerRegistrationPage::FORM_FIELD_SELECTOR_PASSWORD_CONFIRM, $customerTransfer->getPassword()); + $i->checkOption(CustomerRegistrationPage::FORM_FIELD_SELECTOR_ACCEPT_TERMS); + } + +} diff --git a/tests/_support/ConsoleTester.php b/tests/PyzTest/Yves/Customer/_support/CustomerCustomerTester.php similarity index 71% rename from tests/_support/ConsoleTester.php rename to tests/PyzTest/Yves/Customer/_support/CustomerCustomerTester.php index e900db555..97055a7ac 100644 --- a/tests/_support/ConsoleTester.php +++ b/tests/PyzTest/Yves/Customer/_support/CustomerCustomerTester.php @@ -1,4 +1,5 @@ setupSession(); - $customerTransfer = PageObjectCustomer::getCustomerData($email); + $customerTransfer = Customer::getCustomerData($email); $mailMock = new CustomerToMailBridge($this->getMailMock()); $this->setDependency(CustomerDependencyProvider::FACADE_MAIL, $mailMock); @@ -218,10 +217,10 @@ public function addNewsletterSubscription($email, $type = NewsletterConstants::E * * @return void */ - public function amLoggedInCustomer($email = PageObjectCustomer::NEW_CUSTOMER_EMAIL) + public function amLoggedInCustomer($email = Customer::NEW_CUSTOMER_EMAIL) { $this->haveRegisteredCustomer($email); - $customerTransfer = PageObjectCustomer::getCustomerData($email); + $customerTransfer = Customer::getCustomerData($email); $i = $this->getWebDriver(); $i->amOnPage(CustomerLoginPage::URL); diff --git a/tests/Acceptance/Customer/Yves/PageObject/Customer.php b/tests/PyzTest/Yves/Customer/_support/PageObject/Customer.php similarity index 96% rename from tests/Acceptance/Customer/Yves/PageObject/Customer.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/Customer.php index f5e82daae..a1a392779 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/Customer.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/Customer.php @@ -5,7 +5,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; use Generated\Shared\Transfer\CustomerTransfer; diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerAddressPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerAddressPage.php similarity index 96% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerAddressPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerAddressPage.php index 89ae107f6..d9df5ed0e 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerAddressPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerAddressPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerAddressPage extends Customer { diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerAddressesPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerAddressesPage.php similarity index 97% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerAddressesPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerAddressesPage.php index df87de6e8..fd9318872 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerAddressesPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerAddressesPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; use Generated\Shared\Transfer\AddressTransfer; diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerLoginPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerLoginPage.php similarity index 93% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerLoginPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerLoginPage.php index 9516f5583..3231b8e93 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerLoginPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerLoginPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerLoginPage extends Customer { diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerLogoutPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerLogoutPage.php similarity index 83% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerLogoutPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerLogoutPage.php index c9901f75d..4748f28f3 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerLogoutPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerLogoutPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerLogoutPage extends Customer { diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerNewsletterPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerNewsletterPage.php similarity index 93% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerNewsletterPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerNewsletterPage.php index 15ede6975..649a78e4c 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerNewsletterPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerNewsletterPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerNewsletterPage extends Customer { diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerOrdersPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerOrdersPage.php similarity index 84% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerOrdersPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerOrdersPage.php index ad8531f87..ab55e56fc 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerOrdersPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerOrdersPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerOrdersPage extends Customer { diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerOverviewPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerOverviewPage.php similarity index 95% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerOverviewPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerOverviewPage.php index f7a38e5c0..9c73956f8 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerOverviewPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerOverviewPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerOverviewPage extends Customer { diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerPasswordForgottenPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerPasswordForgottenPage.php similarity index 90% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerPasswordForgottenPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerPasswordForgottenPage.php index 8988a97c2..24709aadb 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerPasswordForgottenPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerPasswordForgottenPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerPasswordForgottenPage extends Customer { diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerProfilePage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerProfilePage.php similarity index 97% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerProfilePage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerProfilePage.php index 2d6353a11..28e47f0ab 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerProfilePage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerProfilePage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerProfilePage extends Customer { diff --git a/tests/Acceptance/Customer/Yves/PageObject/CustomerRegistrationPage.php b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerRegistrationPage.php similarity index 95% rename from tests/Acceptance/Customer/Yves/PageObject/CustomerRegistrationPage.php rename to tests/PyzTest/Yves/Customer/_support/PageObject/CustomerRegistrationPage.php index b2d3a2498..75e9e13b0 100644 --- a/tests/Acceptance/Customer/Yves/PageObject/CustomerRegistrationPage.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/CustomerRegistrationPage.php @@ -5,7 +5,7 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Customer\Yves\PageObject; +namespace PyzTest\Yves\Customer\PageObject; class CustomerRegistrationPage extends Customer { diff --git a/tests/PyzTest/Yves/Customer/codeception.yml b/tests/PyzTest/Yves/Customer/codeception.yml new file mode 100644 index 000000000..bac48e742 --- /dev/null +++ b/tests/PyzTest/Yves/Customer/codeception.yml @@ -0,0 +1,45 @@ +namespace: PyzTest\Yves\Customer + +paths: + tests: . + data: _data + support: _support + log: _output + +coverage: + enabled: true + remote: false + whitelist: { include: ['../../../../src/*'] } + +suites: + Acceptance: + path: Acceptance + class_name: CustomerAcceptanceTester + modules: + enabled: + - \PyzTest\Shared\Testify\Helper\Environment + - \SprykerTest\Shared\Propel\Helper\ConnectionHelper + - \PyzTest\Yves\Customer\Helper\CustomerHelper + - \Config\Module\ConfigInit + - \Propel\Module\PropelInstall + - WebDriver: + url: '' + browser: chrome + window_size: 1920x1080 + host: 0.0.0.0 + restart: false + - \SprykerTest\Shared\Testify\Helper\DataCleanupHelper + - \SprykerTest\Shared\Application\Helper\YvesHelper + + + Customer: + path: Customer + class_name: CustomerCustomerTester + modules: + enabled: + - Asserts + - \SprykerTest\Shared\Testify\Helper\Environment + - \SprykerTest\Shared\Testify\Helper\LocatorHelper: + projectNamespaces: ['Pyz'] + + - \SprykerTest\Shared\Testify\Helper\DataCleanupHelper diff --git a/tests/Acceptance/Newsletter/Yves/NewsletterSubscriptionCest.php b/tests/PyzTest/Yves/Newsletter/Acceptance/NewsletterSubscriptionCest.php similarity index 78% rename from tests/Acceptance/Newsletter/Yves/NewsletterSubscriptionCest.php rename to tests/PyzTest/Yves/Newsletter/Acceptance/NewsletterSubscriptionCest.php index afea5985c..249d951f1 100644 --- a/tests/Acceptance/Newsletter/Yves/NewsletterSubscriptionCest.php +++ b/tests/PyzTest/Yves/Newsletter/Acceptance/NewsletterSubscriptionCest.php @@ -5,30 +5,33 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\Newsletter\Yves; +namespace PyzTest\Yves\Newsletter\Yves; -use Acceptance\Customer\Yves\PageObject\Customer; -use Acceptance\Customer\Yves\PageObject\CustomerNewsletterPage; -use Acceptance\Customer\Yves\PageObject\CustomerOverviewPage; -use Acceptance\Homepage\Yves\PageObject\Homepage; -use Acceptance\Newsletter\Yves\PageObject\NewsletterSubscriptionHomePage; -use Acceptance\Newsletter\Yves\Tester\NewsletterSubscriptionTester; +use PyzTest\Yves\Application\PageObject\Homepage; +use PyzTest\Yves\Customer\PageObject\Customer; +use PyzTest\Yves\Customer\PageObject\CustomerNewsletterPage; +use PyzTest\Yves\Customer\PageObject\CustomerOverviewPage; +use PyzTest\Yves\Newsletter\NewsletterAcceptanceTester; +use PyzTest\Yves\Newsletter\PageObject\NewsletterSubscriptionHomePage; /** - * @group Acceptance + * Auto-generated group annotations + * @group PyzTest + * @group Yves * @group Newsletter * @group Yves * @group NewsletterSubscriptionCest + * Add your own group annotations below this line */ class NewsletterSubscriptionCest { /** - * @param \Acceptance\Newsletter\Yves\Tester\NewsletterSubscriptionTester $i + * @param \PyzTest\Yves\Newsletter\NewsletterAcceptanceTester $i * * @return void */ - public function iCanSubscribeWithAnUnsubscribedEmail(NewsletterSubscriptionTester $i) + public function iCanSubscribeWithAnUnsubscribedEmail(NewsletterAcceptanceTester $i) { $i->wantTo('Subscribe to the newsletter with an unsubscribed new email.'); $i->expect('Success message is displayed.'); @@ -42,11 +45,11 @@ public function iCanSubscribeWithAnUnsubscribedEmail(NewsletterSubscriptionTeste } /** - * @param \Acceptance\Newsletter\Yves\Tester\NewsletterSubscriptionTester $i + * @param \PyzTest\Yves\Newsletter\NewsletterAcceptanceTester $i * * @return void */ - public function iCanNotSubscribeWithAnAlreadySubscribedEmail(NewsletterSubscriptionTester $i) + public function iCanNotSubscribeWithAnAlreadySubscribedEmail(NewsletterAcceptanceTester $i) { $i->wantTo('Subscribe to the newsletter with an already subscribed email.'); $i->expect('Error message is displayed.'); @@ -62,11 +65,11 @@ public function iCanNotSubscribeWithAnAlreadySubscribedEmail(NewsletterSubscript } /** - * @param \Acceptance\Newsletter\Yves\Tester\NewsletterSubscriptionTester $i + * @param \PyzTest\Yves\Newsletter\NewsletterAcceptanceTester $i * * @return void */ - public function subscribedEmailIsLinkedWithCustomerAfterRegistration(NewsletterSubscriptionTester $i) + public function subscribedEmailIsLinkedWithCustomerAfterRegistration(NewsletterAcceptanceTester $i) { $i->wantTo('Subscribe to the newsletter with an unsubscribed email and later on register with that address.'); $i->expect('Subscriber email should be linked with registered customer.'); @@ -83,11 +86,11 @@ public function subscribedEmailIsLinkedWithCustomerAfterRegistration(NewsletterS } /** - * @param \Acceptance\Newsletter\Yves\Tester\NewsletterSubscriptionTester $i + * @param \PyzTest\Yves\Newsletter\NewsletterAcceptanceTester $i * * @return void */ - public function subscribedEmailCanBeUnsubscribedByCustomerAfterRegistration(NewsletterSubscriptionTester $i) + public function subscribedEmailCanBeUnsubscribedByCustomerAfterRegistration(NewsletterAcceptanceTester $i) { $i->wantTo('Subscribe to the newsletter with an unsubscribed email should be able to unsubscribe after registration.'); $i->expect('Subscribed email should be unsubscribed after customer unsubscribe.'); diff --git a/tests/Acceptance/Newsletter/Yves/Tester/NewsletterSubscriptionTester.php b/tests/PyzTest/Yves/Newsletter/_support/NewsletterAcceptanceTester.php similarity index 51% rename from tests/Acceptance/Newsletter/Yves/Tester/NewsletterSubscriptionTester.php rename to tests/PyzTest/Yves/Newsletter/_support/NewsletterAcceptanceTester.php index 98a27b187..350983d3c 100644 --- a/tests/Acceptance/Newsletter/Yves/Tester/NewsletterSubscriptionTester.php +++ b/tests/PyzTest/Yves/Newsletter/_support/NewsletterAcceptanceTester.php @@ -1,19 +1,42 @@ amYves(); + } + /** * @param string $email * diff --git a/tests/Acceptance/Newsletter/Yves/PageObject/NewsletterSubscriptionHomePage.php b/tests/PyzTest/Yves/Newsletter/_support/PageObject/NewsletterSubscriptionHomePage.php similarity index 92% rename from tests/Acceptance/Newsletter/Yves/PageObject/NewsletterSubscriptionHomePage.php rename to tests/PyzTest/Yves/Newsletter/_support/PageObject/NewsletterSubscriptionHomePage.php index 0277af205..73939a9fb 100644 --- a/tests/Acceptance/Newsletter/Yves/PageObject/NewsletterSubscriptionHomePage.php +++ b/tests/PyzTest/Yves/Newsletter/_support/PageObject/NewsletterSubscriptionHomePage.php @@ -5,7 +5,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\Newsletter\Yves\PageObject; +namespace PyzTest\Yves\Newsletter\PageObject; class NewsletterSubscriptionHomePage { diff --git a/tests/PyzTest/Yves/Newsletter/codeception.yml b/tests/PyzTest/Yves/Newsletter/codeception.yml new file mode 100644 index 000000000..11202626d --- /dev/null +++ b/tests/PyzTest/Yves/Newsletter/codeception.yml @@ -0,0 +1,32 @@ +namespace: PyzTest\Yves\Newsletter + +paths: + tests: . + data: _data + support: _support + log: _output + +coverage: + enabled: true + remote: false + whitelist: { include: ['../../../../src/*'] } + +suites: + Acceptance: + path: Acceptance + class_name: NewsletterAcceptanceTester + modules: + enabled: + - \PyzTest\Shared\Testify\Helper\Environment + - \Config\Module\ConfigInit + - \SprykerTest\Shared\Propel\Helper\ConnectionHelper + - \PyzTest\Yves\Customer\Helper\CustomerHelper + - \Propel\Module\PropelInstall + - WebDriver: + url: '' + browser: chrome + window_size: 1920x1080 + host: 0.0.0.0 + restart: false + - \SprykerTest\Shared\Testify\Helper\DataCleanupHelper + - \SprykerTest\Shared\Application\Helper\YvesHelper diff --git a/tests/Acceptance/Product/PageObject/ProductDetailPage.php b/tests/PyzTest/Yves/Product/_support/PageObject/ProductDetailPage.php similarity index 87% rename from tests/Acceptance/Product/PageObject/ProductDetailPage.php rename to tests/PyzTest/Yves/Product/_support/PageObject/ProductDetailPage.php index d14c558b7..36f808e54 100644 --- a/tests/Acceptance/Product/PageObject/ProductDetailPage.php +++ b/tests/PyzTest/Yves/Product/_support/PageObject/ProductDetailPage.php @@ -5,7 +5,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\Product\PageObject; +namespace PyzTest\Yves\Product\PageObject; class ProductDetailPage { diff --git a/tests/_support/_generated/.gitkeep b/tests/PyzTest/Zed/Availability/Presentation/.gitkeep similarity index 100% rename from tests/_support/_generated/.gitkeep rename to tests/PyzTest/Zed/Availability/Presentation/.gitkeep diff --git a/tests/PyzTest/Zed/Availability/_support/AvailabilityPresentationTester.php b/tests/PyzTest/Zed/Availability/_support/AvailabilityPresentationTester.php new file mode 100644 index 000000000..5dcf38b72 --- /dev/null +++ b/tests/PyzTest/Zed/Availability/_support/AvailabilityPresentationTester.php @@ -0,0 +1,26 @@ +executeJS("$('#$translationElementId').text('$contents');"); + } + + /** + * @return $this + */ + public function includeJquery() + { + $this->executeJS( + ' + var jq = document.createElement("script"); + jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; + document.getElementsByTagName("head")[0].appendChild(jq); + ' + ); + + $this->wait(1); + + return $this; + } + + /** + * @return int + */ + public function grabCmsPageId() + { + return $this->grabFromCurrentUrl('/id-cms-page=(\d+)/'); + } + + /** + * @return $this + */ + public function clickSubmit() + { + $this->click('//*[@id="submit-cms"]'); + + return $this; + } + + /** + * @param string $date + * + * @return $this + */ + public function setValidFrom($date) + { + $this->fillField("//*[@id=\"cms_page_validFrom\"]", $date); + + return $this; + } + + /** + * @param string $date + * + * @return $this + */ + public function setValidTo($date) + { + $this->fillField("//*[@id=\"cms_page_validTo\"]", $date); + + return $this; + } + + /** + * @param int $formIndex + * @param string $name + * @param string $url + * + * @return $this + */ + public function fillLocalizedUrlForm($formIndex, $name, $url) + { + $this->fillField('//*[@id="cms_page_pageAttributes_' . $formIndex . '_name"]', $name); + $this->fillField('//*[@id="cms_page_pageAttributes_' . $formIndex . '_url"]', $url); + + return $this; + } + + /** + * @return $this + */ + public function expandLocalizedUrlPane() + { + $this->click('//*[@id="tab-content-general"]/div/div[5]/div[1]/a'); + + return $this; + } + + /** + * @return $this + */ + public function clickPublishButton() + { + $this->click('//*[@id="page-wrapper"]/div[2]/div[2]/div/a[1]'); + + return $this; + } + +} diff --git a/tests/Acceptance/CmsGui/PageObject/CmsCreateGlossaryPage.php b/tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsCreateGlossaryPage.php similarity index 95% rename from tests/Acceptance/CmsGui/PageObject/CmsCreateGlossaryPage.php rename to tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsCreateGlossaryPage.php index 5992e30b6..6ac8604fd 100644 --- a/tests/Acceptance/CmsGui/PageObject/CmsCreateGlossaryPage.php +++ b/tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsCreateGlossaryPage.php @@ -4,7 +4,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\CmsGui\PageObject; +namespace PyzTest\Zed\CmsGui\PageObject; class CmsCreateGlossaryPage { diff --git a/tests/Acceptance/CmsGui/PageObject/CmsCreatePage.php b/tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsCreatePage.php similarity index 96% rename from tests/Acceptance/CmsGui/PageObject/CmsCreatePage.php rename to tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsCreatePage.php index b1624696e..c20adbb52 100644 --- a/tests/Acceptance/CmsGui/PageObject/CmsCreatePage.php +++ b/tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsCreatePage.php @@ -4,7 +4,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\CmsGui\PageObject; +namespace PyzTest\Zed\CmsGui\PageObject; class CmsCreatePage { diff --git a/tests/Acceptance/CmsGui/PageObject/CmsEditPage.php b/tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsEditPage.php similarity index 91% rename from tests/Acceptance/CmsGui/PageObject/CmsEditPage.php rename to tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsEditPage.php index e20cebbde..1744eade1 100644 --- a/tests/Acceptance/CmsGui/PageObject/CmsEditPage.php +++ b/tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsEditPage.php @@ -4,7 +4,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\CmsGui\PageObject; +namespace PyzTest\Zed\CmsGui\PageObject; class CmsEditPage { diff --git a/tests/Acceptance/CmsGui/PageObject/CmsListPage.php b/tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsListPage.php similarity index 89% rename from tests/Acceptance/CmsGui/PageObject/CmsListPage.php rename to tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsListPage.php index 07a06d6ec..dcddb0244 100644 --- a/tests/Acceptance/CmsGui/PageObject/CmsListPage.php +++ b/tests/PyzTest/Zed/CmsGui/_support/PageObject/CmsListPage.php @@ -4,7 +4,7 @@ * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. */ -namespace Acceptance\CmsGui\PageObject; +namespace PyzTest\Zed\CmsGui\PageObject; class CmsListPage { diff --git a/tests/PyzTest/Zed/CmsGui/codeception.yml b/tests/PyzTest/Zed/CmsGui/codeception.yml new file mode 100644 index 000000000..e6f692118 --- /dev/null +++ b/tests/PyzTest/Zed/CmsGui/codeception.yml @@ -0,0 +1,32 @@ +namespace: PyzTest\Zed\CmsGui + +paths: + tests: . + data: _data + support: _support + log: _output + +coverage: + enabled: true + remote: false + whitelist: { include: ['../../../../src/*'] } + +suites: + Acceptance: + path: Acceptance + class_name: CmsGuiAcceptanceTester + modules: + enabled: + - \PyzTest\Shared\Testify\Helper\Environment + - \Config\Module\ConfigInit + - \SprykerTest\Shared\Testify\Helper\LocatorHelper: + projectNamespaces: ['Pyz'] + + - \Propel\Module\PropelInstall + - WebDriver: + url: '' + browser: chrome + window_size: 1920x1080 + host: 0.0.0.0 + restart: false + - \SprykerTest\Shared\Testify\Helper\DataCleanupHelper diff --git a/tests/Acceptance/Console/ConsoleCest.php b/tests/PyzTest/Zed/Console/Console/ConsoleCest.php similarity index 63% rename from tests/Acceptance/Console/ConsoleCest.php rename to tests/PyzTest/Zed/Console/Console/ConsoleCest.php index cac940963..90be6db20 100644 --- a/tests/Acceptance/Console/ConsoleCest.php +++ b/tests/PyzTest/Zed/Console/Console/ConsoleCest.php @@ -5,25 +5,30 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace Acceptance\Console; +namespace PyzTest\Zed\Console\Console; use Acceptance\Console\Tester\ConsoleTester; use PHPUnit_Framework_Assert; +use PyzTest\Zed\Console\ConsoleConsoleTester; /** - * @group Acceptance + * Auto-generated group annotations + * @group PyzTest + * @group Zed + * @group Console * @group Console * @group ConsoleCest + * Add your own group annotations below this line */ class ConsoleCest { /** - * @param \Acceptance\Console\Tester\ConsoleTester $i + * @param \PyzTest\Zed\Console\ConsoleConsoleTester $i * * @return void */ - public function testICanRunConsoleApplication(ConsoleTester $i) + public function testICanRunConsoleApplication(ConsoleConsoleTester $i) { $i->wantTo('See that console is running'); diff --git a/tests/PyzTest/Zed/Console/Console/GenerateBundleCest.php b/tests/PyzTest/Zed/Console/Console/GenerateBundleCest.php new file mode 100644 index 000000000..17f23d90f --- /dev/null +++ b/tests/PyzTest/Zed/Console/Console/GenerateBundleCest.php @@ -0,0 +1,36 @@ +runSprykerCommand('code:generate:module:zed Acme -vvv'); + $i->seeInShellOutput('Generated: Pyz/Zed/Acme/AcmeConfig.php'); + $i->seeInShellOutput('Generated: ZedBundleCodeGenerator'); + $bundleDir = codecept_data_dir() . ConsoleHelper::SANDBOX_DIR . 'src/Pyz/Zed/Acme'; + $i->seeFileFound('AcmeConfig.php', $bundleDir); + $i->seeFileFound('AcmeDependencyProvider.php', $bundleDir); + $i->seeFileFound('AcmeFacade.php', $bundleDir . '/Business'); + } + +} diff --git a/tests/PyzTest/Zed/Console/Console/GenerateDataBuildersCest.php b/tests/PyzTest/Zed/Console/Console/GenerateDataBuildersCest.php new file mode 100644 index 000000000..03f2809aa --- /dev/null +++ b/tests/PyzTest/Zed/Console/Console/GenerateDataBuildersCest.php @@ -0,0 +1,32 @@ +runSprykerCommand('transfer:databuilder:generate -vvv'); + $i->seeInShellOutput('CustomerBuilder.php was generated'); + $i->seeFileFound(codecept_data_dir() . 'cli_sandbox/src/Generated/Shared/DataBuilder/CustomerBuilder.php'); + } + +} diff --git a/tests/_data/cli_sandbox/config/Shared/config_default-development.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default-development.php similarity index 100% rename from tests/_data/cli_sandbox/config/Shared/config_default-development.php rename to tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default-development.php diff --git a/tests/_data/cli_sandbox/config/Shared/config_default-development_DE.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default-development_DE.php similarity index 100% rename from tests/_data/cli_sandbox/config/Shared/config_default-development_DE.php rename to tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default-development_DE.php diff --git a/tests/_data/cli_sandbox/config/Shared/config_default.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default.php similarity index 100% rename from tests/_data/cli_sandbox/config/Shared/config_default.php rename to tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_default.php diff --git a/tests/_data/cli_sandbox/config/Shared/config_local.dist.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_local.dist.php similarity index 100% rename from tests/_data/cli_sandbox/config/Shared/config_local.dist.php rename to tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_local.dist.php diff --git a/tests/_data/cli_sandbox/config/Shared/config_propel.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_propel.php similarity index 100% rename from tests/_data/cli_sandbox/config/Shared/config_propel.php rename to tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/config_propel.php diff --git a/tests/_data/cli_sandbox/config/Shared/console_env_local.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/console_env_local.php similarity index 100% rename from tests/_data/cli_sandbox/config/Shared/console_env_local.php rename to tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/console_env_local.php diff --git a/tests/_data/cli_sandbox/config/Shared/default_store.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/default_store.php similarity index 100% rename from tests/_data/cli_sandbox/config/Shared/default_store.php rename to tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/default_store.php diff --git a/tests/_data/cli_sandbox/config/Shared/stores.php b/tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/stores.php similarity index 100% rename from tests/_data/cli_sandbox/config/Shared/stores.php rename to tests/PyzTest/Zed/Console/_data/cli_sandbox/config/Shared/stores.php diff --git a/tests/_data/console_runner.php b/tests/PyzTest/Zed/Console/_data/console_runner.php similarity index 75% rename from tests/_data/console_runner.php rename to tests/PyzTest/Zed/Console/_data/console_runner.php index b83078813..caa609e39 100644 --- a/tests/_data/console_runner.php +++ b/tests/PyzTest/Zed/Console/_data/console_runner.php @@ -1,9 +1,9 @@ run(); + $output = $process->getOutput(); + + return $output; + } + +} diff --git a/tests/_support/Helper/Console.php b/tests/PyzTest/Zed/Console/_support/Helper/ConsoleHelper.php similarity index 93% rename from tests/_support/Helper/Console.php rename to tests/PyzTest/Zed/Console/_support/Helper/ConsoleHelper.php index af3211b09..767d6affe 100644 --- a/tests/_support/Helper/Console.php +++ b/tests/PyzTest/Zed/Console/_support/Helper/ConsoleHelper.php @@ -1,12 +1,12 @@ assertTrue(true); - } - -} diff --git a/tests/Unit/_bootstrap.php b/tests/Unit/_bootstrap.php deleted file mode 100644 index b3d9bbc7f..000000000 --- a/tests/Unit/_bootstrap.php +++ /dev/null @@ -1 +0,0 @@ -bootstrap(SystemUnderTestBootstrap::APPLICATION_YVES); diff --git a/tests/YvesUnit.suite.yml b/tests/YvesUnit.suite.yml deleted file mode 100644 index 1be8e0be9..000000000 --- a/tests/YvesUnit.suite.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Codeception Test Suite Configuration - -# suite for unit (internal) tests. -# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. - -modules: - enabled: - - Asserts - - \Module\Unit diff --git a/tests/YvesUnit/_bootstrap.php b/tests/YvesUnit/_bootstrap.php deleted file mode 100644 index 27918eb61..000000000 --- a/tests/YvesUnit/_bootstrap.php +++ /dev/null @@ -1,6 +0,0 @@ -bootstrap(SystemUnderTestBootstrap::APPLICATION_YVES); diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php deleted file mode 100644 index d20b8a43e..000000000 --- a/tests/_bootstrap.php +++ /dev/null @@ -1,12 +0,0 @@ -setEnvironmentConfig($this->config); - } - -} diff --git a/tests/_helpers/EnvironmentalTestCaseInterface.php b/tests/_helpers/EnvironmentalTestCaseInterface.php deleted file mode 100644 index 22eda3f88..000000000 --- a/tests/_helpers/EnvironmentalTestCaseInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -boot(new Application()); - - Propel::getWriteConnection('zed')->beginTransaction(); - } - - /** - * @param \Codeception\TestCase $test - * - * @return void - */ - public function _after(TestCase $test) - { - parent::_after($test); - - Propel::getWriteConnection('zed')->rollBack(); - - if (session_status() === PHP_SESSION_ACTIVE) { - session_destroy(); - } - } - - /** - * @param \Codeception\TestCase $test - * @param bool $fail - * - * @return void - */ - public function _failed(TestCase $test, $fail) - { - parent::_failed($test, $fail); - - Propel::getWriteConnection('zed')->rollBack(); - - if (session_status() === PHP_SESSION_ACTIVE) { - session_destroy(); - } - } - -} diff --git a/tests/_support/Module/Unit.php b/tests/_support/Module/Unit.php deleted file mode 100644 index 9d7d06f2f..000000000 --- a/tests/_support/Module/Unit.php +++ /dev/null @@ -1,12 +0,0 @@ -amOnPage('/foo/bar/baz');` will use yves host - * - * @param \Codeception\Scenario $scenario - */ - public function __construct(Scenario $scenario) - { - parent::__construct($scenario); - - $i = $this; - $i->amYves(); - } - -} diff --git a/tests/_support/ZedAcceptanceTester.php b/tests/_support/ZedAcceptanceTester.php deleted file mode 100644 index bcb9e915e..000000000 --- a/tests/_support/ZedAcceptanceTester.php +++ /dev/null @@ -1,19 +0,0 @@ -amZed(); - } - -}