diff --git a/codeception.yml b/codeception.yml index 9d56ab4bd..a527906ef 100644 --- a/codeception.yml +++ b/codeception.yml @@ -1,23 +1,21 @@ namespace: PyzTest include: -# - tests/PyzTest/Yves/Application -# - tests/PyzTest/Yves/Assets -# - tests/PyzTest/Yves/Availability -# -# - tests/PyzTest/Yves/Cart + - tests/PyzTest/Yves/Application + - tests/PyzTest/Yves/Assets + - tests/PyzTest/Yves/Availability - tests/PyzTest/Yves/Checkout -# - tests/PyzTest/Yves/Customer -# - tests/PyzTest/Yves/Newsletter -# - 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/Tax -# - tests/PyzTest/Zed/Touch + - tests/PyzTest/Yves/Customer + - tests/PyzTest/Yves/Newsletter + - 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/Tax + - tests/PyzTest/Zed/Touch # - vendor/spryker/spryker/Bundles/*/* paths: diff --git a/composer.json b/composer.json index 2212b40df..8b2109416 100644 --- a/composer.json +++ b/composer.json @@ -93,18 +93,9 @@ "psr-0": { "PyzTest": "tests" }, - "psr-4": { - "PyzTest\\Shared\\Testify\\Helper\\": "tests/PyzTest/Shared/Testify/_support/Helper", - "PyzTest\\Yves\\Application\\PageObject\\": "tests/PyzTest/Yves/Application/_support/PageObject", - "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\\Customer\\Helper\\": "tests/PyzTest/Yves/Customer/_support/Helper", - "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": [ + "test-autoload.php" + ] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/test-autoload.php b/test-autoload.php new file mode 100644 index 000000000..b20a55f32 --- /dev/null +++ b/test-autoload.php @@ -0,0 +1,36 @@ +processCheckout(); - $zedTester = $i->haveFriend('zedTester', ZedAvailabilityPresentationTester::class); + $i->amZed(); + $i->amLoggedInUser(); - $zedTester->does(function (ZedAvailabilityPresentationTester $i) { - $i->amZed(); - $i->amLoggedInUser(); + $idProductFujitsu = 118; - $idProductFujitsu = 118; + $i->amOnPage(sprintf(AvailabilityViewPage::VIEW_PRODUCT_AVAILABILITY_URL, $idProductFujitsu)); - $i->amOnPage(sprintf(AvailabilityViewPage::VIEW_PRODUCT_AVAILABILITY_URL, $idProductFujitsu)); + $i->waitForElementVisible('//*[@id="page-wrapper"]/div[3]/div[2]/div/div/div[2]/div/div[5]/p[2]'); - $i->waitForElementVisible('//*[@id="page-wrapper"]/div[3]/div[2]/div/div/div[2]/div/div[5]/p[2]'); + $reservedProductsBefore = $i->grabTextFrom('//*[@id="page-wrapper"]/div[3]/div[2]/div/div/div[2]/div/div[5]/p[2]'); - $reservedProductsBefore = $i->grabTextFrom('//*[@id="page-wrapper"]/div[3]/div[2]/div/div/div[2]/div/div[5]/p[2]'); + codecept_debug('Reserved Products before: ' . $reservedProductsBefore); - codecept_debug('Reserved Products before: ' . $reservedProductsBefore); + $i->amOnPage(OrderListPage::ORDER_LIST_URL); + $i->wait(2); - $i->amOnPage(OrderListPage::ORDER_LIST_URL); - $i->wait(2); + $idSalesOrder = $i->grabTextFrom('//*[@class="dataTables_scrollBody"]/table/tbody/tr[1]/td[1]'); - $idSalesOrder = $i->grabTextFrom('//*[@class="dataTables_scrollBody"]/table/tbody/tr[1]/td[1]'); + codecept_debug('ID Sales order: ' . $idSalesOrder); - codecept_debug('ID Sales order: ' . $idSalesOrder); + $i->amOnPage(sprintf(OrderDetailPage::ORDER_DETAIL_PAGE_URL, $idSalesOrder)); - $i->amOnPage(sprintf(OrderDetailPage::ORDER_DETAIL_PAGE_URL, $idSalesOrder)); + $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'pay')); + $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'ship')); + $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'stock-update')); + $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'return')); + $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'refund')); - $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'pay')); - $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'ship')); - $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'stock-update')); - $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'return')); - $i->click(sprintf(OrderDetailPage::OMS_EVENT_TRIGGER_XPATH, 'refund')); + $i->amOnPage(sprintf(AvailabilityViewPage::VIEW_PRODUCT_AVAILABILITY_URL, $idProductFujitsu)); - $i->amOnPage(sprintf(AvailabilityViewPage::VIEW_PRODUCT_AVAILABILITY_URL, $idProductFujitsu)); + $reservedProductsAfter = $i->grabTextFrom('//*[@id="page-wrapper"]/div[3]/div[2]/div/div/div[2]/div/div[5]/p[2]'); - $reservedProductsAfter = $i->grabTextFrom('//*[@id="page-wrapper"]/div[3]/div[2]/div/div/div[2]/div/div[5]/p[2]'); - - $i->assertEquals($reservedProductsAfter, $reservedProductsBefore - 1); //Reserved item returned back - }); - - $zedTester->leave(); + $i->assertEquals($reservedProductsAfter, $reservedProductsBefore - 1); //Reserved item returned back } } diff --git a/tests/PyzTest/Yves/Availability/codeception.yml b/tests/PyzTest/Yves/Availability/codeception.yml index c7ba9afa5..83fc403e5 100644 --- a/tests/PyzTest/Yves/Availability/codeception.yml +++ b/tests/PyzTest/Yves/Availability/codeception.yml @@ -17,6 +17,7 @@ suites: class_name: AvailabilityPresentationTester modules: enabled: + - Asserts - \PyzTest\Shared\Testify\Helper\Environment - \SprykerTest\Shared\Config\Helper\ConfigInit - \PyzTest\Yves\Checkout\Helper\CheckoutHelper diff --git a/tests/PyzTest/Yves/Cart/codeception.yml b/tests/PyzTest/Yves/Cart/codeception.yml deleted file mode 100644 index f5e46fde3..000000000 --- a/tests/PyzTest/Yves/Cart/codeception.yml +++ /dev/null @@ -1,12 +0,0 @@ -namespace: PyzTest\Yves\Cart - -paths: - tests: . - data: _data - support: _support - log: _output - -coverage: - enabled: true - remote: false - whitelist: { include: ['../../../../src/*'] }