diff --git a/a-refactor/Console/Bootstrap.php b/a-refactor/Console/Bootstrap.php deleted file mode 100644 index e5713327e..000000000 --- a/a-refactor/Console/Bootstrap.php +++ /dev/null @@ -1,38 +0,0 @@ -header('Spryker refactorer'); - - parent::doRun($input, $output); - - $consoleHelper->success('Done refactoring!'); - } - -} diff --git a/a-refactor/Console/Command/RefactorCommand.php b/a-refactor/Console/Command/RefactorCommand.php deleted file mode 100644 index 845a5cb6f..000000000 --- a/a-refactor/Console/Command/RefactorCommand.php +++ /dev/null @@ -1,136 +0,0 @@ -setName(self::COMMAND_NAME); - $this->setDescription(self::DESCRIPTION); - - $this->addArgument('module', InputArgument::REQUIRED, 'module to refactor tests for'); - $this->addArgument('application', InputArgument::OPTIONAL, 'application to refactor tests for', 'Zed'); - - parent::configure(); - } - - /** - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param \Symfony\Component\Console\Output\OutputInterface $output - * - * @return int|null|void - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $module = $input->getArgument('module'); - $application = $input->getArgument('application'); - - $moduleTestDirectory = realpath(sprintf(__DIR__ . '/../../../vendor/spryker/spryker/Bundles/%s/tests', $module)); - $baseDirectory = sprintf('%s/SprykerTest/%s/%s', $moduleTestDirectory, $application, $module); - - if (!is_dir($baseDirectory)) { - mkdir($baseDirectory, 0777, true); - } - - $rootTemplateContent = file_get_contents(__DIR__ . '/../Templates/rootCodeception.yml'); - $rootTemplateContent = str_replace(['%module%', '%application%'], [$module, $application], $rootTemplateContent); - file_put_contents($moduleTestDirectory . '/../codeception.yml', $rootTemplateContent); - - $applicationTemplateContent = file_get_contents(__DIR__ . '/../Templates/applicationCodeception.yml'); - $applicationTemplateContent = str_replace(['%module%', '%application%'], [$module, $application], $applicationTemplateContent); - file_put_contents($baseDirectory . '/codeception.yml', $applicationTemplateContent); - - $this->moveUnitFiles($moduleTestDirectory, $application, $module); - $this->moveFunctionalFiles($moduleTestDirectory, $application, $module); - } - - /** - * @param string $moduleTestDirectory - * @param string $application - * @param string $module - * - * @return void - */ - protected function moveUnitFiles($moduleTestDirectory, $application, $module) - { - $unitDir = $moduleTestDirectory . sprintf('/Unit/Spryker/%s/%s', $application, $module); - if (is_dir($unitDir)) { - $finder = new Finder(); - $finder->files()->in($unitDir); - - $oldNamespace = sprintf('namespace Unit\\Spryker\\%s\\%s', $application, $module); - $newNamespace = sprintf('namespace SprykerTest\\%s\\%s', $application, $module); - $newUnitDir = $moduleTestDirectory . sprintf('/SprykerTest/%s/%s', $application, $module); - - foreach ($finder as $fileInfo) { - $newDestination = str_replace($unitDir, $newUnitDir, $fileInfo->getRealPath()); - - if (!file_exists($newDestination)) { - $newFileContent = file_get_contents($fileInfo->getRealPath()); - $newFileContent = str_replace($oldNamespace, $newNamespace, $newFileContent); - $newDirectory = dirname($newDestination); - if (!is_dir($newDirectory)) { - mkdir($newDirectory, 0777, true); - } - file_put_contents($newDestination, $newFileContent); - unlink($fileInfo->getRealPath()); - } - } - } - } - - /** - * @param string $moduleTestDirectory - * @param string $application - * @param string $module - * - * @return void - */ - protected function moveFunctionalFiles($moduleTestDirectory, $application, $module) - { - $functionalDir = $moduleTestDirectory . sprintf('/Functional/Spryker/%s/%s', $application, $module); - if (is_dir($functionalDir)) { - $finder = new Finder(); - $finder->files()->in($functionalDir); - - $oldNamespace = sprintf('namespace Functional\\Spryker\\%s\\%s', $application, $module); - $newNamespace = sprintf('namespace SprykerTest\\%s\\%s', $application, $module); - $newFunctionalDir = $moduleTestDirectory . sprintf('/SprykerTest/%s/%s', $application, $module); - - foreach ($finder as $fileInfo) { - $newDestination = str_replace($functionalDir, $newFunctionalDir, $fileInfo->getRealPath()); - - if (!file_exists($newDestination)) { - $newFileContent = file_get_contents($fileInfo->getRealPath()); - $newFileContent = str_replace($oldNamespace, $newNamespace, $newFileContent); - $newDirectory = dirname($newDestination); - if (!is_dir($newDirectory)) { - mkdir($newDirectory, 0777, true); - } - file_put_contents($newDestination, $newFileContent); - unlink($fileInfo->getRealPath()); - } - } - } - } - -} diff --git a/a-refactor/Console/ConsoleHelper.php b/a-refactor/Console/ConsoleHelper.php deleted file mode 100644 index b4346be13..000000000 --- a/a-refactor/Console/ConsoleHelper.php +++ /dev/null @@ -1,42 +0,0 @@ -writeln(sprintf('%s', $output)); - } - - /** - * @param string $name - * @param string $description - * - * @return void - */ - public function commandInfo($name, $description) - { - $this->newLine(3); - $this->section($name); - - if ($description) { - $this->comment($description); - } - } - -} diff --git a/a-refactor/Console/Templates/applicationCodeception.yml b/a-refactor/Console/Templates/applicationCodeception.yml deleted file mode 100644 index 97d4234f3..000000000 --- a/a-refactor/Console/Templates/applicationCodeception.yml +++ /dev/null @@ -1,69 +0,0 @@ -namespace: SprykerTest\%application%\%module% - -paths: - tests: . - data: ../../../_data - support: _support - log: ../../../_output - -coverage: - enabled: true - remote: false - whitelist: { include: ['../../../../src/*'] } - -suites: - Business: - path: Business - class_name: %module%BusinessTester - modules: - enabled: - - Asserts - - \SprykerTest\Shared\Testify\Helper\Environment - - \SprykerTest\Shared\Testify\Helper\ConfigHelper - - \SprykerTest\Shared\Testify\Helper\LocatorHelper - - \SprykerTest\Shared\Testify\Helper\DependencyHelper - - \SprykerTest\Shared\Propel\Helper\TransactionHelper - - Communication: - path: Communication - class_name: %module%CommunicationTester - modules: - enabled: - - Asserts - - \SprykerTest\Shared\Testify\Helper\Environment - - \SprykerTest\Shared\Testify\Helper\ConfigHelper - - \SprykerTest\Shared\Testify\Helper\LocatorHelper - - \SprykerTest\Shared\Testify\Helper\DependencyHelper - - \SprykerTest\Shared\Propel\Helper\TransactionHelper - - Persistence: - path: Persistence - class_name: %module%PersistenceTester - modules: - enabled: - - Asserts - - \SprykerTest\Shared\Testify\Helper\Environment - - \SprykerTest\Shared\Testify\Helper\ConfigHelper - - \SprykerTest\Shared\Testify\Helper\LocatorHelper - - \SprykerTest\Shared\Testify\Helper\DependencyHelper - - \SprykerTest\Shared\Propel\Helper\TransactionHelper - - Presentation: - path: Presentation - class_name: %module%PresentationTester - modules: - enabled: - - Asserts - - \SprykerTest\Shared\Testify\Helper\Environment - - \SprykerTest\Shared\Config\Helper\ConfigInit - - \SprykerTest\Shared\Testify\Helper\LocatorHelper - - WebDriver: - url: '' - browser: chrome - window_size: 1920x1080 - host: 0.0.0.0 - restart: false - - \SprykerTest\Shared\Testify\Helper\DataCleanupHelper - - \SprykerTest\Shared\Application\Helper\ZedHelper - - \SprykerTest\Zed\ZedNavigation\Helper\BreadcrumbHelper - - \SprykerTest\Zed\Gui\Helper\DataTableActionHelper diff --git a/a-refactor/Console/Templates/rootCodeception.yml b/a-refactor/Console/Templates/rootCodeception.yml deleted file mode 100644 index 45cd8dee9..000000000 --- a/a-refactor/Console/Templates/rootCodeception.yml +++ /dev/null @@ -1,32 +0,0 @@ -namespace: SprykerTest - -include: - - tests/SprykerTest/Client/%module% - - tests/SprykerTest/Shared/%module% - - tests/SprykerTest/Zed/%module% - -paths: - tests: tests - support: . - log: tests/_output - data: tests/_data - envs: tests/_envs - -settings: - bootstrap: _bootstrap.php - suite_class: \PHPUnit_Framework_TestSuite - colors: true - memory_limit: 1024M - log: true - -coverage: - enabled: true - whitelist: { include: ['src/*'] } - -extensions: - enabled: - - Codeception\Extension\Phantoman - - config: - Codeception\Extension\Phantoman: - suites: ['Presentation'] diff --git a/a-refactor/index.php b/a-refactor/index.php deleted file mode 100644 index 76c611379..000000000 --- a/a-refactor/index.php +++ /dev/null @@ -1,16 +0,0 @@ -add(new RefactorCommand()); -$console->run(); diff --git a/codeception.yml b/codeception.yml index bfcceb6ce..83ac09838 100644 --- a/codeception.yml +++ b/codeception.yml @@ -1,12 +1,28 @@ -actor: Tester +namespace: PyzTest include: - - tests/PyzTest/Yves/* - - tests/PyzTest/Zed/* - - vendor/spryker/spryker/Bundles/* +# - tests/PyzTest/Yves/Application +# - tests/PyzTest/Yves/Assets + - tests/PyzTest/Yves/Availability +# - tests/PyzTest/Yves/Cart +# - tests/PyzTest/Yves/Checkout +# - tests/PyzTest/Yves/Customer +# - tests/PyzTest/Yves/Newsletter +# - tests/PyzTest/Yves/Product +# - tests/PyzTest/Zed/Availability +# - tests/PyzTest/Zed/Calculation +# - tests/PyzTest/Zed/CmsGui +# - tests/PyzTest/Zed/Console +# - tests/PyzTest/Zed/NavigationGui +# - tests/PyzTest/Zed/Product +# - tests/PyzTest/Zed/ProductOption +# - tests/PyzTest/Zed/ProductRelation +# - tests/PyzTest/Zed/Sales +# - tests/PyzTest/Zed/Tax +# - tests/PyzTest/Zed/Touch +# - vendor/spryker/spryker/Bundles/*/* paths: - tests: tests log: tests/_output data: tests/_data support: tests/_support @@ -30,4 +46,4 @@ extensions: - Codeception\Extension\Phantoman config: Codeception\Extension\Phantoman: - suites: ['Acceptance', 'Presentation'] + suites: ['Presentation'] diff --git a/composer.json b/composer.json index 300cbe3f7..b62f39f22 100644 --- a/composer.json +++ b/composer.json @@ -95,12 +95,18 @@ }, "psr-4": { "PyzTest\\Shared\\Testify\\Helper\\": "tests/PyzTest/Shared/Testify/_support/Helper", - "PyzTest\\ZEd\\CmsGui\\PageObject\\": "tests/PyzTest/Zed/CmsGui/_support/PageObject", - "PyzTest\\Yves\\Customer\\Helper\\": "tests/PyzTest/Yves/Customer/_support/Helper", + "PyzTest\\Yves\\Cart\\PageObject\\": "tests/PyzTest/Yves/Cart/_support/PageObject", + "PyzTest\\Yves\\Checkout\\Helper\\": "tests/PyzTest/Yves/Checkout/_support/Helper", "PyzTest\\Yves\\Customer\\PageObject\\": "tests/PyzTest/Yves/Customer/_support/PageObject", "PyzTest\\Yves\\Product\\PageObject\\": "tests/PyzTest/Yves/Product/_support/PageObject", + "PyzTest\\Zed\\Availability\\PageObject\\": "tests/PyzTest/Zed/Availability/_support/PageObject", + "PyzTest\\Zed\\CmsGui\\PageObject\\": "tests/PyzTest/Zed/CmsGui/_support/PageObject", "PyzTest\\Zed\\Console\\Helper\\": "tests/PyzTest/Zed/Console/_support/Helper" - } + }, + "files": [ + "tests/PyzTest/Zed/Availability/_support/_generated/AvailabilityPresentationTesterActions.php", + "tests/PyzTest/Zed/Availability/_support/AvailabilityPresentationTester.php" + ] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/tests/PyzTest/Yves/Application/Acceptance/HomepageCest.php b/tests/PyzTest/Yves/Application/Presentation/HomepageCest.php similarity index 68% rename from tests/PyzTest/Yves/Application/Acceptance/HomepageCest.php rename to tests/PyzTest/Yves/Application/Presentation/HomepageCest.php index d206dc485..082a536a8 100644 --- a/tests/PyzTest/Yves/Application/Acceptance/HomepageCest.php +++ b/tests/PyzTest/Yves/Application/Presentation/HomepageCest.php @@ -5,9 +5,9 @@ * For full license information, please view the LICENSE file that was distributed with this source code. */ -namespace PyzTest\Yves\Application\Acceptance; +namespace PyzTest\Yves\Application\Presentation; -use PyzTest\Yves\Application\ApplicationAcceptanceTester; +use PyzTest\Yves\Application\ApplicationPresentationTester; use PyzTest\Yves\Application\PageObject\Homepage; /** @@ -15,7 +15,7 @@ * @group PyzTest * @group Yves * @group Application - * @group Acceptance + * @group Presentation * @group HomepageCest * Add your own group annotations below this line */ @@ -23,11 +23,11 @@ class HomepageCest { /** - * @param \PyzTest\Yves\Application\ApplicationAcceptanceTester $i + * @param \PyzTest\Yves\Application\ApplicationPresentationTester $i * * @return void */ - public function testICanOpenHomepage(ApplicationAcceptanceTester $i) + public function testICanOpenHomepage(ApplicationPresentationTester $i) { $i->wantTo('See that i can open the homepage'); $i->amOnPage(Homepage::URL); diff --git a/tests/PyzTest/Yves/Application/_support/ApplicationAcceptanceTester.php b/tests/PyzTest/Yves/Application/_support/ApplicationPresentationTester.php similarity index 87% rename from tests/PyzTest/Yves/Application/_support/ApplicationAcceptanceTester.php rename to tests/PyzTest/Yves/Application/_support/ApplicationPresentationTester.php index fa4d4b52a..bff5cd31e 100644 --- a/tests/PyzTest/Yves/Application/_support/ApplicationAcceptanceTester.php +++ b/tests/PyzTest/Yves/Application/_support/ApplicationPresentationTester.php @@ -19,10 +19,10 @@ * * @SuppressWarnings(PHPMD) */ -class ApplicationAcceptanceTester extends Actor +class ApplicationPresentationTester extends Actor { - use _generated\ApplicationAcceptanceTesterActions; + use _generated\ApplicationPresentationTesterActions; /** * @param \Codeception\Scenario $scenario diff --git a/tests/PyzTest/Yves/Application/_support/PageObject/Homepage.php b/tests/PyzTest/Yves/Application/_support/PageObject/Homepage.php index 13e2a79fc..c23a0a594 100644 --- a/tests/PyzTest/Yves/Application/_support/PageObject/Homepage.php +++ b/tests/PyzTest/Yves/Application/_support/PageObject/Homepage.php @@ -2,7 +2,7 @@ /** * Copyright © 2016-present Spryker Systems GmbH. All rights reserved. - * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. + * Use of this software requires Presentation of the Evaluation License Agreement. See LICENSE file. */ namespace PyzTest\Yves\Application\PageObject; diff --git a/tests/PyzTest/Yves/Application/codeception.yml b/tests/PyzTest/Yves/Application/codeception.yml index 2ceaee524..e64ee1021 100644 --- a/tests/PyzTest/Yves/Application/codeception.yml +++ b/tests/PyzTest/Yves/Application/codeception.yml @@ -12,9 +12,9 @@ coverage: whitelist: { include: ['../../../../src/*'] } suites: - Acceptance: - path: Acceptance - class_name: ApplicationAcceptanceTester + Presentation: + path: Presentation + class_name: ApplicationPresentationTester modules: enabled: - \PyzTest\Shared\Testify\Helper\Environment diff --git a/tests/PyzTest/Yves/Availability/Acceptance/AvailabilityAddToCartCest.php b/tests/PyzTest/Yves/Availability/Presentation/AvailabilityAddToCartCest.php similarity index 64% rename from tests/PyzTest/Yves/Availability/Acceptance/AvailabilityAddToCartCest.php rename to tests/PyzTest/Yves/Availability/Presentation/AvailabilityAddToCartCest.php index f76e4b803..09f72da56 100644 --- a/tests/PyzTest/Yves/Availability/Acceptance/AvailabilityAddToCartCest.php +++ b/tests/PyzTest/Yves/Availability/Presentation/AvailabilityAddToCartCest.php @@ -2,12 +2,12 @@ /** * Copyright © 2016-present Spryker Systems GmbH. All rights reserved. - * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. + * Use of this software requires Presentation of the Evaluation License Agreement. See LICENSE file. */ -namespace PyzTest\Yves\Availability\Acceptance; +namespace PyzTest\Yves\Availability\Presentation; -use PyzTest\Yves\Availability\AvailabilityAcceptanceTester; +use PyzTest\Yves\Availability\AvailabilityPresentationTester; use PyzTest\Yves\Cart\PageObject\CartListPage; use PyzTest\Yves\Product\PageObject\ProductDetailPage; @@ -16,7 +16,7 @@ * @group PyzTest * @group Yves * @group Availability - * @group Acceptance + * @group Presentation * @group AvailabilityAddToCartCest * Add your own group annotations below this line */ @@ -24,16 +24,16 @@ class AvailabilityAddToCartCest { /** - * @param \PyzTest\Yves\Availability\AvailabilityAcceptanceTester $i + * @param \PyzTest\Yves\Availability\AvailabilityPresentationTester $i * * @return void */ - public function testAddToCartWhenBiggerQuantityIsUsed(AvailabilityAcceptanceTester $i) + public function testAddToCartWhenBiggerQuantityIsUsed(AvailabilityPresentationTester $i) { $i->wantTo('Open product page, and add item to cart with larger quantity than available'); $i->expectTo('Display error message'); - $i->amOnPage(AvailabilityAcceptanceTester::FUJITSU2_PRODUCT_PAGE); + $i->amOnPage(AvailabilityPresentationTester::FUJITSU2_PRODUCT_PAGE); $i->click(ProductDetailPage::ADD_TO_CART_XPATH); @@ -42,7 +42,7 @@ public function testAddToCartWhenBiggerQuantityIsUsed(AvailabilityAcceptanceTest $i->fillField(CartListPage::FIRST_CART_ITEM_QUANTITY_INPUT_XPATH, 50); $i->click(CartListPage::FIRST_CART_ITEM_CHANGE_QUANTITY_BUTTON_XPATH); - $i->see(AvailabilityAcceptanceTester::CART_PRE_CHECK_AVAILABILITY_ERROR_MESSAGE); + $i->see(AvailabilityPresentationTester::CART_PRE_CHECK_AVAILABILITY_ERROR_MESSAGE); } } diff --git a/tests/PyzTest/Yves/Availability/Acceptance/CheckoutAvailabilityCest.php b/tests/PyzTest/Yves/Availability/Presentation/CheckoutAvailabilityCest.php similarity index 77% rename from tests/PyzTest/Yves/Availability/Acceptance/CheckoutAvailabilityCest.php rename to tests/PyzTest/Yves/Availability/Presentation/CheckoutAvailabilityCest.php index 9decaf3f0..81540c66b 100644 --- a/tests/PyzTest/Yves/Availability/Acceptance/CheckoutAvailabilityCest.php +++ b/tests/PyzTest/Yves/Availability/Presentation/CheckoutAvailabilityCest.php @@ -1,15 +1,15 @@ wantTo('Checkout item with stock'); $i->expectTo('Availability changed during SM processing.'); - $i->amOnPage(AvailabilityAcceptanceTester::FUJITSU_PRODUCT_PAGE); + $i->amOnPage(AvailabilityPresentationTester::FUJITSU_PRODUCT_PAGE); $i->click(ProductDetailPage::ADD_TO_CART_XPATH); @@ -45,11 +45,9 @@ public function testCheckoutItemWithAvailability(AvailabilityAcceptanceTester $i $i->processCheckout(); - $zedTester = $i->haveFriend('zedTester', AvailabilityPresentationTester::class); - - $zedTester->does(function (AvailabilityPresentationTester $i) { - $i->amLoggedInUser(); + $zedTester = $i->haveFriend('zedTester', ZedAvailabilityPresentationTester::class); + $zedTester->does(function (ZedAvailabilityPresentationTester $i) { $idProductFujitsu = 118; $i->amOnPage(sprintf(AvailabilityViewPage::VIEW_PRODUCT_AVAILABILITY_URL, $idProductFujitsu)); diff --git a/tests/PyzTest/Yves/Availability/_support/AvailabilityAcceptanceTester.php b/tests/PyzTest/Yves/Availability/_support/AvailabilityPresentationTester.php similarity index 79% rename from tests/PyzTest/Yves/Availability/_support/AvailabilityAcceptanceTester.php rename to tests/PyzTest/Yves/Availability/_support/AvailabilityPresentationTester.php index 94d4cb114..3530f1505 100644 --- a/tests/PyzTest/Yves/Availability/_support/AvailabilityAcceptanceTester.php +++ b/tests/PyzTest/Yves/Availability/_support/AvailabilityPresentationTester.php @@ -4,7 +4,6 @@ use Codeception\Actor; use Codeception\Scenario; -use PyzTest\Yves\Checkout\CheckoutAcceptanceTester; /** * Inherited Methods @@ -21,10 +20,10 @@ * * @SuppressWarnings(PHPMD) */ -class AvailabilityAcceptanceTester extends Actor +class AvailabilityPresentationTester extends Actor { - use _generated\AvailabilityAcceptanceTesterActions; + use _generated\AvailabilityPresentationTesterActions; const FUJITSU_PRODUCT_PAGE = '/en/fujitsu-esprimo-e420-118'; const FUJITSU2_PRODUCT_PAGE = 'en/fujitsu-esprimo-e920-119'; @@ -46,8 +45,7 @@ public function __construct(Scenario $scenario) */ public function processCheckout() { - $checkoutTester = new CheckoutAcceptanceTester($this->getScenario()); - $checkoutTester->processAllCheckoutSteps(); + $this->processAllCheckoutSteps(); } } diff --git a/tests/PyzTest/Yves/Availability/codeception.yml b/tests/PyzTest/Yves/Availability/codeception.yml index 2cc490b6f..c7ba9afa5 100644 --- a/tests/PyzTest/Yves/Availability/codeception.yml +++ b/tests/PyzTest/Yves/Availability/codeception.yml @@ -12,13 +12,14 @@ coverage: whitelist: { include: ['../../../../src/*'] } suites: - Acceptance: - path: Acceptance - class_name: AvailabilityAcceptanceTester + Presentation: + path: Presentation + class_name: AvailabilityPresentationTester modules: enabled: - \PyzTest\Shared\Testify\Helper\Environment - \SprykerTest\Shared\Config\Helper\ConfigInit + - \PyzTest\Yves\Checkout\Helper\CheckoutHelper - \SprykerTest\Shared\Propel\Helper\PropelInstallHelper - WebDriver: url: '' @@ -28,3 +29,4 @@ suites: restart: false - \SprykerTest\Shared\Testify\Helper\DataCleanupHelper - \SprykerTest\Shared\Application\Helper\YvesHelper + - \SprykerTest\Shared\Application\Helper\ZedHelper diff --git a/tests/PyzTest/Yves/Cart/_support/PageObject/CartListPage.php b/tests/PyzTest/Yves/Cart/_support/PageObject/CartListPage.php index eae9dccec..ffcc73cfe 100644 --- a/tests/PyzTest/Yves/Cart/_support/PageObject/CartListPage.php +++ b/tests/PyzTest/Yves/Cart/_support/PageObject/CartListPage.php @@ -2,7 +2,7 @@ /** * Copyright © 2016-present Spryker Systems GmbH. All rights reserved. - * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. + * Use of this software requires Presentation of the Evaluation License Agreement. See LICENSE file. */ namespace PyzTest\Yves\Cart\PageObject; diff --git a/tests/PyzTest/Yves/Cart/codeception.yml b/tests/PyzTest/Yves/Cart/codeception.yml new file mode 100644 index 000000000..f5e46fde3 --- /dev/null +++ b/tests/PyzTest/Yves/Cart/codeception.yml @@ -0,0 +1,12 @@ +namespace: PyzTest\Yves\Cart + +paths: + tests: . + data: _data + support: _support + log: _output + +coverage: + enabled: true + remote: false + whitelist: { include: ['../../../../src/*'] } diff --git a/tests/PyzTest/Yves/Checkout/Controller/CheckoutControllerTest.php b/tests/PyzTest/Yves/Checkout/Controller/CheckoutControllerTest.php index 6ceb33787..2ecca22b6 100644 --- a/tests/PyzTest/Yves/Checkout/Controller/CheckoutControllerTest.php +++ b/tests/PyzTest/Yves/Checkout/Controller/CheckoutControllerTest.php @@ -314,6 +314,7 @@ public function testPaymentAction() */ public function testSummaryActionShouldRenderSummaryPage() { + $this->markTestSkipped('Move this to function controller tests'); $this->setQuoteForSummary(); $request = Request::createFromGlobals(); diff --git a/tests/PyzTest/Yves/Checkout/_support/Helper/CheckoutHelper.php b/tests/PyzTest/Yves/Checkout/_support/Helper/CheckoutHelper.php new file mode 100644 index 000000000..5fd1fecb6 --- /dev/null +++ b/tests/PyzTest/Yves/Checkout/_support/Helper/CheckoutHelper.php @@ -0,0 +1,153 @@ +getModule('WebDriver'); + } + + /** + * @return $this + */ + public function processCustomerStep() + { + $tester = $this->getWebDriver(); + $tester->see('Create account'); + + $tester->fillField('//*[@id="registerForm_customer_first_name"]', 'first-name-test' . rand(100, 999)); + $tester->fillField('//*[@id="registerForm_customer_last_name"]', 'last-name-test' . rand(100, 999)); + $tester->fillField('//*[@id="registerForm_customer_email"]', 'email-test@domain-' . rand(100, 999) . '.tld'); + $tester->fillField('//*[@id="registerForm_customer_password_pass"]', 'as'); + $tester->fillField('//*[@id="registerForm_customer_password_confirm"]', 'as'); + $tester->click('//*[@id="registerForm_customer_accept_terms"]'); + + return $this; + } + + /** + * @return $this + */ + public function clickRegisterButton() + { + $tester = $this->getWebDriver(); + $tester->click('/html/body/div[2]/main/div/div[1]/div[3]/form/div/div/button'); + + return $this; + } + + /** + * @return $this + */ + public function processAddressStep() + { + $tester = $this->getWebDriver(); + $tester->see('Shipping Address'); + + $tester->fillField('//*[@id="addressesForm_shippingAddress_first_name"]', 'first-name-test' . rand(100, 999)); + $tester->fillField('//*[@id="addressesForm_shippingAddress_last_name"]', 'last-name-test' . rand(100, 999)); + $tester->fillField('//*[@id="addressesForm_shippingAddress_company"]', 'company-test' . rand(100, 999)); + $tester->fillField('//*[@id="addressesForm_shippingAddress_phone"]', '123456789'); + $tester->fillField('//*[@id="addressesForm_shippingAddress_address1"]', 'address1'); + $tester->fillField('//*[@id="addressesForm_shippingAddress_address2"]', '15'); + $tester->fillField('//*[@id="addressesForm_shippingAddress_address3"]', 'address3'); + $tester->fillField('//*[@id="addressesForm_shippingAddress_zip_code"]', '10405'); + $tester->fillField('//*[@id="addressesForm_shippingAddress_city"]', 'city'); + + return $this; + } + + /** + * @return $this + */ + public function processShipmentStep() + { + $tester = $this->getWebDriver(); + $tester->see('Shipment'); + + $tester->click('//*[@id="shipmentForm_idShipmentMethod_1"]'); + + return $this; + } + + /** + * @return $this + */ + public function processOverviewStep() + { + $tester = $this->getWebDriver(); + $tester->see('Overview'); + + return $this; + } + + /** + * @return $this + */ + public function processSuccessStep() + { + $tester = $this->getWebDriver(); + $tester->see('Your order has been placed successfully!'); + + return $this; + } + + /** + * @return $this + */ + public function processPaymentStep() + { + $tester = $this->getWebDriver(); + $tester->see('Payment'); + + $tester->click('//*[@id="paymentForm_paymentSelection_1"]'); + $tester->fillField('//*[@id="paymentForm_dummyPaymentInvoice_date_of_birth"]', '01.07.1985'); + + return $this; + } + + /** + * @return $this + */ + public function nextStep() + { + $tester = $this->getWebDriver(); + $tester->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/PyzTest/Yves/Customer/Acceptance/CustomerAddressCest.php b/tests/PyzTest/Yves/Customer/Presentation/CustomerAddressCest.php similarity index 91% rename from tests/PyzTest/Yves/Customer/Acceptance/CustomerAddressCest.php rename to tests/PyzTest/Yves/Customer/Presentation/CustomerAddressCest.php index c352da618..2a8c5901e 100644 --- a/tests/PyzTest/Yves/Customer/Acceptance/CustomerAddressCest.php +++ b/tests/PyzTest/Yves/Customer/Presentation/CustomerAddressCest.php @@ -7,7 +7,7 @@ namespace PyzTest\Yves\Customer\Yves; -use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\CustomerPresentationTester; use PyzTest\Yves\Customer\PageObject\CustomerAddressesPage; use PyzTest\Yves\Customer\PageObject\CustomerAddressPage; @@ -24,11 +24,11 @@ class CustomerAddressCest { /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanAddNewAddress(CustomerAcceptanceTester $i) + public function testICanAddNewAddress(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerAddressPage::URL); diff --git a/tests/PyzTest/Yves/Customer/Acceptance/CustomerAddressesCest.php b/tests/PyzTest/Yves/Customer/Presentation/CustomerAddressesCest.php similarity index 80% rename from tests/PyzTest/Yves/Customer/Acceptance/CustomerAddressesCest.php rename to tests/PyzTest/Yves/Customer/Presentation/CustomerAddressesCest.php index dc51edd57..ba896fbcf 100644 --- a/tests/PyzTest/Yves/Customer/Acceptance/CustomerAddressesCest.php +++ b/tests/PyzTest/Yves/Customer/Presentation/CustomerAddressesCest.php @@ -7,7 +7,7 @@ namespace PyzTest\Yves\Customer\Yves; -use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\CustomerPresentationTester; use PyzTest\Yves\Customer\PageObject\CustomerAddressesPage; use PyzTest\Yves\Customer\PageObject\CustomerAddressPage; @@ -24,11 +24,11 @@ class CustomerAddressesCest { /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanOpenAddAddressPage(CustomerAcceptanceTester $i) + public function testICanOpenAddAddressPage(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerAddressesPage::URL); diff --git a/tests/PyzTest/Yves/Customer/Acceptance/CustomerLoginCest.php b/tests/PyzTest/Yves/Customer/Presentation/CustomerLoginCest.php similarity index 72% rename from tests/PyzTest/Yves/Customer/Acceptance/CustomerLoginCest.php rename to tests/PyzTest/Yves/Customer/Presentation/CustomerLoginCest.php index dc0996090..2e5306d5a 100644 --- a/tests/PyzTest/Yves/Customer/Acceptance/CustomerLoginCest.php +++ b/tests/PyzTest/Yves/Customer/Presentation/CustomerLoginCest.php @@ -7,7 +7,7 @@ namespace PyzTest\Yves\Customer\Yves; -use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\CustomerPresentationTester; use PyzTest\Yves\Customer\PageObject\CustomerLoginPage; use PyzTest\Yves\Customer\PageObject\CustomerOverviewPage; use PyzTest\Yves\Customer\PageObject\CustomerPasswordForgottenPage; @@ -25,22 +25,22 @@ class CustomerLoginCest { /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanOpenLoginPage(CustomerAcceptanceTester $i) + public function testICanOpenLoginPage(CustomerPresentationTester $i) { $i->amOnPage(CustomerLoginPage::URL); $i->see(CustomerLoginPage::TITLE_LOGIN, 'h4'); } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanOpenForgotPasswordPage(CustomerAcceptanceTester $i) + public function testICanOpenForgotPasswordPage(CustomerPresentationTester $i) { $i->amOnPage(CustomerLoginPage::URL); $i->click(CustomerLoginPage::FORGOT_PASSWORD_LINK); @@ -48,11 +48,11 @@ public function testICanOpenForgotPasswordPage(CustomerAcceptanceTester $i) } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanLoginWithValidData(CustomerAcceptanceTester $i) + public function testICanLoginWithValidData(CustomerPresentationTester $i) { $i->amOnPage(CustomerLoginPage::URL); $i->haveRegisteredCustomer(CustomerLoginPage::NEW_CUSTOMER_EMAIL); diff --git a/tests/PyzTest/Yves/Customer/Acceptance/CustomerLogoutCest.php b/tests/PyzTest/Yves/Customer/Presentation/CustomerLogoutCest.php similarity index 82% rename from tests/PyzTest/Yves/Customer/Acceptance/CustomerLogoutCest.php rename to tests/PyzTest/Yves/Customer/Presentation/CustomerLogoutCest.php index 3843e588e..84564833f 100644 --- a/tests/PyzTest/Yves/Customer/Acceptance/CustomerLogoutCest.php +++ b/tests/PyzTest/Yves/Customer/Presentation/CustomerLogoutCest.php @@ -7,7 +7,7 @@ namespace PyzTest\Yves\Customer\Yves; -use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\CustomerPresentationTester; use PyzTest\Yves\Customer\PageObject\CustomerLoginPage; use PyzTest\Yves\Customer\PageObject\CustomerLogoutPage; use PyzTest\Yves\Customer\PageObject\CustomerOverviewPage; @@ -25,11 +25,11 @@ class CustomerLogoutCest { /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanLogoutWhenLoggedIn(CustomerAcceptanceTester $i) + public function testICanLogoutWhenLoggedIn(CustomerPresentationTester $i) { $i->amOnPage(CustomerLoginPage::URL); $i->haveRegisteredCustomer(CustomerLoginPage::NEW_CUSTOMER_EMAIL); diff --git a/tests/PyzTest/Yves/Customer/Acceptance/CustomerNewsletterCest.php b/tests/PyzTest/Yves/Customer/Presentation/CustomerNewsletterCest.php similarity index 83% rename from tests/PyzTest/Yves/Customer/Acceptance/CustomerNewsletterCest.php rename to tests/PyzTest/Yves/Customer/Presentation/CustomerNewsletterCest.php index 5a3bb562b..51d9687b1 100644 --- a/tests/PyzTest/Yves/Customer/Acceptance/CustomerNewsletterCest.php +++ b/tests/PyzTest/Yves/Customer/Presentation/CustomerNewsletterCest.php @@ -8,7 +8,7 @@ namespace PyzTest\Yves\Customer\Yves; use Codeception\Util\Stub; -use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\CustomerPresentationTester; use PyzTest\Yves\Customer\PageObject\CustomerNewsletterPage; use Spryker\Zed\Newsletter\Dependency\Facade\NewsletterToMailInterface; use Spryker\Zed\Newsletter\NewsletterDependencyProvider; @@ -26,11 +26,11 @@ class CustomerNewsletterCest { /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanSubscribeNewsletter(CustomerAcceptanceTester $i) + public function testICanSubscribeNewsletter(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerNewsletterPage::URL); @@ -43,11 +43,11 @@ public function testICanSubscribeNewsletter(CustomerAcceptanceTester $i) } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanUnSubscribeNewsletter(CustomerAcceptanceTester $i) + public function testICanUnSubscribeNewsletter(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); diff --git a/tests/PyzTest/Yves/Customer/Acceptance/CustomerOverviewCest.php b/tests/PyzTest/Yves/Customer/Presentation/CustomerOverviewCest.php similarity index 79% rename from tests/PyzTest/Yves/Customer/Acceptance/CustomerOverviewCest.php rename to tests/PyzTest/Yves/Customer/Presentation/CustomerOverviewCest.php index 4b9041c31..f2f169ae5 100644 --- a/tests/PyzTest/Yves/Customer/Acceptance/CustomerOverviewCest.php +++ b/tests/PyzTest/Yves/Customer/Presentation/CustomerOverviewCest.php @@ -7,7 +7,7 @@ namespace PyzTest\Yves\Customer\Yves; -use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\CustomerPresentationTester; use PyzTest\Yves\Customer\PageObject\CustomerAddressesPage; use PyzTest\Yves\Customer\PageObject\CustomerNewsletterPage; use PyzTest\Yves\Customer\PageObject\CustomerOrdersPage; @@ -27,11 +27,11 @@ class CustomerOverviewCest { /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanOpenOverviewPage(CustomerAcceptanceTester $i) + public function testICanOpenOverviewPage(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -44,11 +44,11 @@ public function testICanOpenOverviewPage(CustomerAcceptanceTester $i) } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testCustomerWithoutAddressShouldSeeAddAddressInfoText(CustomerAcceptanceTester $i) + public function testCustomerWithoutAddressShouldSeeAddAddressInfoText(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -58,11 +58,11 @@ public function testCustomerWithoutAddressShouldSeeAddAddressInfoText(CustomerAc } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testCustomerWithAddressShouldNotSeeAddressInfoText(CustomerAcceptanceTester $i) + public function testCustomerWithAddressShouldNotSeeAddressInfoText(CustomerPresentationTester $i) { $i->haveRegisteredCustomer(CustomerOverviewPage::NEW_CUSTOMER_EMAIL); $i->addAddressToCustomer(CustomerOverviewPage::NEW_CUSTOMER_EMAIL, CustomerAddressesPage::ADDRESS_A); @@ -76,11 +76,11 @@ public function testCustomerWithAddressShouldNotSeeAddressInfoText(CustomerAccep } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanGoFromOverviewToProfilePage(CustomerAcceptanceTester $i) + public function testICanGoFromOverviewToProfilePage(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -89,11 +89,11 @@ public function testICanGoFromOverviewToProfilePage(CustomerAcceptanceTester $i) } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanGoFromOverviewToAddressesPage(CustomerAcceptanceTester $i) + public function testICanGoFromOverviewToAddressesPage(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -102,11 +102,11 @@ public function testICanGoFromOverviewToAddressesPage(CustomerAcceptanceTester $ } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanGoFromOverviewToOrdersPage(CustomerAcceptanceTester $i) + public function testICanGoFromOverviewToOrdersPage(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); @@ -115,11 +115,11 @@ public function testICanGoFromOverviewToOrdersPage(CustomerAcceptanceTester $i) } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanGoFromOverviewToNewsletterPage(CustomerAcceptanceTester $i) + public function testICanGoFromOverviewToNewsletterPage(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerOverviewPage::URL); diff --git a/tests/PyzTest/Yves/Customer/Acceptance/CustomerProfileCest.php b/tests/PyzTest/Yves/Customer/Presentation/CustomerProfileCest.php similarity index 86% rename from tests/PyzTest/Yves/Customer/Acceptance/CustomerProfileCest.php rename to tests/PyzTest/Yves/Customer/Presentation/CustomerProfileCest.php index 3a59b6e34..34bda1fad 100644 --- a/tests/PyzTest/Yves/Customer/Acceptance/CustomerProfileCest.php +++ b/tests/PyzTest/Yves/Customer/Presentation/CustomerProfileCest.php @@ -7,7 +7,7 @@ namespace PyzTest\Yves\Customer\Yves; -use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\CustomerPresentationTester; use PyzTest\Yves\Customer\PageObject\CustomerProfilePage; /** @@ -23,11 +23,11 @@ class CustomerProfileCest { /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanUpdateProfileData(CustomerAcceptanceTester $i) + public function testICanUpdateProfileData(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerProfilePage::URL); @@ -43,11 +43,11 @@ public function testICanUpdateProfileData(CustomerAcceptanceTester $i) } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanUpdateEmail(CustomerAcceptanceTester $i) + public function testICanUpdateEmail(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerProfilePage::URL); @@ -59,11 +59,11 @@ public function testICanUpdateEmail(CustomerAcceptanceTester $i) } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanNotUpdateEmailToAnAlreadyUsedOne(CustomerAcceptanceTester $i) + public function testICanNotUpdateEmailToAnAlreadyUsedOne(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->haveRegisteredCustomer(CustomerProfilePage::REGISTERED_CUSTOMER_EMAIL); @@ -76,11 +76,11 @@ public function testICanNotUpdateEmailToAnAlreadyUsedOne(CustomerAcceptanceTeste } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanChangePassword(CustomerAcceptanceTester $i) + public function testICanChangePassword(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerProfilePage::URL); @@ -101,11 +101,11 @@ public function testICanChangePassword(CustomerAcceptanceTester $i) } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanNotChangePasswordWhenNewPasswordsNotMatch(CustomerAcceptanceTester $i) + public function testICanNotChangePasswordWhenNewPasswordsNotMatch(CustomerPresentationTester $i) { $i->amLoggedInCustomer(); $i->amOnPage(CustomerProfilePage::URL); diff --git a/tests/PyzTest/Yves/Customer/Acceptance/CustomerRegistrationCest.php b/tests/PyzTest/Yves/Customer/Presentation/CustomerRegistrationCest.php similarity index 75% rename from tests/PyzTest/Yves/Customer/Acceptance/CustomerRegistrationCest.php rename to tests/PyzTest/Yves/Customer/Presentation/CustomerRegistrationCest.php index 7c146482f..c08107df9 100644 --- a/tests/PyzTest/Yves/Customer/Acceptance/CustomerRegistrationCest.php +++ b/tests/PyzTest/Yves/Customer/Presentation/CustomerRegistrationCest.php @@ -7,7 +7,7 @@ namespace PyzTest\Yves\Customer\Yves; -use PyzTest\Yves\Customer\CustomerAcceptanceTester; +use PyzTest\Yves\Customer\CustomerPresentationTester; use PyzTest\Yves\Customer\PageObject\CustomerOverviewPage; use PyzTest\Yves\Customer\PageObject\CustomerRegistrationPage; @@ -24,22 +24,22 @@ class CustomerRegistrationCest { /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanOpenRegistrationPage(CustomerAcceptanceTester $i) + public function testICanOpenRegistrationPage(CustomerPresentationTester $i) { $i->amOnPage(CustomerRegistrationPage::URL); $i->see(CustomerRegistrationPage::TITLE_CREATE_ACCOUNT, 'h4'); } /** - * @param \PyzTest\Yves\Customer\CustomerAcceptanceTester $i + * @param \PyzTest\Yves\Customer\CustomerPresentationTester $i * * @return void */ - public function testICanRegisterWithValidData(CustomerAcceptanceTester $i) + public function testICanRegisterWithValidData(CustomerPresentationTester $i) { $i->amOnPage(CustomerRegistrationPage::URL); $i->fillOutRegistrationForm(); diff --git a/tests/PyzTest/Yves/Customer/_support/CustomerAcceptanceTester.php b/tests/PyzTest/Yves/Customer/_support/CustomerPresentationTester.php similarity index 95% rename from tests/PyzTest/Yves/Customer/_support/CustomerAcceptanceTester.php rename to tests/PyzTest/Yves/Customer/_support/CustomerPresentationTester.php index 0be3c717b..0c5e73536 100644 --- a/tests/PyzTest/Yves/Customer/_support/CustomerAcceptanceTester.php +++ b/tests/PyzTest/Yves/Customer/_support/CustomerPresentationTester.php @@ -21,10 +21,10 @@ * * @SuppressWarnings(PHPMD) */ -class CustomerAcceptanceTester extends Actor +class CustomerPresentationTester extends Actor { - use _generated\CustomerAcceptanceTesterActions; + use _generated\CustomerPresentationTesterActions; /** * @param \Codeception\Scenario $scenario diff --git a/tests/PyzTest/Yves/Customer/_support/PageObject/Customer.php b/tests/PyzTest/Yves/Customer/_support/PageObject/Customer.php index a1a392779..f904df222 100644 --- a/tests/PyzTest/Yves/Customer/_support/PageObject/Customer.php +++ b/tests/PyzTest/Yves/Customer/_support/PageObject/Customer.php @@ -2,7 +2,7 @@ /** * Copyright © 2016-present Spryker Systems GmbH. All rights reserved. - * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. + * Use of this software requires Presentation of the Evaluation License Agreement. See LICENSE file. */ namespace PyzTest\Yves\Customer\PageObject; diff --git a/tests/PyzTest/Yves/Customer/codeception.yml b/tests/PyzTest/Yves/Customer/codeception.yml index ae1eabad1..358389644 100644 --- a/tests/PyzTest/Yves/Customer/codeception.yml +++ b/tests/PyzTest/Yves/Customer/codeception.yml @@ -12,9 +12,9 @@ coverage: whitelist: { include: ['../../../../src/*'] } suites: - Acceptance: - path: Acceptance - class_name: CustomerAcceptanceTester + Presentation: + path: Presentation + class_name: CustomerPresentationTester modules: enabled: - \PyzTest\Shared\Testify\Helper\Environment diff --git a/tests/PyzTest/Yves/Newsletter/Acceptance/NewsletterSubscriptionCest.php b/tests/PyzTest/Yves/Newsletter/Presentation/NewsletterSubscriptionCest.php similarity index 86% rename from tests/PyzTest/Yves/Newsletter/Acceptance/NewsletterSubscriptionCest.php rename to tests/PyzTest/Yves/Newsletter/Presentation/NewsletterSubscriptionCest.php index 249d951f1..47b54d302 100644 --- a/tests/PyzTest/Yves/Newsletter/Acceptance/NewsletterSubscriptionCest.php +++ b/tests/PyzTest/Yves/Newsletter/Presentation/NewsletterSubscriptionCest.php @@ -2,7 +2,7 @@ /** * Copyright © 2017-present Spryker Systems GmbH. All rights reserved. - * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. + * Use of this software requires Presentation of the Evaluation License Agreement. See LICENSE file. */ namespace PyzTest\Yves\Newsletter\Yves; @@ -11,7 +11,7 @@ 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\NewsletterPresentationTester; use PyzTest\Yves\Newsletter\PageObject\NewsletterSubscriptionHomePage; /** @@ -27,11 +27,11 @@ class NewsletterSubscriptionCest { /** - * @param \PyzTest\Yves\Newsletter\NewsletterAcceptanceTester $i + * @param \PyzTest\Yves\Newsletter\NewsletterPresentationTester $i * * @return void */ - public function iCanSubscribeWithAnUnsubscribedEmail(NewsletterAcceptanceTester $i) + public function iCanSubscribeWithAnUnsubscribedEmail(NewsletterPresentationTester $i) { $i->wantTo('Subscribe to the newsletter with an unsubscribed new email.'); $i->expect('Success message is displayed.'); @@ -45,11 +45,11 @@ public function iCanSubscribeWithAnUnsubscribedEmail(NewsletterAcceptanceTester } /** - * @param \PyzTest\Yves\Newsletter\NewsletterAcceptanceTester $i + * @param \PyzTest\Yves\Newsletter\NewsletterPresentationTester $i * * @return void */ - public function iCanNotSubscribeWithAnAlreadySubscribedEmail(NewsletterAcceptanceTester $i) + public function iCanNotSubscribeWithAnAlreadySubscribedEmail(NewsletterPresentationTester $i) { $i->wantTo('Subscribe to the newsletter with an already subscribed email.'); $i->expect('Error message is displayed.'); @@ -65,11 +65,11 @@ public function iCanNotSubscribeWithAnAlreadySubscribedEmail(NewsletterAcceptanc } /** - * @param \PyzTest\Yves\Newsletter\NewsletterAcceptanceTester $i + * @param \PyzTest\Yves\Newsletter\NewsletterPresentationTester $i * * @return void */ - public function subscribedEmailIsLinkedWithCustomerAfterRegistration(NewsletterAcceptanceTester $i) + public function subscribedEmailIsLinkedWithCustomerAfterRegistration(NewsletterPresentationTester $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.'); @@ -86,11 +86,11 @@ public function subscribedEmailIsLinkedWithCustomerAfterRegistration(NewsletterA } /** - * @param \PyzTest\Yves\Newsletter\NewsletterAcceptanceTester $i + * @param \PyzTest\Yves\Newsletter\NewsletterPresentationTester $i * * @return void */ - public function subscribedEmailCanBeUnsubscribedByCustomerAfterRegistration(NewsletterAcceptanceTester $i) + public function subscribedEmailCanBeUnsubscribedByCustomerAfterRegistration(NewsletterPresentationTester $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/PyzTest/Yves/Newsletter/_support/NewsletterAcceptanceTester.php b/tests/PyzTest/Yves/Newsletter/_support/NewsletterPresentationTester.php similarity index 93% rename from tests/PyzTest/Yves/Newsletter/_support/NewsletterAcceptanceTester.php rename to tests/PyzTest/Yves/Newsletter/_support/NewsletterPresentationTester.php index 350983d3c..8e72a8d06 100644 --- a/tests/PyzTest/Yves/Newsletter/_support/NewsletterAcceptanceTester.php +++ b/tests/PyzTest/Yves/Newsletter/_support/NewsletterPresentationTester.php @@ -22,10 +22,10 @@ * * @SuppressWarnings(PHPMD) */ -class NewsletterAcceptanceTester extends Actor +class NewsletterPresentationTester extends Actor { - use _generated\NewsletterAcceptanceTesterActions; + use _generated\NewsletterPresentationTesterActions; /** * @param \Codeception\Scenario $scenario diff --git a/tests/PyzTest/Yves/Newsletter/_support/PageObject/NewsletterSubscriptionHomePage.php b/tests/PyzTest/Yves/Newsletter/_support/PageObject/NewsletterSubscriptionHomePage.php index 73939a9fb..7420c725d 100644 --- a/tests/PyzTest/Yves/Newsletter/_support/PageObject/NewsletterSubscriptionHomePage.php +++ b/tests/PyzTest/Yves/Newsletter/_support/PageObject/NewsletterSubscriptionHomePage.php @@ -2,7 +2,7 @@ /** * Copyright © 2017-present Spryker Systems GmbH. All rights reserved. - * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. + * Use of this software requires Presentation of the Evaluation License Agreement. See LICENSE file. */ namespace PyzTest\Yves\Newsletter\PageObject; diff --git a/tests/PyzTest/Yves/Newsletter/codeception.yml b/tests/PyzTest/Yves/Newsletter/codeception.yml index d758f5636..d4fae673b 100644 --- a/tests/PyzTest/Yves/Newsletter/codeception.yml +++ b/tests/PyzTest/Yves/Newsletter/codeception.yml @@ -12,9 +12,9 @@ coverage: whitelist: { include: ['../../../../src/*'] } suites: - Acceptance: - path: Acceptance - class_name: NewsletterAcceptanceTester + Presentation: + path: Presentation + class_name: NewsletterPresentationTester modules: enabled: - \PyzTest\Shared\Testify\Helper\Environment diff --git a/tests/PyzTest/Yves/Product/_support/PageObject/ProductDetailPage.php b/tests/PyzTest/Yves/Product/_support/PageObject/ProductDetailPage.php index 36f808e54..cf80bf1f6 100644 --- a/tests/PyzTest/Yves/Product/_support/PageObject/ProductDetailPage.php +++ b/tests/PyzTest/Yves/Product/_support/PageObject/ProductDetailPage.php @@ -2,7 +2,7 @@ /** * Copyright © 2016-present Spryker Systems GmbH. All rights reserved. - * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. + * Use of this software requires Presentation of the Evaluation License Agreement. See LICENSE file. */ namespace PyzTest\Yves\Product\PageObject; diff --git a/tests/PyzTest/Yves/Product/codeception.yml b/tests/PyzTest/Yves/Product/codeception.yml new file mode 100644 index 000000000..4eab0575b --- /dev/null +++ b/tests/PyzTest/Yves/Product/codeception.yml @@ -0,0 +1,12 @@ +namespace: PyzTest\Yves\Product + +paths: + tests: . + data: _data + support: _support + log: _output + +coverage: + enabled: true + remote: false + whitelist: { include: ['../../../../src/*'] } diff --git a/tests/PyzTest/Zed/Availability/_support/AvailabilityPresentationTester.php b/tests/PyzTest/Zed/Availability/_support/AvailabilityPresentationTester.php index adb6fdd9e..8226d7448 100644 --- a/tests/PyzTest/Zed/Availability/_support/AvailabilityPresentationTester.php +++ b/tests/PyzTest/Zed/Availability/_support/AvailabilityPresentationTester.php @@ -1,7 +1,9 @@ amZed(); + $this->amLoggedInUser(); + } }