From 6fc9c650efd8276a7b1ddbc5c2ed68247251b28b Mon Sep 17 00:00:00 2001 From: John Stennett Date: Wed, 15 Mar 2017 12:11:04 -0500 Subject: [PATCH 001/149] Initial commit Initial commit --- .gitignore | 8 + README.md | 104 ++ RoboFile.php | 57 + codeception.yml | 26 + composer.json | 16 + src/Yandex/Allure/Adapter/AllureAdapter.php | 262 ++++ tests/_bootstrap.php | 2 + tests/_data/dump.sql | 1 + tests/_output/.gitignore | 2 + tests/_support/AcceptanceTester.php | 22 + tests/_support/FunctionalTester.php | 26 + tests/_support/Helper/Acceptance.php | 10 + tests/_support/Helper/Functional.php | 10 + tests/_support/Helper/URL_List.php | 98 ++ tests/_support/Helper/Unit.php | 10 + tests/_support/Page/Acceptance/AdminLogin.php | 115 ++ .../Page/Acceptance/SideNavigation.php | 727 ++++++++++ tests/_support/Step/Acceptance/Admin.php | 1189 +++++++++++++++++ tests/_support/UnitTester.php | 26 + tests/acceptance.suite.yml | 36 + tests/acceptance/TestCest.php | 35 + tests/acceptance/_bootstrap.php | 2 + .../login/AccessAdminLoginPageCept.php | 13 + .../login/AccessForgotYourPasswordCest.php | 54 + .../CannotAccessAdminAfterLoggingOutCept.php | 22 + .../login/CannotAccessAdminPagesCept.php | 25 + .../login/LoginOnAdminLoginPageCept.php | 12 + .../acceptance/login/LogoutAfterLoginCept.php | 13 + .../misc/AccessAdminPagesDirectlyCest.php | 248 ++++ .../AccessAdminPagesViaNavMenuCest.php | 443 ++++++ .../OpenEachSideNavMenuCept.php | 38 + tests/functional.suite.yml | 11 + tests/functional/_bootstrap.php | 2 + tests/unit.suite.yml | 9 + tests/unit/_bootstrap.php | 2 + 35 files changed, 3676 insertions(+) create mode 100755 .gitignore create mode 100755 README.md create mode 100644 RoboFile.php create mode 100644 codeception.yml create mode 100755 composer.json create mode 100644 src/Yandex/Allure/Adapter/AllureAdapter.php create mode 100644 tests/_bootstrap.php create mode 100644 tests/_data/dump.sql create mode 100644 tests/_output/.gitignore create mode 100644 tests/_support/AcceptanceTester.php create mode 100644 tests/_support/FunctionalTester.php create mode 100644 tests/_support/Helper/Acceptance.php create mode 100644 tests/_support/Helper/Functional.php create mode 100644 tests/_support/Helper/URL_List.php create mode 100644 tests/_support/Helper/Unit.php create mode 100644 tests/_support/Page/Acceptance/AdminLogin.php create mode 100644 tests/_support/Page/Acceptance/SideNavigation.php create mode 100644 tests/_support/Step/Acceptance/Admin.php create mode 100644 tests/_support/UnitTester.php create mode 100644 tests/acceptance.suite.yml create mode 100644 tests/acceptance/TestCest.php create mode 100644 tests/acceptance/_bootstrap.php create mode 100644 tests/acceptance/login/AccessAdminLoginPageCept.php create mode 100644 tests/acceptance/login/AccessForgotYourPasswordCest.php create mode 100644 tests/acceptance/login/CannotAccessAdminAfterLoggingOutCept.php create mode 100644 tests/acceptance/login/CannotAccessAdminPagesCept.php create mode 100644 tests/acceptance/login/LoginOnAdminLoginPageCept.php create mode 100644 tests/acceptance/login/LogoutAfterLoginCept.php create mode 100644 tests/acceptance/misc/AccessAdminPagesDirectlyCest.php create mode 100644 tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php create mode 100644 tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php create mode 100644 tests/functional.suite.yml create mode 100644 tests/functional/_bootstrap.php create mode 100644 tests/unit.suite.yml create mode 100644 tests/unit/_bootstrap.php diff --git a/.gitignore b/.gitignore new file mode 100755 index 000000000..611f71f7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.iml +.idea +composer.phar +composer.lock +vendor/* +tests/_output/* +allure-report/* +/tests/_support/_generated/ diff --git a/README.md b/README.md new file mode 100755 index 000000000..75d1f6949 --- /dev/null +++ b/README.md @@ -0,0 +1,104 @@ +# Welcome to the example of Codeception + Robo + Allure! + +### Prerequisites +* **Codeception**, **Allure** and **Robo** are PHP based applications installed via **Composer**, so you will need to have **Composer** installed in order to run the following. Please visit the [Composer](https://getcomposer.org/) homepage for installation instructions. + +* Some settings need to be adjusted to meet the build environment settings in the appropriate `XXX.suite.yml` file in the `[PROJECT_ROOT]/tests/` directory: `[PROJECT_ROOT]/tests/XXXXXXX.suite.yml` + + +##### [PROJECT_ROOT]/tests/acceptance.suite.yml +* Edit the following section of code to set the Storefront URL: + ``` + ... + url: "http://127.0.0.1:32769" + ... + ``` + +##### [PROJECT_ROOT]/tests/_support/AcceptanceTester.php +* Edit the following section of code at the bottom of the `AcceptanceTester.php` file to set the **Admin Credentials**: + + ``` + ... + public function loginAsAnExistingAdmin() { + $I = $this; + $I->fillField('login[username]', 'admin'); + $I->fillField('login[password]', 'admin123'); + $I->click('Sign in'); + $I->closeAdminNotification(); + } + ... + ``` + +### Running the Tests +* Open a Terminal Window. CD to the Project Directory. Run the following command to install the project dependencies: + + ``` + cd [LOCATION_OF_GITHUB_REPO] + composer install + ``` + +* **You will need to install Allure's CLI tool to generate the reports, please visit this page for instructions**: http://wiki.qatools.ru/display/AL/Allure+Commandline + +* Next you will need to start a Selenium server so we can run the tests (This will vary based on your local setup). + + +* Then open a New Terminal Window. + + +* Kick off the entire E2E Test Suite run the following command: + + ``` + robo test + ``` + +* To kick off some example tests with 2 test cases run the following command: + + ``` + robo example + ``` + +### Testing using Robo + +* You can run the following test suites using robo: + + * Run the tests marked with **@group chrome**: `robo chrome` + * Run the tests marked with **@group firefox**: `robo chrome` + * Run the tests marked with **@group phantomjs**: `robo phantomjs` + + +### Allure + Robo +* You can generate an Allure report, open an Allure report or both using robo: + * Generate a report from **[PROJECT_ROOT]/tests/_output/allure-results/**: `robo allure:generate` + * Open a generate report from **[PROJECT_ROOT]/tests/_output/allure-report**: `robo allure:open` + * Generate a report and open it: `robo allure:report` + + +### Testing Environments + +* You can run a subset of Tests by editing a command in the file `RoboFile.php` or by running `codecept` directly: + + ```codecept run --env chrome``` + + ```codecept run --env firefox``` + + ```codecept run --env phantomjs``` + + ```codecept run --env chrome --group slow``` + + +### RoboFile.php + +Edit the following command to change the Tests that the command `robo test` executes: + + ... + $this->_exec('codecept run --env chrome'); + ... + + + +#### TROUBLESHOOTING +* TimeZone Error - http://stackoverflow.com/questions/18768276/codeception-datetime-error +* TimeZone List - http://php.net/manual/en/timezones.america.php +* System PATH - Make sure you have `vendor/bin/` and `vendor/` listed in your system path so you can run the `codecept` and `robo` commands directly: + + `sudo nano /etc/private/paths` \ No newline at end of file diff --git a/RoboFile.php b/RoboFile.php new file mode 100644 index 000000000..872f96381 --- /dev/null +++ b/RoboFile.php @@ -0,0 +1,57 @@ +_exec('allure generate tests/_output/allure-results/ -o tests/_output/allure-report/'); + } + + function allureOpen() { + $this->_exec('allure report open --report-dir tests/_output/allure-report/'); + } + + function allureReport() { + $result1 = $this->allureGenerate(); + + if ($result1->wasSuccessful()) { + $this->allureOpen(); + } + } + + function test() { + $this->chrome(); + $this->allureReport(); + } + + function example() { + $this->_exec('codecept run --env chrome --group example'); + $this->allureReport(); + } + + function group($args = '') { + $this->taskExec('codecept run --env chrome --group')->args($args)->run(); + } + + function chrome() { + $this->_exec('codecept run --env chrome'); + $this->allureReport(); + } + + function firefox() { + $this->_exec('codecept run --env chrome'); + $this->allureReport(); + } + + function phantomjs() { + $this->_exec('codecept run --env phantomjs'); + $this->allureReport(); + } +} \ No newline at end of file diff --git a/codeception.yml b/codeception.yml new file mode 100644 index 000000000..6f77ac7fb --- /dev/null +++ b/codeception.yml @@ -0,0 +1,26 @@ +actor: Tester +paths: + tests: tests + log: tests/_output + data: tests/_data + support: tests/_support + envs: tests/_envs +settings: + bootstrap: _bootstrap.php + colors: true + memory_limit: 1024M +extensions: + enabled: + - Codeception\Extension\RunFailed + - Yandex\Allure\Adapter\AllureAdapter + config: + Yandex\Allure\Adapter\AllureAdapter: + deletePreviousResults: true + outputDirectory: allure-results +modules: + config: + Db: + dsn: '' + user: '' + password: '' + dump: tests/_data/dump.sql \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100755 index 000000000..18084fbb0 --- /dev/null +++ b/composer.json @@ -0,0 +1,16 @@ +{ + "name": "codeception-allure-example", + "require": { + "php": ">=5.4.0", + "codeception/codeception": "~2.1.0", + "symfony/filesystem": "~2.6", + "symfony/finder": "~2.6", + "consolidation/robo": "^1.0.0", + "allure-framework/allure-codeception": "~1.2.3" + }, + "autoload": { + "psr-0": { + "Yandex": "src/" + } + } +} \ No newline at end of file diff --git a/src/Yandex/Allure/Adapter/AllureAdapter.php b/src/Yandex/Allure/Adapter/AllureAdapter.php new file mode 100644 index 000000000..c909ea72c --- /dev/null +++ b/src/Yandex/Allure/Adapter/AllureAdapter.php @@ -0,0 +1,262 @@ + 'suiteBefore', + Events::SUITE_AFTER => 'suiteAfter', + Events::TEST_START => 'testStart', + Events::TEST_FAIL => 'testFail', + Events::TEST_ERROR => 'testError', + Events::TEST_INCOMPLETE => 'testIncomplete', + Events::TEST_SKIPPED => 'testSkipped', + Events::TEST_END => 'testEnd', + Events::STEP_BEFORE => 'stepBefore', + Events::STEP_AFTER => 'stepAfter' + ]; + + /** + * Annotations that should be ignored by the annotaions parser (especially PHPUnit annotations). + * + * @var array + */ + private $ignoredAnnotations = [ + 'after', 'afterClass', 'backupGlobals', 'backupStaticAttributes', 'before', 'beforeClass', + 'codeCoverageIgnore', 'codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'covers', + 'coversDefaultClass', 'coversNothing', 'dataProvider', 'depends', 'expectedException', + 'expectedExceptionCode', 'expectedExceptionMessage', 'group', 'large', 'medium', + 'preserveGlobalState', 'requires', 'runTestsInSeparateProcesses', 'runInSeparateProcess', + 'small', 'test', 'testdox', 'ticket', 'uses', + ]; + + /** + * Extra annotations to ignore in addition to standard PHPUnit annotations. + * + * @param array $ignoredAnnotations + */ + public function _initialize(array $ignoredAnnotations = []) + { + parent::_initialize(); + Annotation\AnnotationProvider::registerAnnotationNamespaces(); + // Add standard PHPUnit annotations + Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations); + // Add custom ignored annotations + Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations); + $outputDirectory = $this->getOutputDirectory(); + $deletePreviousResults = + $this->tryGetOption(DELETE_PREVIOUS_RESULTS_PARAMETER, false); + $this->prepareOutputDirectory($outputDirectory, $deletePreviousResults); + if (is_null(Model\Provider::getOutputDirectory())) { + Model\Provider::setOutputDirectory($outputDirectory); + } + } + + /** + * Retrieves option or returns default value. + * + * @param string $optionKey Configuration option key. + * @param mixed $defaultValue Value to return in case option isn't set. + * + * @return mixed Option value. + * @since 0.1.0 + */ + private function tryGetOption($optionKey, $defaultValue = null) + { + if (array_key_exists($optionKey, $this->config)) { + return $this->config[$optionKey]; + } + return $defaultValue; + } + + /** @noinspection PhpUnusedPrivateMethodInspection */ + /** + * Retrieves option or dies. + * + * @param string $optionKey Configuration option key. + * + * @throws ConfigurationException Thrown if option can't be retrieved. + * + * @return mixed Option value. + * @since 0.1.0 + */ + private function getOption($optionKey) + { + if (!array_key_exists($optionKey, $this->config)) { + $template = '%s: Couldn\'t find required configuration option `%s`'; + $message = sprintf($template, __CLASS__, $optionKey); + throw new ConfigurationException($message); + } + return $this->config[$optionKey]; + } + + /** + * Returns output directory. + * + * @throws ConfigurationException Thrown if there is Codeception-wide + * problem with output directory + * configuration. + * + * @return string Absolute path to output directory. + * @since 0.1.0 + */ + private function getOutputDirectory() + { + $outputDirectory = $this->tryGetOption( + OUTPUT_DIRECTORY_PARAMETER, + DEFAULT_RESULTS_DIRECTORY + ); + $filesystem = new Filesystem; + if (!$filesystem->isAbsolutePath($outputDirectory)) { + $outputDirectory = Configuration::outputDir() . $outputDirectory; + } + return $outputDirectory; + } + + /** + * Creates output directory (if it hasn't been created yet) and cleans it + * up (if corresponding argument has been set to true). + * + * @param string $outputDirectory + * @param bool $deletePreviousResults Whether to delete previous results + * or keep 'em. + * + * @since 0.1.0 + */ + private function prepareOutputDirectory( + $outputDirectory, + $deletePreviousResults = false + ) { + $filesystem = new Filesystem; + $filesystem->mkdir($outputDirectory, 0775); + if ($deletePreviousResults) { + $finder = new Finder; + $files = $finder->files()->in($outputDirectory)->name('*.xml'); + $filesystem->remove($files); + } + } + + public function suiteBefore(SuiteEvent $suiteEvent) + { + $suite = $suiteEvent->getSuite(); + $suiteName = $suite->getName(); + $event = new TestSuiteStartedEvent($suiteName); + if (class_exists($suiteName, false)) { + $annotationManager = new Annotation\AnnotationManager( + Annotation\AnnotationProvider::getClassAnnotations($suiteName) + ); + $annotationManager->updateTestSuiteEvent($event); + } + $this->uuid = $event->getUuid(); + $this->getLifecycle()->fire($event); + } + + public function suiteAfter() + { + $this->getLifecycle()->fire(new TestSuiteFinishedEvent($this->uuid)); + } + + public function testStart(TestEvent $testEvent) + { + $test = $testEvent->getTest(); + $testName = $test->getName(); + $className = get_class($test); + $event = new TestCaseStartedEvent($this->uuid, $testName); + if (method_exists($className, $testName)){ + $annotationManager = new Annotation\AnnotationManager(Annotation\AnnotationProvider::getMethodAnnotations($className, $testName)); + $annotationManager->updateTestCaseEvent($event); + } + $this->getLifecycle()->fire($event); + } + + public function testError() + { + $this->getLifecycle()->fire(new TestCaseBrokenEvent()); + } + + public function testFail() + { + $this->getLifecycle()->fire(new TestCaseFailedEvent()); + } + + public function testIncomplete() + { + $this->getLifecycle()->fire(new TestCasePendingEvent()); + } + + public function testSkipped() + { + $this->getLifecycle()->fire(new TestCaseCanceledEvent()); + } + + public function testEnd() + { + $this->getLifecycle()->fire(new TestCaseFinishedEvent()); + } + + public function stepBefore(StepEvent $stepEvent) + { + $stepAction = $stepEvent->getStep()->getAction(); + $this->getLifecycle()->fire(new StepStartedEvent($stepAction)); + } + + public function stepAfter() + { + $this->getLifecycle()->fire(new StepFinishedEvent()); + } + + + /** + * @return Allure + */ + public function getLifecycle() + { + if (!isset($this->lifecycle)){ + $this->lifecycle = Allure::lifecycle(); + } + return $this->lifecycle; + } + + public function setLifecycle(Allure $lifecycle) + { + $this->lifecycle = $lifecycle; + } + +} diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php new file mode 100644 index 000000000..243f9c85b --- /dev/null +++ b/tests/_bootstrap.php @@ -0,0 +1,2 @@ +acceptanceTester = $I; + } + + public function iClickOnMagentoLogo(\AcceptanceTester $I) { + $I->click(self::$logoImage); + } + + public function iClickOnForgotYourPassword(\AcceptanceTester $I) { + $I->click(self::$forgotYourPassword); + } + + public function iClickOnSignIn(\AcceptanceTester $I) { + $I->click(self::$signIn); + } + + public function iEnterTheUsername(\AcceptanceTester $I, $username) { + $I->fillField(self::$username, $username); + } + + public function iEnterThePassword(\AcceptanceTester $I, $password) { + $I->fillField(self::$password, $password); + } + + public function iEnterTheLoginCredentials(\AcceptanceTester $I, $username, $password) { + $I->fillField(self::$username, $username); + $I->fillField(self::$password, $password); + } + + public function iShouldSeeTheLoginPageFields(\AcceptanceTester $I) { + $I->seeElement(self::$mainArea); + $I->seeElement(self::$logoLink); + $I->seeElement(self::$logoImage); + $I->seeElement(self::$title); + $I->seeElement(self::$usernameTitle); + $I->seeElement(self::$username); + $I->seeElement(self::$passwordTitle); + $I->seeElement(self::$password); + $I->seeElement(self::$forgotYourPassword); + $I->seeElement(self::$signIn); + $I->seeElement(self::$copyRight); + } + + public function iEnterTheEmailAddress(\AcceptanceTester $I, $emailAddress) { + $I->fillField(self::$emailAddress, $emailAddress); + } + + public function iClickOnRetrievePassword(\AcceptanceTester $I) { + $I->click(self::$retrievePassword); + } + + public function iClickOnBackToSignIn(\AcceptanceTester $I) { + $I->click(self::$backToSignIn); + } + + public function iShouldSeeTheForgotYourPasswordFields(\AcceptanceTester $I) { + $I->seeElement(self::$forgotPasswordMain); + $I->seeElement(self::$logoLink); + $I->seeElement(self::$logoImage); + $I->seeElement(self::$title); + $I->seeElement(self::$emailAddressTitle); + $I->seeElement(self::$emailAddress); + $I->seeElement(self::$retrievePassword); + $I->seeElement(self::$backToSignIn); + } + +} diff --git a/tests/_support/Page/Acceptance/SideNavigation.php b/tests/_support/Page/Acceptance/SideNavigation.php new file mode 100644 index 000000000..8fb9a4091 --- /dev/null +++ b/tests/_support/Page/Acceptance/SideNavigation.php @@ -0,0 +1,727 @@ +acceptanceTester = $I; + } + + public function iClickOnDashboardInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$dashboardButton); + } + + public function iClickOnSalesInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$salesButton); + $I->wait(1); + } + + public function iClickOnOrdersInTheSalesNavMenu(\AcceptanceTester $I) { + $I->click(self::$salesNavOrders); + } + + public function iClickOnInvoicesInTheSalesNavMenu(\AcceptanceTester $I) { + $I->click(self::$salesNavInvoices); + } + + public function iClickOnShipmentsInTheSalesNavMenu(\AcceptanceTester $I) { + $I->click(self::$salesNavShipments); + } + + public function iClickOnCreditMemosInTheSalesNavMenu(\AcceptanceTester $I) { + $I->click(self::$salesNavCreditMemos); + } + + public function iClickOnBillingAgreementsInTheSalesNavMenu(\AcceptanceTester $I) { + $I->click(self::$salesNavBillingAgreements); + } + + public function iClickOnTransactionsInTheSalesNavMenu(\AcceptanceTester $I) { + $I->click(self::$salesNavTransactions); + } + + public function iClickOnProductsInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$productsButton); + $I->wait(1); + } + + public function iClickOnCatalogInTheProductNavMenu(\AcceptanceTester $I) { + $I->click(self::$productNavCatalog); + } + + public function iClickOnCategoriesInTheProductNavMenu(\AcceptanceTester $I) { + $I->click(self::$productNavCategories); + } + + public function iClickOnCustomersInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$customersButton); + $I->wait(1); + } + + public function iClickOnAllCustomersInTheCustomersNavMenu(\AcceptanceTester $I) { + $I->click(self::$customersNavAllCustomers); + } + + public function iClickOnNowOnlineInTheCustomersNavMenu(\AcceptanceTester $I) { + $I->click(self::$customersNavNowOnline); + } + + public function iClickOnMarketingInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingButton); + $I->wait(1); + } + + public function iClickOnCatalogPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavPromotionsCatalogPriceRule); + } + + public function iClickOnCartPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavPromotionsCartPriceRules); + } + + public function iClickOnEmailTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavCommunicationsEmailTemplates); + } + + public function iClickOnNewsletterTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavCommunicationsNewsletterTemplates); + } + + public function iClickOnNewsletterQueueInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavCommunicationsNewsletterQueue); + } + + public function iClickOnNewsletterSubscribersInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavCommunicationsNewsletterSubscribers); + } + + public function iClickOnURLRewritesInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavSEOSearchURLRewrites); + } + + public function iClickOnSearchTermsInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavSEOSearchTerms); + } + + public function iClickOnSearchSynonymsInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavSEOSearchSynonyms); + } + + public function iClickOnSiteMapInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavSEOSearchSiteMap); + } + + public function iClickOnContentReviewsInTheMarketingNavMenu(\AcceptanceTester $I) { + $I->click(self::$marketingNavUserContentReviews); + } + + public function iClickOnContentInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$contentButton); + $I->wait(1); + } + + public function iClickOnPagesInTheContentNavMenu(\AcceptanceTester $I) { + $I->click(self::$contentNavElementsPages); + } + + public function iClickOnBlocksInTheContentNavMenu(\AcceptanceTester $I) { + $I->click(self::$contentNavElementsBlocks); + } + + public function iClickOnWidgetsInTheContentNavMenu(\AcceptanceTester $I) { + $I->click(self::$contentNavElementsWidgets); + } + + public function iClickOnConfigurationInTheContentNavMenu(\AcceptanceTester $I) { + $I->click(self::$contentNavDesignConfiguration); + } + + public function iClickOnThemesInTheContentNavMenu(\AcceptanceTester $I) { + $I->click(self::$contentNavDesignThemes); + } + + public function iClickOnScheduleInTheContentNavMenu(\AcceptanceTester $I) { + $I->click(self::$contentNavDesignSchedule); + } + + public function iClickOnReportsInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsButton); + $I->wait(1); + } + + public function iClickOnProductsInCartInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavMarketingProductsInCart); + } + + public function iClickOnSearchTermsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavMarketingSearchTerms); + } + + public function iClickOnAbandonedCartsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavMarketingAbandonedCarts); + } + + public function iClickOnNewsletterProblemReportsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavMarketingNewsletterProblemReports); + } + + public function iClickOnByCustomersInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavReviewsByCustomers); + } + + public function iClickOnByProductsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavReviewsByProducts); + } + + public function iClickOnOrdersInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavSalesOrders); + } + + public function iClickOTaxnInTheReportsNavMenu(\AcceptanceTester $I) { + $I = $this->acceptanceTester; + $I->click(self::$reportsNavSalesTax); + } + + public function iClickOnInvoicedInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavSalesInvoiced); + } + + public function iClickOnShippingInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavSalesShipping); + } + + public function iClickOnRefundsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavSalesRefunds); + } + + public function iClickOnCouponsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavSalesCoupons); + } + + public function iClickOnPaypalSettlementInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavSalesPayPalSettlement); + } + + public function iClickOnBraintreeSettlementInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavSalesBraintreeSettlement); + } + + public function iClickOnOrderTotalInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavCustomersOrderTotal); + } + + public function iClickOnOrderCountInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavCustomersOrderCount); + } + + public function iClickOnNewInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavCustomersNew); + } + + public function iClickOnViewsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavProductsViews); + } + + public function iClickOnBestSellersInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavProductsBestsellers); + } + + public function iClickOnLowStockInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavProductsLowStock); + } + + public function iClickOnOrderedInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavProductsOrdered); + } + + public function iClickOnDownloadsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavProductsDownloads); + } + + public function iClickOnRefreshStatisticsInTheReportsNavMenu(\AcceptanceTester $I) { + $I->click(self::$reportsNavStatisticsRefreshStatistics); + } + + public function iClickOnStoresInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesButton); + $I->wait(1); + } + + public function iClickOnAllStoresInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavSettingsAllStores); + } + + public function iClickOnConfigurationInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavSettingsConfiguration); + } + + public function iClickOnTermsAndConditionsInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavSettingsTermsAndConditions); + } + + public function iClickOnOrderStatusInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavSettingsOrderStatus); + } + + public function iClickOnTaxRuleInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavTaxesTaxRules); + } + + public function iClickOnTaxZonesAndRatesInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavTaxesTaxZonesAndRates); + } + + public function iClickOnTaxRatesInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavCurrencyRates); + } + + public function iClickOnTaxSymbolsInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavCurrencySymbols); + } + + public function iClickOnCurrencyRatesInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavCurrencyRates); + } + + public function iClickOnCurrencySymbolsInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavCurrencySymbols); + } + + public function iClickOnProductInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavAttributesProduct); + } + + public function iClickOnAttributesSetInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavAttributesSet); + } + + public function iClickOnRatingsInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavAttributesRating); + } + + public function iClickOnCustomerGroupInTheStoresNavMenu(\AcceptanceTester $I) { + $I->click(self::$storesNavOtherSettingsCustomerGroups); + } + + public function iClickOnSystemInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemButton); + $I->wait(1); + } + + public function iClickOnImportInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavDataTransferImport); + } + + public function iClickOnExportInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavDataTransferExport); + } + + public function iClickOnImportExportTaxRatesInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavDataTransferImportExportTaxRates); + } + + public function iClickOnImportHistoryInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavDataTransferImportHistory); + } + + public function iClickOnIntegrationsInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavExtensionsIntegrations); + } + + public function iClickOnCacheManagementInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavToolsCacheManagement); + } + + public function iClickOnBackupsInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavToolsBackups); + } + + public function iClickOnIndexManagementInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavToolsIndexManagement); + } + + public function iClickOnWebSetupWizardInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavToolsWebSetupWizard); + $I->wait(1); + } + + public function iClickOnAllUsersInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavPermissionsAllUsers); + } + + public function iClickOnLockedUsersInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavPermissionsLockedUsers); + } + + public function iClickOnUserRolesInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavPermissionsUserRoles); + } + + public function iClickOnNotificationsInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavOtherSettingsNotifications); + } + + public function iClickOnCustomVariablesInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavOtherSettingsCustomVariables); + } + + public function iClickOnManageEncryptionKeyInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavOtherSettingsManageEncryptionKey); + } + + public function iClickOnFindPartnersAndExtensionsInTheSideNavMenu(\AcceptanceTester $I) { + $I->click(self::$findPartnersExtensionsButton); + $I->wait(1); + } + + public function iShouldSeeTheSalesNavMenu(\AcceptanceTester $I) { + $I->seeElement(self::$salesNavMainArea); + $I->seeElement(self::$salesNavTitle); + $I->seeElement(self::$salesNavOrders); + $I->seeElement(self::$salesNavInvoices); + $I->seeElement(self::$salesNavShipments); + $I->seeElement(self::$salesNavCreditMemos); + $I->seeElement(self::$salesNavBillingAgreements); + $I->seeElement(self::$salesNavTransactions); + } + + public function iShouldSeeTheProductNavMenu(\AcceptanceTester $I) { + $I->seeElement(self::$productNavMainArea); + $I->seeElement(self::$productNavTitle); + $I->seeElement(self::$productNavCatalog); + $I->seeElement(self::$productNavCategories); + } + + public function iShouldSeeTheCustomersNavMenu(\AcceptanceTester $I) { + $I->seeElement(self::$customersNavAllCustomers); + $I->seeElement(self::$customersNavNowOnline); + } + + public function iShouldSeeTheMarketingNavMenu(\AcceptanceTester $I) { + $I->seeElement(self::$marketingNavPromotionsMainArea); + $I->seeElement(self::$marketingNavPromotionsTitle); + $I->seeElement(self::$marketingNavPromotionsCatalogPriceRule); + $I->seeElement(self::$marketingNavPromotionsCartPriceRules); + + $I->seeElement(self::$marketingNavCommunicationsMainArea); + $I->seeElement(self::$marketingNavCommunicationsTitle); + $I->seeElement(self::$marketingNavCommunicationsEmailTemplates); + $I->seeElement(self::$marketingNavCommunicationsNewsletterTemplates); + $I->seeElement(self::$marketingNavCommunicationsNewsletterQueue); + $I->seeElement(self::$marketingNavCommunicationsNewsletterSubscribers); + + $I->seeElement(self::$marketingNavSEOSearchMainArea); + $I->seeElement(self::$marketingNavSEOSearchTitle); + $I->seeElement(self::$marketingNavSEOSearchURLRewrites); + $I->seeElement(self::$marketingNavSEOSearchTerms); + $I->seeElement(self::$marketingNavSEOSearchSynonyms); + $I->seeElement(self::$marketingNavSEOSearchSiteMap); + + $I->seeElement(self::$marketingNavUserContentMainArea); + $I->seeElement(self::$marketingNavUserContentTitle); + $I->seeElement(self::$marketingNavUserContentReviews); + } + + public function iShouldSeeTheContentNavMenu(\AcceptanceTester $I) { + $I->seeElement(self::$contentNavElementsMainArea); + $I->seeElement(self::$contentNavElementsTitle); + $I->seeElement(self::$contentNavElementsPages); + $I->seeElement(self::$contentNavElementsBlocks); + $I->seeElement(self::$contentNavElementsWidgets); + + $I->seeElement(self::$contentNavDesignMainArea); + $I->seeElement(self::$contentNavDesignTitle); + $I->seeElement(self::$contentNavDesignConfiguration); + $I->seeElement(self::$contentNavDesignThemes); + $I->seeElement(self::$contentNavDesignSchedule); + } + + public function iShouldSeeTheReportsNavMenu(\AcceptanceTester $I) { + $I->seeElement(self::$reportsNavMarketingMainArea); + $I->seeElement(self::$reportsNavMarketingTitle); + $I->seeElement(self::$reportsNavMarketingProductsInCart); + $I->seeElement(self::$reportsNavMarketingSearchTerms); + $I->seeElement(self::$reportsNavMarketingAbandonedCarts); + $I->seeElement(self::$reportsNavMarketingNewsletterProblemReports); + + $I->seeElement(self::$reportsNavReviewsMainArea); + $I->seeElement(self::$reportsNavReviewsTitle); + $I->seeElement(self::$reportsNavReviewsByCustomers); + $I->seeElement(self::$reportsNavReviewsByProducts); + + $I->seeElement(self::$reportsNavSalesMainArea); + $I->seeElement(self::$reportsNavSalesTitle); + $I->seeElement(self::$reportsNavSalesOrders); + $I->seeElement(self::$reportsNavSalesTax); + $I->seeElement(self::$reportsNavSalesInvoiced); + $I->seeElement(self::$reportsNavSalesShipping); + $I->seeElement(self::$reportsNavSalesRefunds); + $I->seeElement(self::$reportsNavSalesCoupons); + $I->seeElement(self::$reportsNavSalesPayPalSettlement); + $I->seeElement(self::$reportsNavSalesBraintreeSettlement); + + $I->seeElement(self::$reportsNavCustomersMainArea); + $I->seeElement(self::$reportsNavCustomersTitle); + $I->seeElement(self::$reportsNavCustomersOrderTotal); + $I->seeElement(self::$reportsNavCustomersOrderCount); + $I->seeElement(self::$reportsNavCustomersNew); + + $I->seeElement(self::$reportsNavProductsMainArea); + $I->seeElement(self::$reportsNavProductsTitle); + $I->seeElement(self::$reportsNavProductsViews); + $I->seeElement(self::$reportsNavProductsBestsellers); + $I->seeElement(self::$reportsNavProductsLowStock); + $I->seeElement(self::$reportsNavProductsOrdered); + $I->seeElement(self::$reportsNavProductsDownloads); + + $I->seeElement(self::$reportsNavStatisticsMainArea); + $I->seeElement(self::$reportsNavStatisticsTitle); + $I->seeElement(self::$reportsNavStatisticsRefreshStatistics); + } + + public function iShouldSeeTheStoresNavMenu(\AcceptanceTester $I) { + $I->seeElement(self::$storesNavSettingsMainArea); + $I->seeElement(self::$storesNavSettingsTitle); + $I->seeElement(self::$storesNavSettingsAllStores); + $I->seeElement(self::$storesNavSettingsConfiguration); + $I->seeElement(self::$storesNavSettingsTermsAndConditions ); + $I->seeElement(self::$storesNavSettingsOrderStatus); + + $I->seeElement(self::$storesNavTaxesMainArea); + $I->seeElement(self::$storesNavTaxesTitle); + $I->seeElement(self::$storesNavTaxesTaxRules); + $I->seeElement(self::$storesNavTaxesTaxZonesAndRates); + + $I->seeElement(self::$storesNavCurrencyMainArea); + $I->seeElement(self::$storesNavCurrencyTitle); + $I->seeElement(self::$storesNavCurrencyRates); + $I->seeElement(self::$storesNavCurrencySymbols); + + $I->seeElement(self::$storesNavAttributesMainArea); + $I->seeElement(self::$storesNavAttributesTitle); + $I->seeElement(self::$storesNavAttributesProduct); + $I->seeElement(self::$storesNavAttributesSet); + $I->seeElement(self::$storesNavAttributesRating); + + $I->seeElement(self::$storesNavOtherSettingsMainArea); + $I->seeElement(self::$storesNavOtherSettingsTitle); + $I->seeElement(self::$storesNavOtherSettingsCustomerGroups); + } + + public function iShouldSeeTheSystemNavMenu(\AcceptanceTester $I) { + $I->seeElement(self::$systemNavDataTransferMainArea); + $I->seeElement(self::$systemNavDataTransferTitle); + $I->seeElement(self::$systemNavDataTransferImport); + $I->seeElement(self::$systemNavDataTransferExport); + $I->seeElement(self::$systemNavDataTransferImportExportTaxRates); + $I->seeElement(self::$systemNavDataTransferImportHistory); + + $I->seeElement(self::$systemNavExtensionsMainArea); + $I->seeElement(self::$systemNavExtensionsTitle); + $I->seeElement(self::$systemNavExtensionsIntegrations); + + $I->seeElement(self::$systemNavToolsMainArea); + $I->seeElement(self::$systemNavToolsTitle); + $I->seeElement(self::$systemNavToolsCacheManagement); + $I->seeElement(self::$systemNavToolsBackups); + $I->seeElement(self::$systemNavToolsIndexManagement); + $I->seeElement(self::$systemNavToolsWebSetupWizard); + + $I->seeElement(self::$systemNavPermissionsMainArea); + $I->seeElement(self::$systemNavPermissionsTitle); + $I->seeElement(self::$systemNavPermissionsAllUsers); + $I->seeElement(self::$systemNavPermissionsLockedUsers); + $I->seeElement(self::$systemNavPermissionsUserRoles); + + $I->seeElement(self::$systemNavOtherSettingsMainArea); + $I->seeElement(self::$systemNavOtherSettingsTitle); + $I->seeElement(self::$systemNavOtherSettingsNotifications); + $I->seeElement(self::$systemNavOtherSettingsCustomVariables); + $I->seeElement(self::$systemNavOtherSettingsManageEncryptionKey); + } +} \ No newline at end of file diff --git a/tests/_support/Step/Acceptance/Admin.php b/tests/_support/Step/Acceptance/Admin.php new file mode 100644 index 000000000..eeb436094 --- /dev/null +++ b/tests/_support/Step/Acceptance/Admin.php @@ -0,0 +1,1189 @@ +amOnPage(\Page\Acceptance\AdminURLList::$adminLogin); + } + + public function goToTheAdminLogoutPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminLogout); + } + + public function goToRandomAdminPage() + { + $I = $this; + + $admin_url_list = array( + "/admin/admin/dashboard/", + "/admin/sales/order/", + "/admin/sales/invoice/", + "/admin/sales/shipment/", + "/admin/sales/creditmemo/", + "/admin/paypal/billing_agreement/", + "/admin/sales/transactions/", + "/admin/catalog/product/", + "/admin/catalog/category/", + "/admin/customer/index/", + "/admin/customer/online/", + "/admin/catalog_rule/promo_catalog/", + "/admin/sales_rule/promo_quote/", + "/admin/admin/email_template/", + "/admin/newsletter/template/", + "/admin/newsletter/queue/", + "/admin/newsletter/subscriber/", + "/admin/admin/url_rewrite/index/", + "/admin/search/term/index/", + "/admin/search/synonyms/index/", + "/admin/admin/sitemap/", + "/admin/review/product/index/", + "/admin/cms/page/", + "/admin/cms/block/", + "/admin/admin/widget_instance/", + "/admin/theme/design_config/", + "/admin/admin/system_design_theme/", + "/admin/admin/system_design/", + "/admin/reports/report_shopcart/product/", + "/admin/search/term/report/", + "/admin/reports/report_shopcart/abandoned/", + "/admin/newsletter/problem/", + "/admin/reports/report_review/customer/", + "/admin/reports/report_review/product/", + "/admin/reports/report_sales/sales/", + "/admin/reports/report_sales/tax/", + "/admin/reports/report_sales/invoiced/", + "/admin/reports/report_sales/shipping/", + "/admin/reports/report_sales/refunded/", + "/admin/reports/report_sales/coupons/", + "/admin/paypal/paypal_reports/", + "/admin/braintree/report/", + "/admin/reports/report_customer/totals/", + "/admin/reports/report_customer/orders/", + "/admin/reports/report_customer/accounts/", + "/admin/reports/report_product/viewed/", + "/admin/reports/report_sales/bestsellers/", + "/admin/reports/report_product/lowstock/", + "/admin/reports/report_product/sold/", + "/admin/reports/report_product/downloads/", + "/admin/reports/report_statistics/", + "/admin/admin/system_store/", + "/admin/admin/system_config/", + "/admin/checkout/agreement/", + "/admin/sales/order_status/", + "/admin/tax/rule/", + "/admin/tax/rate/", + "/admin/admin/system_currency/", + "/admin/admin/system_currencysymbol/", + "/admin/catalog/product_attribute/", + "/admin/catalog/product_set/", + "/admin/review/rating/", + "/admin/customer/group/", + "/admin/admin/import/", + "/admin/admin/export/", + "/admin/tax/rate/importExport/", + "/admin/admin/history/", + "/admin/admin/integration/", + "/admin/admin/cache/", + "/admin/backup/index/", + "/admin/indexer/indexer/list/", + "/admin/admin/user/", + "/admin/admin/locks/", + "/admin/admin/user_role/", + "/admin/admin/notification/", + "/admin/admin/system_variable/", + "/admin/admin/crypt_key/" + ); + + $random_admin_url = array_rand($admin_url_list, 1); + + $I->amOnPage($admin_url_list[$random_admin_url]); + + return $admin_url_list[$random_admin_url]; + } + + // Sales + public function goToTheAdminSalesOrdersPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesOrders); + } + + public function goToTheAdminSalesInvoicesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesInvoices); + } + + public function goToTheAdminSalesShipmentsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesShipments); + } + + public function goToTheAdminSalesCreditMemosPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesCreditMemos); + } + + public function goToTheAdminSalesBillingAgreementsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesBillingAgreements); + } + + public function goToTheAdminSalesTransactionsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesTransactions); + } + + // Products + public function goToTheAdminProductsCatalogPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminProductsCatalog); + } + + public function goToTheAdminProductsCategoriesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminProductsCategories); + } + + // Customers + public function goToTheAdminCustomersAllCustomersPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminCustomersAllCustomers); + } + + public function goToTheAdminCustomersNowOnlinePage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminCustomersNowOnline); + } + + // Marketing + public function goToTheAdminMarketingCatalogPriceRulePage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingCatalogPriceRule); + } + + public function goToTheAdminMarketingCartPriceRulePage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingCartPriceRules); + } + + public function goToTheAdminMarketingEmailTemplatesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingEmailTemplates); + } + + public function goToTheAdminMarketingNewsletterTemplatePage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterTemplate); + } + + public function goToTheAdminMarketingNewsletterQueuePage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterQueue); + } + + public function goToTheAdminMarketingNewsletterSubscribersPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterSubscribers); + } + + public function goToTheAdminMarketingURLRewritesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingURLRewrites); + } + + public function goToTheAdminMarketingSearchTermsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingSearchTerms); + } + + public function goToTheAdminMarketingSearchSynonymsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingSearchSynonyms); + } + + public function goToTheAdminMarketingSiteMapPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingSiteMap); + } + + public function goToTheAdminMarketingReviewsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingReviews); + } + + // Content + public function goToTheAdminContentPagesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentPages); + } + + public function goToTheAdminContentBlocksPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentBlocks); + } + + public function goToTheAdminContentWidgetsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentWidgets); + } + + public function goToTheAdminContentConfigurationPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentConfiguration); + } + + public function goToTheAdminContentThemesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentThemes); + } + + public function goToTheAdminContentSchedulePage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentSchedule); + } + + // Reports + public function goToTheAdminReportsProductsInCartPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsProductsInCart); + } + + public function goToTheAdminReportsSearchTermsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsSearchTerms); + } + + public function goToTheAdminReportsAbandonedCartsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsAbandonedCArts); + } + + public function goToTheAdminReportsNewsletterProblemReportsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsNewsletterProblemReports); + } + + public function goToTheAdminReportsByCustomersPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsByCustomers); + } + + public function goToTheAdminReportsByProductsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsByProducts); + } + + public function goToTheAdminReportsOrdersPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsOrders); + } + + public function goToTheAdminReportsTaxPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsTax); + } + + public function goToTheAdminReportsInvoicedPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsInvoiced); + } + + public function goToTheAdminReportsShippingPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsShipping); + } + + public function goToTheAdminReportsRefundsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsRefunds); + } + + public function goToTheAdminReportsCouponsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsCoupons); + } + + public function goToTheAdminReportsPayPalSettlementPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsPayPalSettlement); + } + + public function goToTheAdminReportsBraintreeSettlementPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsBraintreeSettlement); + } + + public function goToTheAdminReportsOrderTotalPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsOrderTotal); + } + + public function goToTheAdminReportsOrderCountPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsOrderCount); + } + + public function goToTheAdminReportsNewPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsNew); + } + + public function goToTheAdminReportsViewsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsViews); + } + + public function goToTheAdminReportsBestsellersPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsBestsellers); + } + + public function goToTheAdminReportsLowStockPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsLowStock); + } + + public function goToTheAdminReportsOrderedPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsOrdered); + } + + public function goToTheAdminReportsDownloadsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsDownloads); + } + + public function goToTheAdminReportRefreshStatisticsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsRefreshStatistics); + } + + // Stores + public function goToTheAdminStoresAllStoresPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresAllStores); + } + + public function goToTheAdminStoresConfigurationPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresConfiguration); + } + + public function goToTheAdminStoresTermsAndConditionsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresTermsAndConditions); + } + + public function goToTheAdminStoresOrderStatusPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresOrderStatus); + } + + public function goToTheAdminStoresTaxRulesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresTaxRules); + } + + public function goToTheAdminStoresTaxZonesAndRatesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresTaxZonesAndRates); + } + + public function goToTheAdminStoresCurrencyRatesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresCurrencyRates); + } + + public function goToTheAdminStoresCurrencySymbolsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresCurrencySymbols); + } + + public function goToTheAdminStoresProductPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresProduct); + } + + public function goToTheAdminStoresAttributeSetPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresAttributeSet); + } + + public function goToTheAdminStoresRatingPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresRating); + } + + public function goToTheAdminStoresCustomerGroupsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresCustomerGroups); + } + + // System + public function goToTheAdminSystemImportPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemImport); + } + + public function goToTheAdminSystemExportPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemExport); + } + + public function goToTheAdminSystemImportExportTaxRatesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemImportExportTaxRates); + } + + public function goToTheAdminSystemImportHistoryPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemImportHistory); + } + + public function goToTheAdminSystemIntegrationsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemIntegrations); + } + + public function goToTheAdminSystemCacheManagementPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemCacheManagement); + } + + public function goToTheAdminSystemBackupsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemBackups); + } + + public function goToTheAdminSystemIndexManagementPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemIndexManagement); + } + + public function goToTheAdminSystemWebSetupWizardPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemWebSetupWizard); + } + + public function goToTheAdminSystemAllUsersPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemAllUsers); + } + + public function goToTheAdminSystemLockedUsersPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemLockedUsers); + } + + public function goToTheAdminSystemUserRolesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemUserRoles); + } + + public function goToTheAdminSystemNotificationsPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemNotifications); + } + + public function goToTheAdminSystemCustomVariablesPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemCustomVariables); + } + + public function goToTheAdminSystemManageEncryptionKeyPage() + { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemManageEncryptionKey); + } + + public function goToTheAdminFindPartnersAndExtensionsPage() { + $I = $this; + $I->amOnPage(\Page\Acceptance\AdminURLList::$adminFindPartnersAndExtensions); + } + + public function shouldBeOnTheAdminLoginPage() { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminLogin); + } + + public function shouldBeOnTheAdminDashboardPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminDashboard); + $I->see('Dashboard', '.page-title'); + } + + public function shouldBeOnTheForgotYourPasswordPage() { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminForgotYourPassword); + } + + // Sales + public function shouldBeOnTheAdminSalesOrdersPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesOrders); + $I->see('Orders', '.page-title'); + } + + public function shouldBeOnTheAdminSalesInvoicesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesInvoices); + $I->see('Invoices', '.page-title'); + } + + public function shouldBeOnTheAdminSalesShipmentsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesShipments); + $I->see('Shipments', '.page-title'); + } + + public function shouldBeOnTheAdminSalesCreditMemosPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesCreditMemos); + $I->see('Credit Memos', '.page-title'); + } + + public function shouldBeOnTheAdminSalesBillingAgreementsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesBillingAgreements); + $I->see('Billing Agreements', '.page-title'); + } + + public function shouldBeOnTheAdminSalesTransactionsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesTransactions); + $I->see('Transactions', '.page-title'); + } + + // Products + public function shouldBeOnTheAdminProductsCatalogPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminProductsCatalog); + $I->see('Catalog', '.page-title'); + } + + public function shouldBeOnTheAdminProductsCategoriesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminProductsCategories); + $I->see('Default Category', '.page-title'); + } + + // Customers + public function shouldBeOnTheAdminCustomersAllCustomersPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminCustomersAllCustomers); + $I->see('Customers', '.page-title'); + } + + public function shouldBeOnTheAdminCustomersNowOnlinePage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminCustomersNowOnline); + $I->see('Customers Now Online', '.page-title'); + } + + // Marketing + public function shouldBeOnTheAdminMarketingCatalogPriceRulePage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingCatalogPriceRule); + $I->see('Catalog Price Rule', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingCartPriceRulePage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingCartPriceRules); + $I->see('Cart Price Rules', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingEmailTemplatesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingEmailTemplates); + $I->see('Email Templates', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingNewsletterTemplatePage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterTemplate); + $I->see('Newsletter Templates', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingNewsletterQueuePage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterQueue); + $I->see('Newsletter Queue', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingNewsletterSubscribersPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterSubscribers); + $I->see('Newsletter Subscribers', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingURLRewritesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingURLRewrites); + $I->see('URL Rewrites', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingSearchTermsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingSearchTerms); + $I->see('Search Terms', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingSearchSynonymsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingSearchSynonyms); + $I->see('Search Synonyms', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingSiteMapPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingSiteMap); + $I->see('Site Map', '.page-title'); + } + + public function shouldBeOnTheAdminMarketingReviewsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingReviews); + $I->see('Reviews', '.page-title'); + } + + // Content + public function shouldBeOnTheAdminContentPagesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentPages); + $I->see('Pages', '.page-title'); + } + + public function shouldBeOnTheAdminContentBlocksPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentBlocks); + $I->see('Blocks', '.page-title'); + } + + public function shouldBeOnTheAdminContentWidgetsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentWidgets); + $I->see('Widgets', '.page-title'); + } + + public function shouldBeOnTheAdminContentConfigurationPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentConfiguration); + $I->see('Design Configuration', '.page-title'); + } + + public function shouldBeOnTheAdminContentThemesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentThemes); + $I->see('Themes', '.page-title'); + } + + public function shouldBeOnTheAdminContentSchedulePage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentSchedule); + $I->see('Store Design Schedule', '.page-title'); + } + + // Reports + public function shouldBeOnTheAdminReportsProductsInCartPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsProductsInCart); + $I->see('Products in Carts', '.page-title'); + } + + public function shouldBeOnTheAdminReportsSearchTermsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsSearchTerms); + $I->see('Search Terms Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsAbandonedCartsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsAbandonedCArts); + $I->see('Abandoned Carts', '.page-title'); + } + + public function shouldBeOnTheAdminReportsNewsletterProblemReportsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsNewsletterProblemReports); + $I->see('Newsletter Problems Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsByCustomersPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsByCustomers); + $I->see('Customer Reviews Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsByProductsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsByProducts); + $I->see('Product Reviews Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsOrdersPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsOrders); + $I->see('Orders Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsTaxPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsTax); + $I->see('Tax Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsInvoicedPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsInvoiced); + $I->see('Invoice Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsShippingPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsShipping); + $I->see('Shipping Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsRefundsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsRefunds); + $I->see('Refunds Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsCouponsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsCoupons); + $I->see('Coupons Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsPayPalSettlementPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsPayPalSettlement); + $I->see('PayPal Settlement Reports', '.page-title'); + } + + public function shouldBeOnTheAdminReportsBraintreeSettlementPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsBraintreeSettlement); + $I->see('Braintree Settlement Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsOrderTotalPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsOrderTotal); + $I->see('Order Total Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsOrderCountPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsOrderCount); + $I->see('Order Count Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsNewPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsNew); + $I->see('New Accounts Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsViewsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsViews); + $I->see('Product Views Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsBestsellersPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsBestsellers); + $I->see('Bestsellers Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsLowStockPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsLowStock); + $I->see('Low Stock Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsOrderedPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsOrdered); + $I->see('Ordered Products Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportsDownloadsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsDownloads); + $I->see('Downloads Report', '.page-title'); + } + + public function shouldBeOnTheAdminReportRefreshStatisticsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsRefreshStatistics); + $I->see('Refresh Statistics', '.page-title'); + } + + // Stores + public function shouldBeOnTheAdminStoresAllStoresPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresAllStores); + $I->see('Stores', '.page-title'); + } + + public function shouldBeOnTheAdminStoresConfigurationPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresConfiguration); + $I->see('Configuration', '.page-title'); + } + + public function shouldBeOnTheAdminStoresTermsAndConditionsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresTermsAndConditions); + $I->see('Terms and Conditions', '.page-title'); + } + + public function shouldBeOnTheAdminStoresOrderStatusPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresOrderStatus); + $I->see('Order Status', '.page-title'); + } + + public function shouldBeOnTheAdminStoresTaxRulesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresTaxRules); + $I->see('Tax Rules', '.page-title'); + } + + public function shouldBeOnTheAdminStoresTaxZonesAndRatesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresTaxZonesAndRates); + $I->see('Tax Zones and Rates', '.page-title'); + } + + public function shouldBeOnTheAdminStoresCurrencyRatesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresCurrencyRates); + $I->see('Currency Rates', '.page-title'); + } + + public function shouldBeOnTheAdminStoresCurrencySymbolsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresCurrencySymbols); + $I->see('Currency Symbols', '.page-title'); + } + + public function shouldBeOnTheAdminStoresProductPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresProduct); + $I->see('Product Attributes', '.page-title'); + } + + public function shouldBeOnTheAdminStoresAttributeSetPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresAttributeSet); + $I->see('Attribute Sets', '.page-title'); + } + + public function shouldBeOnTheAdminStoresRatingPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresRating); + $I->see('Ratings', '.page-title'); + } + + public function shouldBeOnTheAdminStoresCustomerGroupsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresCustomerGroups); + $I->see('Customer Groups', '.page-title'); + } + + // System + public function shouldBeOnTheAdminSystemImportPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemImport); + $I->see('Import', '.page-title'); + } + + public function shouldBeOnTheAdminSystemExportPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemExport); + $I->see('Export', '.page-title'); + } + + public function shouldBeOnTheAdminSystemImportExportTaxRatesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemImportExportTaxRates); + $I->see('Import and Export Tax Rates', '.page-title'); + } + + public function shouldBeOnTheAdminSystemImportHistoryPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemImportHistory); + $I->see('Import History', '.page-title'); + } + + public function shouldBeOnTheAdminSystemIntegrationsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemIntegrations); + $I->see('Integrations', '.page-title'); + } + + public function shouldBeOnTheAdminSystemCacheManagementPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemCacheManagement); + $I->see('Cache Management', '.page-title'); + } + + public function shouldBeOnTheAdminSystemBackupsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemBackups); + $I->see('Backups', '.page-title'); + } + + public function shouldBeOnTheAdminSystemIndexManagementPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemIndexManagement); + $I->see('Index Management', '.page-title'); + } + + public function shouldBeOnTheAdminSystemWebSetupWizardPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemWebSetupWizard); + $I->see('Setup Wizard', '.page-title'); + } + + public function shouldBeOnTheAdminSystemAllUsersPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemAllUsers); + $I->see('Users', '.page-title'); + } + + public function shouldBeOnTheAdminSystemLockedUsersPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemLockedUsers); + $I->see('Locked Users', '.page-title'); + } + + public function shouldBeOnTheAdminSystemUserRolesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemUserRoles); + $I->see('Roles', '.page-title'); + } + + public function shouldBeOnTheAdminSystemNotificationsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemNotifications); + $I->see('Notifications', '.page-title'); + } + + public function shouldBeOnTheAdminSystemCustomVariablesPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemCustomVariables); + $I->see('Custom Variables', '.page-title'); + } + + public function shouldBeOnTheAdminSystemManageEncryptionKeyPage() + { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemManageEncryptionKey); + $I->see('Encryption Key', '.page-title'); + } + + public function shouldBeOnTheAdminFindPartnersAndExtensionsPage() { + $I = $this; + $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminFindPartnersAndExtensions); + $I->see('Magento Marketplace', '.page-title'); + } + + public function closeAdminNotification() { + $I = $this; + + try { + $I->dontSee('._show .action-close'); + } catch (\Exception $e) { + $I->click('._show .action-close'); + $I->wait(1); + } + } + + public function loginAsTheFollowingAdmin($username, $password) { + $I = $this; + $I->fillField('login[username]', $username); + $I->fillField('login[password]', $password); + $I->click('Sign in'); + + if ($I->seeElement('._show .action-close')) { + $I->closeAdminNotification(); + } + } + + public function loginAsAnExistingAdmin() { + $I = $this; + $I->fillField('login[username]', 'admin'); + $I->fillField('login[password]', 'admin123'); + $I->click('Sign in'); + + codecept_debug($I->seeElement('._show .action-close')); + $I->closeAdminNotification(); + } +} \ No newline at end of file diff --git a/tests/_support/UnitTester.php b/tests/_support/UnitTester.php new file mode 100644 index 000000000..28353572c --- /dev/null +++ b/tests/_support/UnitTester.php @@ -0,0 +1,26 @@ +goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + } + + /** + * @env phantomjs + * @env chrome + * @group example + */ + public function accessTheSalesOrdersPage(\Step\Acceptance\Admin $I) + { + $I->goToTheAdminSalesOrdersPage(); + $I->shouldBeOnTheAdminSalesOrdersPage(); + $I->see('Orders'); + } + + /** + * @env phantomjs + * @env chrome + * @group example + */ + public function accessTheProductsCatalogPage(\Step\Acceptance\Admin $I) + { + $I->goToTheAdminProductsCatalogPage(); + $I->shouldBeOnTheAdminProductsCatalogPage(); + $I->see('Catalog'); + } +} diff --git a/tests/acceptance/_bootstrap.php b/tests/acceptance/_bootstrap.php new file mode 100644 index 000000000..8a8855580 --- /dev/null +++ b/tests/acceptance/_bootstrap.php @@ -0,0 +1,2 @@ +am('an Admin'); +$I->wantTo('verify that I can access the Admin Login page'); + +$I->goToTheAdminLoginPage(); +$I->shouldBeOnTheAdminLoginPage(); \ No newline at end of file diff --git a/tests/acceptance/login/AccessForgotYourPasswordCest.php b/tests/acceptance/login/AccessForgotYourPasswordCest.php new file mode 100644 index 000000000..35cd2164d --- /dev/null +++ b/tests/acceptance/login/AccessForgotYourPasswordCest.php @@ -0,0 +1,54 @@ +goToTheAdminLoginPage(); + } + + /** + * @env chrome + * @env firefox + * @env phantomjs + */ + public function shouldLandOnTheForgotYourPasswordPage(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) + { + $I->wantTo('see if I can access the Forgot Your Password page'); + $adminLogin->iClickOnForgotYourPassword($I); + $I->shouldBeOnTheForgotYourPasswordPage(); + $adminLogin->iShouldSeeTheForgotYourPasswordFields($I); + $I->see('Password Help'); + } + + /** + * @env chrome + * @env firefox + * @env phantomjs + */ + public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) + { + $I->wantTo('see if I can access the Login page from the Forgot Your Password page'); + $adminLogin->iClickOnForgotYourPassword($I); + $adminLogin->iClickOnBackToSignIn($I); + $I->shouldBeOnTheAdminLoginPage(); + } + + /** + * @env chrome + * @env firefox + * @env phantomjs + */ + public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) + { + $I->wantTo('see if I can access the Login page by clicking on the Logo'); + $adminLogin->iClickOnMagentoLogo($I); + $I->shouldBeOnTheAdminLoginPage(); + + $adminLogin->iClickOnForgotYourPassword($I); + $adminLogin->iClickOnMagentoLogo($I); + $I->shouldBeOnTheAdminLoginPage(); + } +} diff --git a/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCept.php b/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCept.php new file mode 100644 index 000000000..02a6cbb87 --- /dev/null +++ b/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCept.php @@ -0,0 +1,22 @@ +wantTo('make sure you cannot access Admin pages after logging out'); + +$I->goToTheAdminLoginPage(); +$I->loginAsAnExistingAdmin(); +$I->goToTheAdminLogoutPage(); + +$I->goToRandomAdminPage(); +$I->shouldBeOnTheAdminLoginPage(); + +$I->goToRandomAdminPage(); +$I->shouldBeOnTheAdminLoginPage(); + +$I->goToRandomAdminPage(); +$I->shouldBeOnTheAdminLoginPage(); \ No newline at end of file diff --git a/tests/acceptance/login/CannotAccessAdminPagesCept.php b/tests/acceptance/login/CannotAccessAdminPagesCept.php new file mode 100644 index 000000000..02c7e4cbb --- /dev/null +++ b/tests/acceptance/login/CannotAccessAdminPagesCept.php @@ -0,0 +1,25 @@ +wantTo('make sure you cannot access Admin pages when NOT logged in'); +$I->goToTheAdminLoginPage(); + +$I->goToRandomAdminPage(); +$I->shouldBeOnTheAdminLoginPage(); + +$I->goToRandomAdminPage(); +$I->shouldBeOnTheAdminLoginPage(); + +$I->goToRandomAdminPage(); +$I->shouldBeOnTheAdminLoginPage(); + +$I->goToRandomAdminPage(); +$I->shouldBeOnTheAdminLoginPage(); + +$I->goToRandomAdminPage(); +$I->shouldBeOnTheAdminLoginPage(); \ No newline at end of file diff --git a/tests/acceptance/login/LoginOnAdminLoginPageCept.php b/tests/acceptance/login/LoginOnAdminLoginPageCept.php new file mode 100644 index 000000000..6697c1664 --- /dev/null +++ b/tests/acceptance/login/LoginOnAdminLoginPageCept.php @@ -0,0 +1,12 @@ +wantTo('verify that I can login via the Admin Login page'); + +$I->goToTheAdminLoginPage(); +$I->loginAsAnExistingAdmin(); +$I->shouldBeOnTheAdminDashboardPage(); \ No newline at end of file diff --git a/tests/acceptance/login/LogoutAfterLoginCept.php b/tests/acceptance/login/LogoutAfterLoginCept.php new file mode 100644 index 000000000..9f3c00525 --- /dev/null +++ b/tests/acceptance/login/LogoutAfterLoginCept.php @@ -0,0 +1,13 @@ +wantTo('logout of the Admin area and land on the Login page'); + +$I->goToTheAdminLoginPage(); +$I->loginAsAnExistingAdmin(); +$I->goToTheAdminLogoutPage(); +$I->shouldBeOnTheAdminLoginPage(); \ No newline at end of file diff --git a/tests/acceptance/misc/AccessAdminPagesDirectlyCest.php b/tests/acceptance/misc/AccessAdminPagesDirectlyCest.php new file mode 100644 index 000000000..c9e8de17f --- /dev/null +++ b/tests/acceptance/misc/AccessAdminPagesDirectlyCest.php @@ -0,0 +1,248 @@ +goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + } + + /** + * @env chrome + * @env firefox + * @env phantomjs + * @group slow + */ + public function shouldBeAbleToAccessEachAdminPageDirectly(\Step\Acceptance\Admin $I) + { + $I->goToTheAdminSalesOrdersPage(); + $I->shouldBeOnTheAdminSalesOrdersPage(); + + $I->goToTheAdminSalesInvoicesPage(); + $I->shouldBeOnTheAdminSalesInvoicesPage(); + + $I->goToTheAdminSalesShipmentsPage(); + $I->shouldBeOnTheAdminSalesShipmentsPage(); + + $I->goToTheAdminSalesCreditMemosPage(); + $I->shouldBeOnTheAdminSalesCreditMemosPage(); + + $I->goToTheAdminSalesBillingAgreementsPage(); + $I->shouldBeOnTheAdminSalesBillingAgreementsPage(); + + $I->goToTheAdminSalesTransactionsPage(); + $I->shouldBeOnTheAdminSalesTransactionsPage(); + + $I->goToTheAdminProductsCatalogPage(); + $I->shouldBeOnTheAdminProductsCatalogPage(); + + $I->goToTheAdminProductsCategoriesPage(); + $I->shouldBeOnTheAdminProductsCategoriesPage(); + + $I->goToTheAdminCustomersAllCustomersPage(); + $I->shouldBeOnTheAdminCustomersAllCustomersPage(); + + $I->goToTheAdminCustomersNowOnlinePage(); + $I->shouldBeOnTheAdminCustomersNowOnlinePage(); + + $I->goToTheAdminMarketingCatalogPriceRulePage(); + $I->shouldBeOnTheAdminMarketingCatalogPriceRulePage(); + + $I->goToTheAdminMarketingCartPriceRulePage(); + $I->shouldBeOnTheAdminMarketingCartPriceRulePage(); + + $I->goToTheAdminMarketingEmailTemplatesPage(); + $I->shouldBeOnTheAdminMarketingEmailTemplatesPage(); + + $I->goToTheAdminMarketingNewsletterTemplatePage(); + $I->shouldBeOnTheAdminMarketingNewsletterTemplatePage(); + + $I->goToTheAdminMarketingNewsletterQueuePage(); + $I->shouldBeOnTheAdminMarketingNewsletterQueuePage(); + + $I->goToTheAdminMarketingNewsletterSubscribersPage(); + $I->shouldBeOnTheAdminMarketingNewsletterSubscribersPage(); + + $I->goToTheAdminMarketingURLRewritesPage(); + $I->shouldBeOnTheAdminMarketingURLRewritesPage(); + + $I->goToTheAdminMarketingSearchTermsPage(); + $I->shouldBeOnTheAdminMarketingSearchTermsPage(); + + $I->goToTheAdminMarketingSearchSynonymsPage(); + $I->shouldBeOnTheAdminMarketingSearchSynonymsPage(); + + $I->goToTheAdminMarketingSiteMapPage(); + $I->shouldBeOnTheAdminMarketingSiteMapPage(); + + $I->goToTheAdminMarketingReviewsPage(); + $I->shouldBeOnTheAdminMarketingReviewsPage(); + + $I->goToTheAdminContentPagesPage(); + $I->shouldBeOnTheAdminContentPagesPage(); + + $I->goToTheAdminContentBlocksPage(); + $I->shouldBeOnTheAdminContentBlocksPage(); + + $I->goToTheAdminContentWidgetsPage(); + $I->shouldBeOnTheAdminContentWidgetsPage(); + + $I->goToTheAdminContentConfigurationPage(); + $I->shouldBeOnTheAdminContentConfigurationPage(); + + $I->goToTheAdminContentThemesPage(); + $I->shouldBeOnTheAdminContentThemesPage(); + + $I->goToTheAdminContentSchedulePage(); + $I->shouldBeOnTheAdminContentSchedulePage(); + + $I->goToTheAdminReportsProductsInCartPage(); + $I->shouldBeOnTheAdminReportsProductsInCartPage(); + + $I->goToTheAdminReportsSearchTermsPage(); + $I->shouldBeOnTheAdminReportsSearchTermsPage(); + + $I->goToTheAdminReportsAbandonedCartsPage(); + $I->shouldBeOnTheAdminReportsAbandonedCartsPage(); + + $I->goToTheAdminReportsNewsletterProblemReportsPage(); + $I->shouldBeOnTheAdminReportsNewsletterProblemReportsPage(); + + $I->goToTheAdminReportsByCustomersPage(); + $I->shouldBeOnTheAdminReportsByCustomersPage(); + + $I->goToTheAdminReportsByProductsPage(); + $I->shouldBeOnTheAdminReportsByProductsPage(); + + $I->goToTheAdminReportsOrdersPage(); + $I->shouldBeOnTheAdminReportsOrdersPage(); + + $I->goToTheAdminReportsTaxPage(); + $I->shouldBeOnTheAdminReportsTaxPage(); + + $I->goToTheAdminReportsInvoicedPage(); + $I->shouldBeOnTheAdminReportsInvoicedPage(); + + $I->goToTheAdminReportsShippingPage(); + $I->shouldBeOnTheAdminReportsShippingPage(); + + $I->goToTheAdminReportsRefundsPage(); + $I->shouldBeOnTheAdminReportsRefundsPage(); + + $I->goToTheAdminReportsCouponsPage(); + $I->shouldBeOnTheAdminReportsCouponsPage(); + + $I->goToTheAdminReportsPayPalSettlementPage(); + $I->shouldBeOnTheAdminReportsPayPalSettlementPage(); + + $I->goToTheAdminReportsBraintreeSettlementPage(); + $I->shouldBeOnTheAdminReportsBraintreeSettlementPage(); + + $I->goToTheAdminReportsOrderTotalPage(); + $I->shouldBeOnTheAdminReportsOrderTotalPage(); + + $I->goToTheAdminReportsOrderCountPage(); + $I->shouldBeOnTheAdminReportsOrderCountPage(); + + $I->goToTheAdminReportsNewPage(); + $I->shouldBeOnTheAdminReportsNewPage(); + + $I->goToTheAdminReportsViewsPage(); + $I->shouldBeOnTheAdminReportsViewsPage(); + + $I->goToTheAdminReportsBestsellersPage(); + $I->shouldBeOnTheAdminReportsBestsellersPage(); + + $I->goToTheAdminReportsLowStockPage(); + $I->shouldBeOnTheAdminReportsLowStockPage(); + + $I->goToTheAdminReportsOrderedPage(); + $I->shouldBeOnTheAdminReportsOrderedPage(); + + $I->goToTheAdminReportsDownloadsPage(); + $I->shouldBeOnTheAdminReportsDownloadsPage(); + + $I->goToTheAdminReportRefreshStatisticsPage(); + $I->shouldBeOnTheAdminReportRefreshStatisticsPage(); + + $I->goToTheAdminStoresAllStoresPage(); + $I->shouldBeOnTheAdminStoresAllStoresPage(); + + $I->goToTheAdminStoresConfigurationPage(); + $I->shouldBeOnTheAdminStoresConfigurationPage(); + + $I->goToTheAdminStoresTermsAndConditionsPage(); + $I->shouldBeOnTheAdminStoresTermsAndConditionsPage(); + + $I->goToTheAdminStoresOrderStatusPage(); + $I->shouldBeOnTheAdminStoresOrderStatusPage(); + + $I->goToTheAdminStoresTaxRulesPage(); + $I->shouldBeOnTheAdminStoresTaxRulesPage(); + + $I->goToTheAdminStoresTaxZonesAndRatesPage(); + $I->shouldBeOnTheAdminStoresTaxZonesAndRatesPage(); + + $I->goToTheAdminStoresCurrencyRatesPage(); + $I->shouldBeOnTheAdminStoresCurrencyRatesPage(); + + $I->goToTheAdminStoresCurrencySymbolsPage(); + $I->shouldBeOnTheAdminStoresCurrencySymbolsPage(); + + $I->goToTheAdminStoresProductPage(); + $I->shouldBeOnTheAdminStoresProductPage(); + + $I->goToTheAdminStoresAttributeSetPage(); + $I->shouldBeOnTheAdminStoresAttributeSetPage(); + + $I->goToTheAdminStoresRatingPage(); + $I->shouldBeOnTheAdminStoresRatingPage(); + + $I->goToTheAdminStoresCustomerGroupsPage(); + $I->shouldBeOnTheAdminStoresCustomerGroupsPage(); + + $I->goToTheAdminSystemImportPage(); + $I->shouldBeOnTheAdminSystemImportPage(); + + $I->goToTheAdminSystemExportPage(); + $I->shouldBeOnTheAdminSystemExportPage(); + + $I->goToTheAdminSystemImportExportTaxRatesPage(); + $I->shouldBeOnTheAdminSystemImportExportTaxRatesPage(); + + $I->goToTheAdminSystemImportHistoryPage(); + $I->shouldBeOnTheAdminSystemImportHistoryPage(); + + $I->goToTheAdminSystemIntegrationsPage(); + $I->shouldBeOnTheAdminSystemIntegrationsPage(); + + $I->goToTheAdminSystemCacheManagementPage(); + $I->shouldBeOnTheAdminSystemCacheManagementPage(); + + $I->goToTheAdminSystemBackupsPage(); + $I->shouldBeOnTheAdminSystemBackupsPage(); + + $I->goToTheAdminSystemIndexManagementPage(); + $I->shouldBeOnTheAdminSystemIndexManagementPage(); + + $I->goToTheAdminSystemAllUsersPage(); + $I->shouldBeOnTheAdminSystemAllUsersPage(); + + $I->goToTheAdminSystemLockedUsersPage(); + $I->shouldBeOnTheAdminSystemLockedUsersPage(); + + $I->goToTheAdminSystemUserRolesPage(); + $I->shouldBeOnTheAdminSystemUserRolesPage(); + + $I->goToTheAdminSystemNotificationsPage(); + $I->shouldBeOnTheAdminSystemNotificationsPage(); + + $I->goToTheAdminSystemCustomVariablesPage(); + $I->shouldBeOnTheAdminSystemCustomVariablesPage(); + + $I->goToTheAdminSystemManageEncryptionKeyPage(); + $I->shouldBeOnTheAdminSystemManageEncryptionKeyPage(); + } +} diff --git a/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php new file mode 100644 index 000000000..739cb5280 --- /dev/null +++ b/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php @@ -0,0 +1,443 @@ +goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + } + + // Dashboard Menu Test + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnTheDashboardPage(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access the DASHBOARD Page using the Side Nav Menus'); + $I->goToRandomAdminPage(); + $sideNavMenu->iClickOnDashboardInTheSideNavMenu($I); + $I->shouldBeOnTheAdminDashboardPage(); + } + + // Sales Menu Tests + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnEachOfTheSalesPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access each of the SALES Admin Pages using the Side Nav Menus'); + $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); + $sideNavMenu->iClickOnOrdersInTheSalesNavMenu($I); + $I->shouldBeOnTheAdminSalesOrdersPage(); + + $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); + $sideNavMenu->iClickOnInvoicesInTheSalesNavMenu($I); + $I->shouldBeOnTheAdminSalesInvoicesPage(); + + $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); + $sideNavMenu->iClickOnShipmentsInTheSalesNavMenu($I); + $I->shouldBeOnTheAdminSalesShipmentsPage(); + + $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); + $sideNavMenu->iClickOnCreditMemosInTheSalesNavMenu($I); + $I->shouldBeOnTheAdminSalesCreditMemosPage(); + + $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); + $sideNavMenu->iClickOnBillingAgreementsInTheSalesNavMenu($I); + $I->shouldBeOnTheAdminSalesBillingAgreementsPage(); + + $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); + $sideNavMenu->iClickOnTransactionsInTheSalesNavMenu($I); + $I->shouldBeOnTheAdminSalesTransactionsPage(); + } + + // Products Menu Tests + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnEachOfTheProductsPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access each of the PRODUCTS Admin Pages using the Side Nav Menus'); + $sideNavMenu->iClickOnProductsInTheSideNavMenu($I); + $sideNavMenu->iClickOnCatalogInTheProductNavMenu($I); + $I->shouldBeOnTheAdminProductsCatalogPage(); + + $sideNavMenu->iClickOnProductsInTheSideNavMenu($I); + $sideNavMenu->iClickOnCategoriesInTheProductNavMenu($I); + $I->shouldBeOnTheAdminProductsCategoriesPage(); + } + + // Customers Menu Tests + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLanOnEachOfTheCustomersPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access each of the CUSTOMERS Admin Pages using the Side Nav Menus'); + $sideNavMenu->iClickOnCustomersInTheSideNavMenu($I); + $sideNavMenu->iClickOnAllCustomersInTheCustomersNavMenu($I); + $I->shouldBeOnTheAdminCustomersAllCustomersPage(); + + $sideNavMenu->iClickOnCustomersInTheSideNavMenu($I); + $sideNavMenu->iClickOnNowOnlineInTheCustomersNavMenu($I); + $I->shouldBeOnTheAdminCustomersNowOnlinePage(); + } + + // Marketing Menu Tests + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnEachOfTheMarketingPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access each of the MARKETING Admin Pages using the Side Nav Menus'); + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnCatalogPriceRulesInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingCatalogPriceRulePage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnCartPriceRulesInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingCartPriceRulePage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnEmailTemplatesInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingEmailTemplatesPage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnNewsletterTemplatesInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingNewsletterTemplatePage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnNewsletterQueueInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingNewsletterQueuePage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnNewsletterSubscribersInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingNewsletterSubscribersPage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnURLRewritesInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingURLRewritesPage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnSearchTermsInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingSearchTermsPage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnSearchSynonymsInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingSearchSynonymsPage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnSiteMapInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingSiteMapPage(); + + $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->iClickOnContentReviewsInTheMarketingNavMenu($I); + $I->shouldBeOnTheAdminMarketingReviewsPage(); + } + + // Content Menu Tests + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnEachOfTheContentPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access each of the CONTENT Admin Pages using the Side Nav Menus'); + $sideNavMenu->iClickOnContentInTheSideNavMenu($I); + $sideNavMenu->iClickOnPagesInTheContentNavMenu($I); + $I->shouldBeOnTheAdminContentPagesPage(); + + $sideNavMenu->iClickOnContentInTheSideNavMenu($I); + $sideNavMenu->iClickOnBlocksInTheContentNavMenu($I); + $I->shouldBeOnTheAdminContentBlocksPage(); + + $sideNavMenu->iClickOnContentInTheSideNavMenu($I); + $sideNavMenu->iClickOnWidgetsInTheContentNavMenu($I); + $I->shouldBeOnTheAdminContentWidgetsPage(); + + $sideNavMenu->iClickOnContentInTheSideNavMenu($I); + $sideNavMenu->iClickOnConfigurationInTheContentNavMenu($I); + $I->shouldBeOnTheAdminContentConfigurationPage(); + + $sideNavMenu->iClickOnContentInTheSideNavMenu($I); + $sideNavMenu->iClickOnThemesInTheContentNavMenu($I); + $I->shouldBeOnTheAdminContentThemesPage(); + + $sideNavMenu->iClickOnContentInTheSideNavMenu($I); + $sideNavMenu->iClickOnScheduleInTheContentNavMenu($I); + $I->shouldBeOnTheAdminContentSchedulePage(); + } + + // Reports Menu Tests + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnEachOfTheReportsPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access each of the REPORTS Admin Pages using the Side Nav Menu'); + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnProductsInCartInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsProductsInCartPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnSearchTermsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsSearchTermsPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnAbandonedCartsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsAbandonedCartsPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnNewsletterProblemReportsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsNewsletterProblemReportsPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnByCustomersInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsByCustomersPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnByProductsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsByProductsPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnOrdersInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsOrdersPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOTaxnInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsTaxPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnInvoicedInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsInvoicedPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnShippingInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsShippingPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnRefundsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsRefundsPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnCouponsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsCouponsPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnPaypalSettlementInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsPayPalSettlementPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnBraintreeSettlementInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsBraintreeSettlementPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnOrderTotalInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsOrderTotalPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnOrderCountInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsOrderCountPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnNewInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsNewPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnViewsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsViewsPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnBestSellersInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsBestsellersPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnLowStockInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsLowStockPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnOrderedInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsOrderedPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnDownloadsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportsDownloadsPage(); + + $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); + $sideNavMenu->iClickOnRefreshStatisticsInTheReportsNavMenu($I); + $I->shouldBeOnTheAdminReportRefreshStatisticsPage(); + } + + // Stores Menu Tests + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnEachOfTheStoresPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access each of the STORES Admin Pages using the Side Nav Menu'); + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnAllStoresInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresAllStoresPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnConfigurationInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresConfigurationPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnTermsAndConditionsInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresTermsAndConditionsPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnOrderStatusInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresOrderStatusPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnTaxRuleInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresTaxRulesPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnTaxZonesAndRatesInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresTaxZonesAndRatesPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnCurrencyRatesInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresCurrencyRatesPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnCurrencySymbolsInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresCurrencySymbolsPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnProductInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresProductPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnAttributesSetInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresAttributeSetPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnRatingsInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresRatingPage(); + + $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); + $sideNavMenu->iClickOnCustomerGroupInTheStoresNavMenu($I); + $I->shouldBeOnTheAdminStoresCustomerGroupsPage(); + } + + // System Menu Tests + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnEachOfTheSystemPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access each of the SYSTEM Admin Pages using the Side Nav Menu'); + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnImportInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemImportPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnExportInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemExportPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnImportExportTaxRatesInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemImportExportTaxRatesPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnImportHistoryInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemImportHistoryPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnIntegrationsInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemIntegrationsPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnCacheManagementInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemCacheManagementPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnBackupsInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemBackupsPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnIndexManagementInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemIndexManagementPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnAllUsersInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemAllUsersPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnLockedUsersInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemLockedUsersPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnUserRolesInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemUserRolesPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnNotificationsInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemNotificationsPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnCustomVariablesInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemCustomVariablesPage(); + + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnManageEncryptionKeyInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemManageEncryptionKeyPage(); + } + + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnTheWebSetupWizardPage(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access the Web Setup Wizard Admin Page using the Side Nav Menu'); + $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); + $sideNavMenu->iClickOnWebSetupWizardInTheSystemNavMenu($I); + $I->shouldBeOnTheAdminSystemWebSetupWizardPage(); + $I->goToTheAdminLogoutPage(); + } + + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldLandOnThePartnersAndExtensionsPage(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $I->wantTo('see if I can access the Partners and Extensions Admin Page using the Side Nav Menu'); + $sideNavMenu->iClickOnFindPartnersAndExtensionsInTheSideNavMenu($I); + $I->shouldBeOnTheAdminFindPartnersAndExtensionsPage(); + } + +} diff --git a/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php b/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php new file mode 100644 index 000000000..7086ac7f9 --- /dev/null +++ b/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php @@ -0,0 +1,38 @@ +wantTo('see if I can open each of the Side Nav Menus'); + +$I->goToTheAdminLoginPage(); +$I->loginAsAnExistingAdmin(); + +$sideNavMenu->iClickOnSalesInTheSideNavMenu($I); +$sideNavMenu->iShouldSeeTheSalesNavMenu($I); + +$sideNavMenu->iClickOnProductsInTheSideNavMenu($I); +$sideNavMenu->iShouldSeeTheProductNavMenu($I); + +$sideNavMenu->iClickOnCustomersInTheSideNavMenu($I); +$sideNavMenu->iShouldSeeTheCustomersNavMenu($I); + +$sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); +$sideNavMenu->iShouldSeeTheMarketingNavMenu($I); + +$sideNavMenu->iClickOnContentInTheSideNavMenu($I); +$sideNavMenu->iShouldSeeTheContentNavMenu($I); + +$sideNavMenu->iClickOnReportsInTheSideNavMenu($I); +$sideNavMenu->iShouldSeeTheReportsNavMenu($I); + +$sideNavMenu->iClickOnStoresInTheSideNavMenu($I); +$sideNavMenu->iShouldSeeTheStoresNavMenu($I); + +$sideNavMenu->iClickOnSystemInTheSideNavMenu($I); +$sideNavMenu->iShouldSeeTheSystemNavMenu($I); \ No newline at end of file diff --git a/tests/functional.suite.yml b/tests/functional.suite.yml new file mode 100644 index 000000000..075765bd9 --- /dev/null +++ b/tests/functional.suite.yml @@ -0,0 +1,11 @@ +# Codeception Test Suite Configuration +# +# Suite for functional (integration) tests +# Emulate web requests and make application process them +# Include one of framework modules (Symfony2, Yii2, Laravel5) to use it + +class_name: FunctionalTester +modules: + enabled: + # add framework module here + - \Helper\Functional \ No newline at end of file diff --git a/tests/functional/_bootstrap.php b/tests/functional/_bootstrap.php new file mode 100644 index 000000000..8a8855580 --- /dev/null +++ b/tests/functional/_bootstrap.php @@ -0,0 +1,2 @@ + Date: Wed, 15 Mar 2017 14:13:22 -0500 Subject: [PATCH 002/149] Adding Helper, disabling a Group, updating function to address some issues. - Skipping the Nav Menu tests for now. Still having a random modal issue from time to time. - Adding a Helper function to change the Codeception Config from within a test. - Updating the closeNotificationModal function to address some issues with it. Still a work in progress. --- RoboFile.php | 14 +++++++++----- tests/_support/Helper/Acceptance.php | 4 +++- tests/_support/Step/Acceptance/Admin.php | 12 ++++++------ .../AccessAdminPagesViaNavMenuCest.php | 5 +---- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index 872f96381..4509e9f7e 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -32,26 +32,30 @@ function test() { } function example() { - $this->_exec('codecept run --env chrome --group example'); + $this->_exec('codecept run --env chrome --group example --skip-group navmenu'); $this->allureReport(); } function group($args = '') { - $this->taskExec('codecept run --env chrome --group')->args($args)->run(); + $this->taskExec('codecept run --env chrome --skip-group navmenu --group')->args($args)->run(); } function chrome() { - $this->_exec('codecept run --env chrome'); + $this->_exec('codecept run --env chrome --skip-group navmenu'); $this->allureReport(); } function firefox() { - $this->_exec('codecept run --env chrome'); + $this->_exec('codecept run --env chrome --skip-group navmenu'); $this->allureReport(); } function phantomjs() { - $this->_exec('codecept run --env phantomjs'); + $this->_exec('codecept run --env phantomjs --skip-group navmenu'); $this->allureReport(); } + + function console() { + $this->_exec('codecept console acceptance'); + } } \ No newline at end of file diff --git a/tests/_support/Helper/Acceptance.php b/tests/_support/Helper/Acceptance.php index 9496c1a63..3cff47609 100644 --- a/tests/_support/Helper/Acceptance.php +++ b/tests/_support/Helper/Acceptance.php @@ -6,5 +6,7 @@ class Acceptance extends \Codeception\Module { - + public function changeConfiguration($config, $value) { + $this->getModule('WebDriver')->_reconfigure(array($config => $value)); + } } diff --git a/tests/_support/Step/Acceptance/Admin.php b/tests/_support/Step/Acceptance/Admin.php index eeb436094..34983cb0e 100644 --- a/tests/_support/Step/Acceptance/Admin.php +++ b/tests/_support/Step/Acceptance/Admin.php @@ -1159,10 +1159,11 @@ public function closeAdminNotification() { $I = $this; try { - $I->dontSee('._show .action-close'); - } catch (\Exception $e) { + $I->waitForElementVisible('._show .action-close', 1); $I->click('._show .action-close'); - $I->wait(1); + $I->waitForElementNotVisible('._show .action-close', 1); + } catch (\Exception $e) { + return false; } } @@ -1171,8 +1172,8 @@ public function loginAsTheFollowingAdmin($username, $password) { $I->fillField('login[username]', $username); $I->fillField('login[password]', $password); $I->click('Sign in'); - - if ($I->seeElement('._show .action-close')) { + + if ($I->seeElement('._show')) { $I->closeAdminNotification(); } } @@ -1183,7 +1184,6 @@ public function loginAsAnExistingAdmin() { $I->fillField('login[password]', 'admin123'); $I->click('Sign in'); - codecept_debug($I->seeElement('._show .action-close')); $I->closeAdminNotification(); } } \ No newline at end of file diff --git a/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php index 739cb5280..66b5cb54f 100644 --- a/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php @@ -3,10 +3,7 @@ use Page\Acceptance\SideNavigation as SideNav; /** - * @env chrome - * @env firefox - * @group slow - * @group new + * @group navmenu */ class AccessAdminPagesViaNavMenuCest { From d301e8638795b2632605f57ca69926cb20ec91d9 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Wed, 15 Mar 2017 15:58:15 -0500 Subject: [PATCH 003/149] Updating Tags and Robo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adding a “skip” group tag. - Updated Robo commands to include the “skip” tag instead of “navmenu”. --- RoboFile.php | 10 +++++----- tests/_support/Step/Acceptance/Admin.php | 5 ++--- tests/acceptance/misc/AccessAdminPagesDirectlyCest.php | 4 +++- .../sideNavigation/AccessAdminPagesViaNavMenuCest.php | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index 4509e9f7e..2eb46228a 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -32,26 +32,26 @@ function test() { } function example() { - $this->_exec('codecept run --env chrome --group example --skip-group navmenu'); + $this->_exec('codecept run --env chrome --group example --skip-group skip'); $this->allureReport(); } function group($args = '') { - $this->taskExec('codecept run --env chrome --skip-group navmenu --group')->args($args)->run(); + $this->taskExec('codecept run --env chrome --skip-group skip --group')->args($args)->run(); } function chrome() { - $this->_exec('codecept run --env chrome --skip-group navmenu'); + $this->_exec('codecept run --env chrome --skip-group skip'); $this->allureReport(); } function firefox() { - $this->_exec('codecept run --env chrome --skip-group navmenu'); + $this->_exec('codecept run --env chrome --skip-group skip'); $this->allureReport(); } function phantomjs() { - $this->_exec('codecept run --env phantomjs --skip-group navmenu'); + $this->_exec('codecept run --env phantomjs'); $this->allureReport(); } diff --git a/tests/_support/Step/Acceptance/Admin.php b/tests/_support/Step/Acceptance/Admin.php index 34983cb0e..36920d7ae 100644 --- a/tests/_support/Step/Acceptance/Admin.php +++ b/tests/_support/Step/Acceptance/Admin.php @@ -6,7 +6,6 @@ class Admin extends \AcceptanceTester { - public function goToTheAdminLoginPage() { $I = $this; @@ -1172,8 +1171,8 @@ public function loginAsTheFollowingAdmin($username, $password) { $I->fillField('login[username]', $username); $I->fillField('login[password]', $password); $I->click('Sign in'); - - if ($I->seeElement('._show')) { + + if ($I->canSeeElement('._show')) { $I->closeAdminNotification(); } } diff --git a/tests/acceptance/misc/AccessAdminPagesDirectlyCest.php b/tests/acceptance/misc/AccessAdminPagesDirectlyCest.php index c9e8de17f..f8206bb73 100644 --- a/tests/acceptance/misc/AccessAdminPagesDirectlyCest.php +++ b/tests/acceptance/misc/AccessAdminPagesDirectlyCest.php @@ -1,6 +1,8 @@ Date: Wed, 15 Mar 2017 16:02:29 -0500 Subject: [PATCH 004/149] Removing assertions from inside of test. I moved the assertions to the Step Object page instead of in the test itself. --- tests/acceptance/TestCest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/acceptance/TestCest.php b/tests/acceptance/TestCest.php index 1a2058393..2f212ab71 100644 --- a/tests/acceptance/TestCest.php +++ b/tests/acceptance/TestCest.php @@ -18,7 +18,6 @@ public function accessTheSalesOrdersPage(\Step\Acceptance\Admin $I) { $I->goToTheAdminSalesOrdersPage(); $I->shouldBeOnTheAdminSalesOrdersPage(); - $I->see('Orders'); } /** @@ -30,6 +29,5 @@ public function accessTheProductsCatalogPage(\Step\Acceptance\Admin $I) { $I->goToTheAdminProductsCatalogPage(); $I->shouldBeOnTheAdminProductsCatalogPage(); - $I->see('Catalog'); } } From c65103365e5731b60a57f83c03a26c098ef97784 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 16 Mar 2017 10:43:13 -0500 Subject: [PATCH 005/149] Updating function names. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated most function names removing the “I” from the name. --- tests/_support/Page/Acceptance/AdminLogin.php | 70 +++- .../Page/Acceptance/SideNavigation.php | 226 +++++++------ tests/acceptance.suite.yml | 4 +- .../login/AccessForgotYourPasswordCest.php | 14 +- .../AccessAdminPagesViaNavMenuCest.php | 312 +++++++++--------- .../OpenEachSideNavMenuCept.php | 32 +- 6 files changed, 367 insertions(+), 291 deletions(-) diff --git a/tests/_support/Page/Acceptance/AdminLogin.php b/tests/_support/Page/Acceptance/AdminLogin.php index d20aca86d..8b204a0f5 100644 --- a/tests/_support/Page/Acceptance/AdminLogin.php +++ b/tests/_support/Page/Acceptance/AdminLogin.php @@ -50,58 +50,102 @@ public function __construct(\AcceptanceTester $I) $this->acceptanceTester = $I; } - public function iClickOnMagentoLogo(\AcceptanceTester $I) { + public function clickOnMagentoLogo(\AcceptanceTester $I) { $I->click(self::$logoImage); } - public function iClickOnForgotYourPassword(\AcceptanceTester $I) { + public function clickOnForgotYourPassword(\AcceptanceTester $I) { $I->click(self::$forgotYourPassword); } - public function iClickOnSignIn(\AcceptanceTester $I) { + public function clickOnSignIn(\AcceptanceTester $I) { $I->click(self::$signIn); } - public function iEnterTheUsername(\AcceptanceTester $I, $username) { + public function enterTheUsername(\AcceptanceTester $I, $username) { $I->fillField(self::$username, $username); } - public function iEnterThePassword(\AcceptanceTester $I, $password) { + public function enterThePassword(\AcceptanceTester $I, $password) { $I->fillField(self::$password, $password); } - public function iEnterTheLoginCredentials(\AcceptanceTester $I, $username, $password) { - $I->fillField(self::$username, $username); - $I->fillField(self::$password, $password); + public function enterTheLoginCredentials(\AcceptanceTester $I, $username, $password) { + $this->enterTheUsername($I, $username); + $this->enterThePassword($I, $password); } - public function iShouldSeeTheLoginPageFields(\AcceptanceTester $I) { + public function shouldSeeTheLoginMainArea(\AcceptanceTester $I) { $I->seeElement(self::$mainArea); + } + + public function shouldSeeTheLoginLogoLink(\AcceptanceTester $I) { $I->seeElement(self::$logoLink); + } + + public function shouldSeeTheLoginLogoImage(\AcceptanceTester $I) { $I->seeElement(self::$logoImage); + } + + public function shouldSeeTheLoginTitle(\AcceptanceTester $I) { $I->seeElement(self::$title); + } + + public function shouldSeeTheLoginUsernameTitle(\AcceptanceTester $I) { $I->seeElement(self::$usernameTitle); + } + + public function shouldSeeTheLoginUsernameField(\AcceptanceTester $I) { $I->seeElement(self::$username); + } + + public function shouldSeeTheLoginPasswordTitle(\AcceptanceTester $I) { $I->seeElement(self::$passwordTitle); + } + + public function shouldSeeTheLoginPasswordField(\AcceptanceTester $I) { $I->seeElement(self::$password); + } + + public function shouldSeeTheLoginForgotPasswordLink(\AcceptanceTester $I) { $I->seeElement(self::$forgotYourPassword); + } + + public function shouldSeeTheLoginSignInButton(\AcceptanceTester $I) { $I->seeElement(self::$signIn); + } + + public function shouldSeeTheLoginCopyrightText(\AcceptanceTester $I) { $I->seeElement(self::$copyRight); } - public function iEnterTheEmailAddress(\AcceptanceTester $I, $emailAddress) { + public function shouldSeeTheLoginPageFields(\AcceptanceTester $I) { + $this->shouldSeeTheLoginMainArea($I); + $this->shouldSeeTheLoginLogoLink($I); + $this->shouldSeeTheLoginLogoImage($I); + $this->shouldSeeTheLoginTitle($I); + $this->shouldSeeTheLoginUsernameTitle($I); + $this->shouldSeeTheLoginUsernameField($I); + $this->shouldSeeTheLoginPasswordTitle($I); + $this->shouldSeeTheLoginPasswordField($I); + $this->shouldSeeTheLoginForgotPasswordLink($I); + $this->shouldSeeTheLoginSignInButton($I); + $this->shouldSeeTheLoginCopyrightText($I); + } + + public function enterTheEmailAddress(\AcceptanceTester $I, $emailAddress) { $I->fillField(self::$emailAddress, $emailAddress); } - public function iClickOnRetrievePassword(\AcceptanceTester $I) { + public function clickOnRetrievePassword(\AcceptanceTester $I) { $I->click(self::$retrievePassword); } - public function iClickOnBackToSignIn(\AcceptanceTester $I) { + public function clickOnBackToSignIn(\AcceptanceTester $I) { $I->click(self::$backToSignIn); } - public function iShouldSeeTheForgotYourPasswordFields(\AcceptanceTester $I) { + public function shouldSeeTheForgotYourPasswordFields(\AcceptanceTester $I) { $I->seeElement(self::$forgotPasswordMain); $I->seeElement(self::$logoLink); $I->seeElement(self::$logoImage); diff --git a/tests/_support/Page/Acceptance/SideNavigation.php b/tests/_support/Page/Acceptance/SideNavigation.php index 8fb9a4091..5c3b71280 100644 --- a/tests/_support/Page/Acceptance/SideNavigation.php +++ b/tests/_support/Page/Acceptance/SideNavigation.php @@ -192,397 +192,429 @@ public function __construct(\AcceptanceTester $I) $this->acceptanceTester = $I; } - public function iClickOnDashboardInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnDashboardInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$dashboardButton); } - public function iClickOnSalesInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnSalesInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$salesButton); $I->wait(1); } - public function iClickOnOrdersInTheSalesNavMenu(\AcceptanceTester $I) { + public function clickOnOrdersInTheSalesNavMenu(\AcceptanceTester $I) { $I->click(self::$salesNavOrders); } - public function iClickOnInvoicesInTheSalesNavMenu(\AcceptanceTester $I) { + public function clickOnInvoicesInTheSalesNavMenu(\AcceptanceTester $I) { $I->click(self::$salesNavInvoices); } - public function iClickOnShipmentsInTheSalesNavMenu(\AcceptanceTester $I) { + public function clickOnShipmentsInTheSalesNavMenu(\AcceptanceTester $I) { $I->click(self::$salesNavShipments); } - public function iClickOnCreditMemosInTheSalesNavMenu(\AcceptanceTester $I) { + public function clickOnCreditMemosInTheSalesNavMenu(\AcceptanceTester $I) { $I->click(self::$salesNavCreditMemos); } - public function iClickOnBillingAgreementsInTheSalesNavMenu(\AcceptanceTester $I) { + public function clickOnBillingAgreementsInTheSalesNavMenu(\AcceptanceTester $I) { $I->click(self::$salesNavBillingAgreements); } - public function iClickOnTransactionsInTheSalesNavMenu(\AcceptanceTester $I) { + public function clickOnTransactionsInTheSalesNavMenu(\AcceptanceTester $I) { $I->click(self::$salesNavTransactions); } - public function iClickOnProductsInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnProductsInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$productsButton); $I->wait(1); } - public function iClickOnCatalogInTheProductNavMenu(\AcceptanceTester $I) { + public function clickOnCatalogInTheProductNavMenu(\AcceptanceTester $I) { $I->click(self::$productNavCatalog); } - public function iClickOnCategoriesInTheProductNavMenu(\AcceptanceTester $I) { + public function clickOnCategoriesInTheProductNavMenu(\AcceptanceTester $I) { $I->click(self::$productNavCategories); } - public function iClickOnCustomersInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnCustomersInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$customersButton); $I->wait(1); } - public function iClickOnAllCustomersInTheCustomersNavMenu(\AcceptanceTester $I) { + public function clickOnAllCustomersInTheCustomersNavMenu(\AcceptanceTester $I) { $I->click(self::$customersNavAllCustomers); } - public function iClickOnNowOnlineInTheCustomersNavMenu(\AcceptanceTester $I) { + public function clickOnNowOnlineInTheCustomersNavMenu(\AcceptanceTester $I) { $I->click(self::$customersNavNowOnline); } - public function iClickOnMarketingInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnMarketingInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingButton); $I->wait(1); } - public function iClickOnCatalogPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnCatalogPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavPromotionsCatalogPriceRule); } - public function iClickOnCartPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnCartPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavPromotionsCartPriceRules); } - public function iClickOnEmailTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnEmailTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavCommunicationsEmailTemplates); } - public function iClickOnNewsletterTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnNewsletterTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavCommunicationsNewsletterTemplates); } - public function iClickOnNewsletterQueueInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnNewsletterQueueInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavCommunicationsNewsletterQueue); } - public function iClickOnNewsletterSubscribersInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnNewsletterSubscribersInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavCommunicationsNewsletterSubscribers); } - public function iClickOnURLRewritesInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnURLRewritesInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavSEOSearchURLRewrites); } - public function iClickOnSearchTermsInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnSearchTermsInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavSEOSearchTerms); } - public function iClickOnSearchSynonymsInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnSearchSynonymsInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavSEOSearchSynonyms); } - public function iClickOnSiteMapInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnSiteMapInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavSEOSearchSiteMap); } - public function iClickOnContentReviewsInTheMarketingNavMenu(\AcceptanceTester $I) { + public function clickOnContentReviewsInTheMarketingNavMenu(\AcceptanceTester $I) { $I->click(self::$marketingNavUserContentReviews); } - public function iClickOnContentInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnContentInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$contentButton); $I->wait(1); } - public function iClickOnPagesInTheContentNavMenu(\AcceptanceTester $I) { + public function clickOnPagesInTheContentNavMenu(\AcceptanceTester $I) { $I->click(self::$contentNavElementsPages); } - public function iClickOnBlocksInTheContentNavMenu(\AcceptanceTester $I) { + public function clickOnBlocksInTheContentNavMenu(\AcceptanceTester $I) { $I->click(self::$contentNavElementsBlocks); } - public function iClickOnWidgetsInTheContentNavMenu(\AcceptanceTester $I) { + public function clickOnWidgetsInTheContentNavMenu(\AcceptanceTester $I) { $I->click(self::$contentNavElementsWidgets); } - public function iClickOnConfigurationInTheContentNavMenu(\AcceptanceTester $I) { + public function clickOnConfigurationInTheContentNavMenu(\AcceptanceTester $I) { $I->click(self::$contentNavDesignConfiguration); } - public function iClickOnThemesInTheContentNavMenu(\AcceptanceTester $I) { + public function clickOnThemesInTheContentNavMenu(\AcceptanceTester $I) { $I->click(self::$contentNavDesignThemes); } - public function iClickOnScheduleInTheContentNavMenu(\AcceptanceTester $I) { + public function clickOnScheduleInTheContentNavMenu(\AcceptanceTester $I) { $I->click(self::$contentNavDesignSchedule); } - public function iClickOnReportsInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnReportsInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsButton); $I->wait(1); } - public function iClickOnProductsInCartInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnProductsInCartInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavMarketingProductsInCart); } - public function iClickOnSearchTermsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnSearchTermsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavMarketingSearchTerms); } - public function iClickOnAbandonedCartsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnAbandonedCartsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavMarketingAbandonedCarts); } - public function iClickOnNewsletterProblemReportsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnNewsletterProblemReportsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavMarketingNewsletterProblemReports); } - public function iClickOnByCustomersInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnByCustomersInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavReviewsByCustomers); } - public function iClickOnByProductsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnByProductsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavReviewsByProducts); } - public function iClickOnOrdersInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnOrdersInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavSalesOrders); } - public function iClickOTaxnInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOTaxInTheReportsNavMenu(\AcceptanceTester $I) { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesTax); } - public function iClickOnInvoicedInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnInvoicedInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavSalesInvoiced); } - public function iClickOnShippingInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnShippingInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavSalesShipping); } - public function iClickOnRefundsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnRefundsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavSalesRefunds); } - public function iClickOnCouponsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnCouponsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavSalesCoupons); } - public function iClickOnPaypalSettlementInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnPayPalSettlementInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavSalesPayPalSettlement); } - public function iClickOnBraintreeSettlementInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnBraintreeSettlementInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavSalesBraintreeSettlement); } - public function iClickOnOrderTotalInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnOrderTotalInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavCustomersOrderTotal); } - public function iClickOnOrderCountInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnOrderCountInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavCustomersOrderCount); } - public function iClickOnNewInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnNewInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavCustomersNew); } - public function iClickOnViewsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnViewsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavProductsViews); } - public function iClickOnBestSellersInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnBestSellersInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavProductsBestsellers); } - public function iClickOnLowStockInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnLowStockInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavProductsLowStock); } - public function iClickOnOrderedInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnOrderedInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavProductsOrdered); } - public function iClickOnDownloadsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnDownloadsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavProductsDownloads); } - public function iClickOnRefreshStatisticsInTheReportsNavMenu(\AcceptanceTester $I) { + public function clickOnRefreshStatisticsInTheReportsNavMenu(\AcceptanceTester $I) { $I->click(self::$reportsNavStatisticsRefreshStatistics); } - public function iClickOnStoresInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnStoresInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$storesButton); $I->wait(1); } - public function iClickOnAllStoresInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnAllStoresInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavSettingsAllStores); } - public function iClickOnConfigurationInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnConfigurationInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavSettingsConfiguration); } - public function iClickOnTermsAndConditionsInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnTermsAndConditionsInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavSettingsTermsAndConditions); } - public function iClickOnOrderStatusInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnOrderStatusInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavSettingsOrderStatus); } - public function iClickOnTaxRuleInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnTaxRuleInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavTaxesTaxRules); } - public function iClickOnTaxZonesAndRatesInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnTaxZonesAndRatesInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavTaxesTaxZonesAndRates); } - public function iClickOnTaxRatesInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnTaxRatesInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavCurrencyRates); } - public function iClickOnTaxSymbolsInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnTaxSymbolsInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavCurrencySymbols); } - public function iClickOnCurrencyRatesInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnCurrencyRatesInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavCurrencyRates); } - public function iClickOnCurrencySymbolsInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnCurrencySymbolsInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavCurrencySymbols); } - public function iClickOnProductInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnProductInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavAttributesProduct); } - public function iClickOnAttributesSetInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnAttributesSetInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavAttributesSet); } - public function iClickOnRatingsInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnRatingsInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavAttributesRating); } - public function iClickOnCustomerGroupInTheStoresNavMenu(\AcceptanceTester $I) { + public function clickOnCustomerGroupInTheStoresNavMenu(\AcceptanceTester $I) { $I->click(self::$storesNavOtherSettingsCustomerGroups); } - public function iClickOnSystemInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnSystemInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$systemButton); $I->wait(1); } - public function iClickOnImportInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnImportInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavDataTransferImport); } - public function iClickOnExportInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnExportInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavDataTransferExport); } - public function iClickOnImportExportTaxRatesInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnImportExportTaxRatesInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavDataTransferImportExportTaxRates); } - public function iClickOnImportHistoryInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnImportHistoryInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavDataTransferImportHistory); } - public function iClickOnIntegrationsInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnIntegrationsInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavExtensionsIntegrations); } - public function iClickOnCacheManagementInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnCacheManagementInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavToolsCacheManagement); } - public function iClickOnBackupsInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnBackupsInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavToolsBackups); } - public function iClickOnIndexManagementInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnIndexManagementInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavToolsIndexManagement); } - public function iClickOnWebSetupWizardInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnWebSetupWizardInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavToolsWebSetupWizard); $I->wait(1); } - public function iClickOnAllUsersInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnAllUsersInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavPermissionsAllUsers); } - public function iClickOnLockedUsersInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnLockedUsersInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavPermissionsLockedUsers); } - public function iClickOnUserRolesInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnUserRolesInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavPermissionsUserRoles); } - public function iClickOnNotificationsInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnNotificationsInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavOtherSettingsNotifications); } - public function iClickOnCustomVariablesInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnCustomVariablesInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavOtherSettingsCustomVariables); } - public function iClickOnManageEncryptionKeyInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnManageEncryptionKeyInTheSystemNavMenu(\AcceptanceTester $I) { $I->click(self::$systemNavOtherSettingsManageEncryptionKey); } - public function iClickOnFindPartnersAndExtensionsInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnFindPartnersAndExtensionsInTheSideNavMenu(\AcceptanceTester $I) { $I->click(self::$findPartnersExtensionsButton); $I->wait(1); } - public function iShouldSeeTheSalesNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavMainArea(\AcceptanceTester $I) { $I->seeElement(self::$salesNavMainArea); + } + + public function shouldSeeTheSalesNavTitle(\AcceptanceTester $I) { $I->seeElement(self::$salesNavTitle); + } + + public function shouldSeeTheSalesNavOrders(\AcceptanceTester $I) { $I->seeElement(self::$salesNavOrders); + } + + public function shouldSeeTheSalesNavInvoices(\AcceptanceTester $I) { $I->seeElement(self::$salesNavInvoices); + } + + public function shouldSeeTheSalesNavShipments(\AcceptanceTester $I) { $I->seeElement(self::$salesNavShipments); + } + + public function shouldSeeTheSalesNavCreditMemos(\AcceptanceTester $I) { $I->seeElement(self::$salesNavCreditMemos); + } + + public function shouldSeeTheSalesNavBillingAgreements(\AcceptanceTester $I) { $I->seeElement(self::$salesNavBillingAgreements); + } + + public function shouldSeeTheSalesNavTransactions(\AcceptanceTester $I) { $I->seeElement(self::$salesNavTransactions); } - public function iShouldSeeTheProductNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavMenu(\AcceptanceTester $I) { + $this->shouldSeeTheSalesNavMainArea($I); + $this->shouldSeeTheSalesNavTitle($I); + $this->shouldSeeTheSalesNavOrders($I); + $this->shouldSeeTheSalesNavInvoices($I); + $this->shouldSeeTheSalesNavShipments($I); + $this->shouldSeeTheSalesNavCreditMemos($I); + $this->shouldSeeTheSalesNavBillingAgreements($I); + $this->shouldSeeTheSalesNavTransactions($I); + } + + public function shouldSeeTheProductNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$productNavMainArea); $I->seeElement(self::$productNavTitle); $I->seeElement(self::$productNavCatalog); $I->seeElement(self::$productNavCategories); } - public function iShouldSeeTheCustomersNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheCustomersNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$customersNavAllCustomers); $I->seeElement(self::$customersNavNowOnline); } - public function iShouldSeeTheMarketingNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheMarketingNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$marketingNavPromotionsMainArea); $I->seeElement(self::$marketingNavPromotionsTitle); $I->seeElement(self::$marketingNavPromotionsCatalogPriceRule); @@ -607,7 +639,7 @@ public function iShouldSeeTheMarketingNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$marketingNavUserContentReviews); } - public function iShouldSeeTheContentNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheContentNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$contentNavElementsMainArea); $I->seeElement(self::$contentNavElementsTitle); $I->seeElement(self::$contentNavElementsPages); @@ -621,7 +653,7 @@ public function iShouldSeeTheContentNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$contentNavDesignSchedule); } - public function iShouldSeeTheReportsNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheReportsNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$reportsNavMarketingMainArea); $I->seeElement(self::$reportsNavMarketingTitle); $I->seeElement(self::$reportsNavMarketingProductsInCart); @@ -664,7 +696,7 @@ public function iShouldSeeTheReportsNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$reportsNavStatisticsRefreshStatistics); } - public function iShouldSeeTheStoresNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheStoresNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$storesNavSettingsMainArea); $I->seeElement(self::$storesNavSettingsTitle); $I->seeElement(self::$storesNavSettingsAllStores); @@ -693,7 +725,7 @@ public function iShouldSeeTheStoresNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$storesNavOtherSettingsCustomerGroups); } - public function iShouldSeeTheSystemNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheSystemNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$systemNavDataTransferMainArea); $I->seeElement(self::$systemNavDataTransferTitle); $I->seeElement(self::$systemNavDataTransferImport); diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 58346b327..fad4fcf1d 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -26,11 +26,11 @@ env: modules: config: WebDriver: - browser: 'chrome' + browser: chrome window_size: maximize phantomjs: modules: config: WebDriver: - browser: 'phantomjs' + browser: phantomjs window_size: 1920x1080 \ No newline at end of file diff --git a/tests/acceptance/login/AccessForgotYourPasswordCest.php b/tests/acceptance/login/AccessForgotYourPasswordCest.php index 35cd2164d..e687dbb22 100644 --- a/tests/acceptance/login/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/login/AccessForgotYourPasswordCest.php @@ -17,9 +17,9 @@ public function _before(\Step\Acceptance\Admin $I) public function shouldLandOnTheForgotYourPasswordPage(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Forgot Your Password page'); - $adminLogin->iClickOnForgotYourPassword($I); + $adminLogin->clickOnForgotYourPassword($I); $I->shouldBeOnTheForgotYourPasswordPage(); - $adminLogin->iShouldSeeTheForgotYourPasswordFields($I); + $adminLogin->shouldSeeTheForgotYourPasswordFields($I); $I->see('Password Help'); } @@ -31,8 +31,8 @@ public function shouldLandOnTheForgotYourPasswordPage(\Step\Acceptance\Admin $I, public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Login page from the Forgot Your Password page'); - $adminLogin->iClickOnForgotYourPassword($I); - $adminLogin->iClickOnBackToSignIn($I); + $adminLogin->clickOnForgotYourPassword($I); + $adminLogin->clickOnBackToSignIn($I); $I->shouldBeOnTheAdminLoginPage(); } @@ -44,11 +44,11 @@ public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(\Step\Acceptan public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Login page by clicking on the Logo'); - $adminLogin->iClickOnMagentoLogo($I); + $adminLogin->clickOnMagentoLogo($I); $I->shouldBeOnTheAdminLoginPage(); - $adminLogin->iClickOnForgotYourPassword($I); - $adminLogin->iClickOnMagentoLogo($I); + $adminLogin->clickOnForgotYourPassword($I); + $adminLogin->clickOnMagentoLogo($I); $I->shouldBeOnTheAdminLoginPage(); } } diff --git a/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php index f06246908..a12abf07f 100644 --- a/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php @@ -23,7 +23,7 @@ public function shouldLandOnTheDashboardPage(\Step\Acceptance\Admin $I, SideNav { $I->wantTo('see if I can access the DASHBOARD Page using the Side Nav Menus'); $I->goToRandomAdminPage(); - $sideNavMenu->iClickOnDashboardInTheSideNavMenu($I); + $sideNavMenu->clickOnDashboardInTheSideNavMenu($I); $I->shouldBeOnTheAdminDashboardPage(); } @@ -36,28 +36,28 @@ public function shouldLandOnTheDashboardPage(\Step\Acceptance\Admin $I, SideNav public function shouldLandOnEachOfTheSalesPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the SALES Admin Pages using the Side Nav Menus'); - $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); - $sideNavMenu->iClickOnOrdersInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu($I); + $sideNavMenu->clickOnOrdersInTheSalesNavMenu($I); $I->shouldBeOnTheAdminSalesOrdersPage(); - $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); - $sideNavMenu->iClickOnInvoicesInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu($I); + $sideNavMenu->clickOnInvoicesInTheSalesNavMenu($I); $I->shouldBeOnTheAdminSalesInvoicesPage(); - $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); - $sideNavMenu->iClickOnShipmentsInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu($I); + $sideNavMenu->clickOnShipmentsInTheSalesNavMenu($I); $I->shouldBeOnTheAdminSalesShipmentsPage(); - $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); - $sideNavMenu->iClickOnCreditMemosInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu($I); + $sideNavMenu->clickOnCreditMemosInTheSalesNavMenu($I); $I->shouldBeOnTheAdminSalesCreditMemosPage(); - $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); - $sideNavMenu->iClickOnBillingAgreementsInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu($I); + $sideNavMenu->clickOnBillingAgreementsInTheSalesNavMenu($I); $I->shouldBeOnTheAdminSalesBillingAgreementsPage(); - $sideNavMenu->iClickOnSalesInTheSideNavMenu($I); - $sideNavMenu->iClickOnTransactionsInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu($I); + $sideNavMenu->clickOnTransactionsInTheSalesNavMenu($I); $I->shouldBeOnTheAdminSalesTransactionsPage(); } @@ -70,12 +70,12 @@ public function shouldLandOnEachOfTheSalesPages(\Step\Acceptance\Admin $I, SideN public function shouldLandOnEachOfTheProductsPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the PRODUCTS Admin Pages using the Side Nav Menus'); - $sideNavMenu->iClickOnProductsInTheSideNavMenu($I); - $sideNavMenu->iClickOnCatalogInTheProductNavMenu($I); + $sideNavMenu->clickOnProductsInTheSideNavMenu($I); + $sideNavMenu->clickOnCatalogInTheProductNavMenu($I); $I->shouldBeOnTheAdminProductsCatalogPage(); - $sideNavMenu->iClickOnProductsInTheSideNavMenu($I); - $sideNavMenu->iClickOnCategoriesInTheProductNavMenu($I); + $sideNavMenu->clickOnProductsInTheSideNavMenu($I); + $sideNavMenu->clickOnCategoriesInTheProductNavMenu($I); $I->shouldBeOnTheAdminProductsCategoriesPage(); } @@ -88,12 +88,12 @@ public function shouldLandOnEachOfTheProductsPages(\Step\Acceptance\Admin $I, Si public function shouldLanOnEachOfTheCustomersPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the CUSTOMERS Admin Pages using the Side Nav Menus'); - $sideNavMenu->iClickOnCustomersInTheSideNavMenu($I); - $sideNavMenu->iClickOnAllCustomersInTheCustomersNavMenu($I); + $sideNavMenu->clickOnCustomersInTheSideNavMenu($I); + $sideNavMenu->clickOnAllCustomersInTheCustomersNavMenu($I); $I->shouldBeOnTheAdminCustomersAllCustomersPage(); - $sideNavMenu->iClickOnCustomersInTheSideNavMenu($I); - $sideNavMenu->iClickOnNowOnlineInTheCustomersNavMenu($I); + $sideNavMenu->clickOnCustomersInTheSideNavMenu($I); + $sideNavMenu->clickOnNowOnlineInTheCustomersNavMenu($I); $I->shouldBeOnTheAdminCustomersNowOnlinePage(); } @@ -106,48 +106,48 @@ public function shouldLanOnEachOfTheCustomersPages(\Step\Acceptance\Admin $I, Si public function shouldLandOnEachOfTheMarketingPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the MARKETING Admin Pages using the Side Nav Menus'); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnCatalogPriceRulesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnCatalogPriceRulesInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingCatalogPriceRulePage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnCartPriceRulesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnCartPriceRulesInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingCartPriceRulePage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnEmailTemplatesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnEmailTemplatesInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingEmailTemplatesPage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnNewsletterTemplatesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnNewsletterTemplatesInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingNewsletterTemplatePage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnNewsletterQueueInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnNewsletterQueueInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingNewsletterQueuePage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnNewsletterSubscribersInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnNewsletterSubscribersInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingNewsletterSubscribersPage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnURLRewritesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnURLRewritesInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingURLRewritesPage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnSearchTermsInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnSearchTermsInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingSearchTermsPage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnSearchSynonymsInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnSearchSynonymsInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingSearchSynonymsPage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnSiteMapInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnSiteMapInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingSiteMapPage(); - $sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->iClickOnContentReviewsInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->clickOnContentReviewsInTheMarketingNavMenu($I); $I->shouldBeOnTheAdminMarketingReviewsPage(); } @@ -160,28 +160,28 @@ public function shouldLandOnEachOfTheMarketingPages(\Step\Acceptance\Admin $I, S public function shouldLandOnEachOfTheContentPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the CONTENT Admin Pages using the Side Nav Menus'); - $sideNavMenu->iClickOnContentInTheSideNavMenu($I); - $sideNavMenu->iClickOnPagesInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu($I); + $sideNavMenu->clickOnPagesInTheContentNavMenu($I); $I->shouldBeOnTheAdminContentPagesPage(); - $sideNavMenu->iClickOnContentInTheSideNavMenu($I); - $sideNavMenu->iClickOnBlocksInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu($I); + $sideNavMenu->clickOnBlocksInTheContentNavMenu($I); $I->shouldBeOnTheAdminContentBlocksPage(); - $sideNavMenu->iClickOnContentInTheSideNavMenu($I); - $sideNavMenu->iClickOnWidgetsInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu($I); + $sideNavMenu->clickOnWidgetsInTheContentNavMenu($I); $I->shouldBeOnTheAdminContentWidgetsPage(); - $sideNavMenu->iClickOnContentInTheSideNavMenu($I); - $sideNavMenu->iClickOnConfigurationInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu($I); + $sideNavMenu->clickOnConfigurationInTheContentNavMenu($I); $I->shouldBeOnTheAdminContentConfigurationPage(); - $sideNavMenu->iClickOnContentInTheSideNavMenu($I); - $sideNavMenu->iClickOnThemesInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu($I); + $sideNavMenu->clickOnThemesInTheContentNavMenu($I); $I->shouldBeOnTheAdminContentThemesPage(); - $sideNavMenu->iClickOnContentInTheSideNavMenu($I); - $sideNavMenu->iClickOnScheduleInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu($I); + $sideNavMenu->clickOnScheduleInTheContentNavMenu($I); $I->shouldBeOnTheAdminContentSchedulePage(); } @@ -194,96 +194,96 @@ public function shouldLandOnEachOfTheContentPages(\Step\Acceptance\Admin $I, Sid public function shouldLandOnEachOfTheReportsPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the REPORTS Admin Pages using the Side Nav Menu'); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnProductsInCartInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnProductsInCartInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsProductsInCartPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnSearchTermsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnSearchTermsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsSearchTermsPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnAbandonedCartsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnAbandonedCartsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsAbandonedCartsPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnNewsletterProblemReportsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnNewsletterProblemReportsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsNewsletterProblemReportsPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnByCustomersInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnByCustomersInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsByCustomersPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnByProductsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnByProductsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsByProductsPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnOrdersInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnOrdersInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsOrdersPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOTaxnInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOTaxInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsTaxPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnInvoicedInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnInvoicedInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsInvoicedPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnShippingInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnShippingInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsShippingPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnRefundsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnRefundsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsRefundsPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnCouponsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnCouponsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsCouponsPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnPaypalSettlementInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnPayPalSettlementInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsPayPalSettlementPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnBraintreeSettlementInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnBraintreeSettlementInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsBraintreeSettlementPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnOrderTotalInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnOrderTotalInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsOrderTotalPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnOrderCountInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnOrderCountInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsOrderCountPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnNewInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnNewInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsNewPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnViewsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnViewsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsViewsPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnBestSellersInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnBestSellersInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsBestsellersPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnLowStockInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnLowStockInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsLowStockPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnOrderedInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnOrderedInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsOrderedPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnDownloadsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnDownloadsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportsDownloadsPage(); - $sideNavMenu->iClickOnReportsInTheSideNavMenu($I); - $sideNavMenu->iClickOnRefreshStatisticsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->clickOnRefreshStatisticsInTheReportsNavMenu($I); $I->shouldBeOnTheAdminReportRefreshStatisticsPage(); } @@ -296,52 +296,52 @@ public function shouldLandOnEachOfTheReportsPages(\Step\Acceptance\Admin $I, Sid public function shouldLandOnEachOfTheStoresPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the STORES Admin Pages using the Side Nav Menu'); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnAllStoresInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnAllStoresInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresAllStoresPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnConfigurationInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnConfigurationInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresConfigurationPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnTermsAndConditionsInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnTermsAndConditionsInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresTermsAndConditionsPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnOrderStatusInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnOrderStatusInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresOrderStatusPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnTaxRuleInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnTaxRuleInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresTaxRulesPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnTaxZonesAndRatesInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnTaxZonesAndRatesInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresTaxZonesAndRatesPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnCurrencyRatesInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnCurrencyRatesInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresCurrencyRatesPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnCurrencySymbolsInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnCurrencySymbolsInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresCurrencySymbolsPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnProductInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnProductInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresProductPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnAttributesSetInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnAttributesSetInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresAttributeSetPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnRatingsInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnRatingsInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresRatingPage(); - $sideNavMenu->iClickOnStoresInTheSideNavMenu($I); - $sideNavMenu->iClickOnCustomerGroupInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->clickOnCustomerGroupInTheStoresNavMenu($I); $I->shouldBeOnTheAdminStoresCustomerGroupsPage(); } @@ -354,60 +354,60 @@ public function shouldLandOnEachOfTheStoresPages(\Step\Acceptance\Admin $I, Side public function shouldLandOnEachOfTheSystemPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the SYSTEM Admin Pages using the Side Nav Menu'); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnImportInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnImportInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemImportPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnExportInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnExportInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemExportPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnImportExportTaxRatesInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnImportExportTaxRatesInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemImportExportTaxRatesPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnImportHistoryInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnImportHistoryInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemImportHistoryPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnIntegrationsInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnIntegrationsInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemIntegrationsPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnCacheManagementInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnCacheManagementInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemCacheManagementPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnBackupsInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnBackupsInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemBackupsPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnIndexManagementInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnIndexManagementInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemIndexManagementPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnAllUsersInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnAllUsersInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemAllUsersPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnLockedUsersInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnLockedUsersInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemLockedUsersPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnUserRolesInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnUserRolesInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemUserRolesPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnNotificationsInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnNotificationsInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemNotificationsPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnCustomVariablesInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnCustomVariablesInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemCustomVariablesPage(); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnManageEncryptionKeyInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnManageEncryptionKeyInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemManageEncryptionKeyPage(); } @@ -419,8 +419,8 @@ public function shouldLandOnEachOfTheSystemPages(\Step\Acceptance\Admin $I, Side public function shouldLandOnTheWebSetupWizardPage(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the Web Setup Wizard Admin Page using the Side Nav Menu'); - $sideNavMenu->iClickOnSystemInTheSideNavMenu($I); - $sideNavMenu->iClickOnWebSetupWizardInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->clickOnWebSetupWizardInTheSystemNavMenu($I); $I->shouldBeOnTheAdminSystemWebSetupWizardPage(); $I->goToTheAdminLogoutPage(); } @@ -433,7 +433,7 @@ public function shouldLandOnTheWebSetupWizardPage(\Step\Acceptance\Admin $I, Sid public function shouldLandOnThePartnersAndExtensionsPage(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the Partners and Extensions Admin Page using the Side Nav Menu'); - $sideNavMenu->iClickOnFindPartnersAndExtensionsInTheSideNavMenu($I); + $sideNavMenu->clickOnFindPartnersAndExtensionsInTheSideNavMenu($I); $I->shouldBeOnTheAdminFindPartnersAndExtensionsPage(); } diff --git a/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php b/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php index 7086ac7f9..043136d60 100644 --- a/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php +++ b/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php @@ -13,26 +13,26 @@ $I->goToTheAdminLoginPage(); $I->loginAsAnExistingAdmin(); -$sideNavMenu->iClickOnSalesInTheSideNavMenu($I); -$sideNavMenu->iShouldSeeTheSalesNavMenu($I); +$sideNavMenu->clickOnSalesInTheSideNavMenu($I); +$sideNavMenu->shouldSeeTheSalesNavMenu($I); -$sideNavMenu->iClickOnProductsInTheSideNavMenu($I); -$sideNavMenu->iShouldSeeTheProductNavMenu($I); +$sideNavMenu->clickOnProductsInTheSideNavMenu($I); +$sideNavMenu->shouldSeeTheProductNavMenu($I); -$sideNavMenu->iClickOnCustomersInTheSideNavMenu($I); -$sideNavMenu->iShouldSeeTheCustomersNavMenu($I); +$sideNavMenu->clickOnCustomersInTheSideNavMenu($I); +$sideNavMenu->shouldSeeTheCustomersNavMenu($I); -$sideNavMenu->iClickOnMarketingInTheSideNavMenu($I); -$sideNavMenu->iShouldSeeTheMarketingNavMenu($I); +$sideNavMenu->clickOnMarketingInTheSideNavMenu($I); +$sideNavMenu->shouldSeeTheMarketingNavMenu($I); -$sideNavMenu->iClickOnContentInTheSideNavMenu($I); -$sideNavMenu->iShouldSeeTheContentNavMenu($I); +$sideNavMenu->clickOnContentInTheSideNavMenu($I); +$sideNavMenu->shouldSeeTheContentNavMenu($I); -$sideNavMenu->iClickOnReportsInTheSideNavMenu($I); -$sideNavMenu->iShouldSeeTheReportsNavMenu($I); +$sideNavMenu->clickOnReportsInTheSideNavMenu($I); +$sideNavMenu->shouldSeeTheReportsNavMenu($I); -$sideNavMenu->iClickOnStoresInTheSideNavMenu($I); -$sideNavMenu->iShouldSeeTheStoresNavMenu($I); +$sideNavMenu->clickOnStoresInTheSideNavMenu($I); +$sideNavMenu->shouldSeeTheStoresNavMenu($I); -$sideNavMenu->iClickOnSystemInTheSideNavMenu($I); -$sideNavMenu->iShouldSeeTheSystemNavMenu($I); \ No newline at end of file +$sideNavMenu->clickOnSystemInTheSideNavMenu($I); +$sideNavMenu->shouldSeeTheSystemNavMenu($I); \ No newline at end of file From 219547b28bce1629e216416fe56a3205917a2a0a Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 16 Mar 2017 11:20:03 -0500 Subject: [PATCH 006/149] Added api, ui (admin category, product), StepObject test. (cherry picked from commit 3728cf6) --- composer.json | 3 +- tests/_support/ApiTester.php | 60 ++++++ .../Page/Acceptance/AdminCategoryPage.php | 34 ++++ .../Page/Acceptance/AdminProductEditPage.php | 77 ++++++++ tests/_support/Step/Api/Category.php | 37 ++++ tests/_support/Step/Api/Customer.php | 22 +++ tests/_support/Step/Api/Product.php | 37 ++++ tests/acceptance/login/TestStepObjectCept.php | 10 + tests/acceptance/login/TestStepObjectCest.php | 21 +++ tests/api.suite.yml | 35 ++++ tests/api/ApiAndUiExampleCest.php | 175 ++++++++++++++++++ tests/api/_bootstrap.php | 2 + 12 files changed, 512 insertions(+), 1 deletion(-) create mode 100644 tests/_support/ApiTester.php create mode 100644 tests/_support/Page/Acceptance/AdminCategoryPage.php create mode 100644 tests/_support/Page/Acceptance/AdminProductEditPage.php create mode 100644 tests/_support/Step/Api/Category.php create mode 100644 tests/_support/Step/Api/Customer.php create mode 100644 tests/_support/Step/Api/Product.php create mode 100644 tests/acceptance/login/TestStepObjectCept.php create mode 100644 tests/acceptance/login/TestStepObjectCest.php create mode 100644 tests/api.suite.yml create mode 100644 tests/api/ApiAndUiExampleCest.php create mode 100644 tests/api/_bootstrap.php diff --git a/composer.json b/composer.json index 18084fbb0..012e58f99 100755 --- a/composer.json +++ b/composer.json @@ -6,7 +6,8 @@ "symfony/filesystem": "~2.6", "symfony/finder": "~2.6", "consolidation/robo": "^1.0.0", - "allure-framework/allure-codeception": "~1.2.3" + "allure-framework/allure-codeception": "~1.2.3", + "flow/jsonpath": ">0.2" }, "autoload": { "psr-0": { diff --git a/tests/_support/ApiTester.php b/tests/_support/ApiTester.php new file mode 100644 index 000000000..573b1ff4d --- /dev/null +++ b/tests/_support/ApiTester.php @@ -0,0 +1,60 @@ +haveHttpHeader('Content-Type', 'application/json'); + $this->sendPOST('integration/admin/token', ['username' => $this->superAdminUsername, 'password' => $this->superAdminPassword]); + $this->superAdminToken = $this->grabDataFromResponseByJsonPath('$..*'); + $this->superAdminToken = substr($this->grabResponse(), 1, strlen($this->grabResponse())-2); + $this->seeResponseCodeIs(200); + } + + /** + * Get admin auth token + * + * @return string + */ + public function getAuthToke() + { + return $this->superAdminToken; + } +} diff --git a/tests/_support/Page/Acceptance/AdminCategoryPage.php b/tests/_support/Page/Acceptance/AdminCategoryPage.php new file mode 100644 index 000000000..05cc3300f --- /dev/null +++ b/tests/_support/Page/Acceptance/AdminCategoryPage.php @@ -0,0 +1,34 @@ +amOnPage(self::$URL . 'edit/id/' . $id); + } + + public function seeCategoryNameInPageTitle(\AcceptanceTester $I, $name) { + $I->see($name, self::$pageTitle); + } +} diff --git a/tests/_support/Page/Acceptance/AdminProductEditPage.php b/tests/_support/Page/Acceptance/AdminProductEditPage.php new file mode 100644 index 000000000..c143c4e2d --- /dev/null +++ b/tests/_support/Page/Acceptance/AdminProductEditPage.php @@ -0,0 +1,77 @@ +amOnPage(self::$URL . 'id/' . $id); + } + + public function seeProductNameInPageTitle(\AcceptanceTester $I, $name) + { + $I->see($name, self::$pageTitle); + } + + public function seeProductAttributeSet(\AcceptanceTester $I, $name) + { + $I->see($name, self::$producAttributeSet); + } + + public function seeProductName(\AcceptanceTester $I, $name) + { + $I->see($name, self::$productName); + } + + public function seeProductSku(\AcceptanceTester $I, $name) + { + $I->see($name, self::$productSku); + } + + public function seeProductPrice(\AcceptanceTester $I, $name) + { + $I->see($name, self::$productPrice); + } + + public function seeProductQuantity(\AcceptanceTester $I, $name) + { + $I->see($name, self::$productQuantity); + } + + public function seeProductStockStatus(\AcceptanceTester $I, $name) + { + $I->see($name, self::$productStockStatus); + } + + public function seeProductCategories(\AcceptanceTester $I, $name) + { + $I->see($name, self::$productCategories); + } +} diff --git a/tests/_support/Step/Api/Category.php b/tests/_support/Step/Api/Category.php new file mode 100644 index 000000000..b2495e646 --- /dev/null +++ b/tests/_support/Step/Api/Category.php @@ -0,0 +1,37 @@ +amBearerAuthenticated($this->getAuthToke()); + $this->haveHttpHeader('Content-Type', 'application/json'); + $this->sendPOST($this->endpoint, $params); + $this->seeResponseCodeIs(200); + return $this->grabDataFromResponseByJsonPath('$.id')[0]; + } + + /** + * Get Magento Category Data by REST API + * + * @param string $id + * @return string + */ + public function getCategory($id) + { + $this->amBearerAuthenticated($this->getAuthToke()); + $this->haveHttpHeader('Content-Type', 'application/json'); + $this->sendGET($this->endpoint . "/$id"); + $this->seeResponseCodeIs(200); + return $this->grabResponse(); + } +} \ No newline at end of file diff --git a/tests/_support/Step/Api/Customer.php b/tests/_support/Step/Api/Customer.php new file mode 100644 index 000000000..83a19d5d5 --- /dev/null +++ b/tests/_support/Step/Api/Customer.php @@ -0,0 +1,22 @@ +amBearerAuthenticated($this->getAuthToke()); + $this->haveHttpHeader('Content-Type', 'application/json'); + $this->sendPOST($this->endpoint, $params); + $this->seeResponseCodeIs(200); + return $this->grabDataFromResponseByJsonPath('$.id')[0]; + } +} \ No newline at end of file diff --git a/tests/_support/Step/Api/Product.php b/tests/_support/Step/Api/Product.php new file mode 100644 index 000000000..9a0cb4ff5 --- /dev/null +++ b/tests/_support/Step/Api/Product.php @@ -0,0 +1,37 @@ +amBearerAuthenticated($this->getAuthToke()); + $this->haveHttpHeader('Content-Type', 'application/json'); + $this->sendPOST($this->endpoint, $params); + $this->seeResponseCodeIs(200); + return $this->grabDataFromResponseByJsonPath('$.id')[0]; + } + + /** + * Get Magento Product Data by REST API + * + * @param string $sku + * @return string + */ + public function getProduct($sku) + { + $this->amBearerAuthenticated($this->getAuthToke()); + $this->haveHttpHeader('Content-Type', 'application/json'); + $this->sendGET($this->endpoint . "/$sku"); + $this->seeResponseCodeIs(200); + return $this->grabDataFromResponseByJsonPath('$..*'); + } +} \ No newline at end of file diff --git a/tests/acceptance/login/TestStepObjectCept.php b/tests/acceptance/login/TestStepObjectCept.php new file mode 100644 index 000000000..d9c86f5fb --- /dev/null +++ b/tests/acceptance/login/TestStepObjectCept.php @@ -0,0 +1,10 @@ +wantTo('demo the usage of StepObject in Cept'); +$I->goToTheAdminLoginPage(); +$I->loginAsAnExistingAdmin(); \ No newline at end of file diff --git a/tests/acceptance/login/TestStepObjectCest.php b/tests/acceptance/login/TestStepObjectCest.php new file mode 100644 index 000000000..52ea0cade --- /dev/null +++ b/tests/acceptance/login/TestStepObjectCest.php @@ -0,0 +1,21 @@ +wantTo('demo the usage of StepObject in Cest'); + $I->goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + } +} \ No newline at end of file diff --git a/tests/api.suite.yml b/tests/api.suite.yml new file mode 100644 index 000000000..cfdd0645c --- /dev/null +++ b/tests/api.suite.yml @@ -0,0 +1,35 @@ +class_name: ApiTester +modules: + enabled: + - REST: + url: http://magento2.loc/index.php/rest/default/V1/ + depends: PhpBrowser + part: Json + - Sequence + - WebDriver + - \Helper\Acceptance + config: + WebDriver: + url: 'http://magento2.loc/index.php' + browser: chrome + window_size: maximize + +env: + firefox: + modules: + config: + WebDriver: + browser: firefox + window_size: maximize + chrome: + modules: + config: + WebDriver: + browser: 'chrome' + window_size: maximize + phantomjs: + modules: + config: + WebDriver: + browser: 'phantomjs' + window_size: 1920x1080 \ No newline at end of file diff --git a/tests/api/ApiAndUiExampleCest.php b/tests/api/ApiAndUiExampleCest.php new file mode 100644 index 000000000..27871503d --- /dev/null +++ b/tests/api/ApiAndUiExampleCest.php @@ -0,0 +1,175 @@ +getCategoryData(); + $this->categoryName = $categoryData['name']; + $this->categoryId = $I->createCategory(['category' => $categoryData]); + + $I = new Product($scenario); + $productData = $this->getSimpleProductData(); + $this->productName = $productData['name']; + $this->productId = $I->createProduct(['product' => $productData]); + + $I = new Customer($scenario); + $this->customerId = $I->createCustomer($this->getCustomerDataWithPassword()); + + $I = new Admin($scenario); + $I->goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + } + + public function _after(Scenario $scenario) + { + $I = new Admin($scenario); + $I->goToTheAdminLogoutPage(); + } + + /** + * Test Category Visible in Backend. + * + * @param Scenario $scenario + * @param AdminCategoryPage $adminCategoryPage + * @return void + */ + public function CheckCategoryInAdminTest(Scenario $scenario, AdminCategoryPage $adminCategoryPage) + { + $I = new Admin($scenario); + $I->wantTo('verify category created visible in admin'); + $adminCategoryPage->amOnAdminCategoryPageById($I, $this->categoryId); + $adminCategoryPage->seeCategoryNameInPageTitle($I, $this->categoryName); + } + + /** + * Test Product Visible in Backend. + * + * @param Scenario $scenario + * @param AdminProductEditPage $adminProductEditPage + * @return void + */ + public function checkProductBackendTest(Scenario $scenario, AdminProductEditPage $adminProductEditPage) + { + $I = new Admin($scenario); + $I->wantTo('verify product created visible in admin'); + $adminProductEditPage->amOnAdminProductPageById($I, $this->productId); + $adminProductEditPage->seeProductNameInPageTitle($I, $this->productName); + } + + /** + * Get Category Data. + * + * @param array $categoryData + * @return array + */ + protected function getCategoryData($categoryData = []) + { + $sq = sq(1); + return [ + 'parent_id' => '2', + 'name' => isset($categoryData['name']) + ? $categoryData['name'] : 'category'.$sq, + 'is_active' => '1', + 'include_in_menu' => '1', + 'available_sort_by' => ['position', 'name'], + 'custom_attributes' => [ + ['attribute_code' => 'url_key', 'value' => 'category'.$sq], + ['attribute_code' => 'description', 'value' => 'Custom description'], + ['attribute_code' => 'meta_title', 'value' => ''], + ['attribute_code' => 'meta_keywords', 'value' => ''], + ['attribute_code' => 'meta_description', 'value' => ''], + ['attribute_code' => 'display_mode', 'value' => 'PRODUCTS'], + ['attribute_code' => 'landing_page', 'value' => ''], + ['attribute_code' => 'is_anchor', 'value' => '0'], + ['attribute_code' => 'custom_use_parent_settings', 'value' => '0'], + ['attribute_code' => 'custom_apply_to_products', 'value' => '0'], + ['attribute_code' => 'custom_design', 'value' => ''], + ['attribute_code' => 'custom_design_from', 'value' => ''], + ['attribute_code' => 'custom_design_to', 'value' => ''], + ['attribute_code' => 'page_layout', 'value' => ''], + ] + ]; + } + + /** + * Get Simple Product Data. + * + * @param array $productData + * @return array + */ + protected function getSimpleProductData($productData = []) + { + $sq = sq(1); + return [ + 'sku' => isset($productData['sku']) + ? $productData['sku'] : 'sku'.$sq, + 'name' => isset($productData['name']) + ? $productData['name'] : 'sku'.$sq, + 'visibility' => 4, + 'type_id' => 'simple', + 'price' => 17.71, + 'status' => 1, + 'attribute_set_id' => 4, + 'custom_attributes' => [ + ['attribute_code' => 'url_key', 'value' => 'sku'.$sq], + ['attribute_code' => 'cost', 'value' => ''], + ['attribute_code' => 'description', 'value' => 'Description'], + ['attribute_code' => 'category_ids', 'value' => $this->categoryId], + ] + ]; + } + + /** + * Get Customer Data. + * + * @param array $additional + * @return array + */ + protected function getCustomerData(array $additional = []) + { + $sq = sq(1); + $customerData = [ + 'firstname' => 'firstname'.$sq, + 'lastname' => 'lastname'.$sq, + 'email' => 'email'.$sq.'@example.com', + 'gender' => rand(0, 1), + 'group_id' => 1, + 'middlename' => 'middlename'.$sq, + 'store_id' => 1, + 'website_id' => 1, + 'custom_attributes' => [ + [ + 'attribute_code' => 'disable_auto_group_change', + 'value' => '0', + ], + ], + ]; + return array_merge($customerData, $additional); + } + + /** + * Get Customer Data Including Password. + * + * @param string $password + * @return array + */ + protected function getCustomerDataWithPassword($password = '') + { + return ['customer' => $this->getCustomerData(), 'password' => ($password !== '') ? $password : '123123qW']; + } +} diff --git a/tests/api/_bootstrap.php b/tests/api/_bootstrap.php new file mode 100644 index 000000000..8a8855580 --- /dev/null +++ b/tests/api/_bootstrap.php @@ -0,0 +1,2 @@ + Date: Thu, 16 Mar 2017 11:34:26 -0500 Subject: [PATCH 007/149] "Fixing" the CloseAdminNotification function. - Adding a jQuery script that will hide the popup after login. - Working on a better solution to the problem using Codeception. --- tests/_support/Step/Acceptance/Admin.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/_support/Step/Acceptance/Admin.php b/tests/_support/Step/Acceptance/Admin.php index 36920d7ae..cecb51f5b 100644 --- a/tests/_support/Step/Acceptance/Admin.php +++ b/tests/_support/Step/Acceptance/Admin.php @@ -6,6 +6,7 @@ class Admin extends \AcceptanceTester { + public function goToTheAdminLoginPage() { $I = $this; @@ -1157,13 +1158,16 @@ public function shouldBeOnTheAdminFindPartnersAndExtensionsPage() { public function closeAdminNotification() { $I = $this; - try { - $I->waitForElementVisible('._show .action-close', 1); - $I->click('._show .action-close'); - $I->waitForElementNotVisible('._show .action-close', 1); - } catch (\Exception $e) { - return false; - } + // Cheating here for the minute. Still working on the best method to deal with this issue. + $I->executeJS("jQuery('.modal-popup').hide(); jQuery('.modals-overlay').hide();"); + +// try { +// $I->waitForElementVisible('._show .action-close', 1); +// $I->click('._show .action-close'); +// $I->waitForElementNotVisible('._show .action-close', 1); +// } catch (\Exception $e) { +// return false; +// } } public function loginAsTheFollowingAdmin($username, $password) { @@ -1172,9 +1176,7 @@ public function loginAsTheFollowingAdmin($username, $password) { $I->fillField('login[password]', $password); $I->click('Sign in'); - if ($I->canSeeElement('._show')) { - $I->closeAdminNotification(); - } + $I->closeAdminNotification(); } public function loginAsAnExistingAdmin() { From 764c89779cd9461f557b2ee0a2b713dd1f8b7e1a Mon Sep 17 00:00:00 2001 From: John Stennett Date: Mon, 20 Mar 2017 11:10:37 -0500 Subject: [PATCH 008/149] Changing RoboFile, splitting out env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adding “acceptance” command to the Robo commands so it only runs acceptance tests. - Breaking out the Testing Environments into their own files. --- RoboFile.php | 13 +++++++++---- tests/_envs/chrome.yml | 9 +++++++++ tests/_envs/firefox.yml | 9 +++++++++ tests/_envs/phantomjs.yml | 8 ++++++++ tests/_support/Step/Acceptance/Admin.php | 2 +- tests/acceptance.suite.yml | 22 +--------------------- 6 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 tests/_envs/chrome.yml create mode 100644 tests/_envs/firefox.yml create mode 100644 tests/_envs/phantomjs.yml diff --git a/RoboFile.php b/RoboFile.php index 2eb46228a..dc7d96427 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -26,6 +26,11 @@ function allureReport() { } } + function code(array $args) { + $this->_exec('codecept run ' . implode(' ', $args)); + $this->allureReport(); + } + function test() { $this->chrome(); $this->allureReport(); @@ -37,21 +42,21 @@ function example() { } function group($args = '') { - $this->taskExec('codecept run --env chrome --skip-group skip --group')->args($args)->run(); + $this->taskExec('codecept run acceptance --env chrome --skip-group skip --group')->args($args)->run(); } function chrome() { - $this->_exec('codecept run --env chrome --skip-group skip'); + $this->_exec('codecept run acceptance --env chrome --skip-group skip'); $this->allureReport(); } function firefox() { - $this->_exec('codecept run --env chrome --skip-group skip'); + $this->_exec('codecept run acceptance --env firefox --skip-group skip'); $this->allureReport(); } function phantomjs() { - $this->_exec('codecept run --env phantomjs'); + $this->_exec('codecept run acceptance --env phantomjs'); $this->allureReport(); } diff --git a/tests/_envs/chrome.yml b/tests/_envs/chrome.yml new file mode 100644 index 000000000..6082aeef1 --- /dev/null +++ b/tests/_envs/chrome.yml @@ -0,0 +1,9 @@ +# `chrome` environment config goes here +modules: + enabled: + - WebDriver + - \Helper\Acceptance + config: + WebDriver: + browser: chrome + window_size: maximize \ No newline at end of file diff --git a/tests/_envs/firefox.yml b/tests/_envs/firefox.yml new file mode 100644 index 000000000..2d83180ba --- /dev/null +++ b/tests/_envs/firefox.yml @@ -0,0 +1,9 @@ +# `firefox` environment config goes here +modules: + enabled: + - WebDriver + - \Helper\Acceptance + config: + WebDriver: + browser: firefox + window_size: maximize \ No newline at end of file diff --git a/tests/_envs/phantomjs.yml b/tests/_envs/phantomjs.yml new file mode 100644 index 000000000..4e6640d59 --- /dev/null +++ b/tests/_envs/phantomjs.yml @@ -0,0 +1,8 @@ +# `phantomjs` environment config goes here +modules: + enabled: + - WebDriver + - \Helper\Acceptance + config: + WebDriver: + browser: phantomjs \ No newline at end of file diff --git a/tests/_support/Step/Acceptance/Admin.php b/tests/_support/Step/Acceptance/Admin.php index cecb51f5b..4ddd2289d 100644 --- a/tests/_support/Step/Acceptance/Admin.php +++ b/tests/_support/Step/Acceptance/Admin.php @@ -1159,7 +1159,7 @@ public function closeAdminNotification() { $I = $this; // Cheating here for the minute. Still working on the best method to deal with this issue. - $I->executeJS("jQuery('.modal-popup').hide(); jQuery('.modals-overlay').hide();"); + $I->executeJS("jQuery('.modal-popup').remove(); jQuery('.modals-overlay').remove();"); // try { // $I->waitForElementVisible('._show .action-close', 1); diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index fad4fcf1d..21650bdc5 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -13,24 +13,4 @@ modules: WebDriver: url: 'http://127.0.0.1:32769' browser: chrome - window_size: maximize - -env: - firefox: - modules: - config: - WebDriver: - browser: firefox - window_size: maximize - chrome: - modules: - config: - WebDriver: - browser: chrome - window_size: maximize - phantomjs: - modules: - config: - WebDriver: - browser: phantomjs - window_size: 1920x1080 \ No newline at end of file + window_size: maximize \ No newline at end of file From 1fc772fd03d81c69d8f96911cbda5cb940f8ac0f Mon Sep 17 00:00:00 2001 From: John Stennett Date: Mon, 20 Mar 2017 11:17:08 -0500 Subject: [PATCH 009/149] Removing broken robo command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Removing broken robo command for interactive console. - Moving the Forgot Password test to it’s own folder. --- RoboFile.php | 4 ---- .../AccessForgotYourPasswordCest.php | 0 2 files changed, 4 deletions(-) rename tests/acceptance/{login => forgotPassword}/AccessForgotYourPasswordCest.php (100%) diff --git a/RoboFile.php b/RoboFile.php index dc7d96427..dc35727a7 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -59,8 +59,4 @@ function phantomjs() { $this->_exec('codecept run acceptance --env phantomjs'); $this->allureReport(); } - - function console() { - $this->_exec('codecept console acceptance'); - } } \ No newline at end of file diff --git a/tests/acceptance/login/AccessForgotYourPasswordCest.php b/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php similarity index 100% rename from tests/acceptance/login/AccessForgotYourPasswordCest.php rename to tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php From 6d496b8d5de339a1d9ade8ea52d49460747a5bbc Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 21 Mar 2017 16:08:10 -0500 Subject: [PATCH 010/149] Fixing the Codeception-Allure-Adapter version - Removing the non-source controlled version. - Adding reference to the composer controlled version. --- composer.json | 4 +- src/Yandex/Allure/Adapter/AllureAdapter.php | 262 -------------------- 2 files changed, 2 insertions(+), 264 deletions(-) delete mode 100644 src/Yandex/Allure/Adapter/AllureAdapter.php diff --git a/composer.json b/composer.json index 012e58f99..6dafc6cad 100755 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "codeception-allure-example", + "name": "tooling-demo", "require": { "php": ">=5.4.0", "codeception/codeception": "~2.1.0", @@ -11,7 +11,7 @@ }, "autoload": { "psr-0": { - "Yandex": "src/" + "Yandex": "vendor/allure-framework/allure-codeception/src/" } } } \ No newline at end of file diff --git a/src/Yandex/Allure/Adapter/AllureAdapter.php b/src/Yandex/Allure/Adapter/AllureAdapter.php deleted file mode 100644 index c909ea72c..000000000 --- a/src/Yandex/Allure/Adapter/AllureAdapter.php +++ /dev/null @@ -1,262 +0,0 @@ - 'suiteBefore', - Events::SUITE_AFTER => 'suiteAfter', - Events::TEST_START => 'testStart', - Events::TEST_FAIL => 'testFail', - Events::TEST_ERROR => 'testError', - Events::TEST_INCOMPLETE => 'testIncomplete', - Events::TEST_SKIPPED => 'testSkipped', - Events::TEST_END => 'testEnd', - Events::STEP_BEFORE => 'stepBefore', - Events::STEP_AFTER => 'stepAfter' - ]; - - /** - * Annotations that should be ignored by the annotaions parser (especially PHPUnit annotations). - * - * @var array - */ - private $ignoredAnnotations = [ - 'after', 'afterClass', 'backupGlobals', 'backupStaticAttributes', 'before', 'beforeClass', - 'codeCoverageIgnore', 'codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'covers', - 'coversDefaultClass', 'coversNothing', 'dataProvider', 'depends', 'expectedException', - 'expectedExceptionCode', 'expectedExceptionMessage', 'group', 'large', 'medium', - 'preserveGlobalState', 'requires', 'runTestsInSeparateProcesses', 'runInSeparateProcess', - 'small', 'test', 'testdox', 'ticket', 'uses', - ]; - - /** - * Extra annotations to ignore in addition to standard PHPUnit annotations. - * - * @param array $ignoredAnnotations - */ - public function _initialize(array $ignoredAnnotations = []) - { - parent::_initialize(); - Annotation\AnnotationProvider::registerAnnotationNamespaces(); - // Add standard PHPUnit annotations - Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations); - // Add custom ignored annotations - Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations); - $outputDirectory = $this->getOutputDirectory(); - $deletePreviousResults = - $this->tryGetOption(DELETE_PREVIOUS_RESULTS_PARAMETER, false); - $this->prepareOutputDirectory($outputDirectory, $deletePreviousResults); - if (is_null(Model\Provider::getOutputDirectory())) { - Model\Provider::setOutputDirectory($outputDirectory); - } - } - - /** - * Retrieves option or returns default value. - * - * @param string $optionKey Configuration option key. - * @param mixed $defaultValue Value to return in case option isn't set. - * - * @return mixed Option value. - * @since 0.1.0 - */ - private function tryGetOption($optionKey, $defaultValue = null) - { - if (array_key_exists($optionKey, $this->config)) { - return $this->config[$optionKey]; - } - return $defaultValue; - } - - /** @noinspection PhpUnusedPrivateMethodInspection */ - /** - * Retrieves option or dies. - * - * @param string $optionKey Configuration option key. - * - * @throws ConfigurationException Thrown if option can't be retrieved. - * - * @return mixed Option value. - * @since 0.1.0 - */ - private function getOption($optionKey) - { - if (!array_key_exists($optionKey, $this->config)) { - $template = '%s: Couldn\'t find required configuration option `%s`'; - $message = sprintf($template, __CLASS__, $optionKey); - throw new ConfigurationException($message); - } - return $this->config[$optionKey]; - } - - /** - * Returns output directory. - * - * @throws ConfigurationException Thrown if there is Codeception-wide - * problem with output directory - * configuration. - * - * @return string Absolute path to output directory. - * @since 0.1.0 - */ - private function getOutputDirectory() - { - $outputDirectory = $this->tryGetOption( - OUTPUT_DIRECTORY_PARAMETER, - DEFAULT_RESULTS_DIRECTORY - ); - $filesystem = new Filesystem; - if (!$filesystem->isAbsolutePath($outputDirectory)) { - $outputDirectory = Configuration::outputDir() . $outputDirectory; - } - return $outputDirectory; - } - - /** - * Creates output directory (if it hasn't been created yet) and cleans it - * up (if corresponding argument has been set to true). - * - * @param string $outputDirectory - * @param bool $deletePreviousResults Whether to delete previous results - * or keep 'em. - * - * @since 0.1.0 - */ - private function prepareOutputDirectory( - $outputDirectory, - $deletePreviousResults = false - ) { - $filesystem = new Filesystem; - $filesystem->mkdir($outputDirectory, 0775); - if ($deletePreviousResults) { - $finder = new Finder; - $files = $finder->files()->in($outputDirectory)->name('*.xml'); - $filesystem->remove($files); - } - } - - public function suiteBefore(SuiteEvent $suiteEvent) - { - $suite = $suiteEvent->getSuite(); - $suiteName = $suite->getName(); - $event = new TestSuiteStartedEvent($suiteName); - if (class_exists($suiteName, false)) { - $annotationManager = new Annotation\AnnotationManager( - Annotation\AnnotationProvider::getClassAnnotations($suiteName) - ); - $annotationManager->updateTestSuiteEvent($event); - } - $this->uuid = $event->getUuid(); - $this->getLifecycle()->fire($event); - } - - public function suiteAfter() - { - $this->getLifecycle()->fire(new TestSuiteFinishedEvent($this->uuid)); - } - - public function testStart(TestEvent $testEvent) - { - $test = $testEvent->getTest(); - $testName = $test->getName(); - $className = get_class($test); - $event = new TestCaseStartedEvent($this->uuid, $testName); - if (method_exists($className, $testName)){ - $annotationManager = new Annotation\AnnotationManager(Annotation\AnnotationProvider::getMethodAnnotations($className, $testName)); - $annotationManager->updateTestCaseEvent($event); - } - $this->getLifecycle()->fire($event); - } - - public function testError() - { - $this->getLifecycle()->fire(new TestCaseBrokenEvent()); - } - - public function testFail() - { - $this->getLifecycle()->fire(new TestCaseFailedEvent()); - } - - public function testIncomplete() - { - $this->getLifecycle()->fire(new TestCasePendingEvent()); - } - - public function testSkipped() - { - $this->getLifecycle()->fire(new TestCaseCanceledEvent()); - } - - public function testEnd() - { - $this->getLifecycle()->fire(new TestCaseFinishedEvent()); - } - - public function stepBefore(StepEvent $stepEvent) - { - $stepAction = $stepEvent->getStep()->getAction(); - $this->getLifecycle()->fire(new StepStartedEvent($stepAction)); - } - - public function stepAfter() - { - $this->getLifecycle()->fire(new StepFinishedEvent()); - } - - - /** - * @return Allure - */ - public function getLifecycle() - { - if (!isset($this->lifecycle)){ - $this->lifecycle = Allure::lifecycle(); - } - return $this->lifecycle; - } - - public function setLifecycle(Allure $lifecycle) - { - $this->lifecycle = $lifecycle; - } - -} From dc2101b2af2911ff5c538090979c93173af5b54e Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 21 Mar 2017 17:39:44 -0500 Subject: [PATCH 011/149] Removing Functional and Unit test stuff for now. Removing Functional and Unit test stuff for now. --- tests/_support/FunctionalTester.php | 26 ------------------- tests/_support/Helper/Functional.php | 10 ------- tests/_support/UnitTester.php | 26 ------------------- .../OpenEachSideNavMenuCept.php | 1 + tests/functional.suite.yml | 11 -------- tests/functional/_bootstrap.php | 2 -- tests/unit.suite.yml | 9 ------- tests/unit/_bootstrap.php | 2 -- 8 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 tests/_support/FunctionalTester.php delete mode 100644 tests/_support/Helper/Functional.php delete mode 100644 tests/_support/UnitTester.php delete mode 100644 tests/functional.suite.yml delete mode 100644 tests/functional/_bootstrap.php delete mode 100644 tests/unit.suite.yml delete mode 100644 tests/unit/_bootstrap.php diff --git a/tests/_support/FunctionalTester.php b/tests/_support/FunctionalTester.php deleted file mode 100644 index 7e888f8b2..000000000 --- a/tests/_support/FunctionalTester.php +++ /dev/null @@ -1,26 +0,0 @@ - Date: Tue, 21 Mar 2017 17:40:20 -0500 Subject: [PATCH 012/149] Forgot a file Forgot a Unit testing file. --- tests/_support/Helper/Unit.php | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 tests/_support/Helper/Unit.php diff --git a/tests/_support/Helper/Unit.php b/tests/_support/Helper/Unit.php deleted file mode 100644 index 6064d3732..000000000 --- a/tests/_support/Helper/Unit.php +++ /dev/null @@ -1,10 +0,0 @@ - Date: Tue, 21 Mar 2017 19:15:42 -0500 Subject: [PATCH 013/149] Converting some Cest tests to Cept tests. Converting test types. --- .../login/AccessAdminLoginPageCept.php | 13 ------------- .../login/AccessAdminLoginPageCest.php | 19 +++++++++++++++++++ .../login/LoginOnAdminLoginPageCept.php | 12 ------------ .../login/LoginOnAdminLoginPageCest.php | 18 ++++++++++++++++++ .../acceptance/login/LogoutAfterLoginCept.php | 13 ------------- .../acceptance/login/LogoutAfterLoginCest.php | 19 +++++++++++++++++++ 6 files changed, 56 insertions(+), 38 deletions(-) delete mode 100644 tests/acceptance/login/AccessAdminLoginPageCept.php create mode 100644 tests/acceptance/login/AccessAdminLoginPageCest.php delete mode 100644 tests/acceptance/login/LoginOnAdminLoginPageCept.php create mode 100644 tests/acceptance/login/LoginOnAdminLoginPageCest.php delete mode 100644 tests/acceptance/login/LogoutAfterLoginCept.php create mode 100644 tests/acceptance/login/LogoutAfterLoginCest.php diff --git a/tests/acceptance/login/AccessAdminLoginPageCept.php b/tests/acceptance/login/AccessAdminLoginPageCept.php deleted file mode 100644 index 1b1122cad..000000000 --- a/tests/acceptance/login/AccessAdminLoginPageCept.php +++ /dev/null @@ -1,13 +0,0 @@ -am('an Admin'); -$I->wantTo('verify that I can access the Admin Login page'); - -$I->goToTheAdminLoginPage(); -$I->shouldBeOnTheAdminLoginPage(); \ No newline at end of file diff --git a/tests/acceptance/login/AccessAdminLoginPageCest.php b/tests/acceptance/login/AccessAdminLoginPageCest.php new file mode 100644 index 000000000..d8f662253 --- /dev/null +++ b/tests/acceptance/login/AccessAdminLoginPageCest.php @@ -0,0 +1,19 @@ +am('an Admin'); + $I->wantTo('verify that I can access the Admin Login page'); + + $I->goToTheAdminLoginPage(); + $I->shouldBeOnTheAdminLoginPage(); + } +} diff --git a/tests/acceptance/login/LoginOnAdminLoginPageCept.php b/tests/acceptance/login/LoginOnAdminLoginPageCept.php deleted file mode 100644 index 6697c1664..000000000 --- a/tests/acceptance/login/LoginOnAdminLoginPageCept.php +++ /dev/null @@ -1,12 +0,0 @@ -wantTo('verify that I can login via the Admin Login page'); - -$I->goToTheAdminLoginPage(); -$I->loginAsAnExistingAdmin(); -$I->shouldBeOnTheAdminDashboardPage(); \ No newline at end of file diff --git a/tests/acceptance/login/LoginOnAdminLoginPageCest.php b/tests/acceptance/login/LoginOnAdminLoginPageCest.php new file mode 100644 index 000000000..e7d694735 --- /dev/null +++ b/tests/acceptance/login/LoginOnAdminLoginPageCest.php @@ -0,0 +1,18 @@ +wantTo('verify that I can login via the Admin Login page'); + + $I->goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + $I->shouldBeOnTheAdminDashboardPage(); + } +} diff --git a/tests/acceptance/login/LogoutAfterLoginCept.php b/tests/acceptance/login/LogoutAfterLoginCept.php deleted file mode 100644 index 9f3c00525..000000000 --- a/tests/acceptance/login/LogoutAfterLoginCept.php +++ /dev/null @@ -1,13 +0,0 @@ -wantTo('logout of the Admin area and land on the Login page'); - -$I->goToTheAdminLoginPage(); -$I->loginAsAnExistingAdmin(); -$I->goToTheAdminLogoutPage(); -$I->shouldBeOnTheAdminLoginPage(); \ No newline at end of file diff --git a/tests/acceptance/login/LogoutAfterLoginCest.php b/tests/acceptance/login/LogoutAfterLoginCest.php new file mode 100644 index 000000000..76eac6bf5 --- /dev/null +++ b/tests/acceptance/login/LogoutAfterLoginCest.php @@ -0,0 +1,19 @@ +wantTo('logout of the Admin area and land on the Login page'); + + $I->goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + $I->goToTheAdminLogoutPage(); + $I->shouldBeOnTheAdminLoginPage(); + } +} From 0053f751ccea2e1066e67631c9d3ee9eeab4bdc5 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 21 Mar 2017 19:19:00 -0500 Subject: [PATCH 014/149] Adding Examples. Converted cept to cest. - Adding an Example folder - Moved all example tests to the Example folder - Converted cept to cest - Adding additional mark up to tests --- .../AccessAdminPagesDirectlyCest.php | 0 tests/acceptance/examples/ExampleCept.php | 4 ++ tests/acceptance/examples/ExampleCest.php | 20 ++++++++ tests/acceptance/{ => examples}/TestCest.php | 4 +- .../TestStepObjectCept.php | 4 +- .../TestStepObjectCest.php | 1 + .../CannotAccessAdminAfterLoggingOutCept.php | 22 --------- .../CannotAccessAdminAfterLoggingOutCest.php | 28 +++++++++++ .../login/CannotAccessAdminPagesCept.php | 25 ---------- .../login/CannotAccessAdminPagesCest.php | 30 ++++++++++++ .../OpenEachSideNavMenuCept.php | 39 --------------- .../OpenEachSideNavMenuCest.php | 47 +++++++++++++++++++ 12 files changed, 134 insertions(+), 90 deletions(-) rename tests/acceptance/{misc => adminAccess}/AccessAdminPagesDirectlyCest.php (100%) create mode 100644 tests/acceptance/examples/ExampleCept.php create mode 100644 tests/acceptance/examples/ExampleCest.php rename tests/acceptance/{ => examples}/TestCest.php (96%) rename tests/acceptance/{login => examples}/TestStepObjectCept.php (77%) rename tests/acceptance/{login => examples}/TestStepObjectCest.php (95%) delete mode 100644 tests/acceptance/login/CannotAccessAdminAfterLoggingOutCept.php create mode 100644 tests/acceptance/login/CannotAccessAdminAfterLoggingOutCest.php delete mode 100644 tests/acceptance/login/CannotAccessAdminPagesCept.php create mode 100644 tests/acceptance/login/CannotAccessAdminPagesCest.php delete mode 100644 tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php create mode 100644 tests/acceptance/sideNavigation/OpenEachSideNavMenuCest.php diff --git a/tests/acceptance/misc/AccessAdminPagesDirectlyCest.php b/tests/acceptance/adminAccess/AccessAdminPagesDirectlyCest.php similarity index 100% rename from tests/acceptance/misc/AccessAdminPagesDirectlyCest.php rename to tests/acceptance/adminAccess/AccessAdminPagesDirectlyCest.php diff --git a/tests/acceptance/examples/ExampleCept.php b/tests/acceptance/examples/ExampleCept.php new file mode 100644 index 000000000..2aa5d39c3 --- /dev/null +++ b/tests/acceptance/examples/ExampleCept.php @@ -0,0 +1,4 @@ +wantTo('perform actions and see result'); diff --git a/tests/acceptance/examples/ExampleCest.php b/tests/acceptance/examples/ExampleCest.php new file mode 100644 index 000000000..7d3fc2fc8 --- /dev/null +++ b/tests/acceptance/examples/ExampleCest.php @@ -0,0 +1,20 @@ +wantTo('demo the usage of StepObject in Cept'); $I->goToTheAdminLoginPage(); diff --git a/tests/acceptance/login/TestStepObjectCest.php b/tests/acceptance/examples/TestStepObjectCest.php similarity index 95% rename from tests/acceptance/login/TestStepObjectCest.php rename to tests/acceptance/examples/TestStepObjectCest.php index 52ea0cade..e5b74d423 100644 --- a/tests/acceptance/login/TestStepObjectCest.php +++ b/tests/acceptance/examples/TestStepObjectCest.php @@ -8,6 +8,7 @@ class AdminCest * @env chrome * @env firefox * @env phantomjs + * @group skip * @param Scenario $scenario * @param Admin $I * @return void diff --git a/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCept.php b/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCept.php deleted file mode 100644 index 02a6cbb87..000000000 --- a/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCept.php +++ /dev/null @@ -1,22 +0,0 @@ -wantTo('make sure you cannot access Admin pages after logging out'); - -$I->goToTheAdminLoginPage(); -$I->loginAsAnExistingAdmin(); -$I->goToTheAdminLogoutPage(); - -$I->goToRandomAdminPage(); -$I->shouldBeOnTheAdminLoginPage(); - -$I->goToRandomAdminPage(); -$I->shouldBeOnTheAdminLoginPage(); - -$I->goToRandomAdminPage(); -$I->shouldBeOnTheAdminLoginPage(); \ No newline at end of file diff --git a/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCest.php b/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCest.php new file mode 100644 index 000000000..869556520 --- /dev/null +++ b/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCest.php @@ -0,0 +1,28 @@ +wantTo('make sure you cannot access Admin pages after logging out'); + + $I->goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + $I->goToTheAdminLogoutPage(); + + $I->goToRandomAdminPage(); + $I->shouldBeOnTheAdminLoginPage(); + + $I->goToRandomAdminPage(); + $I->shouldBeOnTheAdminLoginPage(); + + $I->goToRandomAdminPage(); + $I->shouldBeOnTheAdminLoginPage(); + } +} diff --git a/tests/acceptance/login/CannotAccessAdminPagesCept.php b/tests/acceptance/login/CannotAccessAdminPagesCept.php deleted file mode 100644 index 02c7e4cbb..000000000 --- a/tests/acceptance/login/CannotAccessAdminPagesCept.php +++ /dev/null @@ -1,25 +0,0 @@ -wantTo('make sure you cannot access Admin pages when NOT logged in'); -$I->goToTheAdminLoginPage(); - -$I->goToRandomAdminPage(); -$I->shouldBeOnTheAdminLoginPage(); - -$I->goToRandomAdminPage(); -$I->shouldBeOnTheAdminLoginPage(); - -$I->goToRandomAdminPage(); -$I->shouldBeOnTheAdminLoginPage(); - -$I->goToRandomAdminPage(); -$I->shouldBeOnTheAdminLoginPage(); - -$I->goToRandomAdminPage(); -$I->shouldBeOnTheAdminLoginPage(); \ No newline at end of file diff --git a/tests/acceptance/login/CannotAccessAdminPagesCest.php b/tests/acceptance/login/CannotAccessAdminPagesCest.php new file mode 100644 index 000000000..ec7ecea69 --- /dev/null +++ b/tests/acceptance/login/CannotAccessAdminPagesCest.php @@ -0,0 +1,30 @@ +wantTo('make sure you cannot access Admin pages when NOT logged in'); + $I->goToTheAdminLoginPage(); + + $I->goToRandomAdminPage(); + $I->shouldBeOnTheAdminLoginPage(); + + $I->goToRandomAdminPage(); + $I->shouldBeOnTheAdminLoginPage(); + + $I->goToRandomAdminPage(); + $I->shouldBeOnTheAdminLoginPage(); + + $I->goToRandomAdminPage(); + $I->shouldBeOnTheAdminLoginPage(); + + $I->goToRandomAdminPage(); + $I->shouldBeOnTheAdminLoginPage(); + } +} diff --git a/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php b/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php deleted file mode 100644 index 73080ae0a..000000000 --- a/tests/acceptance/sideNavigation/OpenEachSideNavMenuCept.php +++ /dev/null @@ -1,39 +0,0 @@ -wantTo('see if I can open each of the Side Nav Menus'); - -$I->goToTheAdminLoginPage(); -$I->loginAsAnExistingAdmin(); - -$sideNavMenu->clickOnSalesInTheSideNavMenu($I); -$sideNavMenu->shouldSeeTheSalesNavMenu($I); - -$sideNavMenu->clickOnProductsInTheSideNavMenu($I); -$sideNavMenu->shouldSeeTheProductNavMenu($I); - -$sideNavMenu->clickOnCustomersInTheSideNavMenu($I); -$sideNavMenu->shouldSeeTheCustomersNavMenu($I); - -$sideNavMenu->clickOnMarketingInTheSideNavMenu($I); -$sideNavMenu->shouldSeeTheMarketingNavMenu($I); - -$sideNavMenu->clickOnContentInTheSideNavMenu($I); -$sideNavMenu->shouldSeeTheContentNavMenu($I); - -$sideNavMenu->clickOnReportsInTheSideNavMenu($I); -$sideNavMenu->shouldSeeTheReportsNavMenu($I); - -$sideNavMenu->clickOnStoresInTheSideNavMenu($I); -$sideNavMenu->shouldSeeTheStoresNavMenu($I); - -$sideNavMenu->clickOnSystemInTheSideNavMenu($I); -$sideNavMenu->shouldSeeTheSystemNavMenu($I); \ No newline at end of file diff --git a/tests/acceptance/sideNavigation/OpenEachSideNavMenuCest.php b/tests/acceptance/sideNavigation/OpenEachSideNavMenuCest.php new file mode 100644 index 000000000..f9d17c4ce --- /dev/null +++ b/tests/acceptance/sideNavigation/OpenEachSideNavMenuCest.php @@ -0,0 +1,47 @@ +goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + } + + /** + * @env chrome + * @env firefox + * @group slow + */ + public function shouldBeAbleToOpenEachSideNavMenu(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + { + $sideNavMenu->clickOnSalesInTheSideNavMenu($I); + $sideNavMenu->shouldSeeTheSalesNavMenu($I); + + $sideNavMenu->clickOnProductsInTheSideNavMenu($I); + $sideNavMenu->shouldSeeTheProductNavMenu($I); + + $sideNavMenu->clickOnCustomersInTheSideNavMenu($I); + $sideNavMenu->shouldSeeTheCustomersNavMenu($I); + + $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); + $sideNavMenu->shouldSeeTheMarketingNavMenu($I); + + $sideNavMenu->clickOnContentInTheSideNavMenu($I); + $sideNavMenu->shouldSeeTheContentNavMenu($I); + + $sideNavMenu->clickOnReportsInTheSideNavMenu($I); + $sideNavMenu->shouldSeeTheReportsNavMenu($I); + + $sideNavMenu->clickOnStoresInTheSideNavMenu($I); + $sideNavMenu->shouldSeeTheStoresNavMenu($I); + + $sideNavMenu->clickOnSystemInTheSideNavMenu($I); + $sideNavMenu->shouldSeeTheSystemNavMenu($I); + } +} From 16d197f3150d3252075980a3905b49ec5a242cd0 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 21 Mar 2017 19:22:42 -0500 Subject: [PATCH 015/149] Adding additional Allure markup - Adding Allure tags for Severity, Stories, Features and Titles. --- .../AccessForgotYourPasswordCest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php b/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php index e687dbb22..39b255c90 100644 --- a/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php @@ -1,7 +1,15 @@ Date: Tue, 21 Mar 2017 21:11:37 -0500 Subject: [PATCH 016/149] Adding additional Allure Tags - Adding a TestCaseId tag. - Adding a lookForwardTo statement. --- .../acceptance/forgotPassword/AccessForgotYourPasswordCest.php | 3 +++ tests/acceptance/login/AccessAdminLoginPageCest.php | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php b/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php index 39b255c90..10b6a36f7 100644 --- a/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php @@ -5,10 +5,13 @@ use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * @Features("Admin Login") * @Stories("Forgot Your Password") + * @TestCaseId("ZEP-1") + * @group test */ class AccessForgotYourPasswordCest { diff --git a/tests/acceptance/login/AccessAdminLoginPageCest.php b/tests/acceptance/login/AccessAdminLoginPageCest.php index d8f662253..98c337034 100644 --- a/tests/acceptance/login/AccessAdminLoginPageCest.php +++ b/tests/acceptance/login/AccessAdminLoginPageCest.php @@ -15,5 +15,6 @@ public function shouldBeAbleToAccessTheAdminLoginPage(\Step\Acceptance\Admin $I) $I->goToTheAdminLoginPage(); $I->shouldBeOnTheAdminLoginPage(); + $I->lookForwardTo('being on the Admin Login page'); } } From 4f02319d175c38204209ef58e843b53d2cc18816 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 21 Mar 2017 21:23:49 -0500 Subject: [PATCH 017/149] Adding a Param Adding a param example --- .../acceptance/forgotPassword/AccessForgotYourPasswordCest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php b/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php index 10b6a36f7..bfc45a0e6 100644 --- a/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php @@ -6,6 +6,7 @@ use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Annotation\TestCaseId; +use Yandex\Allure\Adapter\Annotation\Parameter; /** * @Features("Admin Login") @@ -26,6 +27,7 @@ public function _before(\Step\Acceptance\Admin $I) * @env phantomjs * @Title("You should land on the Forgot Your Password page.") * @Severity("critical") + * @Parameter("My Param") */ public function shouldLandOnTheForgotYourPasswordPage(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) { From 819275c714b0fe429c9cfa1eb3e245d02f0fa862 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Wed, 22 Mar 2017 13:20:29 -0500 Subject: [PATCH 018/149] Adding a basic CreateCategoryEntityTest. - Adding basic Category PageObject - Adding basic Category Add test - Adding a helper function for the Loader on Edit/Add pages. --- .../_support/Page/Acceptance/CategoryAdd.php | 60 +++++++++++++++++++ tests/_support/Step/Acceptance/Admin.php | 7 +++ .../category/AddRandomCategoryCest.php | 34 +++++++++++ 3 files changed, 101 insertions(+) create mode 100644 tests/_support/Page/Acceptance/CategoryAdd.php create mode 100644 tests/acceptance/category/AddRandomCategoryCest.php diff --git a/tests/_support/Page/Acceptance/CategoryAdd.php b/tests/_support/Page/Acceptance/CategoryAdd.php new file mode 100644 index 000000000..a2e9b280e --- /dev/null +++ b/tests/_support/Page/Acceptance/CategoryAdd.php @@ -0,0 +1,60 @@ +acceptanceTester = $I; + } + + public function clickOnAddRootCategoryButton(\AcceptanceTester $I) + { + $I->click(self::$addRootCategoryButton); + } + + public function enterCategoryName(\AcceptanceTester $I, $categoryName) + { + $I->fillField(self::$categoryNameField, $categoryName); + } + + public function clickOnSaveButton(\AcceptanceTester $I) + { + $I->click(self::$saveButton); + } + + public function verifyCategoryNameTitleIsCorrect(\AcceptanceTester $I, $categoryName) + { + $I->see($categoryName, self::$categoryNameTitle); + } + +} diff --git a/tests/_support/Step/Acceptance/Admin.php b/tests/_support/Step/Acceptance/Admin.php index 4ddd2289d..5b157a9a6 100644 --- a/tests/_support/Step/Acceptance/Admin.php +++ b/tests/_support/Step/Acceptance/Admin.php @@ -110,6 +110,13 @@ public function goToRandomAdminPage() return $admin_url_list[$random_admin_url]; } + public function waitForSpinnerToDisappear() + { + $I = $this; + $I->wait(1); + $I->waitForElementNotVisible('.admin__data-grid-loading-mask', 15); + } + // Sales public function goToTheAdminSalesOrdersPage() { diff --git a/tests/acceptance/category/AddRandomCategoryCest.php b/tests/acceptance/category/AddRandomCategoryCest.php new file mode 100644 index 000000000..3509b8909 --- /dev/null +++ b/tests/acceptance/category/AddRandomCategoryCest.php @@ -0,0 +1,34 @@ +goToTheAdminLoginPage(); + $I->loginAsAnExistingAdmin(); + $I->goToTheAdminProductsCategoriesPage(); + $I->waitForSpinnerToDisappear(); + } + + public function shouldBeAbleToAddARandomCategory(\Step\Acceptance\Admin $I, CategoryAdd $categoryAdd) + { + $categoryName = 'testCategory'; + + $I->am('an Admin'); + $I->wantTo('verify that I can add a random Category'); + + $categoryAdd->clickOnAddRootCategoryButton($I); + $I->waitForSpinnerToDisappear(); + $categoryAdd->enterCategoryName($I, $categoryName); + $categoryAdd->clickOnSaveButton($I); + $I->waitForSpinnerToDisappear(); + $categoryAdd->verifyCategoryNameTitleIsCorrect($I, $categoryName); + } +} From da76861df0d6bd7a5f4c090dbf76f72132fb7ff3 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 29 Mar 2017 16:02:46 -0500 Subject: [PATCH 019/149] - Added PSR-4 compliance namespace and directory structure - Refactored code to follow naming convention and coding standard - Added global helper classes for login and api authentication - Changed hard coded test configurations in suite yml file --- .gitignore | 2 + RoboFile.php | 8 +- codeception.yml => codeception.dist.yml | 3 + tests/_bootstrap.php | 4 + tests/_envs/chrome.yml | 4 +- tests/_envs/firefox.yml | 4 +- tests/_envs/phantomjs.yml | 4 +- tests/_support/AcceptanceTester.php | 22 +- tests/_support/ApiTester.php | 60 -- tests/_support/Helper/Acceptance.php | 12 - .../Magento/Xxyyzz/Helper/Acceptance.php | 35 + .../Magento/Xxyyzz/Helper/AdminUiHelper.php | 77 +++ .../Xxyyzz/Helper/AdminUrlList.php} | 7 +- .../Magento/Xxyyzz/Helper/DataHelper.php | 124 ++++ .../Magento/Xxyyzz/Helper/WebapiHelper.php | 78 +++ .../Page/Acceptance/AdminCategoryPage.php | 34 - .../Page/Acceptance/AdminProductEditPage.php | 77 --- .../Xxyyzz/Page/Backend/Admin}/AdminLogin.php | 71 +- .../Page/Backend/Admin}/SideNavigation.php | 640 ++++++++++-------- .../Page/Catalog/Admin/AdminCategoryPage.php | 86 +++ .../Catalog/Admin/AdminProductEditPage.php | 80 +++ .../Catalog/Admin/AdminProductGridPage.php | 73 ++ .../Page/Catalog/Admin/AdminProductPage.php | 129 ++++ .../Xxyyzz/Page/Catalog/ProductPage.php | 28 + .../Customer/CustomerAccountDashboardPage.php | 42 ++ .../Customer/CustomerAccountLoginPage.php | 42 ++ .../Xxyyzz/Step/Backend}/Admin.php | 372 +++++----- .../Xxyyzz/Step/Catalog}/Api/Category.php | 14 +- .../Xxyyzz/Step/Catalog}/Api/Product.php | 14 +- .../Xxyyzz/Step/Customer}/Api/Customer.php | 10 +- tests/acceptance.suite.dist.yml | 28 + tests/acceptance.suite.yml | 16 - .../SampleTests}/ExampleCept.php | 1 + .../SampleTests}/ExampleCest.php | 0 .../SampleTests}/TestCest.php | 12 +- .../SampleTests}/TestStepObjectCept.php | 5 +- .../SampleTests}/TestStepObjectCest.php | 5 +- .../Backend}/AccessAdminPagesDirectlyCest.php | 9 +- .../AccessAdminPagesViaNavMenuCest.php | 31 +- .../Backend}/OpenEachSideNavMenuCest.php | 10 +- .../Xxyyzz/Catalog/CreateCategoryCest.php | 71 ++ .../Catalog/CreateSimpleProductCest.php | 81 +++ .../Catalog/UpdateSimpleProductCest.php | 119 ++++ .../Xxyyzz/User}/AccessAdminLoginPageCest.php | 5 +- .../User}/AccessForgotYourPasswordCest.php | 12 +- .../CannotAccessAdminAfterLoggingOutCest.php | 7 +- .../User}/CannotAccessAdminPagesCest.php | 5 +- .../User}/LoginOnAdminLoginPageCest.php | 7 +- .../Xxyyzz/User}/LogoutAfterLoginCest.php | 7 +- tests/api.suite.yml | 35 - tests/api/ApiAndUiExampleCest.php | 175 ----- tests/api/_bootstrap.php | 2 - 52 files changed, 1819 insertions(+), 980 deletions(-) rename codeception.yml => codeception.dist.yml (88%) delete mode 100644 tests/_support/ApiTester.php delete mode 100644 tests/_support/Helper/Acceptance.php create mode 100644 tests/_support/Helper/Magento/Xxyyzz/Helper/Acceptance.php create mode 100644 tests/_support/Helper/Magento/Xxyyzz/Helper/AdminUiHelper.php rename tests/_support/Helper/{URL_List.php => Magento/Xxyyzz/Helper/AdminUrlList.php} (98%) create mode 100644 tests/_support/Helper/Magento/Xxyyzz/Helper/DataHelper.php create mode 100644 tests/_support/Helper/Magento/Xxyyzz/Helper/WebapiHelper.php delete mode 100644 tests/_support/Page/Acceptance/AdminCategoryPage.php delete mode 100644 tests/_support/Page/Acceptance/AdminProductEditPage.php rename tests/_support/Page/{Acceptance => Magento/Xxyyzz/Page/Backend/Admin}/AdminLogin.php (90%) rename tests/_support/Page/{Acceptance => Magento/Xxyyzz/Page/Backend/Admin}/SideNavigation.php (66%) create mode 100644 tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php create mode 100644 tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php create mode 100644 tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php create mode 100644 tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php create mode 100644 tests/_support/Page/Magento/Xxyyzz/Page/Catalog/ProductPage.php create mode 100644 tests/_support/Page/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php create mode 100644 tests/_support/Page/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php rename tests/_support/Step/{Acceptance => Magento/Xxyyzz/Step/Backend}/Admin.php (61%) rename tests/_support/Step/{ => Magento/Xxyyzz/Step/Catalog}/Api/Category.php (70%) rename tests/_support/Step/{ => Magento/Xxyyzz/Step/Catalog}/Api/Product.php (70%) rename tests/_support/Step/{ => Magento/Xxyyzz/Step/Customer}/Api/Customer.php (67%) create mode 100644 tests/acceptance.suite.dist.yml delete mode 100644 tests/acceptance.suite.yml rename tests/acceptance/{examples => Magento/SampleTests}/ExampleCept.php (99%) rename tests/acceptance/{examples => Magento/SampleTests}/ExampleCest.php (100%) rename tests/acceptance/{examples => Magento/SampleTests}/TestCest.php (64%) rename tests/acceptance/{examples => Magento/SampleTests}/TestStepObjectCept.php (55%) rename tests/acceptance/{examples => Magento/SampleTests}/TestStepObjectCest.php (85%) rename tests/acceptance/{adminAccess => Magento/Xxyyzz/Backend}/AccessAdminPagesDirectlyCest.php (97%) rename tests/acceptance/{sideNavigation => Magento/Xxyyzz/Backend}/AccessAdminPagesViaNavMenuCest.php (92%) rename tests/acceptance/{sideNavigation => Magento/Xxyyzz/Backend}/OpenEachSideNavMenuCest.php (79%) create mode 100644 tests/acceptance/Magento/Xxyyzz/Catalog/CreateCategoryCest.php create mode 100644 tests/acceptance/Magento/Xxyyzz/Catalog/CreateSimpleProductCest.php create mode 100644 tests/acceptance/Magento/Xxyyzz/Catalog/UpdateSimpleProductCest.php rename tests/acceptance/{login => Magento/Xxyyzz/User}/AccessAdminLoginPageCest.php (72%) rename tests/acceptance/{forgotPassword => Magento/Xxyyzz/User}/AccessForgotYourPasswordCest.php (86%) rename tests/acceptance/{login => Magento/Xxyyzz/User}/CannotAccessAdminAfterLoggingOutCest.php (75%) rename tests/acceptance/{login => Magento/Xxyyzz/User}/CannotAccessAdminPagesCest.php (88%) rename tests/acceptance/{login => Magento/Xxyyzz/User}/LoginOnAdminLoginPageCest.php (64%) rename tests/acceptance/{login => Magento/Xxyyzz/User}/LogoutAfterLoginCest.php (66%) delete mode 100644 tests/api.suite.yml delete mode 100644 tests/api/ApiAndUiExampleCest.php delete mode 100644 tests/api/_bootstrap.php diff --git a/.gitignore b/.gitignore index 611f71f7c..81db1dc1d 100755 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ vendor/* tests/_output/* allure-report/* /tests/_support/_generated/ +codeception.yml +tests/acceptance.suite.yml diff --git a/RoboFile.php b/RoboFile.php index dc35727a7..6edb232ee 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -59,4 +59,10 @@ function phantomjs() { $this->_exec('codecept run acceptance --env phantomjs'); $this->allureReport(); } -} \ No newline at end of file + + function catalog() + { + $this->_exec('codecept run --env chrome --group catalog'); + $this->allureReport(); + } +} diff --git a/codeception.yml b/codeception.dist.yml similarity index 88% rename from codeception.yml rename to codeception.dist.yml index 6f77ac7fb..614152225 100644 --- a/codeception.yml +++ b/codeception.dist.yml @@ -17,6 +17,9 @@ extensions: Yandex\Allure\Adapter\AllureAdapter: deletePreviousResults: true outputDirectory: allure-results + ignoredAnnotations: + - env + - zephyrId modules: config: Db: diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index 243f9c85b..61273dc3c 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -1,2 +1,6 @@ haveHttpHeader('Content-Type', 'application/json'); - $this->sendPOST('integration/admin/token', ['username' => $this->superAdminUsername, 'password' => $this->superAdminPassword]); - $this->superAdminToken = $this->grabDataFromResponseByJsonPath('$..*'); - $this->superAdminToken = substr($this->grabResponse(), 1, strlen($this->grabResponse())-2); - $this->seeResponseCodeIs(200); - } - - /** - * Get admin auth token - * - * @return string - */ - public function getAuthToke() - { - return $this->superAdminToken; - } -} diff --git a/tests/_support/Helper/Acceptance.php b/tests/_support/Helper/Acceptance.php deleted file mode 100644 index 3cff47609..000000000 --- a/tests/_support/Helper/Acceptance.php +++ /dev/null @@ -1,12 +0,0 @@ -getModule('WebDriver')->_reconfigure(array($config => $value)); - } -} diff --git a/tests/_support/Helper/Magento/Xxyyzz/Helper/Acceptance.php b/tests/_support/Helper/Magento/Xxyyzz/Helper/Acceptance.php new file mode 100644 index 000000000..1e8c978bb --- /dev/null +++ b/tests/_support/Helper/Magento/Xxyyzz/Helper/Acceptance.php @@ -0,0 +1,35 @@ +getModule('WebDriver')->_reconfigure(array($config => $value)); + } + + /** + * Get config value for a given $configGroup by $configKey. + * + * @param string $configGroup + * @param string $configKey + * @return string | null + */ + public function getConfiguration($configGroup, $configKey) + { + return isset($this->config[$configGroup][$configKey]) ? $this->config[$configGroup][$configKey] : null; + } +} diff --git a/tests/_support/Helper/Magento/Xxyyzz/Helper/AdminUiHelper.php b/tests/_support/Helper/Magento/Xxyyzz/Helper/AdminUiHelper.php new file mode 100644 index 000000000..4f0d92d53 --- /dev/null +++ b/tests/_support/Helper/Magento/Xxyyzz/Helper/AdminUiHelper.php @@ -0,0 +1,77 @@ +webDriver = $this->getModule('WebDriver'); + if (!isset(self::$adminUsername) || !isset(self::$adminUsername)) { + $config = \Codeception\Configuration::suiteSettings('acceptance', \Codeception\Configuration::config()); + self::$adminUsername = $config['data']['magento']['admin_username']; + self::$adminPassword = $config['data']['magento']['admin_password']; + } + } + + /** + * Login Magento Admin with given username and password. + * + * @param string $username + * @param string $password + * @return void + */ + public function loginAsAdmin($username = null, $password = null) + { + $this->webDriver->fillField('login[username]', !is_null($username) ? $username : self::$adminUsername); + $this->webDriver->fillField('login[password]', !is_null($password) ? $password : self::$adminPassword); + $this->webDriver->click('Sign in'); + + $this->closeAdminNotification(); + } + + /** + * Close admin notification popup windows. + * + * @return void + */ + public function closeAdminNotification() + { + // Cheating here for the minute. Still working on the best method to deal with this issue. + $this->webDriver->executeJS("jQuery('.modal-popup').remove(); jQuery('.modals-overlay').remove();"); + +// try { +// $I->waitForElementVisible('._show .action-close', 1); +// $I->click('._show .action-close'); +// $I->waitForElementNotVisible('._show .action-close', 1); +// } catch (\Exception $e) { +// return false; +// } + } +} diff --git a/tests/_support/Helper/URL_List.php b/tests/_support/Helper/Magento/Xxyyzz/Helper/AdminUrlList.php similarity index 98% rename from tests/_support/Helper/URL_List.php rename to tests/_support/Helper/Magento/Xxyyzz/Helper/AdminUrlList.php index 54baf4647..1e80a2661 100644 --- a/tests/_support/Helper/URL_List.php +++ b/tests/_support/Helper/Magento/Xxyyzz/Helper/AdminUrlList.php @@ -1,7 +1,10 @@ getSqs(); + return [ + 'parent_id' => '2', + 'name' => isset($categoryData['name']) + ? $categoryData['name'] : 'category'.$sq, + 'is_active' => '1', + 'include_in_menu' => '1', + 'available_sort_by' => ['position', 'name'], + 'custom_attributes' => [ + ['attribute_code' => 'url_key', 'value' => isset($categoryData['name']) + ? $categoryData['name'] : 'category'.$sq], + ['attribute_code' => 'description', 'value' => 'Custom description'], + ['attribute_code' => 'meta_title', 'value' => ''], + ['attribute_code' => 'meta_keywords', 'value' => ''], + ['attribute_code' => 'meta_description', 'value' => ''], + ['attribute_code' => 'display_mode', 'value' => 'PRODUCTS'], + ['attribute_code' => 'landing_page', 'value' => ''], + ['attribute_code' => 'is_anchor', 'value' => '0'], + ['attribute_code' => 'custom_use_parent_settings', 'value' => '0'], + ['attribute_code' => 'custom_apply_to_products', 'value' => '0'], + ['attribute_code' => 'custom_design', 'value' => ''], + ['attribute_code' => 'custom_design_from', 'value' => ''], + ['attribute_code' => 'custom_design_to', 'value' => ''], + ['attribute_code' => 'page_layout', 'value' => ''], + ] + ]; + } + + /** + * Get simple product data. + * + * @param integer $categoryId + * @param array $productData + * @return array + */ + public function getSimpleProductData($categoryId = 0, $productData = []) + { + $sq = $this->getSqs(); + return [ + 'sku' => isset($productData['sku']) + ? $productData['sku'] : 'simple_product_sku'.$sq, + 'name' => isset($productData['name']) + ? $productData['name'] : 'simple_product'.$sq, + 'visibility' => 4, + 'type_id' => 'simple', + 'price' => 17.71, + 'status' => 1, + 'attribute_set_id' => 4, + 'extension_attributes' => [ + 'stock_item' => ['is_in_stock' => 1, 'qty' => 1000] + ], + 'custom_attributes' => [ + ['attribute_code' => 'url_key', 'value' => isset($productData['sku']) + ? $productData['sku'] : 'sku'.$sq], + ['attribute_code' => 'tax_class_id', 'value' => 2], + ['attribute_code' => 'category_ids', 'value' => $categoryId], + ], + ]; + } + + /** + * Get Customer Data. + * + * @param array $additional + * @return array + */ + public function getCustomerData(array $additional = []) + { + $sq = $this->getSqs(); + $customerData = [ + 'firstname' => 'firstname'.$sq, + 'lastname' => 'lastname'.$sq, + 'email' => 'email'.$sq.'@example.com', + 'gender' => rand(0, 1), + 'group_id' => 1, + 'middlename' => 'middlename'.$sq, + 'store_id' => 1, + 'website_id' => 1, + 'custom_attributes' => [ + [ + 'attribute_code' => 'disable_auto_group_change', + 'value' => '0', + ], + ], + ]; + return array_merge($customerData, $additional); + } + + /** + * Get customer data including password. + * + * @param string $password + * @return array + */ + public function getCustomerDataWithPassword($password = '') + { + return ['customer' => self::getCustomerData(), 'password' => ($password !== '') ? $password : '123123qW']; + } + + /** + * Get a unique sequence across suite. + * + * @return string + */ + public function getSqs() + { + return sqs(); + } +} \ No newline at end of file diff --git a/tests/_support/Helper/Magento/Xxyyzz/Helper/WebapiHelper.php b/tests/_support/Helper/Magento/Xxyyzz/Helper/WebapiHelper.php new file mode 100644 index 000000000..31dc8e565 --- /dev/null +++ b/tests/_support/Helper/Magento/Xxyyzz/Helper/WebapiHelper.php @@ -0,0 +1,78 @@ +restDriver = $this->getModule('REST'); + if (!isset(self::$adminUsername) || !isset(self::$adminUsername)) { + $config = \Codeception\Configuration::suiteSettings('acceptance', \Codeception\Configuration::config()); + self::$adminUsername = $config['data']['magento']['admin_username']; + self::$adminPassword = $config['data']['magento']['admin_password']; + } + } + + /** + * Get admin auth token by username and password. + * + * @param string $username + * @param string $password + * @param bool $newToken + * @return string + */ + public function getAdminAuthToken($username = null, $password = null, $newToken = false) + { + $username = !is_null($username) ? $username : self::$adminUsername; + $password = !is_null($password) ? $password : self::$adminPassword; + + // Use existing token if it exists + if (!$newToken + && (isset(self::$adminTokens[$username]) || array_key_exists($username, self::$adminTokens))) { + return self::$adminTokens[$username]; + } + $this->restDriver = $this->getModule('REST'); + $this->restDriver->haveHttpHeader('Content-Type', 'application/json'); + $this->restDriver->sendPOST('integration/admin/token', ['username' => $username, 'password' => $password]); + $token = substr($this->restDriver->grabResponse(), 1, strlen($this->restDriver->grabResponse())-2); + $this->restDriver->seeResponseCodeIs(200); + self::$adminTokens[$username] = $token; + return $token; + } +} diff --git a/tests/_support/Page/Acceptance/AdminCategoryPage.php b/tests/_support/Page/Acceptance/AdminCategoryPage.php deleted file mode 100644 index 05cc3300f..000000000 --- a/tests/_support/Page/Acceptance/AdminCategoryPage.php +++ /dev/null @@ -1,34 +0,0 @@ -amOnPage(self::$URL . 'edit/id/' . $id); - } - - public function seeCategoryNameInPageTitle(\AcceptanceTester $I, $name) { - $I->see($name, self::$pageTitle); - } -} diff --git a/tests/_support/Page/Acceptance/AdminProductEditPage.php b/tests/_support/Page/Acceptance/AdminProductEditPage.php deleted file mode 100644 index c143c4e2d..000000000 --- a/tests/_support/Page/Acceptance/AdminProductEditPage.php +++ /dev/null @@ -1,77 +0,0 @@ -amOnPage(self::$URL . 'id/' . $id); - } - - public function seeProductNameInPageTitle(\AcceptanceTester $I, $name) - { - $I->see($name, self::$pageTitle); - } - - public function seeProductAttributeSet(\AcceptanceTester $I, $name) - { - $I->see($name, self::$producAttributeSet); - } - - public function seeProductName(\AcceptanceTester $I, $name) - { - $I->see($name, self::$productName); - } - - public function seeProductSku(\AcceptanceTester $I, $name) - { - $I->see($name, self::$productSku); - } - - public function seeProductPrice(\AcceptanceTester $I, $name) - { - $I->see($name, self::$productPrice); - } - - public function seeProductQuantity(\AcceptanceTester $I, $name) - { - $I->see($name, self::$productQuantity); - } - - public function seeProductStockStatus(\AcceptanceTester $I, $name) - { - $I->see($name, self::$productStockStatus); - } - - public function seeProductCategories(\AcceptanceTester $I, $name) - { - $I->see($name, self::$productCategories); - } -} diff --git a/tests/_support/Page/Acceptance/AdminLogin.php b/tests/_support/Page/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php similarity index 90% rename from tests/_support/Page/Acceptance/AdminLogin.php rename to tests/_support/Page/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php index 8b204a0f5..0d894ada2 100644 --- a/tests/_support/Page/Acceptance/AdminLogin.php +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php @@ -1,5 +1,5 @@ acceptanceTester = $I; } - public function clickOnMagentoLogo(\AcceptanceTester $I) { + public function clickOnMagentoLogo(\AcceptanceTester $I) + { $I->click(self::$logoImage); } - public function clickOnForgotYourPassword(\AcceptanceTester $I) { + public function clickOnForgotYourPassword(\AcceptanceTester $I) + { $I->click(self::$forgotYourPassword); } - public function clickOnSignIn(\AcceptanceTester $I) { + public function clickOnSignIn(\AcceptanceTester $I) + { $I->click(self::$signIn); } - public function enterTheUsername(\AcceptanceTester $I, $username) { + public function enterTheUsername(\AcceptanceTester $I, $username) + { $I->fillField(self::$username, $username); } - public function enterThePassword(\AcceptanceTester $I, $password) { + public function enterThePassword(\AcceptanceTester $I, $password) + { $I->fillField(self::$password, $password); } - public function enterTheLoginCredentials(\AcceptanceTester $I, $username, $password) { + public function enterTheLoginCredentials(\AcceptanceTester $I, $username, $password) + { $this->enterTheUsername($I, $username); $this->enterThePassword($I, $password); } - public function shouldSeeTheLoginMainArea(\AcceptanceTester $I) { + public function shouldSeeTheLoginMainArea(\AcceptanceTester $I) + { $I->seeElement(self::$mainArea); } - public function shouldSeeTheLoginLogoLink(\AcceptanceTester $I) { + public function shouldSeeTheLoginLogoLink(\AcceptanceTester $I) + { $I->seeElement(self::$logoLink); } - public function shouldSeeTheLoginLogoImage(\AcceptanceTester $I) { + public function shouldSeeTheLoginLogoImage(\AcceptanceTester $I) + { $I->seeElement(self::$logoImage); } - public function shouldSeeTheLoginTitle(\AcceptanceTester $I) { + public function shouldSeeTheLoginTitle(\AcceptanceTester $I) + { $I->seeElement(self::$title); } - public function shouldSeeTheLoginUsernameTitle(\AcceptanceTester $I) { + public function shouldSeeTheLoginUsernameTitle(\AcceptanceTester $I) + { $I->seeElement(self::$usernameTitle); } - public function shouldSeeTheLoginUsernameField(\AcceptanceTester $I) { + public function shouldSeeTheLoginUsernameField(\AcceptanceTester $I) + { $I->seeElement(self::$username); } - public function shouldSeeTheLoginPasswordTitle(\AcceptanceTester $I) { + public function shouldSeeTheLoginPasswordTitle(\AcceptanceTester $I) + { $I->seeElement(self::$passwordTitle); } - public function shouldSeeTheLoginPasswordField(\AcceptanceTester $I) { + public function shouldSeeTheLoginPasswordField(\AcceptanceTester $I) + { $I->seeElement(self::$password); } - public function shouldSeeTheLoginForgotPasswordLink(\AcceptanceTester $I) { + public function shouldSeeTheLoginForgotPasswordLink(\AcceptanceTester $I) + { $I->seeElement(self::$forgotYourPassword); } - public function shouldSeeTheLoginSignInButton(\AcceptanceTester $I) { + public function shouldSeeTheLoginSignInButton(\AcceptanceTester $I) + { $I->seeElement(self::$signIn); } - public function shouldSeeTheLoginCopyrightText(\AcceptanceTester $I) { + public function shouldSeeTheLoginCopyrightText(\AcceptanceTester $I) + { $I->seeElement(self::$copyRight); } - public function shouldSeeTheLoginPageFields(\AcceptanceTester $I) { + public function shouldSeeTheLoginPageFields(\AcceptanceTester $I) + { $this->shouldSeeTheLoginMainArea($I); $this->shouldSeeTheLoginLogoLink($I); $this->shouldSeeTheLoginLogoImage($I); @@ -133,19 +149,23 @@ public function shouldSeeTheLoginPageFields(\AcceptanceTester $I) { $this->shouldSeeTheLoginCopyrightText($I); } - public function enterTheEmailAddress(\AcceptanceTester $I, $emailAddress) { + public function enterTheEmailAddress(\AcceptanceTester $I, $emailAddress) + { $I->fillField(self::$emailAddress, $emailAddress); } - public function clickOnRetrievePassword(\AcceptanceTester $I) { + public function clickOnRetrievePassword(\AcceptanceTester $I) + { $I->click(self::$retrievePassword); } - public function clickOnBackToSignIn(\AcceptanceTester $I) { + public function clickOnBackToSignIn(\AcceptanceTester $I) + { $I->click(self::$backToSignIn); } - public function shouldSeeTheForgotYourPasswordFields(\AcceptanceTester $I) { + public function shouldSeeTheForgotYourPasswordFields(\AcceptanceTester $I) + { $I->seeElement(self::$forgotPasswordMain); $I->seeElement(self::$logoLink); $I->seeElement(self::$logoImage); @@ -155,5 +175,4 @@ public function shouldSeeTheForgotYourPasswordFields(\AcceptanceTester $I) { $I->seeElement(self::$retrievePassword); $I->seeElement(self::$backToSignIn); } - } diff --git a/tests/_support/Page/Acceptance/SideNavigation.php b/tests/_support/Page/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php similarity index 66% rename from tests/_support/Page/Acceptance/SideNavigation.php rename to tests/_support/Page/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php index 5c3b71280..0cae86951 100644 --- a/tests/_support/Page/Acceptance/SideNavigation.php +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php @@ -1,5 +1,5 @@ acceptanceTester = $I; } - public function clickOnDashboardInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnDashboardInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$dashboardButton); } - public function clickOnSalesInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnSalesInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$salesButton); $I->wait(1); } - public function clickOnOrdersInTheSalesNavMenu(\AcceptanceTester $I) { - $I->click(self::$salesNavOrders); - } + public function clickOnOrdersInTheSalesNavMenu(\AcceptanceTester $I) + { + $I->click(self::$salesNavOrders); + } - public function clickOnInvoicesInTheSalesNavMenu(\AcceptanceTester $I) { - $I->click(self::$salesNavInvoices); - } + public function clickOnInvoicesInTheSalesNavMenu(\AcceptanceTester $I) + { + $I->click(self::$salesNavInvoices); + } - public function clickOnShipmentsInTheSalesNavMenu(\AcceptanceTester $I) { - $I->click(self::$salesNavShipments); - } + public function clickOnShipmentsInTheSalesNavMenu(\AcceptanceTester $I) + { + $I->click(self::$salesNavShipments); + } - public function clickOnCreditMemosInTheSalesNavMenu(\AcceptanceTester $I) { - $I->click(self::$salesNavCreditMemos); - } + public function clickOnCreditMemosInTheSalesNavMenu(\AcceptanceTester $I) + { + $I->click(self::$salesNavCreditMemos); + } - public function clickOnBillingAgreementsInTheSalesNavMenu(\AcceptanceTester $I) { - $I->click(self::$salesNavBillingAgreements); - } + public function clickOnBillingAgreementsInTheSalesNavMenu(\AcceptanceTester $I) + { + $I->click(self::$salesNavBillingAgreements); + } - public function clickOnTransactionsInTheSalesNavMenu(\AcceptanceTester $I) { - $I->click(self::$salesNavTransactions); - } + public function clickOnTransactionsInTheSalesNavMenu(\AcceptanceTester $I) + { + $I->click(self::$salesNavTransactions); + } - public function clickOnProductsInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnProductsInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$productsButton); $I->wait(1); } - public function clickOnCatalogInTheProductNavMenu(\AcceptanceTester $I) { - $I->click(self::$productNavCatalog); - } + public function clickOnCatalogInTheProductNavMenu(\AcceptanceTester $I) + { + $I->click(self::$productNavCatalog); + } - public function clickOnCategoriesInTheProductNavMenu(\AcceptanceTester $I) { - $I->click(self::$productNavCategories); - } + public function clickOnCategoriesInTheProductNavMenu(\AcceptanceTester $I) + { + $I->click(self::$productNavCategories); + } - public function clickOnCustomersInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnCustomersInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$customersButton); $I->wait(1); } - public function clickOnAllCustomersInTheCustomersNavMenu(\AcceptanceTester $I) { - $I->click(self::$customersNavAllCustomers); - } + public function clickOnAllCustomersInTheCustomersNavMenu(\AcceptanceTester $I) + { + $I->click(self::$customersNavAllCustomers); + } - public function clickOnNowOnlineInTheCustomersNavMenu(\AcceptanceTester $I) { - $I->click(self::$customersNavNowOnline); - } + public function clickOnNowOnlineInTheCustomersNavMenu(\AcceptanceTester $I) + { + $I->click(self::$customersNavNowOnline); + } - public function clickOnMarketingInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnMarketingInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$marketingButton); $I->wait(1); } - public function clickOnCatalogPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavPromotionsCatalogPriceRule); - } + public function clickOnCatalogPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavPromotionsCatalogPriceRule); + } - public function clickOnCartPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavPromotionsCartPriceRules); - } + public function clickOnCartPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavPromotionsCartPriceRules); + } - public function clickOnEmailTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavCommunicationsEmailTemplates); - } + public function clickOnEmailTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavCommunicationsEmailTemplates); + } - public function clickOnNewsletterTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavCommunicationsNewsletterTemplates); - } + public function clickOnNewsletterTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavCommunicationsNewsletterTemplates); + } - public function clickOnNewsletterQueueInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavCommunicationsNewsletterQueue); - } + public function clickOnNewsletterQueueInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavCommunicationsNewsletterQueue); + } - public function clickOnNewsletterSubscribersInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavCommunicationsNewsletterSubscribers); - } + public function clickOnNewsletterSubscribersInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavCommunicationsNewsletterSubscribers); + } - public function clickOnURLRewritesInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavSEOSearchURLRewrites); - } + public function clickOnURLRewritesInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavSEOSearchURLRewrites); + } - public function clickOnSearchTermsInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavSEOSearchTerms); - } + public function clickOnSearchTermsInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavSEOSearchTerms); + } - public function clickOnSearchSynonymsInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavSEOSearchSynonyms); - } + public function clickOnSearchSynonymsInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavSEOSearchSynonyms); + } - public function clickOnSiteMapInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavSEOSearchSiteMap); - } + public function clickOnSiteMapInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavSEOSearchSiteMap); + } - public function clickOnContentReviewsInTheMarketingNavMenu(\AcceptanceTester $I) { - $I->click(self::$marketingNavUserContentReviews); - } + public function clickOnContentReviewsInTheMarketingNavMenu(\AcceptanceTester $I) + { + $I->click(self::$marketingNavUserContentReviews); + } - public function clickOnContentInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnContentInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$contentButton); $I->wait(1); } - public function clickOnPagesInTheContentNavMenu(\AcceptanceTester $I) { - $I->click(self::$contentNavElementsPages); - } + public function clickOnPagesInTheContentNavMenu(\AcceptanceTester $I) + { + $I->click(self::$contentNavElementsPages); + } - public function clickOnBlocksInTheContentNavMenu(\AcceptanceTester $I) { - $I->click(self::$contentNavElementsBlocks); - } + public function clickOnBlocksInTheContentNavMenu(\AcceptanceTester $I) + { + $I->click(self::$contentNavElementsBlocks); + } - public function clickOnWidgetsInTheContentNavMenu(\AcceptanceTester $I) { - $I->click(self::$contentNavElementsWidgets); - } + public function clickOnWidgetsInTheContentNavMenu(\AcceptanceTester $I) + { + $I->click(self::$contentNavElementsWidgets); + } - public function clickOnConfigurationInTheContentNavMenu(\AcceptanceTester $I) { - $I->click(self::$contentNavDesignConfiguration); - } + public function clickOnConfigurationInTheContentNavMenu(\AcceptanceTester $I) + { + $I->click(self::$contentNavDesignConfiguration); + } - public function clickOnThemesInTheContentNavMenu(\AcceptanceTester $I) { - $I->click(self::$contentNavDesignThemes); - } + public function clickOnThemesInTheContentNavMenu(\AcceptanceTester $I) + { + $I->click(self::$contentNavDesignThemes); + } - public function clickOnScheduleInTheContentNavMenu(\AcceptanceTester $I) { - $I->click(self::$contentNavDesignSchedule); - } + public function clickOnScheduleInTheContentNavMenu(\AcceptanceTester $I) + { + $I->click(self::$contentNavDesignSchedule); + } - public function clickOnReportsInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnReportsInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$reportsButton); $I->wait(1); } - public function clickOnProductsInCartInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavMarketingProductsInCart); - } + public function clickOnProductsInCartInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavMarketingProductsInCart); + } - public function clickOnSearchTermsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavMarketingSearchTerms); - } + public function clickOnSearchTermsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavMarketingSearchTerms); + } - public function clickOnAbandonedCartsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavMarketingAbandonedCarts); - } + public function clickOnAbandonedCartsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavMarketingAbandonedCarts); + } - public function clickOnNewsletterProblemReportsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavMarketingNewsletterProblemReports); - } + public function clickOnNewsletterProblemReportsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavMarketingNewsletterProblemReports); + } - public function clickOnByCustomersInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavReviewsByCustomers); - } + public function clickOnByCustomersInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavReviewsByCustomers); + } - public function clickOnByProductsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavReviewsByProducts); - } + public function clickOnByProductsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavReviewsByProducts); + } - public function clickOnOrdersInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavSalesOrders); - } + public function clickOnOrdersInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavSalesOrders); + } - public function clickOTaxInTheReportsNavMenu(\AcceptanceTester $I) { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesTax); - } + public function clickOTaxInTheReportsNavMenu(\AcceptanceTester $I) + { + $I = $this->acceptanceTester; + $I->click(self::$reportsNavSalesTax); + } - public function clickOnInvoicedInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavSalesInvoiced); - } + public function clickOnInvoicedInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavSalesInvoiced); + } - public function clickOnShippingInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavSalesShipping); - } + public function clickOnShippingInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavSalesShipping); + } - public function clickOnRefundsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavSalesRefunds); - } + public function clickOnRefundsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavSalesRefunds); + } - public function clickOnCouponsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavSalesCoupons); - } + public function clickOnCouponsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavSalesCoupons); + } - public function clickOnPayPalSettlementInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavSalesPayPalSettlement); - } + public function clickOnPayPalSettlementInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavSalesPayPalSettlement); + } - public function clickOnBraintreeSettlementInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavSalesBraintreeSettlement); - } + public function clickOnBraintreeSettlementInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavSalesBraintreeSettlement); + } - public function clickOnOrderTotalInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavCustomersOrderTotal); - } + public function clickOnOrderTotalInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavCustomersOrderTotal); + } - public function clickOnOrderCountInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavCustomersOrderCount); - } + public function clickOnOrderCountInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavCustomersOrderCount); + } - public function clickOnNewInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavCustomersNew); - } + public function clickOnNewInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavCustomersNew); + } - public function clickOnViewsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavProductsViews); - } + public function clickOnViewsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavProductsViews); + } - public function clickOnBestSellersInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavProductsBestsellers); - } + public function clickOnBestSellersInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavProductsBestsellers); + } - public function clickOnLowStockInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavProductsLowStock); - } + public function clickOnLowStockInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavProductsLowStock); + } - public function clickOnOrderedInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavProductsOrdered); - } + public function clickOnOrderedInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavProductsOrdered); + } - public function clickOnDownloadsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavProductsDownloads); - } + public function clickOnDownloadsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavProductsDownloads); + } - public function clickOnRefreshStatisticsInTheReportsNavMenu(\AcceptanceTester $I) { - $I->click(self::$reportsNavStatisticsRefreshStatistics); - } + public function clickOnRefreshStatisticsInTheReportsNavMenu(\AcceptanceTester $I) + { + $I->click(self::$reportsNavStatisticsRefreshStatistics); + } - public function clickOnStoresInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnStoresInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$storesButton); $I->wait(1); } - public function clickOnAllStoresInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavSettingsAllStores); - } + public function clickOnAllStoresInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavSettingsAllStores); + } - public function clickOnConfigurationInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavSettingsConfiguration); - } + public function clickOnConfigurationInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavSettingsConfiguration); + } - public function clickOnTermsAndConditionsInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavSettingsTermsAndConditions); - } + public function clickOnTermsAndConditionsInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavSettingsTermsAndConditions); + } - public function clickOnOrderStatusInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavSettingsOrderStatus); - } + public function clickOnOrderStatusInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavSettingsOrderStatus); + } - public function clickOnTaxRuleInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavTaxesTaxRules); - } + public function clickOnTaxRuleInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavTaxesTaxRules); + } - public function clickOnTaxZonesAndRatesInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavTaxesTaxZonesAndRates); - } + public function clickOnTaxZonesAndRatesInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavTaxesTaxZonesAndRates); + } - public function clickOnTaxRatesInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavCurrencyRates); - } + public function clickOnTaxRatesInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavCurrencyRates); + } - public function clickOnTaxSymbolsInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavCurrencySymbols); - } + public function clickOnTaxSymbolsInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavCurrencySymbols); + } - public function clickOnCurrencyRatesInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavCurrencyRates); - } + public function clickOnCurrencyRatesInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavCurrencyRates); + } - public function clickOnCurrencySymbolsInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavCurrencySymbols); - } + public function clickOnCurrencySymbolsInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavCurrencySymbols); + } - public function clickOnProductInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavAttributesProduct); - } + public function clickOnProductInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavAttributesProduct); + } - public function clickOnAttributesSetInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavAttributesSet); - } + public function clickOnAttributesSetInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavAttributesSet); + } - public function clickOnRatingsInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavAttributesRating); - } + public function clickOnRatingsInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavAttributesRating); + } - public function clickOnCustomerGroupInTheStoresNavMenu(\AcceptanceTester $I) { - $I->click(self::$storesNavOtherSettingsCustomerGroups); - } + public function clickOnCustomerGroupInTheStoresNavMenu(\AcceptanceTester $I) + { + $I->click(self::$storesNavOtherSettingsCustomerGroups); + } - public function clickOnSystemInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnSystemInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$systemButton); $I->wait(1); } - public function clickOnImportInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavDataTransferImport); - } + public function clickOnImportInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavDataTransferImport); + } - public function clickOnExportInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavDataTransferExport); - } + public function clickOnExportInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavDataTransferExport); + } - public function clickOnImportExportTaxRatesInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavDataTransferImportExportTaxRates); - } + public function clickOnImportExportTaxRatesInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavDataTransferImportExportTaxRates); + } - public function clickOnImportHistoryInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavDataTransferImportHistory); - } + public function clickOnImportHistoryInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavDataTransferImportHistory); + } - public function clickOnIntegrationsInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavExtensionsIntegrations); - } + public function clickOnIntegrationsInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavExtensionsIntegrations); + } - public function clickOnCacheManagementInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavToolsCacheManagement); - } + public function clickOnCacheManagementInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavToolsCacheManagement); + } - public function clickOnBackupsInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavToolsBackups); - } + public function clickOnBackupsInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavToolsBackups); + } - public function clickOnIndexManagementInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavToolsIndexManagement); - } + public function clickOnIndexManagementInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavToolsIndexManagement); + } - public function clickOnWebSetupWizardInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavToolsWebSetupWizard); - $I->wait(1); - } + public function clickOnWebSetupWizardInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavToolsWebSetupWizard); + $I->wait(1); + } - public function clickOnAllUsersInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavPermissionsAllUsers); - } + public function clickOnAllUsersInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavPermissionsAllUsers); + } - public function clickOnLockedUsersInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavPermissionsLockedUsers); - } + public function clickOnLockedUsersInTheSystemNavMenu(\AcceptanceTester $I) { + $I->click(self::$systemNavPermissionsLockedUsers); + } - public function clickOnUserRolesInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavPermissionsUserRoles); - } + public function clickOnUserRolesInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavPermissionsUserRoles); + } - public function clickOnNotificationsInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavOtherSettingsNotifications); - } + public function clickOnNotificationsInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavOtherSettingsNotifications); + } - public function clickOnCustomVariablesInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavOtherSettingsCustomVariables); - } + public function clickOnCustomVariablesInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavOtherSettingsCustomVariables); + } - public function clickOnManageEncryptionKeyInTheSystemNavMenu(\AcceptanceTester $I) { - $I->click(self::$systemNavOtherSettingsManageEncryptionKey); - } + public function clickOnManageEncryptionKeyInTheSystemNavMenu(\AcceptanceTester $I) + { + $I->click(self::$systemNavOtherSettingsManageEncryptionKey); + } - public function clickOnFindPartnersAndExtensionsInTheSideNavMenu(\AcceptanceTester $I) { + public function clickOnFindPartnersAndExtensionsInTheSideNavMenu(\AcceptanceTester $I) + { $I->click(self::$findPartnersExtensionsButton); $I->wait(1); } - public function shouldSeeTheSalesNavMainArea(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavMainArea(\AcceptanceTester $I) + { $I->seeElement(self::$salesNavMainArea); } - public function shouldSeeTheSalesNavTitle(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavTitle(\AcceptanceTester $I) + { $I->seeElement(self::$salesNavTitle); } - public function shouldSeeTheSalesNavOrders(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavOrders(\AcceptanceTester $I) + { $I->seeElement(self::$salesNavOrders); } - public function shouldSeeTheSalesNavInvoices(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavInvoices(\AcceptanceTester $I) + { $I->seeElement(self::$salesNavInvoices); } - public function shouldSeeTheSalesNavShipments(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavShipments(\AcceptanceTester $I) + { $I->seeElement(self::$salesNavShipments); } - public function shouldSeeTheSalesNavCreditMemos(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavCreditMemos(\AcceptanceTester $I) + { $I->seeElement(self::$salesNavCreditMemos); } - public function shouldSeeTheSalesNavBillingAgreements(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavBillingAgreements(\AcceptanceTester $I) + { $I->seeElement(self::$salesNavBillingAgreements); } - public function shouldSeeTheSalesNavTransactions(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavTransactions(\AcceptanceTester $I) + { $I->seeElement(self::$salesNavTransactions); } - public function shouldSeeTheSalesNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheSalesNavMenu(\AcceptanceTester $I) + { $this->shouldSeeTheSalesNavMainArea($I); $this->shouldSeeTheSalesNavTitle($I); $this->shouldSeeTheSalesNavOrders($I); @@ -602,19 +697,22 @@ public function shouldSeeTheSalesNavMenu(\AcceptanceTester $I) { $this->shouldSeeTheSalesNavTransactions($I); } - public function shouldSeeTheProductNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheProductNavMenu(\AcceptanceTester $I) + { $I->seeElement(self::$productNavMainArea); $I->seeElement(self::$productNavTitle); $I->seeElement(self::$productNavCatalog); $I->seeElement(self::$productNavCategories); } - public function shouldSeeTheCustomersNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheCustomersNavMenu(\AcceptanceTester $I) + { $I->seeElement(self::$customersNavAllCustomers); $I->seeElement(self::$customersNavNowOnline); } - public function shouldSeeTheMarketingNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheMarketingNavMenu(\AcceptanceTester $I) + { $I->seeElement(self::$marketingNavPromotionsMainArea); $I->seeElement(self::$marketingNavPromotionsTitle); $I->seeElement(self::$marketingNavPromotionsCatalogPriceRule); @@ -639,7 +737,8 @@ public function shouldSeeTheMarketingNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$marketingNavUserContentReviews); } - public function shouldSeeTheContentNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheContentNavMenu(\AcceptanceTester $I) + { $I->seeElement(self::$contentNavElementsMainArea); $I->seeElement(self::$contentNavElementsTitle); $I->seeElement(self::$contentNavElementsPages); @@ -653,7 +752,8 @@ public function shouldSeeTheContentNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$contentNavDesignSchedule); } - public function shouldSeeTheReportsNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheReportsNavMenu(\AcceptanceTester $I) + { $I->seeElement(self::$reportsNavMarketingMainArea); $I->seeElement(self::$reportsNavMarketingTitle); $I->seeElement(self::$reportsNavMarketingProductsInCart); @@ -696,7 +796,8 @@ public function shouldSeeTheReportsNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$reportsNavStatisticsRefreshStatistics); } - public function shouldSeeTheStoresNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheStoresNavMenu(\AcceptanceTester $I) + { $I->seeElement(self::$storesNavSettingsMainArea); $I->seeElement(self::$storesNavSettingsTitle); $I->seeElement(self::$storesNavSettingsAllStores); @@ -725,7 +826,8 @@ public function shouldSeeTheStoresNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$storesNavOtherSettingsCustomerGroups); } - public function shouldSeeTheSystemNavMenu(\AcceptanceTester $I) { + public function shouldSeeTheSystemNavMenu(\AcceptanceTester $I) + { $I->seeElement(self::$systemNavDataTransferMainArea); $I->seeElement(self::$systemNavDataTransferTitle); $I->seeElement(self::$systemNavDataTransferImport); @@ -756,4 +858,4 @@ public function shouldSeeTheSystemNavMenu(\AcceptanceTester $I) { $I->seeElement(self::$systemNavOtherSettingsCustomVariables); $I->seeElement(self::$systemNavOtherSettingsManageEncryptionKey); } -} \ No newline at end of file +} diff --git a/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php new file mode 100644 index 000000000..4971b1fec --- /dev/null +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php @@ -0,0 +1,86 @@ +amOnPage(self::route($param)); + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs + } + + public function amOnAdminCategoryPageById(\AcceptanceTester $I, $id) + { + $I->amOnPage(self::$URL . 'edit/id/' . $id); + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs + } + + public function seeCategoryNameInPageTitle(\AcceptanceTester $I, $name) + { + $I->see($name, self::$pageTitle); + } + + public function addRootCategory(\AcceptanceTester $I) + { + $I->click(self::$addRootCategoryButton); + } + + public function addSubCategory(\AcceptanceTester $I) + { + $I->click(self::$addSubCategoryButton); + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs + } + + public function fillFieldCategoryName(\AcceptanceTester $I, $name) + { + $I->fillField(self::$categoryName, $name); + } + + public function fillFieldCategoryUrlKey(\AcceptanceTester $I, $name) + { + try { + $I->click(sprintf(self::$categorySearchEngineOptimToggle, 'closed')); + } catch (\Exception $e) { + } + $I->fillField(self::$categoryUrlKey, $name); + } + + public function saveCategory(\AcceptanceTester $I) + { + $I->click(self::$saveCategoryButton); + $I->waitForElementNotVisible(self::$catagorySavedSpinner); + $I->waitForElementVisible(self::$catagorySaveSuccessMessage); + } +} diff --git a/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php new file mode 100644 index 000000000..f755d84b0 --- /dev/null +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php @@ -0,0 +1,80 @@ +amOnPage(self::$URL . 'id/' . $id); + $I->waitForElementNotVisible(self::$productFormSpinner, 30); // secs + + } + + public function seeProductNameInPageTitle(\AcceptanceTester $I, $name) + { + $I->see($name, self::$pageTitle); + } + + public function seeProductAttributeSet(\AcceptanceTester $I, $name) + { + $I->seeOptionIsSelected(self::$producAttributeSet, $name); + } + + public function seeProductName(\AcceptanceTester $I, $name) + { + $I->seeInField(self::$productName, $name); + } + + public function seeProductSku(\AcceptanceTester $I, $name) + { + $I->seeInField(self::$productSku, $name); + } + + public function seeProductPrice(\AcceptanceTester $I, $name) + { + $I->seeInField(self::$productPrice, $name); + } + + public function seeProductQuantity(\AcceptanceTester $I, $name) + { + $I->seeInField(self::$productQuantity, $name); + } + + public function seeProductStockStatus(\AcceptanceTester $I, $name) + { + $I->seeOptionIsSelected(self::$productStockStatus, $name); + } + + public function seeProductCategories(\AcceptanceTester $I, $name) + { + $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); + } +} diff --git a/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php new file mode 100644 index 000000000..429521696 --- /dev/null +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php @@ -0,0 +1,73 @@ +.spinner'; + public static $addNewProductButton = '#add_new_product-button'; + public static $filterClearAllButton = '.admin__data-grid-header button[data-action=grid-filter-reset]'; + public static $filterExpanded = '.admin__data-grid-filters-wrap._show'; + public static $filterExpandButton = + '.admin__data-grid-outer-wrap>.admin__data-grid-header button[data-action=grid-filter-expand]'; + public static $filterProductName = '.admin__form-field input[name=name]'; + public static $filterProductSku = '.admin__form-field input[name=sku]'; + public static $filterApplyButton = + '.admin__data-grid-filters-footer button[data-action=grid-filter-apply]'; + public static $gridNthRow = + '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s)'; + + /** + * Basic route example for your current URL + * You can append any additional parameter to URL + * and use it in tests like: Page\Edit::route('/123-post'); + */ + public static function route($param) + { + return static::$URL . $param; + } + + public function amOnAdminProductGridPage(\AcceptanceTester $I) + { + $I->amOnPage(self::$URL); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); // secs + + } + + public function goToAddNewProductPage(\AcceptanceTester $I) + { + $I->click(self::$addNewProductButton); + } + + public function searchBySku(\AcceptanceTester $I, $sku) + { + try { + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); + $I->click(self::$filterClearAllButton); + } catch (\Codeception\Exception\ElementNotFound $e) { + } + try { + $I->wait(5); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); + $I->click(self::$filterExpandButton); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); // secs + } catch (\Codeception\Exception\ElementNotFound $e) { + } + + $I->fillField(self::$filterProductSku, $sku); + $I->click(self::$filterApplyButton); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); // secs + } + + public function containsInNthRow(\AcceptanceTester $I, $n, $text) + { + return $I->see($text, sprintf(self::$gridNthRow, $n)); + } +} diff --git a/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php new file mode 100644 index 000000000..77edb739d --- /dev/null +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php @@ -0,0 +1,129 @@ +seeInCurrentUrl(static::$URL . 'new'); + $I->waitForElementNotVisible(self::$productFormLoadingSpinner, 30); // secs + } + + public function amOnAdminProductPageById(\AcceptanceTester $I, $id) + { + $I->amOnPage(self::route('edit/id/' . $id)); + $I->waitForElementNotVisible(self::$productFormLoadingSpinner, 30); // secs + } + + // Assert existing product + public function seeProductNameInPageTitle(\AcceptanceTester $I, $name) + { + $I->see($name, self::$pageTitle); + } + + public function seeProductAttributeSet(\AcceptanceTester $I, $name) + { + $I->seeOptionIsSelected(self::$producAttributeSet, $name); + } + + public function seeProductName(\AcceptanceTester $I, $name) + { + $I->seeInField(self::$productName, $name); + } + + public function seeProductSku(\AcceptanceTester $I, $name) + { + $I->seeInField(self::$productSku, $name); + } + + public function seeProductPrice(\AcceptanceTester $I, $name) + { + $I->seeInField(self::$productPrice, $name); + } + + public function seeProductQuantity(\AcceptanceTester $I, $name) + { + $I->seeInField(self::$productQuantity, $name); + } + + public function seeProductStockStatus(\AcceptanceTester $I, $name) + { + $I->seeOptionIsSelected(self::$productStockStatus, $name); + } + + public function seeProductCategories(\AcceptanceTester $I, $name) + { + $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); + } + + // Fill new product + public function fillFieldProductName(\AcceptanceTester $I, $name) + { + $I->fillField(self::$productName, $name); + } + + public function fillFieldProductSku(\AcceptanceTester $I, $name) + { + $I->fillField(self::$productSku, $name); + } + + public function fillFieldProductPrice(\AcceptanceTester $I, $name) + { + $I->fillField(self::$productPrice, $name); + } + + public function fillFieldProductQuantity(\AcceptanceTester $I, $name) + { + $I->fillField(self::$productQuantity, $name); + } + + public function selectProductStockStatus(\AcceptanceTester $I, $name) + { + $I->selectOption(self::$productStockStatus, $name); + } + + public function fillFieldProductCategories(\AcceptanceTester $I, $name) + { + $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); + } + + public function saveProduct(\AcceptanceTester $I) + { + $I->click(self::$productSaveButton); + $I->waitForElementNotVisible(self::$productSavedSpinner); + $I->waitForElementVisible(self::$productSaveSuccessMessage); + } +} diff --git a/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/ProductPage.php b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/ProductPage.php new file mode 100644 index 000000000..efefac966 --- /dev/null +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Catalog/ProductPage.php @@ -0,0 +1,28 @@ +span'; + public static $productFormLoadingSpinner = './/*[@data-component=\'product_form.product_form\']'; + public static $productName = '.page-title>span'; + public static $productSku = '."product attribute sku" div'; + public static $productPrice = '.price'; + public static $productStockStatus = '.product-info-stock-sku span'; + + /** + * Basic route example for your current URL + * You can append any additional parameter to URL + * and use it in tests like: Page\Edit::route('/123-post'); + */ + public static function route($param) + { + return static::$URL . $param; + } +} diff --git a/tests/_support/Page/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php b/tests/_support/Page/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php new file mode 100644 index 000000000..3ebc6e1e6 --- /dev/null +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php @@ -0,0 +1,42 @@ +span'; + public static $createNewAccountLink = '.action.create.primary>span'; + + /** + * Basic route example for your current URL + * You can append any additional parameter to URL + * and use it in tests like: Page\Edit::route('/123-post'); + */ + public static function route($param) + { + return static::$URL . $param; + } + + public function amOnCustomerAccountLoginPage(\AcceptanceTester $I) + { + $I->amOnPage(self::$URL); + $I->waitForElementVisible(self::$customerLoginForm, 30); + } + + public function signInWithCredentials(\AcceptanceTester $I, $email, $password) + { + $I->fillField(self::$customerEmailField, $email); + $I->fillField(self::$customerPasswordField, $password); + $I->click(self::$customerSignInButton); + } +} diff --git a/tests/_support/Page/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php b/tests/_support/Page/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php new file mode 100644 index 000000000..e6d6dae9c --- /dev/null +++ b/tests/_support/Page/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php @@ -0,0 +1,42 @@ +span'; + public static $createNewAccountLink = '.action.create.primary>span'; + + /** + * Basic route example for your current URL + * You can append any additional parameter to URL + * and use it in tests like: Page\Edit::route('/123-post'); + */ + public static function route($param) + { + return static::$URL . $param; + } + + public function amOnCustomerAccountLoginPage(\AcceptanceTester $I) + { + $I->amOnPage(self::$URL); + $I->waitForElementVisible(self::$customerLoginForm, 30); + } + + public function signInWithCredentials(\AcceptanceTester $I, $email, $password) + { + $I->fillField(self::$customerEmailField, $email); + $I->fillField(self::$customerPasswordField, $password); + $I->click(self::$customerSignInButton); + } +} diff --git a/tests/_support/Step/Acceptance/Admin.php b/tests/_support/Step/Magento/Xxyyzz/Step/Backend/Admin.php similarity index 61% rename from tests/_support/Step/Acceptance/Admin.php rename to tests/_support/Step/Magento/Xxyyzz/Step/Backend/Admin.php index 4ddd2289d..dfd4a5a0f 100644 --- a/tests/_support/Step/Acceptance/Admin.php +++ b/tests/_support/Step/Magento/Xxyyzz/Step/Backend/Admin.php @@ -1,22 +1,20 @@ amOnPage(\Page\Acceptance\AdminURLList::$adminLogin); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogin); } public function goToTheAdminLogoutPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminLogout); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogout); } public function goToRandomAdminPage() @@ -114,534 +112,537 @@ public function goToRandomAdminPage() public function goToTheAdminSalesOrdersPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesOrders); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesOrders); } public function goToTheAdminSalesInvoicesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesInvoices); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesInvoices); } public function goToTheAdminSalesShipmentsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesShipments); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesShipments); } public function goToTheAdminSalesCreditMemosPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesCreditMemos); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesCreditMemos); } public function goToTheAdminSalesBillingAgreementsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesBillingAgreements); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesBillingAgreements); } public function goToTheAdminSalesTransactionsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSalesTransactions); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesTransactions); } // Products public function goToTheAdminProductsCatalogPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminProductsCatalog); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCatalog); } public function goToTheAdminProductsCategoriesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminProductsCategories); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCategories); } // Customers public function goToTheAdminCustomersAllCustomersPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminCustomersAllCustomers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersAllCustomers); } public function goToTheAdminCustomersNowOnlinePage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminCustomersNowOnline); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnline); } // Marketing public function goToTheAdminMarketingCatalogPriceRulePage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingCatalogPriceRule); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCatalogPriceRule); } public function goToTheAdminMarketingCartPriceRulePage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingCartPriceRules); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCartPriceRules); } public function goToTheAdminMarketingEmailTemplatesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingEmailTemplates); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingEmailTemplates); } public function goToTheAdminMarketingNewsletterTemplatePage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterTemplate); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterTemplate); } public function goToTheAdminMarketingNewsletterQueuePage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterQueue); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterQueue); } public function goToTheAdminMarketingNewsletterSubscribersPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterSubscribers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterSubscribers); } public function goToTheAdminMarketingURLRewritesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingURLRewrites); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingURLRewrites); } public function goToTheAdminMarketingSearchTermsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingSearchTerms); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchTerms); } public function goToTheAdminMarketingSearchSynonymsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingSearchSynonyms); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchSynonyms); } public function goToTheAdminMarketingSiteMapPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingSiteMap); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSiteMap); } public function goToTheAdminMarketingReviewsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminMarketingReviews); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingReviews); } // Content public function goToTheAdminContentPagesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentPages); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentPages); } public function goToTheAdminContentBlocksPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentBlocks); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentBlocks); } public function goToTheAdminContentWidgetsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentWidgets); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentWidgets); } public function goToTheAdminContentConfigurationPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentConfiguration); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentConfiguration); } public function goToTheAdminContentThemesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentThemes); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentThemes); } public function goToTheAdminContentSchedulePage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminContentSchedule); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentSchedule); } // Reports public function goToTheAdminReportsProductsInCartPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsProductsInCart); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsProductsInCart); } public function goToTheAdminReportsSearchTermsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsSearchTerms); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsSearchTerms); } public function goToTheAdminReportsAbandonedCartsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsAbandonedCArts); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsAbandonedCArts); } public function goToTheAdminReportsNewsletterProblemReportsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsNewsletterProblemReports); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNewsletterProblemReports); } public function goToTheAdminReportsByCustomersPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsByCustomers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByCustomers); } public function goToTheAdminReportsByProductsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsByProducts); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByProducts); } public function goToTheAdminReportsOrdersPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsOrders); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrders); } public function goToTheAdminReportsTaxPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsTax); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsTax); } public function goToTheAdminReportsInvoicedPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsInvoiced); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsInvoiced); } public function goToTheAdminReportsShippingPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsShipping); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsShipping); } public function goToTheAdminReportsRefundsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsRefunds); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefunds); } public function goToTheAdminReportsCouponsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsCoupons); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsCoupons); } public function goToTheAdminReportsPayPalSettlementPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsPayPalSettlement); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsPayPalSettlement); } public function goToTheAdminReportsBraintreeSettlementPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsBraintreeSettlement); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBraintreeSettlement); } public function goToTheAdminReportsOrderTotalPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsOrderTotal); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderTotal); } public function goToTheAdminReportsOrderCountPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsOrderCount); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderCount); } public function goToTheAdminReportsNewPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsNew); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNew); } public function goToTheAdminReportsViewsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsViews); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsViews); } public function goToTheAdminReportsBestsellersPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsBestsellers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBestsellers); } public function goToTheAdminReportsLowStockPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsLowStock); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsLowStock); } public function goToTheAdminReportsOrderedPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsOrdered); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrdered); } public function goToTheAdminReportsDownloadsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsDownloads); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsDownloads); } public function goToTheAdminReportRefreshStatisticsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminReportsRefreshStatistics); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefreshStatistics); } // Stores public function goToTheAdminStoresAllStoresPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresAllStores); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAllStores); } public function goToTheAdminStoresConfigurationPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresConfiguration); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresConfiguration); } public function goToTheAdminStoresTermsAndConditionsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresTermsAndConditions); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTermsAndConditions); } public function goToTheAdminStoresOrderStatusPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresOrderStatus); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresOrderStatus); } public function goToTheAdminStoresTaxRulesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresTaxRules); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxRules); } public function goToTheAdminStoresTaxZonesAndRatesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresTaxZonesAndRates); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxZonesAndRates); } public function goToTheAdminStoresCurrencyRatesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresCurrencyRates); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencyRates); } public function goToTheAdminStoresCurrencySymbolsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresCurrencySymbols); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencySymbols); } public function goToTheAdminStoresProductPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresProduct); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresProduct); } public function goToTheAdminStoresAttributeSetPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresAttributeSet); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAttributeSet); } public function goToTheAdminStoresRatingPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresRating); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresRating); } public function goToTheAdminStoresCustomerGroupsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminStoresCustomerGroups); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCustomerGroups); } // System public function goToTheAdminSystemImportPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemImport); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImport); } public function goToTheAdminSystemExportPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemExport); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemExport); } public function goToTheAdminSystemImportExportTaxRatesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemImportExportTaxRates); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportExportTaxRates); } public function goToTheAdminSystemImportHistoryPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemImportHistory); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportHistory); } public function goToTheAdminSystemIntegrationsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemIntegrations); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIntegrations); } public function goToTheAdminSystemCacheManagementPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemCacheManagement); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCacheManagement); } public function goToTheAdminSystemBackupsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemBackups); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemBackups); } public function goToTheAdminSystemIndexManagementPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemIndexManagement); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIndexManagement); } public function goToTheAdminSystemWebSetupWizardPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemWebSetupWizard); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemWebSetupWizard); } public function goToTheAdminSystemAllUsersPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemAllUsers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemAllUsers); } public function goToTheAdminSystemLockedUsersPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemLockedUsers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemLockedUsers); } public function goToTheAdminSystemUserRolesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemUserRoles); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemUserRoles); } public function goToTheAdminSystemNotificationsPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemNotifications); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemNotifications); } public function goToTheAdminSystemCustomVariablesPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemCustomVariables); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCustomVariables); } public function goToTheAdminSystemManageEncryptionKeyPage() { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminSystemManageEncryptionKey); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemManageEncryptionKey); } - public function goToTheAdminFindPartnersAndExtensionsPage() { + public function goToTheAdminFindPartnersAndExtensionsPage() + { $I = $this; - $I->amOnPage(\Page\Acceptance\AdminURLList::$adminFindPartnersAndExtensions); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminFindPartnersAndExtensions); } - public function shouldBeOnTheAdminLoginPage() { + public function shouldBeOnTheAdminLoginPage() + { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminLogin); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogin); } public function shouldBeOnTheAdminDashboardPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminDashboard); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDashboard); $I->see('Dashboard', '.page-title'); } - public function shouldBeOnTheForgotYourPasswordPage() { + public function shouldBeOnTheForgotYourPasswordPage() + { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminForgotYourPassword); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminForgotYourPassword); } // Sales public function shouldBeOnTheAdminSalesOrdersPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesOrders); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesOrders); $I->see('Orders', '.page-title'); } public function shouldBeOnTheAdminSalesInvoicesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesInvoices); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesInvoices); $I->see('Invoices', '.page-title'); } public function shouldBeOnTheAdminSalesShipmentsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesShipments); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesShipments); $I->see('Shipments', '.page-title'); } public function shouldBeOnTheAdminSalesCreditMemosPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesCreditMemos); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesCreditMemos); $I->see('Credit Memos', '.page-title'); } public function shouldBeOnTheAdminSalesBillingAgreementsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesBillingAgreements); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesBillingAgreements); $I->see('Billing Agreements', '.page-title'); } public function shouldBeOnTheAdminSalesTransactionsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSalesTransactions); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesTransactions); $I->see('Transactions', '.page-title'); } @@ -649,14 +650,14 @@ public function shouldBeOnTheAdminSalesTransactionsPage() public function shouldBeOnTheAdminProductsCatalogPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminProductsCatalog); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCatalog); $I->see('Catalog', '.page-title'); } public function shouldBeOnTheAdminProductsCategoriesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminProductsCategories); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCategories); $I->see('Default Category', '.page-title'); } @@ -664,14 +665,14 @@ public function shouldBeOnTheAdminProductsCategoriesPage() public function shouldBeOnTheAdminCustomersAllCustomersPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminCustomersAllCustomers); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersAllCustomers); $I->see('Customers', '.page-title'); } public function shouldBeOnTheAdminCustomersNowOnlinePage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminCustomersNowOnline); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnline); $I->see('Customers Now Online', '.page-title'); } @@ -679,77 +680,77 @@ public function shouldBeOnTheAdminCustomersNowOnlinePage() public function shouldBeOnTheAdminMarketingCatalogPriceRulePage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingCatalogPriceRule); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCatalogPriceRule); $I->see('Catalog Price Rule', '.page-title'); } public function shouldBeOnTheAdminMarketingCartPriceRulePage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingCartPriceRules); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCartPriceRules); $I->see('Cart Price Rules', '.page-title'); } public function shouldBeOnTheAdminMarketingEmailTemplatesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingEmailTemplates); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingEmailTemplates); $I->see('Email Templates', '.page-title'); } public function shouldBeOnTheAdminMarketingNewsletterTemplatePage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterTemplate); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterTemplate); $I->see('Newsletter Templates', '.page-title'); } public function shouldBeOnTheAdminMarketingNewsletterQueuePage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterQueue); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterQueue); $I->see('Newsletter Queue', '.page-title'); } public function shouldBeOnTheAdminMarketingNewsletterSubscribersPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingNewsletterSubscribers); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterSubscribers); $I->see('Newsletter Subscribers', '.page-title'); } public function shouldBeOnTheAdminMarketingURLRewritesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingURLRewrites); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingURLRewrites); $I->see('URL Rewrites', '.page-title'); } public function shouldBeOnTheAdminMarketingSearchTermsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingSearchTerms); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchTerms); $I->see('Search Terms', '.page-title'); } public function shouldBeOnTheAdminMarketingSearchSynonymsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingSearchSynonyms); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchSynonyms); $I->see('Search Synonyms', '.page-title'); } public function shouldBeOnTheAdminMarketingSiteMapPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingSiteMap); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSiteMap); $I->see('Site Map', '.page-title'); } public function shouldBeOnTheAdminMarketingReviewsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminMarketingReviews); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingReviews); $I->see('Reviews', '.page-title'); } @@ -757,42 +758,42 @@ public function shouldBeOnTheAdminMarketingReviewsPage() public function shouldBeOnTheAdminContentPagesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentPages); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentPages); $I->see('Pages', '.page-title'); } public function shouldBeOnTheAdminContentBlocksPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentBlocks); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentBlocks); $I->see('Blocks', '.page-title'); } public function shouldBeOnTheAdminContentWidgetsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentWidgets); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentWidgets); $I->see('Widgets', '.page-title'); } public function shouldBeOnTheAdminContentConfigurationPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentConfiguration); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentConfiguration); $I->see('Design Configuration', '.page-title'); } public function shouldBeOnTheAdminContentThemesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentThemes); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentThemes); $I->see('Themes', '.page-title'); } public function shouldBeOnTheAdminContentSchedulePage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminContentSchedule); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentSchedule); $I->see('Store Design Schedule', '.page-title'); } @@ -800,161 +801,161 @@ public function shouldBeOnTheAdminContentSchedulePage() public function shouldBeOnTheAdminReportsProductsInCartPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsProductsInCart); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsProductsInCart); $I->see('Products in Carts', '.page-title'); } public function shouldBeOnTheAdminReportsSearchTermsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsSearchTerms); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsSearchTerms); $I->see('Search Terms Report', '.page-title'); } public function shouldBeOnTheAdminReportsAbandonedCartsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsAbandonedCArts); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsAbandonedCArts); $I->see('Abandoned Carts', '.page-title'); } public function shouldBeOnTheAdminReportsNewsletterProblemReportsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsNewsletterProblemReports); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNewsletterProblemReports); $I->see('Newsletter Problems Report', '.page-title'); } public function shouldBeOnTheAdminReportsByCustomersPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsByCustomers); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByCustomers); $I->see('Customer Reviews Report', '.page-title'); } public function shouldBeOnTheAdminReportsByProductsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsByProducts); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByProducts); $I->see('Product Reviews Report', '.page-title'); } public function shouldBeOnTheAdminReportsOrdersPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsOrders); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrders); $I->see('Orders Report', '.page-title'); } public function shouldBeOnTheAdminReportsTaxPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsTax); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsTax); $I->see('Tax Report', '.page-title'); } public function shouldBeOnTheAdminReportsInvoicedPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsInvoiced); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsInvoiced); $I->see('Invoice Report', '.page-title'); } public function shouldBeOnTheAdminReportsShippingPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsShipping); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsShipping); $I->see('Shipping Report', '.page-title'); } public function shouldBeOnTheAdminReportsRefundsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsRefunds); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefunds); $I->see('Refunds Report', '.page-title'); } public function shouldBeOnTheAdminReportsCouponsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsCoupons); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsCoupons); $I->see('Coupons Report', '.page-title'); } public function shouldBeOnTheAdminReportsPayPalSettlementPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsPayPalSettlement); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsPayPalSettlement); $I->see('PayPal Settlement Reports', '.page-title'); } public function shouldBeOnTheAdminReportsBraintreeSettlementPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsBraintreeSettlement); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBraintreeSettlement); $I->see('Braintree Settlement Report', '.page-title'); } public function shouldBeOnTheAdminReportsOrderTotalPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsOrderTotal); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderTotal); $I->see('Order Total Report', '.page-title'); } public function shouldBeOnTheAdminReportsOrderCountPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsOrderCount); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderCount); $I->see('Order Count Report', '.page-title'); } public function shouldBeOnTheAdminReportsNewPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsNew); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNew); $I->see('New Accounts Report', '.page-title'); } public function shouldBeOnTheAdminReportsViewsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsViews); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsViews); $I->see('Product Views Report', '.page-title'); } public function shouldBeOnTheAdminReportsBestsellersPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsBestsellers); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBestsellers); $I->see('Bestsellers Report', '.page-title'); } public function shouldBeOnTheAdminReportsLowStockPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsLowStock); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsLowStock); $I->see('Low Stock Report', '.page-title'); } public function shouldBeOnTheAdminReportsOrderedPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsOrdered); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrdered); $I->see('Ordered Products Report', '.page-title'); } public function shouldBeOnTheAdminReportsDownloadsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsDownloads); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsDownloads); $I->see('Downloads Report', '.page-title'); } public function shouldBeOnTheAdminReportRefreshStatisticsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminReportsRefreshStatistics); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefreshStatistics); $I->see('Refresh Statistics', '.page-title'); } @@ -962,84 +963,84 @@ public function shouldBeOnTheAdminReportRefreshStatisticsPage() public function shouldBeOnTheAdminStoresAllStoresPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresAllStores); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAllStores); $I->see('Stores', '.page-title'); } public function shouldBeOnTheAdminStoresConfigurationPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresConfiguration); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresConfiguration); $I->see('Configuration', '.page-title'); } public function shouldBeOnTheAdminStoresTermsAndConditionsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresTermsAndConditions); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTermsAndConditions); $I->see('Terms and Conditions', '.page-title'); } public function shouldBeOnTheAdminStoresOrderStatusPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresOrderStatus); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresOrderStatus); $I->see('Order Status', '.page-title'); } public function shouldBeOnTheAdminStoresTaxRulesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresTaxRules); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxRules); $I->see('Tax Rules', '.page-title'); } public function shouldBeOnTheAdminStoresTaxZonesAndRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresTaxZonesAndRates); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxZonesAndRates); $I->see('Tax Zones and Rates', '.page-title'); } public function shouldBeOnTheAdminStoresCurrencyRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresCurrencyRates); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencyRates); $I->see('Currency Rates', '.page-title'); } public function shouldBeOnTheAdminStoresCurrencySymbolsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresCurrencySymbols); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencySymbols); $I->see('Currency Symbols', '.page-title'); } public function shouldBeOnTheAdminStoresProductPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresProduct); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresProduct); $I->see('Product Attributes', '.page-title'); } public function shouldBeOnTheAdminStoresAttributeSetPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresAttributeSet); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAttributeSet); $I->see('Attribute Sets', '.page-title'); } public function shouldBeOnTheAdminStoresRatingPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresRating); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresRating); $I->see('Ratings', '.page-title'); } public function shouldBeOnTheAdminStoresCustomerGroupsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminStoresCustomerGroups); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCustomerGroups); $I->see('Customer Groups', '.page-title'); } @@ -1047,144 +1048,111 @@ public function shouldBeOnTheAdminStoresCustomerGroupsPage() public function shouldBeOnTheAdminSystemImportPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemImport); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImport); $I->see('Import', '.page-title'); } public function shouldBeOnTheAdminSystemExportPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemExport); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemExport); $I->see('Export', '.page-title'); } public function shouldBeOnTheAdminSystemImportExportTaxRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemImportExportTaxRates); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportExportTaxRates); $I->see('Import and Export Tax Rates', '.page-title'); } public function shouldBeOnTheAdminSystemImportHistoryPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemImportHistory); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportHistory); $I->see('Import History', '.page-title'); } public function shouldBeOnTheAdminSystemIntegrationsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemIntegrations); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIntegrations); $I->see('Integrations', '.page-title'); } public function shouldBeOnTheAdminSystemCacheManagementPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemCacheManagement); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCacheManagement); $I->see('Cache Management', '.page-title'); } public function shouldBeOnTheAdminSystemBackupsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemBackups); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemBackups); $I->see('Backups', '.page-title'); } public function shouldBeOnTheAdminSystemIndexManagementPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemIndexManagement); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIndexManagement); $I->see('Index Management', '.page-title'); } public function shouldBeOnTheAdminSystemWebSetupWizardPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemWebSetupWizard); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemWebSetupWizard); $I->see('Setup Wizard', '.page-title'); } public function shouldBeOnTheAdminSystemAllUsersPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemAllUsers); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemAllUsers); $I->see('Users', '.page-title'); } public function shouldBeOnTheAdminSystemLockedUsersPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemLockedUsers); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemLockedUsers); $I->see('Locked Users', '.page-title'); } public function shouldBeOnTheAdminSystemUserRolesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemUserRoles); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemUserRoles); $I->see('Roles', '.page-title'); } public function shouldBeOnTheAdminSystemNotificationsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemNotifications); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemNotifications); $I->see('Notifications', '.page-title'); } public function shouldBeOnTheAdminSystemCustomVariablesPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemCustomVariables); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCustomVariables); $I->see('Custom Variables', '.page-title'); } public function shouldBeOnTheAdminSystemManageEncryptionKeyPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminSystemManageEncryptionKey); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemManageEncryptionKey); $I->see('Encryption Key', '.page-title'); } public function shouldBeOnTheAdminFindPartnersAndExtensionsPage() { $I = $this; - $I->seeInCurrentUrl(\Page\Acceptance\AdminURLList::$adminFindPartnersAndExtensions); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminFindPartnersAndExtensions); $I->see('Magento Marketplace', '.page-title'); } - - public function closeAdminNotification() { - $I = $this; - - // Cheating here for the minute. Still working on the best method to deal with this issue. - $I->executeJS("jQuery('.modal-popup').remove(); jQuery('.modals-overlay').remove();"); - -// try { -// $I->waitForElementVisible('._show .action-close', 1); -// $I->click('._show .action-close'); -// $I->waitForElementNotVisible('._show .action-close', 1); -// } catch (\Exception $e) { -// return false; -// } - } - - public function loginAsTheFollowingAdmin($username, $password) { - $I = $this; - $I->fillField('login[username]', $username); - $I->fillField('login[password]', $password); - $I->click('Sign in'); - - $I->closeAdminNotification(); - } - - public function loginAsAnExistingAdmin() { - $I = $this; - $I->fillField('login[username]', 'admin'); - $I->fillField('login[password]', 'admin123'); - $I->click('Sign in'); - - $I->closeAdminNotification(); - } -} \ No newline at end of file +} diff --git a/tests/_support/Step/Api/Category.php b/tests/_support/Step/Magento/Xxyyzz/Step/Catalog/Api/Category.php similarity index 70% rename from tests/_support/Step/Api/Category.php rename to tests/_support/Step/Magento/Xxyyzz/Step/Catalog/Api/Category.php index b2495e646..a5ac973bc 100644 --- a/tests/_support/Step/Api/Category.php +++ b/tests/_support/Step/Magento/Xxyyzz/Step/Catalog/Api/Category.php @@ -1,19 +1,19 @@ amBearerAuthenticated($this->getAuthToke()); + $this->amBearerAuthenticated($this->getAdminAuthToken()); $this->haveHttpHeader('Content-Type', 'application/json'); $this->sendPOST($this->endpoint, $params); $this->seeResponseCodeIs(200); @@ -21,17 +21,17 @@ public function createCategory(array $params) } /** - * Get Magento Category Data by REST API + * Get Magento Category Data by REST API. * * @param string $id * @return string */ public function getCategory($id) { - $this->amBearerAuthenticated($this->getAuthToke()); + $this->amBearerAuthenticated($this->getAdminAuthToken()); $this->haveHttpHeader('Content-Type', 'application/json'); $this->sendGET($this->endpoint . "/$id"); $this->seeResponseCodeIs(200); return $this->grabResponse(); } -} \ No newline at end of file +} diff --git a/tests/_support/Step/Api/Product.php b/tests/_support/Step/Magento/Xxyyzz/Step/Catalog/Api/Product.php similarity index 70% rename from tests/_support/Step/Api/Product.php rename to tests/_support/Step/Magento/Xxyyzz/Step/Catalog/Api/Product.php index 9a0cb4ff5..c2e7d9ea5 100644 --- a/tests/_support/Step/Api/Product.php +++ b/tests/_support/Step/Magento/Xxyyzz/Step/Catalog/Api/Product.php @@ -1,19 +1,19 @@ amBearerAuthenticated($this->getAuthToke()); + $this->amBearerAuthenticated($this->getAdminAuthToken()); $this->haveHttpHeader('Content-Type', 'application/json'); $this->sendPOST($this->endpoint, $params); $this->seeResponseCodeIs(200); @@ -21,17 +21,17 @@ public function createProduct(array $params) } /** - * Get Magento Product Data by REST API + * Get Magento Product Data by REST API. * * @param string $sku * @return string */ public function getProduct($sku) { - $this->amBearerAuthenticated($this->getAuthToke()); + $this->amBearerAuthenticated($this->getAdminAuthToken()); $this->haveHttpHeader('Content-Type', 'application/json'); $this->sendGET($this->endpoint . "/$sku"); $this->seeResponseCodeIs(200); return $this->grabDataFromResponseByJsonPath('$..*'); } -} \ No newline at end of file +} diff --git a/tests/_support/Step/Api/Customer.php b/tests/_support/Step/Magento/Xxyyzz/Step/Customer/Api/Customer.php similarity index 67% rename from tests/_support/Step/Api/Customer.php rename to tests/_support/Step/Magento/Xxyyzz/Step/Customer/Api/Customer.php index 83a19d5d5..c4644a47a 100644 --- a/tests/_support/Step/Api/Customer.php +++ b/tests/_support/Step/Magento/Xxyyzz/Step/Customer/Api/Customer.php @@ -1,22 +1,22 @@ amBearerAuthenticated($this->getAuthToke()); + $this->amBearerAuthenticated($this->getAdminAuthToken()); $this->haveHttpHeader('Content-Type', 'application/json'); $this->sendPOST($this->endpoint, $params); $this->seeResponseCodeIs(200); return $this->grabDataFromResponseByJsonPath('$.id')[0]; } -} \ No newline at end of file +} diff --git a/tests/acceptance.suite.dist.yml b/tests/acceptance.suite.dist.yml new file mode 100644 index 000000000..78b740a42 --- /dev/null +++ b/tests/acceptance.suite.dist.yml @@ -0,0 +1,28 @@ +# Codeception Test Suite Configuration +# +# Suite for acceptance tests. +# Perform tests in browser using the WebDriver or PhpBrowser. +# If you need both WebDriver and PHPBrowser tests - create a separate suite. + +class_name: AcceptanceTester +modules: + enabled: + - WebDriver + - \Magento\Xxyyzz\Helper\Acceptance + - \Magento\Xxyyzz\Helper\AdminUiHelper + - \Magento\Xxyyzz\Helper\WebapiHelper + - REST: + url: http://magento.loc/index.php/rest/default/V1/ + depends: PhpBrowser + part: Json + - Sequence + config: + WebDriver: + url: http://magento.loc/index.php + browser: chrome + window_size: maximize +data: + magento: + url: http://magento.loc/index.php + admin_username: admin + admin_password: 123123q \ No newline at end of file diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml deleted file mode 100644 index 21650bdc5..000000000 --- a/tests/acceptance.suite.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Codeception Test Suite Configuration -# -# Suite for acceptance tests. -# Perform tests in browser using the WebDriver or PhpBrowser. -# If you need both WebDriver and PHPBrowser tests - create a separate suite. - -class_name: AcceptanceTester -modules: - enabled: - - WebDriver - - \Helper\Acceptance - config: - WebDriver: - url: 'http://127.0.0.1:32769' - browser: chrome - window_size: maximize \ No newline at end of file diff --git a/tests/acceptance/examples/ExampleCept.php b/tests/acceptance/Magento/SampleTests/ExampleCept.php similarity index 99% rename from tests/acceptance/examples/ExampleCept.php rename to tests/acceptance/Magento/SampleTests/ExampleCept.php index 2aa5d39c3..be188f626 100644 --- a/tests/acceptance/examples/ExampleCept.php +++ b/tests/acceptance/Magento/SampleTests/ExampleCept.php @@ -1,4 +1,5 @@ wantTo('perform actions and see result'); diff --git a/tests/acceptance/examples/ExampleCest.php b/tests/acceptance/Magento/SampleTests/ExampleCest.php similarity index 100% rename from tests/acceptance/examples/ExampleCest.php rename to tests/acceptance/Magento/SampleTests/ExampleCest.php diff --git a/tests/acceptance/examples/TestCest.php b/tests/acceptance/Magento/SampleTests/TestCest.php similarity index 64% rename from tests/acceptance/examples/TestCest.php rename to tests/acceptance/Magento/SampleTests/TestCest.php index 6d353d33a..eea4f2450 100644 --- a/tests/acceptance/examples/TestCest.php +++ b/tests/acceptance/Magento/SampleTests/TestCest.php @@ -1,14 +1,16 @@ goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); + $I->loginAsAdmin(); } /** @@ -16,7 +18,7 @@ public function _before(\Step\Acceptance\Admin $I) * @env chrome * @group example */ - public function accessTheSalesOrdersPage(\Step\Acceptance\Admin $I) + public function accessTheSalesOrdersPage(Admin $I) { $I->goToTheAdminSalesOrdersPage(); $I->shouldBeOnTheAdminSalesOrdersPage(); @@ -27,7 +29,7 @@ public function accessTheSalesOrdersPage(\Step\Acceptance\Admin $I) * @env chrome * @group example */ - public function accessTheProductsCatalogPage(\Step\Acceptance\Admin $I) + public function accessTheProductsCatalogPage(Admin $I) { $I->goToTheAdminProductsCatalogPage(); $I->shouldBeOnTheAdminProductsCatalogPage(); diff --git a/tests/acceptance/examples/TestStepObjectCept.php b/tests/acceptance/Magento/SampleTests/TestStepObjectCept.php similarity index 55% rename from tests/acceptance/examples/TestStepObjectCept.php rename to tests/acceptance/Magento/SampleTests/TestStepObjectCept.php index 96a34fcaf..ca64ac5c7 100644 --- a/tests/acceptance/examples/TestStepObjectCept.php +++ b/tests/acceptance/Magento/SampleTests/TestStepObjectCept.php @@ -1,8 +1,7 @@ wantTo('demo the usage of StepObject in Cept'); $I->goToTheAdminLoginPage(); -$I->loginAsAnExistingAdmin(); \ No newline at end of file +$I->loginAsAdmin(); \ No newline at end of file diff --git a/tests/acceptance/examples/TestStepObjectCest.php b/tests/acceptance/Magento/SampleTests/TestStepObjectCest.php similarity index 85% rename from tests/acceptance/examples/TestStepObjectCest.php rename to tests/acceptance/Magento/SampleTests/TestStepObjectCest.php index e5b74d423..9919fa990 100644 --- a/tests/acceptance/examples/TestStepObjectCest.php +++ b/tests/acceptance/Magento/SampleTests/TestStepObjectCest.php @@ -1,5 +1,6 @@ wantTo('demo the usage of StepObject in Cest'); $I->goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); + $I->loginAsAdmin(); } } \ No newline at end of file diff --git a/tests/acceptance/adminAccess/AccessAdminPagesDirectlyCest.php b/tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesDirectlyCest.php similarity index 97% rename from tests/acceptance/adminAccess/AccessAdminPagesDirectlyCest.php rename to tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesDirectlyCest.php index f8206bb73..fdc6acd6d 100644 --- a/tests/acceptance/adminAccess/AccessAdminPagesDirectlyCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesDirectlyCest.php @@ -1,14 +1,17 @@ goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); + $I->loginAsAdmin(); } /** @@ -17,7 +20,7 @@ public function _before(\Step\Acceptance\Admin $I) * @env phantomjs * @group slow */ - public function shouldBeAbleToAccessEachAdminPageDirectly(\Step\Acceptance\Admin $I) + public function shouldBeAbleToAccessEachAdminPageDirectly(Admin $I) { $I->goToTheAdminSalesOrdersPage(); $I->shouldBeOnTheAdminSalesOrdersPage(); diff --git a/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesViaNavMenuCest.php similarity index 92% rename from tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php rename to tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesViaNavMenuCest.php index a12abf07f..cc9b98e47 100644 --- a/tests/acceptance/sideNavigation/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesViaNavMenuCest.php @@ -1,16 +1,18 @@ goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); + $I->loginAsAdmin(); } // Dashboard Menu Test @@ -19,7 +21,7 @@ public function _before(\Step\Acceptance\Admin $I) * @env firefox * @group slow */ - public function shouldLandOnTheDashboardPage(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnTheDashboardPage(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the DASHBOARD Page using the Side Nav Menus'); $I->goToRandomAdminPage(); @@ -33,7 +35,7 @@ public function shouldLandOnTheDashboardPage(\Step\Acceptance\Admin $I, SideNav * @env firefox * @group slow */ - public function shouldLandOnEachOfTheSalesPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheSalesPages(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the SALES Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnSalesInTheSideNavMenu($I); @@ -67,7 +69,7 @@ public function shouldLandOnEachOfTheSalesPages(\Step\Acceptance\Admin $I, SideN * @env firefox * @group slow */ - public function shouldLandOnEachOfTheProductsPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheProductsPages(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the PRODUCTS Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnProductsInTheSideNavMenu($I); @@ -85,7 +87,7 @@ public function shouldLandOnEachOfTheProductsPages(\Step\Acceptance\Admin $I, Si * @env firefox * @group slow */ - public function shouldLanOnEachOfTheCustomersPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLanOnEachOfTheCustomersPages(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the CUSTOMERS Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnCustomersInTheSideNavMenu($I); @@ -103,7 +105,7 @@ public function shouldLanOnEachOfTheCustomersPages(\Step\Acceptance\Admin $I, Si * @env firefox * @group slow */ - public function shouldLandOnEachOfTheMarketingPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheMarketingPages(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the MARKETING Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); @@ -157,7 +159,7 @@ public function shouldLandOnEachOfTheMarketingPages(\Step\Acceptance\Admin $I, S * @env firefox * @group slow */ - public function shouldLandOnEachOfTheContentPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheContentPages(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the CONTENT Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnContentInTheSideNavMenu($I); @@ -191,7 +193,7 @@ public function shouldLandOnEachOfTheContentPages(\Step\Acceptance\Admin $I, Sid * @env firefox * @group slow */ - public function shouldLandOnEachOfTheReportsPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheReportsPages(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the REPORTS Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnReportsInTheSideNavMenu($I); @@ -293,7 +295,7 @@ public function shouldLandOnEachOfTheReportsPages(\Step\Acceptance\Admin $I, Sid * @env firefox * @group slow */ - public function shouldLandOnEachOfTheStoresPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheStoresPages(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the STORES Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnStoresInTheSideNavMenu($I); @@ -351,7 +353,7 @@ public function shouldLandOnEachOfTheStoresPages(\Step\Acceptance\Admin $I, Side * @env firefox * @group slow */ - public function shouldLandOnEachOfTheSystemPages(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheSystemPages(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the SYSTEM Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnSystemInTheSideNavMenu($I); @@ -416,7 +418,7 @@ public function shouldLandOnEachOfTheSystemPages(\Step\Acceptance\Admin $I, Side * @env firefox * @group slow */ - public function shouldLandOnTheWebSetupWizardPage(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnTheWebSetupWizardPage(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the Web Setup Wizard Admin Page using the Side Nav Menu'); $sideNavMenu->clickOnSystemInTheSideNavMenu($I); @@ -430,11 +432,10 @@ public function shouldLandOnTheWebSetupWizardPage(\Step\Acceptance\Admin $I, Sid * @env firefox * @group slow */ - public function shouldLandOnThePartnersAndExtensionsPage(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldLandOnThePartnersAndExtensionsPage(Admin $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the Partners and Extensions Admin Page using the Side Nav Menu'); $sideNavMenu->clickOnFindPartnersAndExtensionsInTheSideNavMenu($I); $I->shouldBeOnTheAdminFindPartnersAndExtensionsPage(); } - } diff --git a/tests/acceptance/sideNavigation/OpenEachSideNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Backend/OpenEachSideNavMenuCest.php similarity index 79% rename from tests/acceptance/sideNavigation/OpenEachSideNavMenuCest.php rename to tests/acceptance/Magento/Xxyyzz/Backend/OpenEachSideNavMenuCest.php index f9d17c4ce..9700f7f7b 100644 --- a/tests/acceptance/sideNavigation/OpenEachSideNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Backend/OpenEachSideNavMenuCest.php @@ -1,16 +1,18 @@ goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); + $I->loginAsAdmin(); } /** @@ -18,7 +20,7 @@ public function _before(\Step\Acceptance\Admin $I) * @env firefox * @group slow */ - public function shouldBeAbleToOpenEachSideNavMenu(\Step\Acceptance\Admin $I, SideNav $sideNavMenu) + public function shouldBeAbleToOpenEachSideNavMenu(Admin $I, SideNav $sideNavMenu) { $sideNavMenu->clickOnSalesInTheSideNavMenu($I); $sideNavMenu->shouldSeeTheSalesNavMenu($I); diff --git a/tests/acceptance/Magento/Xxyyzz/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Catalog/CreateCategoryCest.php new file mode 100644 index 000000000..ad1f86382 --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Catalog/CreateCategoryCest.php @@ -0,0 +1,71 @@ +goToTheAdminLoginPage(); + $I->loginAsAdmin(); + } + + public function _after(Admin $I) + { + $I->goToTheAdminLogoutPage(); + } + + /** + * Create sub category in admin. + * + * Allure annotations + * @Description("Method Description: Create sub category with required fields") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") + * @Parameter(name = "DataHelper", value = "$dataHelper") + * + * Codeception annotations + * @group catalog + * @env chrome + * @env firefox + * @env phantomjs + * + * @param Admin $I + * @param AdminCategoryPage $adminCategoryPage + * @param DataHelper $dataHelper + * @return void + */ + public function createCategoryTest( + Admin $I, + AdminCategoryPage $adminCategoryPage, + DataHelper $dataHelper + ) { + $I->wantTo('verify category creation in admin'); + $category = $dataHelper->getCategoryData(); + $adminCategoryPage->amOnAdminCategoryPage($I); + $adminCategoryPage->addSubCategory($I); + $adminCategoryPage->fillFieldCategoryName($I, $category['name']); + $adminCategoryPage->fillFieldCategoryUrlKey($I, $category['custom_attributes'][0]['value']); + $adminCategoryPage->saveCategory($I); + $I->seeElement(AdminCategoryPage::$catagorySaveSuccessMessage); + } +} diff --git a/tests/acceptance/Magento/Xxyyzz/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Catalog/CreateSimpleProductCest.php new file mode 100644 index 000000000..914d56531 --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Catalog/CreateSimpleProductCest.php @@ -0,0 +1,81 @@ +goToTheAdminLoginPage(); + $I->loginAsAdmin(); + } + + public function _after(Admin $I) + { + $I->goToTheAdminLogoutPage(); + } + + /** + * Create simple product in admin. + * + * Allure annotations + * @Description("Method Description: Create simple product with required fields") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") + * @Parameter(name = "AdminProductPage", value = "$adminProductPage") + * + * Codeception annotations + * @group catalog + * @env chrome + * @env firefox + * @env phantomjs + * + * @param Admin $I + * @param AdminProductGridPage $adminProductGridPage + * @param AdminProductPage $adminProductPage + * @param DataHelper $dataHelper + * @return void + */ + public function createSimpleProductTest( + Admin $I, + AdminProductGridPage $adminProductGridPage, + AdminProductPage $adminProductPage, + DataHelper $dataHelper + ) { + $I->wantTo('verify simple product creation in admin'); + $product = $dataHelper->getSimpleProductData(); + $adminProductGridPage->amOnAdminProductGridPage($I); + $adminProductGridPage->goToAddNewProductPage($I); + $adminProductPage->amOnAdminNewProductPage($I); + + $adminProductPage->fillFieldProductName($I, $product['name']); + $adminProductPage->fillFieldProductSku($I, $product['sku']); + $adminProductPage->fillFieldProductPrice($I, $product['price']); + $adminProductPage->fillFieldProductQuantity($I, $product['extension_attributes']['stock_item']['qty']); + $adminProductPage->selectProductStockStatus( + $I, + $product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' + ); + $adminProductPage->saveProduct($I); + $I->seeElement(AdminProductPage::$productSaveSuccessMessage); + } +} diff --git a/tests/acceptance/Magento/Xxyyzz/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Catalog/UpdateSimpleProductCest.php new file mode 100644 index 000000000..ba55c8447 --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Catalog/UpdateSimpleProductCest.php @@ -0,0 +1,119 @@ +admin = new Admin($scenario); + $I = $this->admin; + $I->goToTheAdminLoginPage(); + $I->loginAsAdmin(); + $this->product = $dataHelper->getSimpleProductData(); + $apiHandler = new Product($scenario); + $this->product = array_merge($this->product, ['id' => $apiHandler->createProduct(['product' => $this->product])]); + } + + public function _after() + { + $I = $this->admin; + $I->goToTheAdminLogoutPage(); + } + + /** + * Update simple product in admin. + * + * Allure annotations + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") + * @Parameter(name = "AdminProductPage", value = "$adminProductPage") + * + * Codeception annotations + * @group catalog + * @env chrome + * @env firefox + * @env phantomjs + * + * @param Admin $I + * @param AdminProductGridPage $adminProductGridPage + * @param AdminProductPage $adminProductPage + * @return void + */ + public function updateSimpleProductTest( + Admin $I, + AdminProductGridPage $adminProductGridPage, + AdminProductPage $adminProductPage + ) { + $I->wantTo('verify product updated in admin'); + $adminProductGridPage->amOnAdminProductGridPage($I); + //$adminProductGridPage->searchBySku($I, $this->product['sku']); + $I->wantTo('verify product created visible in product form in admin'); + $adminProductPage->amOnAdminProductPageById($I, $this->product['id']); + $adminProductPage->seeProductNameInPageTitle($I, $this->product['name']); + $adminProductPage->seeProductAttributeSet($I, 'Default'); + $adminProductPage->seeProductName($I, $this->product['name']); + $adminProductPage->seeProductSku($I, $this->product['sku']); + $adminProductPage->seeProductPrice($I, $this->product['price']); + $adminProductPage->seeProductQuantity($I, $this->product['extension_attributes']['stock_item']['qty']); + $adminProductPage->seeProductStockStatus( + $I, + $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' + ); + $I->wantTo('verify product updated in admin'); + $adminProductPage->fillFieldProductName($I, $this->product['name'] . '-updated'); + $adminProductPage->fillFieldProductSku($I, $this->product['sku'] . '-updated'); + $adminProductPage->fillFieldProductPrice($I, $this->product['price']+10); + $adminProductPage->fillFieldProductQuantity($I, $this->product['extension_attributes']['stock_item']['qty']+100); + $adminProductPage->saveProduct($I); + $I->wantTo('verify product created visible in product form in admin'); + $adminProductPage->amOnAdminProductPageById($I, $this->product['id']); + $adminProductPage->seeProductNameInPageTitle($I, $this->product['name']); + $adminProductPage->seeProductAttributeSet($I, 'Default'); + $adminProductPage->seeProductName($I, $this->product['name']); + $adminProductPage->seeProductSku($I, $this->product['sku']); + $adminProductPage->seeProductPrice($I, $this->product['price']); + $adminProductPage->seeProductQuantity($I, $this->product['extension_attributes']['stock_item']['qty']); + $adminProductPage->seeProductStockStatus( + $I, + $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' + ); + } +} diff --git a/tests/acceptance/login/AccessAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/User/AccessAdminLoginPageCest.php similarity index 72% rename from tests/acceptance/login/AccessAdminLoginPageCest.php rename to tests/acceptance/Magento/Xxyyzz/User/AccessAdminLoginPageCest.php index 98c337034..59a5b1947 100644 --- a/tests/acceptance/login/AccessAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/User/AccessAdminLoginPageCest.php @@ -1,4 +1,7 @@ am('an Admin'); $I->wantTo('verify that I can access the Admin Login page'); diff --git a/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php b/tests/acceptance/Magento/Xxyyzz/User/AccessForgotYourPasswordCest.php similarity index 86% rename from tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php rename to tests/acceptance/Magento/Xxyyzz/User/AccessForgotYourPasswordCest.php index bfc45a0e6..e7ad72dec 100644 --- a/tests/acceptance/forgotPassword/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/Magento/Xxyyzz/User/AccessForgotYourPasswordCest.php @@ -1,6 +1,8 @@ goToTheAdminLoginPage(); } @@ -29,7 +31,7 @@ public function _before(\Step\Acceptance\Admin $I) * @Severity("critical") * @Parameter("My Param") */ - public function shouldLandOnTheForgotYourPasswordPage(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) + public function shouldLandOnTheForgotYourPasswordPage(Admin $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Forgot Your Password page'); $adminLogin->clickOnForgotYourPassword($I); @@ -45,7 +47,7 @@ public function shouldLandOnTheForgotYourPasswordPage(\Step\Acceptance\Admin $I, * @Title("You should land on the Login page after clicking on 'Back to Sign In'.") * @Severity("trivial") */ - public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) + public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(Admin $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Login page from the Forgot Your Password page'); $adminLogin->clickOnForgotYourPassword($I); @@ -60,7 +62,7 @@ public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(\Step\Acceptan * @Title("You should land on the Login page after clicking on the Logo.") * @Severity("normal") */ - public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(\Step\Acceptance\Admin $I, AdminLogin $adminLogin) + public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(Admin $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Login page by clicking on the Logo'); $adminLogin->clickOnMagentoLogo($I); diff --git a/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCest.php b/tests/acceptance/Magento/Xxyyzz/User/CannotAccessAdminAfterLoggingOutCest.php similarity index 75% rename from tests/acceptance/login/CannotAccessAdminAfterLoggingOutCest.php rename to tests/acceptance/Magento/Xxyyzz/User/CannotAccessAdminAfterLoggingOutCest.php index 869556520..313801579 100644 --- a/tests/acceptance/login/CannotAccessAdminAfterLoggingOutCest.php +++ b/tests/acceptance/Magento/Xxyyzz/User/CannotAccessAdminAfterLoggingOutCest.php @@ -1,4 +1,7 @@ wantTo('make sure you cannot access Admin pages after logging out'); $I->goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); + $I->loginAsAdmin(); $I->goToTheAdminLogoutPage(); $I->goToRandomAdminPage(); diff --git a/tests/acceptance/login/CannotAccessAdminPagesCest.php b/tests/acceptance/Magento/Xxyyzz/User/CannotAccessAdminPagesCest.php similarity index 88% rename from tests/acceptance/login/CannotAccessAdminPagesCest.php rename to tests/acceptance/Magento/Xxyyzz/User/CannotAccessAdminPagesCest.php index ec7ecea69..aa94ab11b 100644 --- a/tests/acceptance/login/CannotAccessAdminPagesCest.php +++ b/tests/acceptance/Magento/Xxyyzz/User/CannotAccessAdminPagesCest.php @@ -1,4 +1,7 @@ wantTo('make sure you cannot access Admin pages when NOT logged in'); $I->goToTheAdminLoginPage(); diff --git a/tests/acceptance/login/LoginOnAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/User/LoginOnAdminLoginPageCest.php similarity index 64% rename from tests/acceptance/login/LoginOnAdminLoginPageCest.php rename to tests/acceptance/Magento/Xxyyzz/User/LoginOnAdminLoginPageCest.php index e7d694735..1573d778e 100644 --- a/tests/acceptance/login/LoginOnAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/User/LoginOnAdminLoginPageCest.php @@ -1,4 +1,7 @@ wantTo('verify that I can login via the Admin Login page'); $I->goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); + $I->loginAsAdmin(); $I->shouldBeOnTheAdminDashboardPage(); } } diff --git a/tests/acceptance/login/LogoutAfterLoginCest.php b/tests/acceptance/Magento/Xxyyzz/User/LogoutAfterLoginCest.php similarity index 66% rename from tests/acceptance/login/LogoutAfterLoginCest.php rename to tests/acceptance/Magento/Xxyyzz/User/LogoutAfterLoginCest.php index 76eac6bf5..35b0c1b63 100644 --- a/tests/acceptance/login/LogoutAfterLoginCest.php +++ b/tests/acceptance/Magento/Xxyyzz/User/LogoutAfterLoginCest.php @@ -1,4 +1,7 @@ wantTo('logout of the Admin area and land on the Login page'); $I->goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); + $I->loginAsAdmin(); $I->goToTheAdminLogoutPage(); $I->shouldBeOnTheAdminLoginPage(); } diff --git a/tests/api.suite.yml b/tests/api.suite.yml deleted file mode 100644 index cfdd0645c..000000000 --- a/tests/api.suite.yml +++ /dev/null @@ -1,35 +0,0 @@ -class_name: ApiTester -modules: - enabled: - - REST: - url: http://magento2.loc/index.php/rest/default/V1/ - depends: PhpBrowser - part: Json - - Sequence - - WebDriver - - \Helper\Acceptance - config: - WebDriver: - url: 'http://magento2.loc/index.php' - browser: chrome - window_size: maximize - -env: - firefox: - modules: - config: - WebDriver: - browser: firefox - window_size: maximize - chrome: - modules: - config: - WebDriver: - browser: 'chrome' - window_size: maximize - phantomjs: - modules: - config: - WebDriver: - browser: 'phantomjs' - window_size: 1920x1080 \ No newline at end of file diff --git a/tests/api/ApiAndUiExampleCest.php b/tests/api/ApiAndUiExampleCest.php deleted file mode 100644 index 27871503d..000000000 --- a/tests/api/ApiAndUiExampleCest.php +++ /dev/null @@ -1,175 +0,0 @@ -getCategoryData(); - $this->categoryName = $categoryData['name']; - $this->categoryId = $I->createCategory(['category' => $categoryData]); - - $I = new Product($scenario); - $productData = $this->getSimpleProductData(); - $this->productName = $productData['name']; - $this->productId = $I->createProduct(['product' => $productData]); - - $I = new Customer($scenario); - $this->customerId = $I->createCustomer($this->getCustomerDataWithPassword()); - - $I = new Admin($scenario); - $I->goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); - } - - public function _after(Scenario $scenario) - { - $I = new Admin($scenario); - $I->goToTheAdminLogoutPage(); - } - - /** - * Test Category Visible in Backend. - * - * @param Scenario $scenario - * @param AdminCategoryPage $adminCategoryPage - * @return void - */ - public function CheckCategoryInAdminTest(Scenario $scenario, AdminCategoryPage $adminCategoryPage) - { - $I = new Admin($scenario); - $I->wantTo('verify category created visible in admin'); - $adminCategoryPage->amOnAdminCategoryPageById($I, $this->categoryId); - $adminCategoryPage->seeCategoryNameInPageTitle($I, $this->categoryName); - } - - /** - * Test Product Visible in Backend. - * - * @param Scenario $scenario - * @param AdminProductEditPage $adminProductEditPage - * @return void - */ - public function checkProductBackendTest(Scenario $scenario, AdminProductEditPage $adminProductEditPage) - { - $I = new Admin($scenario); - $I->wantTo('verify product created visible in admin'); - $adminProductEditPage->amOnAdminProductPageById($I, $this->productId); - $adminProductEditPage->seeProductNameInPageTitle($I, $this->productName); - } - - /** - * Get Category Data. - * - * @param array $categoryData - * @return array - */ - protected function getCategoryData($categoryData = []) - { - $sq = sq(1); - return [ - 'parent_id' => '2', - 'name' => isset($categoryData['name']) - ? $categoryData['name'] : 'category'.$sq, - 'is_active' => '1', - 'include_in_menu' => '1', - 'available_sort_by' => ['position', 'name'], - 'custom_attributes' => [ - ['attribute_code' => 'url_key', 'value' => 'category'.$sq], - ['attribute_code' => 'description', 'value' => 'Custom description'], - ['attribute_code' => 'meta_title', 'value' => ''], - ['attribute_code' => 'meta_keywords', 'value' => ''], - ['attribute_code' => 'meta_description', 'value' => ''], - ['attribute_code' => 'display_mode', 'value' => 'PRODUCTS'], - ['attribute_code' => 'landing_page', 'value' => ''], - ['attribute_code' => 'is_anchor', 'value' => '0'], - ['attribute_code' => 'custom_use_parent_settings', 'value' => '0'], - ['attribute_code' => 'custom_apply_to_products', 'value' => '0'], - ['attribute_code' => 'custom_design', 'value' => ''], - ['attribute_code' => 'custom_design_from', 'value' => ''], - ['attribute_code' => 'custom_design_to', 'value' => ''], - ['attribute_code' => 'page_layout', 'value' => ''], - ] - ]; - } - - /** - * Get Simple Product Data. - * - * @param array $productData - * @return array - */ - protected function getSimpleProductData($productData = []) - { - $sq = sq(1); - return [ - 'sku' => isset($productData['sku']) - ? $productData['sku'] : 'sku'.$sq, - 'name' => isset($productData['name']) - ? $productData['name'] : 'sku'.$sq, - 'visibility' => 4, - 'type_id' => 'simple', - 'price' => 17.71, - 'status' => 1, - 'attribute_set_id' => 4, - 'custom_attributes' => [ - ['attribute_code' => 'url_key', 'value' => 'sku'.$sq], - ['attribute_code' => 'cost', 'value' => ''], - ['attribute_code' => 'description', 'value' => 'Description'], - ['attribute_code' => 'category_ids', 'value' => $this->categoryId], - ] - ]; - } - - /** - * Get Customer Data. - * - * @param array $additional - * @return array - */ - protected function getCustomerData(array $additional = []) - { - $sq = sq(1); - $customerData = [ - 'firstname' => 'firstname'.$sq, - 'lastname' => 'lastname'.$sq, - 'email' => 'email'.$sq.'@example.com', - 'gender' => rand(0, 1), - 'group_id' => 1, - 'middlename' => 'middlename'.$sq, - 'store_id' => 1, - 'website_id' => 1, - 'custom_attributes' => [ - [ - 'attribute_code' => 'disable_auto_group_change', - 'value' => '0', - ], - ], - ]; - return array_merge($customerData, $additional); - } - - /** - * Get Customer Data Including Password. - * - * @param string $password - * @return array - */ - protected function getCustomerDataWithPassword($password = '') - { - return ['customer' => $this->getCustomerData(), 'password' => ($password !== '') ? $password : '123123qW']; - } -} diff --git a/tests/api/_bootstrap.php b/tests/api/_bootstrap.php deleted file mode 100644 index 8a8855580..000000000 --- a/tests/api/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ - Date: Wed, 29 Mar 2017 17:40:52 -0500 Subject: [PATCH 020/149] - Changed namespace and directory structure and added autoload configuration in composer. --- .gitignore | 2 +- composer.json | 5 +++++ tests/_bootstrap.php | 6 +++--- tests/_support/{ => Magento/Xxyyzz}/AcceptanceTester.php | 1 + .../{Helper => }/Magento/Xxyyzz/Helper/Acceptance.php | 0 .../{Helper => }/Magento/Xxyyzz/Helper/AdminUiHelper.php | 0 .../{Helper => }/Magento/Xxyyzz/Helper/AdminUrlList.php | 0 .../{Helper => }/Magento/Xxyyzz/Helper/DataHelper.php | 0 .../{Helper => }/Magento/Xxyyzz/Helper/WebapiHelper.php | 0 .../Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php | 0 .../Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php | 0 .../Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php | 0 .../Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php | 0 .../Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php | 0 .../Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php | 0 .../{Page => }/Magento/Xxyyzz/Page/Catalog/ProductPage.php | 0 .../Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php | 0 .../Xxyyzz/Page/Customer/CustomerAccountLoginPage.php | 0 .../{Step => }/Magento/Xxyyzz/Step/Backend/Admin.php | 2 +- .../{Step => }/Magento/Xxyyzz/Step/Catalog/Api/Category.php | 0 .../{Step => }/Magento/Xxyyzz/Step/Catalog/Api/Product.php | 0 .../Magento/Xxyyzz/Step/Customer/Api/Customer.php | 0 22 files changed, 11 insertions(+), 5 deletions(-) rename tests/_support/{ => Magento/Xxyyzz}/AcceptanceTester.php (99%) rename tests/_support/{Helper => }/Magento/Xxyyzz/Helper/Acceptance.php (100%) rename tests/_support/{Helper => }/Magento/Xxyyzz/Helper/AdminUiHelper.php (100%) rename tests/_support/{Helper => }/Magento/Xxyyzz/Helper/AdminUrlList.php (100%) rename tests/_support/{Helper => }/Magento/Xxyyzz/Helper/DataHelper.php (100%) rename tests/_support/{Helper => }/Magento/Xxyyzz/Helper/WebapiHelper.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Catalog/ProductPage.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php (100%) rename tests/_support/{Page => }/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php (100%) rename tests/_support/{Step => }/Magento/Xxyyzz/Step/Backend/Admin.php (99%) rename tests/_support/{Step => }/Magento/Xxyyzz/Step/Catalog/Api/Category.php (100%) rename tests/_support/{Step => }/Magento/Xxyyzz/Step/Catalog/Api/Product.php (100%) rename tests/_support/{Step => }/Magento/Xxyyzz/Step/Customer/Api/Customer.php (100%) diff --git a/.gitignore b/.gitignore index 81db1dc1d..30b870857 100755 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,6 @@ composer.lock vendor/* tests/_output/* allure-report/* -/tests/_support/_generated/ +/tests/_support/Magento/Xxyyzz/_generated/ codeception.yml tests/acceptance.suite.yml diff --git a/composer.json b/composer.json index 6dafc6cad..66eaea7c2 100755 --- a/composer.json +++ b/composer.json @@ -12,6 +12,11 @@ "autoload": { "psr-0": { "Yandex": "vendor/allure-framework/allure-codeception/src/" + }, + "psr-4": { + "Magento\\Xxyyzz\\Helper\\": "tests/_support/Magento/Xxyyzz/Helper", + "Magento\\Xxyyzz\\Page\\": "tests/_support/Magento/Xxyyzz/Page", + "Magento\\Xxyyzz\\Step\\": "tests/_support/Magento/Xxyyzz/Step" } } } \ No newline at end of file diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index 61273dc3c..cc5a6869b 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -1,6 +1,6 @@ Date: Wed, 29 Mar 2017 17:46:18 -0500 Subject: [PATCH 021/149] - Changed namespace and directory structure and added autoload configuration in composer. --- codeception.dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codeception.dist.yml b/codeception.dist.yml index 614152225..4aabf32e6 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -3,7 +3,7 @@ paths: tests: tests log: tests/_output data: tests/_data - support: tests/_support + support: tests/_support/Magento/Xxyyzz envs: tests/_envs settings: bootstrap: _bootstrap.php From 974f362e18dc4f931d140ea3adf2a9f98fc47b98 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 30 Mar 2017 16:58:25 -0500 Subject: [PATCH 022/149] MTA-4133: Fixed root level AcceptanceTester namespace issue. --- composer.json | 5 +- tests/_bootstrap.php | 6 +- .../Magento/Xxyyzz/AcceptanceTester.php | 1 + .../Xxyyzz/Page/Backend/Admin/AdminLogin.php | 50 ++-- .../Page/Backend/Admin/SideNavigation.php | 216 +++++++++--------- .../Page/Catalog/Admin/AdminCategoryPage.php | 18 +- .../Catalog/Admin/AdminProductEditPage.php | 20 +- .../Catalog/Admin/AdminProductGridPage.php | 10 +- .../Page/Catalog/Admin/AdminProductPage.php | 36 +-- .../Customer/CustomerAccountDashboardPage.php | 6 +- .../Customer/CustomerAccountLoginPage.php | 6 +- .../Magento/Xxyyzz/Step/Backend/Admin.php | 2 +- .../Xxyyzz/Step/Catalog/Api/Category.php | 2 +- .../Xxyyzz/Step/Catalog/Api/Product.php | 2 +- .../Xxyyzz/Step/Customer/Api/Customer.php | 2 +- tests/acceptance.suite.dist.yml | 1 + .../Magento/SampleTests/ExampleCept.php | 5 - .../Backend/AccessAdminPagesDirectlyCest.php | 2 +- .../AccessAdminPagesViaNavMenuCest.php | 2 +- .../Backend/OpenEachSideNavMenuCest.php | 2 +- .../Catalog/CreateCategoryCest.php | 2 +- .../Catalog/CreateSimpleProductCest.php | 2 +- .../Catalog/UpdateSimpleProductCest.php | 12 +- .../Acceptance/SampleTests/ExampleCept.php | 6 + .../Acceptance}/SampleTests/ExampleCest.php | 2 + .../Acceptance}/SampleTests/TestCest.php | 0 .../SampleTests/TestStepObjectCept.php | 0 .../SampleTests/TestStepObjectCest.php | 0 .../User/AccessAdminLoginPageCest.php | 2 +- .../User/AccessForgotYourPasswordCest.php | 2 +- .../CannotAccessAdminAfterLoggingOutCest.php | 2 +- .../User/CannotAccessAdminPagesCest.php | 2 +- .../User/LoginOnAdminLoginPageCest.php | 2 +- .../User/LogoutAfterLoginCest.php | 2 +- 34 files changed, 223 insertions(+), 207 deletions(-) delete mode 100644 tests/acceptance/Magento/SampleTests/ExampleCept.php rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/Backend/AccessAdminPagesDirectlyCest.php (99%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/Backend/AccessAdminPagesViaNavMenuCest.php (99%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/Backend/OpenEachSideNavMenuCest.php (96%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/Catalog/CreateCategoryCest.php (98%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/Catalog/CreateSimpleProductCest.php (98%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/Catalog/UpdateSimpleProductCest.php (96%) create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCept.php rename tests/acceptance/Magento/{ => Xxyyzz/Acceptance}/SampleTests/ExampleCest.php (86%) rename tests/acceptance/Magento/{ => Xxyyzz/Acceptance}/SampleTests/TestCest.php (100%) rename tests/acceptance/Magento/{ => Xxyyzz/Acceptance}/SampleTests/TestStepObjectCept.php (100%) rename tests/acceptance/Magento/{ => Xxyyzz/Acceptance}/SampleTests/TestStepObjectCest.php (100%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/User/AccessAdminLoginPageCest.php (91%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/User/AccessForgotYourPasswordCest.php (98%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/User/CannotAccessAdminAfterLoggingOutCest.php (94%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/User/CannotAccessAdminPagesCest.php (94%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/User/LoginOnAdminLoginPageCest.php (90%) rename tests/acceptance/Magento/Xxyyzz/{ => Acceptance}/User/LogoutAfterLoginCest.php (90%) diff --git a/composer.json b/composer.json index 66eaea7c2..101572c04 100755 --- a/composer.json +++ b/composer.json @@ -14,9 +14,8 @@ "Yandex": "vendor/allure-framework/allure-codeception/src/" }, "psr-4": { - "Magento\\Xxyyzz\\Helper\\": "tests/_support/Magento/Xxyyzz/Helper", - "Magento\\Xxyyzz\\Page\\": "tests/_support/Magento/Xxyyzz/Page", - "Magento\\Xxyyzz\\Step\\": "tests/_support/Magento/Xxyyzz/Step" + "Magento\\Xxyyzz\\": "tests/_support/Magento/Xxyyzz", + "Magento\\Xxyyzz\\Acceptance\\": "tests/acceptance/Magento/Xxyyzz/Acceptance" } } } \ No newline at end of file diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index cc5a6869b..bb76a0033 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -1,6 +1,2 @@ acceptanceTester = $I; } - public function clickOnMagentoLogo(\AcceptanceTester $I) + public function clickOnMagentoLogo(AcceptanceTester $I) { $I->click(self::$logoImage); } - public function clickOnForgotYourPassword(\AcceptanceTester $I) + public function clickOnForgotYourPassword(AcceptanceTester $I) { $I->click(self::$forgotYourPassword); } - public function clickOnSignIn(\AcceptanceTester $I) + public function clickOnSignIn(AcceptanceTester $I) { $I->click(self::$signIn); } - public function enterTheUsername(\AcceptanceTester $I, $username) + public function enterTheUsername(AcceptanceTester $I, $username) { $I->fillField(self::$username, $username); } - public function enterThePassword(\AcceptanceTester $I, $password) + public function enterThePassword(AcceptanceTester $I, $password) { $I->fillField(self::$password, $password); } - public function enterTheLoginCredentials(\AcceptanceTester $I, $username, $password) + public function enterTheLoginCredentials(AcceptanceTester $I, $username, $password) { $this->enterTheUsername($I, $username); $this->enterThePassword($I, $password); } - public function shouldSeeTheLoginMainArea(\AcceptanceTester $I) + public function shouldSeeTheLoginMainArea(AcceptanceTester $I) { $I->seeElement(self::$mainArea); } - public function shouldSeeTheLoginLogoLink(\AcceptanceTester $I) + public function shouldSeeTheLoginLogoLink(AcceptanceTester $I) { $I->seeElement(self::$logoLink); } - public function shouldSeeTheLoginLogoImage(\AcceptanceTester $I) + public function shouldSeeTheLoginLogoImage(AcceptanceTester $I) { $I->seeElement(self::$logoImage); } - public function shouldSeeTheLoginTitle(\AcceptanceTester $I) + public function shouldSeeTheLoginTitle(AcceptanceTester $I) { $I->seeElement(self::$title); } - public function shouldSeeTheLoginUsernameTitle(\AcceptanceTester $I) + public function shouldSeeTheLoginUsernameTitle(AcceptanceTester $I) { $I->seeElement(self::$usernameTitle); } - public function shouldSeeTheLoginUsernameField(\AcceptanceTester $I) + public function shouldSeeTheLoginUsernameField(AcceptanceTester $I) { $I->seeElement(self::$username); } - public function shouldSeeTheLoginPasswordTitle(\AcceptanceTester $I) + public function shouldSeeTheLoginPasswordTitle(AcceptanceTester $I) { $I->seeElement(self::$passwordTitle); } - public function shouldSeeTheLoginPasswordField(\AcceptanceTester $I) + public function shouldSeeTheLoginPasswordField(AcceptanceTester $I) { $I->seeElement(self::$password); } - public function shouldSeeTheLoginForgotPasswordLink(\AcceptanceTester $I) + public function shouldSeeTheLoginForgotPasswordLink(AcceptanceTester $I) { $I->seeElement(self::$forgotYourPassword); } - public function shouldSeeTheLoginSignInButton(\AcceptanceTester $I) + public function shouldSeeTheLoginSignInButton(AcceptanceTester $I) { $I->seeElement(self::$signIn); } - public function shouldSeeTheLoginCopyrightText(\AcceptanceTester $I) + public function shouldSeeTheLoginCopyrightText(AcceptanceTester $I) { $I->seeElement(self::$copyRight); } - public function shouldSeeTheLoginPageFields(\AcceptanceTester $I) + public function shouldSeeTheLoginPageFields(AcceptanceTester $I) { $this->shouldSeeTheLoginMainArea($I); $this->shouldSeeTheLoginLogoLink($I); @@ -149,22 +151,22 @@ public function shouldSeeTheLoginPageFields(\AcceptanceTester $I) $this->shouldSeeTheLoginCopyrightText($I); } - public function enterTheEmailAddress(\AcceptanceTester $I, $emailAddress) + public function enterTheEmailAddress(AcceptanceTester $I, $emailAddress) { $I->fillField(self::$emailAddress, $emailAddress); } - public function clickOnRetrievePassword(\AcceptanceTester $I) + public function clickOnRetrievePassword(AcceptanceTester $I) { $I->click(self::$retrievePassword); } - public function clickOnBackToSignIn(\AcceptanceTester $I) + public function clickOnBackToSignIn(AcceptanceTester $I) { $I->click(self::$backToSignIn); } - public function shouldSeeTheForgotYourPasswordFields(\AcceptanceTester $I) + public function shouldSeeTheForgotYourPasswordFields(AcceptanceTester $I) { $I->seeElement(self::$forgotPasswordMain); $I->seeElement(self::$logoLink); diff --git a/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php b/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php index 0cae86951..d9f6a6d7a 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php +++ b/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php @@ -1,6 +1,8 @@ acceptanceTester = $I; } - public function clickOnDashboardInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnDashboardInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$dashboardButton); } - public function clickOnSalesInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnSalesInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$salesButton); $I->wait(1); } - public function clickOnOrdersInTheSalesNavMenu(\AcceptanceTester $I) + public function clickOnOrdersInTheSalesNavMenu(AcceptanceTester $I) { $I->click(self::$salesNavOrders); } - public function clickOnInvoicesInTheSalesNavMenu(\AcceptanceTester $I) + public function clickOnInvoicesInTheSalesNavMenu(AcceptanceTester $I) { $I->click(self::$salesNavInvoices); } - public function clickOnShipmentsInTheSalesNavMenu(\AcceptanceTester $I) + public function clickOnShipmentsInTheSalesNavMenu(AcceptanceTester $I) { $I->click(self::$salesNavShipments); } - public function clickOnCreditMemosInTheSalesNavMenu(\AcceptanceTester $I) + public function clickOnCreditMemosInTheSalesNavMenu(AcceptanceTester $I) { $I->click(self::$salesNavCreditMemos); } - public function clickOnBillingAgreementsInTheSalesNavMenu(\AcceptanceTester $I) + public function clickOnBillingAgreementsInTheSalesNavMenu(AcceptanceTester $I) { $I->click(self::$salesNavBillingAgreements); } - public function clickOnTransactionsInTheSalesNavMenu(\AcceptanceTester $I) + public function clickOnTransactionsInTheSalesNavMenu(AcceptanceTester $I) { $I->click(self::$salesNavTransactions); } - public function clickOnProductsInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnProductsInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$productsButton); $I->wait(1); } - public function clickOnCatalogInTheProductNavMenu(\AcceptanceTester $I) + public function clickOnCatalogInTheProductNavMenu(AcceptanceTester $I) { $I->click(self::$productNavCatalog); } - public function clickOnCategoriesInTheProductNavMenu(\AcceptanceTester $I) + public function clickOnCategoriesInTheProductNavMenu(AcceptanceTester $I) { $I->click(self::$productNavCategories); } - public function clickOnCustomersInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnCustomersInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$customersButton); $I->wait(1); } - public function clickOnAllCustomersInTheCustomersNavMenu(\AcceptanceTester $I) + public function clickOnAllCustomersInTheCustomersNavMenu(AcceptanceTester $I) { $I->click(self::$customersNavAllCustomers); } - public function clickOnNowOnlineInTheCustomersNavMenu(\AcceptanceTester $I) + public function clickOnNowOnlineInTheCustomersNavMenu(AcceptanceTester $I) { $I->click(self::$customersNavNowOnline); } - public function clickOnMarketingInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnMarketingInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$marketingButton); $I->wait(1); } - public function clickOnCatalogPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnCatalogPriceRulesInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavPromotionsCatalogPriceRule); } - public function clickOnCartPriceRulesInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnCartPriceRulesInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavPromotionsCartPriceRules); } - public function clickOnEmailTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnEmailTemplatesInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavCommunicationsEmailTemplates); } - public function clickOnNewsletterTemplatesInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnNewsletterTemplatesInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavCommunicationsNewsletterTemplates); } - public function clickOnNewsletterQueueInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnNewsletterQueueInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavCommunicationsNewsletterQueue); } - public function clickOnNewsletterSubscribersInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnNewsletterSubscribersInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavCommunicationsNewsletterSubscribers); } - public function clickOnURLRewritesInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnURLRewritesInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavSEOSearchURLRewrites); } - public function clickOnSearchTermsInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnSearchTermsInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavSEOSearchTerms); } - public function clickOnSearchSynonymsInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnSearchSynonymsInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavSEOSearchSynonyms); } - public function clickOnSiteMapInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnSiteMapInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavSEOSearchSiteMap); } - public function clickOnContentReviewsInTheMarketingNavMenu(\AcceptanceTester $I) + public function clickOnContentReviewsInTheMarketingNavMenu(AcceptanceTester $I) { $I->click(self::$marketingNavUserContentReviews); } - public function clickOnContentInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnContentInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$contentButton); $I->wait(1); } - public function clickOnPagesInTheContentNavMenu(\AcceptanceTester $I) + public function clickOnPagesInTheContentNavMenu(AcceptanceTester $I) { $I->click(self::$contentNavElementsPages); } - public function clickOnBlocksInTheContentNavMenu(\AcceptanceTester $I) + public function clickOnBlocksInTheContentNavMenu(AcceptanceTester $I) { $I->click(self::$contentNavElementsBlocks); } - public function clickOnWidgetsInTheContentNavMenu(\AcceptanceTester $I) + public function clickOnWidgetsInTheContentNavMenu(AcceptanceTester $I) { $I->click(self::$contentNavElementsWidgets); } - public function clickOnConfigurationInTheContentNavMenu(\AcceptanceTester $I) + public function clickOnConfigurationInTheContentNavMenu(AcceptanceTester $I) { $I->click(self::$contentNavDesignConfiguration); } - public function clickOnThemesInTheContentNavMenu(\AcceptanceTester $I) + public function clickOnThemesInTheContentNavMenu(AcceptanceTester $I) { $I->click(self::$contentNavDesignThemes); } - public function clickOnScheduleInTheContentNavMenu(\AcceptanceTester $I) + public function clickOnScheduleInTheContentNavMenu(AcceptanceTester $I) { $I->click(self::$contentNavDesignSchedule); } - public function clickOnReportsInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnReportsInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$reportsButton); $I->wait(1); } - public function clickOnProductsInCartInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnProductsInCartInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavMarketingProductsInCart); } - public function clickOnSearchTermsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnSearchTermsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavMarketingSearchTerms); } - public function clickOnAbandonedCartsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnAbandonedCartsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavMarketingAbandonedCarts); } - public function clickOnNewsletterProblemReportsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnNewsletterProblemReportsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavMarketingNewsletterProblemReports); } - public function clickOnByCustomersInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnByCustomersInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavReviewsByCustomers); } - public function clickOnByProductsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnByProductsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavReviewsByProducts); } - public function clickOnOrdersInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnOrdersInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavSalesOrders); } - public function clickOTaxInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOTaxInTheReportsNavMenu(AcceptanceTester $I) { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesTax); } - public function clickOnInvoicedInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnInvoicedInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavSalesInvoiced); } - public function clickOnShippingInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnShippingInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavSalesShipping); } - public function clickOnRefundsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnRefundsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavSalesRefunds); } - public function clickOnCouponsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnCouponsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavSalesCoupons); } - public function clickOnPayPalSettlementInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnPayPalSettlementInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavSalesPayPalSettlement); } - public function clickOnBraintreeSettlementInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnBraintreeSettlementInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavSalesBraintreeSettlement); } - public function clickOnOrderTotalInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnOrderTotalInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavCustomersOrderTotal); } - public function clickOnOrderCountInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnOrderCountInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavCustomersOrderCount); } - public function clickOnNewInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnNewInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavCustomersNew); } - public function clickOnViewsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnViewsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavProductsViews); } - public function clickOnBestSellersInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnBestSellersInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavProductsBestsellers); } - public function clickOnLowStockInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnLowStockInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavProductsLowStock); } - public function clickOnOrderedInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnOrderedInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavProductsOrdered); } - public function clickOnDownloadsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnDownloadsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavProductsDownloads); } - public function clickOnRefreshStatisticsInTheReportsNavMenu(\AcceptanceTester $I) + public function clickOnRefreshStatisticsInTheReportsNavMenu(AcceptanceTester $I) { $I->click(self::$reportsNavStatisticsRefreshStatistics); } - public function clickOnStoresInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnStoresInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$storesButton); $I->wait(1); } - public function clickOnAllStoresInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnAllStoresInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavSettingsAllStores); } - public function clickOnConfigurationInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnConfigurationInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavSettingsConfiguration); } - public function clickOnTermsAndConditionsInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnTermsAndConditionsInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavSettingsTermsAndConditions); } - public function clickOnOrderStatusInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnOrderStatusInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavSettingsOrderStatus); } - public function clickOnTaxRuleInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnTaxRuleInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavTaxesTaxRules); } - public function clickOnTaxZonesAndRatesInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnTaxZonesAndRatesInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavTaxesTaxZonesAndRates); } - public function clickOnTaxRatesInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnTaxRatesInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavCurrencyRates); } - public function clickOnTaxSymbolsInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnTaxSymbolsInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavCurrencySymbols); } - public function clickOnCurrencyRatesInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnCurrencyRatesInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavCurrencyRates); } - public function clickOnCurrencySymbolsInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnCurrencySymbolsInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavCurrencySymbols); } - public function clickOnProductInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnProductInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavAttributesProduct); } - public function clickOnAttributesSetInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnAttributesSetInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavAttributesSet); } - public function clickOnRatingsInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnRatingsInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavAttributesRating); } - public function clickOnCustomerGroupInTheStoresNavMenu(\AcceptanceTester $I) + public function clickOnCustomerGroupInTheStoresNavMenu(AcceptanceTester $I) { $I->click(self::$storesNavOtherSettingsCustomerGroups); } - public function clickOnSystemInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnSystemInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$systemButton); $I->wait(1); } - public function clickOnImportInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnImportInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavDataTransferImport); } - public function clickOnExportInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnExportInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavDataTransferExport); } - public function clickOnImportExportTaxRatesInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnImportExportTaxRatesInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavDataTransferImportExportTaxRates); } - public function clickOnImportHistoryInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnImportHistoryInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavDataTransferImportHistory); } - public function clickOnIntegrationsInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnIntegrationsInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavExtensionsIntegrations); } - public function clickOnCacheManagementInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnCacheManagementInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavToolsCacheManagement); } - public function clickOnBackupsInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnBackupsInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavToolsBackups); } - public function clickOnIndexManagementInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnIndexManagementInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavToolsIndexManagement); } - public function clickOnWebSetupWizardInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnWebSetupWizardInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavToolsWebSetupWizard); $I->wait(1); } - public function clickOnAllUsersInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnAllUsersInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavPermissionsAllUsers); } - public function clickOnLockedUsersInTheSystemNavMenu(\AcceptanceTester $I) { + public function clickOnLockedUsersInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavPermissionsLockedUsers); } - public function clickOnUserRolesInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnUserRolesInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavPermissionsUserRoles); } - public function clickOnNotificationsInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnNotificationsInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavOtherSettingsNotifications); } - public function clickOnCustomVariablesInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnCustomVariablesInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavOtherSettingsCustomVariables); } - public function clickOnManageEncryptionKeyInTheSystemNavMenu(\AcceptanceTester $I) + public function clickOnManageEncryptionKeyInTheSystemNavMenu(AcceptanceTester $I) { $I->click(self::$systemNavOtherSettingsManageEncryptionKey); } - public function clickOnFindPartnersAndExtensionsInTheSideNavMenu(\AcceptanceTester $I) + public function clickOnFindPartnersAndExtensionsInTheSideNavMenu(AcceptanceTester $I) { $I->click(self::$findPartnersExtensionsButton); $I->wait(1); } - public function shouldSeeTheSalesNavMainArea(\AcceptanceTester $I) + public function shouldSeeTheSalesNavMainArea(AcceptanceTester $I) { $I->seeElement(self::$salesNavMainArea); } - public function shouldSeeTheSalesNavTitle(\AcceptanceTester $I) + public function shouldSeeTheSalesNavTitle(AcceptanceTester $I) { $I->seeElement(self::$salesNavTitle); } - public function shouldSeeTheSalesNavOrders(\AcceptanceTester $I) + public function shouldSeeTheSalesNavOrders(AcceptanceTester $I) { $I->seeElement(self::$salesNavOrders); } - public function shouldSeeTheSalesNavInvoices(\AcceptanceTester $I) + public function shouldSeeTheSalesNavInvoices(AcceptanceTester $I) { $I->seeElement(self::$salesNavInvoices); } - public function shouldSeeTheSalesNavShipments(\AcceptanceTester $I) + public function shouldSeeTheSalesNavShipments(AcceptanceTester $I) { $I->seeElement(self::$salesNavShipments); } - public function shouldSeeTheSalesNavCreditMemos(\AcceptanceTester $I) + public function shouldSeeTheSalesNavCreditMemos(AcceptanceTester $I) { $I->seeElement(self::$salesNavCreditMemos); } - public function shouldSeeTheSalesNavBillingAgreements(\AcceptanceTester $I) + public function shouldSeeTheSalesNavBillingAgreements(AcceptanceTester $I) { $I->seeElement(self::$salesNavBillingAgreements); } - public function shouldSeeTheSalesNavTransactions(\AcceptanceTester $I) + public function shouldSeeTheSalesNavTransactions(AcceptanceTester $I) { $I->seeElement(self::$salesNavTransactions); } - public function shouldSeeTheSalesNavMenu(\AcceptanceTester $I) + public function shouldSeeTheSalesNavMenu(AcceptanceTester $I) { $this->shouldSeeTheSalesNavMainArea($I); $this->shouldSeeTheSalesNavTitle($I); @@ -697,7 +699,7 @@ public function shouldSeeTheSalesNavMenu(\AcceptanceTester $I) $this->shouldSeeTheSalesNavTransactions($I); } - public function shouldSeeTheProductNavMenu(\AcceptanceTester $I) + public function shouldSeeTheProductNavMenu(AcceptanceTester $I) { $I->seeElement(self::$productNavMainArea); $I->seeElement(self::$productNavTitle); @@ -705,13 +707,13 @@ public function shouldSeeTheProductNavMenu(\AcceptanceTester $I) $I->seeElement(self::$productNavCategories); } - public function shouldSeeTheCustomersNavMenu(\AcceptanceTester $I) + public function shouldSeeTheCustomersNavMenu(AcceptanceTester $I) { $I->seeElement(self::$customersNavAllCustomers); $I->seeElement(self::$customersNavNowOnline); } - public function shouldSeeTheMarketingNavMenu(\AcceptanceTester $I) + public function shouldSeeTheMarketingNavMenu(AcceptanceTester $I) { $I->seeElement(self::$marketingNavPromotionsMainArea); $I->seeElement(self::$marketingNavPromotionsTitle); @@ -737,7 +739,7 @@ public function shouldSeeTheMarketingNavMenu(\AcceptanceTester $I) $I->seeElement(self::$marketingNavUserContentReviews); } - public function shouldSeeTheContentNavMenu(\AcceptanceTester $I) + public function shouldSeeTheContentNavMenu(AcceptanceTester $I) { $I->seeElement(self::$contentNavElementsMainArea); $I->seeElement(self::$contentNavElementsTitle); @@ -752,7 +754,7 @@ public function shouldSeeTheContentNavMenu(\AcceptanceTester $I) $I->seeElement(self::$contentNavDesignSchedule); } - public function shouldSeeTheReportsNavMenu(\AcceptanceTester $I) + public function shouldSeeTheReportsNavMenu(AcceptanceTester $I) { $I->seeElement(self::$reportsNavMarketingMainArea); $I->seeElement(self::$reportsNavMarketingTitle); @@ -796,7 +798,7 @@ public function shouldSeeTheReportsNavMenu(\AcceptanceTester $I) $I->seeElement(self::$reportsNavStatisticsRefreshStatistics); } - public function shouldSeeTheStoresNavMenu(\AcceptanceTester $I) + public function shouldSeeTheStoresNavMenu(AcceptanceTester $I) { $I->seeElement(self::$storesNavSettingsMainArea); $I->seeElement(self::$storesNavSettingsTitle); @@ -826,7 +828,7 @@ public function shouldSeeTheStoresNavMenu(\AcceptanceTester $I) $I->seeElement(self::$storesNavOtherSettingsCustomerGroups); } - public function shouldSeeTheSystemNavMenu(\AcceptanceTester $I) + public function shouldSeeTheSystemNavMenu(AcceptanceTester $I) { $I->seeElement(self::$systemNavDataTransferMainArea); $I->seeElement(self::$systemNavDataTransferTitle); diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php index 4971b1fec..a5e0ca4a9 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php @@ -1,6 +1,8 @@ amOnPage(self::route($param)); $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs } - public function amOnAdminCategoryPageById(\AcceptanceTester $I, $id) + public function amOnAdminCategoryPageById(AcceptanceTester $I, $id) { $I->amOnPage(self::$URL . 'edit/id/' . $id); $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs } - public function seeCategoryNameInPageTitle(\AcceptanceTester $I, $name) + public function seeCategoryNameInPageTitle(AcceptanceTester $I, $name) { $I->see($name, self::$pageTitle); } - public function addRootCategory(\AcceptanceTester $I) + public function addRootCategory(AcceptanceTester $I) { $I->click(self::$addRootCategoryButton); } - public function addSubCategory(\AcceptanceTester $I) + public function addSubCategory(AcceptanceTester $I) { $I->click(self::$addSubCategoryButton); $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs } - public function fillFieldCategoryName(\AcceptanceTester $I, $name) + public function fillFieldCategoryName(AcceptanceTester $I, $name) { $I->fillField(self::$categoryName, $name); } - public function fillFieldCategoryUrlKey(\AcceptanceTester $I, $name) + public function fillFieldCategoryUrlKey(AcceptanceTester $I, $name) { try { $I->click(sprintf(self::$categorySearchEngineOptimToggle, 'closed')); @@ -77,7 +79,7 @@ public function fillFieldCategoryUrlKey(\AcceptanceTester $I, $name) $I->fillField(self::$categoryUrlKey, $name); } - public function saveCategory(\AcceptanceTester $I) + public function saveCategory(AcceptanceTester $I) { $I->click(self::$saveCategoryButton); $I->waitForElementNotVisible(self::$catagorySavedSpinner); diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php index f755d84b0..ba139de38 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php @@ -1,6 +1,8 @@ amOnPage(self::$URL . 'id/' . $id); $I->waitForElementNotVisible(self::$productFormSpinner, 30); // secs } - public function seeProductNameInPageTitle(\AcceptanceTester $I, $name) + public function seeProductNameInPageTitle(AcceptanceTester $I, $name) { $I->see($name, self::$pageTitle); } - public function seeProductAttributeSet(\AcceptanceTester $I, $name) + public function seeProductAttributeSet(AcceptanceTester $I, $name) { $I->seeOptionIsSelected(self::$producAttributeSet, $name); } - public function seeProductName(\AcceptanceTester $I, $name) + public function seeProductName(AcceptanceTester $I, $name) { $I->seeInField(self::$productName, $name); } - public function seeProductSku(\AcceptanceTester $I, $name) + public function seeProductSku(AcceptanceTester $I, $name) { $I->seeInField(self::$productSku, $name); } - public function seeProductPrice(\AcceptanceTester $I, $name) + public function seeProductPrice(AcceptanceTester $I, $name) { $I->seeInField(self::$productPrice, $name); } - public function seeProductQuantity(\AcceptanceTester $I, $name) + public function seeProductQuantity(AcceptanceTester $I, $name) { $I->seeInField(self::$productQuantity, $name); } - public function seeProductStockStatus(\AcceptanceTester $I, $name) + public function seeProductStockStatus(AcceptanceTester $I, $name) { $I->seeOptionIsSelected(self::$productStockStatus, $name); } - public function seeProductCategories(\AcceptanceTester $I, $name) + public function seeProductCategories(AcceptanceTester $I, $name) { $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php index 429521696..27cc6031a 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php @@ -1,6 +1,8 @@ amOnPage(self::$URL); $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); // secs } - public function goToAddNewProductPage(\AcceptanceTester $I) + public function goToAddNewProductPage(AcceptanceTester $I) { $I->click(self::$addNewProductButton); } - public function searchBySku(\AcceptanceTester $I, $sku) + public function searchBySku(AcceptanceTester $I, $sku) { try { $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); @@ -66,7 +68,7 @@ public function searchBySku(\AcceptanceTester $I, $sku) $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); // secs } - public function containsInNthRow(\AcceptanceTester $I, $n, $text) + public function containsInNthRow(AcceptanceTester $I, $n, $text) { return $I->see($text, sprintf(self::$gridNthRow, $n)); } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php index 77edb739d..dc1cac8bc 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php @@ -1,6 +1,8 @@ seeInCurrentUrl(static::$URL . 'new'); $I->waitForElementNotVisible(self::$productFormLoadingSpinner, 30); // secs } - public function amOnAdminProductPageById(\AcceptanceTester $I, $id) + public function amOnAdminProductPageById(AcceptanceTester $I, $id) { $I->amOnPage(self::route('edit/id/' . $id)); $I->waitForElementNotVisible(self::$productFormLoadingSpinner, 30); // secs } // Assert existing product - public function seeProductNameInPageTitle(\AcceptanceTester $I, $name) + public function seeProductNameInPageTitle(AcceptanceTester $I, $name) { $I->see($name, self::$pageTitle); } - public function seeProductAttributeSet(\AcceptanceTester $I, $name) + public function seeProductAttributeSet(AcceptanceTester $I, $name) { $I->seeOptionIsSelected(self::$producAttributeSet, $name); } - public function seeProductName(\AcceptanceTester $I, $name) + public function seeProductName(AcceptanceTester $I, $name) { $I->seeInField(self::$productName, $name); } - public function seeProductSku(\AcceptanceTester $I, $name) + public function seeProductSku(AcceptanceTester $I, $name) { $I->seeInField(self::$productSku, $name); } - public function seeProductPrice(\AcceptanceTester $I, $name) + public function seeProductPrice(AcceptanceTester $I, $name) { $I->seeInField(self::$productPrice, $name); } - public function seeProductQuantity(\AcceptanceTester $I, $name) + public function seeProductQuantity(AcceptanceTester $I, $name) { $I->seeInField(self::$productQuantity, $name); } - public function seeProductStockStatus(\AcceptanceTester $I, $name) + public function seeProductStockStatus(AcceptanceTester $I, $name) { $I->seeOptionIsSelected(self::$productStockStatus, $name); } - public function seeProductCategories(\AcceptanceTester $I, $name) + public function seeProductCategories(AcceptanceTester $I, $name) { $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); } // Fill new product - public function fillFieldProductName(\AcceptanceTester $I, $name) + public function fillFieldProductName(AcceptanceTester $I, $name) { $I->fillField(self::$productName, $name); } - public function fillFieldProductSku(\AcceptanceTester $I, $name) + public function fillFieldProductSku(AcceptanceTester $I, $name) { $I->fillField(self::$productSku, $name); } - public function fillFieldProductPrice(\AcceptanceTester $I, $name) + public function fillFieldProductPrice(AcceptanceTester $I, $name) { $I->fillField(self::$productPrice, $name); } - public function fillFieldProductQuantity(\AcceptanceTester $I, $name) + public function fillFieldProductQuantity(AcceptanceTester $I, $name) { $I->fillField(self::$productQuantity, $name); } - public function selectProductStockStatus(\AcceptanceTester $I, $name) + public function selectProductStockStatus(AcceptanceTester $I, $name) { $I->selectOption(self::$productStockStatus, $name); } - public function fillFieldProductCategories(\AcceptanceTester $I, $name) + public function fillFieldProductCategories(AcceptanceTester $I, $name) { $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); } - public function saveProduct(\AcceptanceTester $I) + public function saveProduct(AcceptanceTester $I) { $I->click(self::$productSaveButton); $I->waitForElementNotVisible(self::$productSavedSpinner); diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php index 3ebc6e1e6..418d10053 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php @@ -1,6 +1,8 @@ amOnPage(self::$URL); $I->waitForElementVisible(self::$customerLoginForm, 30); } - public function signInWithCredentials(\AcceptanceTester $I, $email, $password) + public function signInWithCredentials(AcceptanceTester $I, $email, $password) { $I->fillField(self::$customerEmailField, $email); $I->fillField(self::$customerPasswordField, $password); diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php index e6d6dae9c..5fc7547ac 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php @@ -1,6 +1,8 @@ amOnPage(self::$URL); $I->waitForElementVisible(self::$customerLoginForm, 30); } - public function signInWithCredentials(\AcceptanceTester $I, $email, $password) + public function signInWithCredentials(AcceptanceTester $I, $email, $password) { $I->fillField(self::$customerEmailField, $email); $I->fillField(self::$customerPasswordField, $password); diff --git a/tests/_support/Magento/Xxyyzz/Step/Backend/Admin.php b/tests/_support/Magento/Xxyyzz/Step/Backend/Admin.php index d49474ad6..39993c77c 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Backend/Admin.php +++ b/tests/_support/Magento/Xxyyzz/Step/Backend/Admin.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/../../Helper/AdminUrlList.php'; -class Admin extends \AcceptanceTester +class Admin extends \Magento\Xxyyzz\AcceptanceTester { public function goToTheAdminLoginPage() { diff --git a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/Category.php b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/Category.php index a5ac973bc..fd39fd480 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/Category.php +++ b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/Category.php @@ -1,7 +1,7 @@ wantTo('perform actions and see result'); diff --git a/tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesDirectlyCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php similarity index 99% rename from tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesDirectlyCest.php rename to tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php index fdc6acd6d..ab2e24de0 100644 --- a/tests/acceptance/Magento/Xxyyzz/Backend/AccessAdminPagesDirectlyCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php @@ -1,5 +1,5 @@ saveProduct($I); $I->wantTo('verify product created visible in product form in admin'); $adminProductPage->amOnAdminProductPageById($I, $this->product['id']); - $adminProductPage->seeProductNameInPageTitle($I, $this->product['name']); + $adminProductPage->seeProductNameInPageTitle($I, $this->product['name']. '-updated'); $adminProductPage->seeProductAttributeSet($I, 'Default'); - $adminProductPage->seeProductName($I, $this->product['name']); - $adminProductPage->seeProductSku($I, $this->product['sku']); - $adminProductPage->seeProductPrice($I, $this->product['price']); - $adminProductPage->seeProductQuantity($I, $this->product['extension_attributes']['stock_item']['qty']); + $adminProductPage->seeProductName($I, $this->product['name']. '-updated'); + $adminProductPage->seeProductSku($I, $this->product['sku']. '-updated'); + $adminProductPage->seeProductPrice($I, $this->product['price']+10); + $adminProductPage->seeProductQuantity($I, $this->product['extension_attributes']['stock_item']['qty']+100); $adminProductPage->seeProductStockStatus( $I, $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCept.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCept.php new file mode 100644 index 000000000..781a07371 --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCept.php @@ -0,0 +1,6 @@ +wantTo('perform actions and see result'); diff --git a/tests/acceptance/Magento/SampleTests/ExampleCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php similarity index 86% rename from tests/acceptance/Magento/SampleTests/ExampleCest.php rename to tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php index 7d3fc2fc8..a5c12f28b 100644 --- a/tests/acceptance/Magento/SampleTests/ExampleCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php @@ -1,5 +1,7 @@ Date: Thu, 30 Mar 2017 17:12:58 -0500 Subject: [PATCH 023/149] MTA-4133: Fixed root level AcceptanceTester namespace issue. --- .../Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php | 1 + .../Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php | 1 + .../Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php | 3 ++- .../Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php index a5c12f28b..2c24da331 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php @@ -1,4 +1,5 @@ wantTo('demo the usage of StepObject in Cept'); $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php index 9919fa990..e99e7dd36 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php @@ -1,4 +1,5 @@ Date: Thu, 30 Mar 2017 17:15:36 -0500 Subject: [PATCH 024/149] MTA-4133: Fixed root level AcceptanceTester namespace issue. --- tests/_bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index bb76a0033..243f9c85b 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -1,2 +1,2 @@ Date: Fri, 31 Mar 2017 16:33:07 -0500 Subject: [PATCH 025/149] Updated to use codeception latest version 2.2; Temporarily updated allure-codeception adapter to dev-master to pick up a bug fix we needed. --- .gitignore | 1 - composer.json | 4 +- composer.lock | 3730 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 3732 insertions(+), 3 deletions(-) create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 30b870857..351679f69 100755 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.iml .idea composer.phar -composer.lock vendor/* tests/_output/* allure-report/* diff --git a/composer.json b/composer.json index 101572c04..04b03c8b3 100755 --- a/composer.json +++ b/composer.json @@ -2,11 +2,11 @@ "name": "tooling-demo", "require": { "php": ">=5.4.0", - "codeception/codeception": "~2.1.0", + "codeception/codeception": "~2.2", "symfony/filesystem": "~2.6", "symfony/finder": "~2.6", "consolidation/robo": "^1.0.0", - "allure-framework/allure-codeception": "~1.2.3", + "allure-framework/allure-codeception": "dev-master", "flow/jsonpath": ">0.2" }, "autoload": { diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..47cb45822 --- /dev/null +++ b/composer.lock @@ -0,0 +1,3730 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "410ceacf5b3a4b2a47062cea3cf24a7c", + "content-hash": "bf20c944a10299d67300853866fb3777", + "packages": [ + { + "name": "allure-framework/allure-codeception", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/allure-framework/allure-codeception.git", + "reference": "af40af5ae2b717618a42fe3e137d75878508c75d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/allure-framework/allure-codeception/zipball/af40af5ae2b717618a42fe3e137d75878508c75d", + "reference": "af40af5ae2b717618a42fe3e137d75878508c75d", + "shasum": "" + }, + "require": { + "allure-framework/allure-php-api": "~1.1.0", + "codeception/codeception": "~2.1", + "php": ">=5.4.0", + "symfony/filesystem": ">=2.6", + "symfony/finder": ">=2.6" + }, + "type": "library", + "autoload": { + "psr-0": { + "Yandex": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Ivan Krutov", + "email": "vania-pooh@yandex-team.ru", + "role": "Developer" + } + ], + "description": "A Codeception adapter for Allure report.", + "homepage": "http://allure.qatools.ru/", + "keywords": [ + "allure", + "attachments", + "cases", + "codeception", + "report", + "steps", + "testing" + ], + "time": "2017-03-30 09:01:00" + }, + { + "name": "allure-framework/allure-php-api", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/allure-framework/allure-php-adapter-api.git", + "reference": "a462a0da121681577033e13c123b6cc4e89cdc64" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/allure-framework/allure-php-adapter-api/zipball/a462a0da121681577033e13c123b6cc4e89cdc64", + "reference": "a462a0da121681577033e13c123b6cc4e89cdc64", + "shasum": "" + }, + "require": { + "jms/serializer": ">=0.16.0", + "moontoast/math": ">=1.1.0", + "php": ">=5.4.0", + "phpunit/phpunit": ">=4.0.0", + "ramsey/uuid": ">=3.0.0", + "symfony/http-foundation": ">=2.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Yandex": [ + "src/", + "test/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Ivan Krutov", + "email": "vania-pooh@yandex-team.ru", + "role": "Developer" + } + ], + "description": "PHP API for Allure adapter", + "homepage": "http://allure.qatools.ru/", + "keywords": [ + "allure", + "api", + "php", + "report" + ], + "time": "2016-12-07 12:15:46" + }, + { + "name": "behat/gherkin", + "version": "v4.4.5", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74", + "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.5|~5", + "symfony/phpunit-bridge": "~2.7|~3", + "symfony/yaml": "~2.3|~3" + }, + "suggest": { + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Cucumber", + "DSL", + "gherkin", + "parser" + ], + "time": "2016-10-30 11:50:56" + }, + { + "name": "codeception/codeception", + "version": "2.2.10", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Codeception.git", + "reference": "c32a3f92834db08ceedb4666ea2265c3aa43396e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/c32a3f92834db08ceedb4666ea2265c3aa43396e", + "reference": "c32a3f92834db08ceedb4666ea2265c3aa43396e", + "shasum": "" + }, + "require": { + "behat/gherkin": "~4.4.0", + "ext-json": "*", + "ext-mbstring": "*", + "facebook/webdriver": ">=1.0.1 <2.0", + "guzzlehttp/guzzle": ">=4.1.4 <7.0", + "guzzlehttp/psr7": "~1.0", + "php": ">=5.4.0 <8.0", + "phpunit/php-code-coverage": ">=2.2.4 <5.0", + "phpunit/phpunit": ">4.8.20 <6.0", + "sebastian/comparator": "~1.1", + "sebastian/diff": "^1.4", + "stecman/symfony-console-completion": "^0.7.0", + "symfony/browser-kit": ">=2.7 <4.0", + "symfony/console": ">=2.7 <4.0", + "symfony/css-selector": ">=2.7 <4.0", + "symfony/dom-crawler": ">=2.7.5 <4.0", + "symfony/event-dispatcher": ">=2.7 <4.0", + "symfony/finder": ">=2.7 <4.0", + "symfony/yaml": ">=2.7 <4.0" + }, + "require-dev": { + "codeception/specify": "~0.3", + "facebook/graph-sdk": "~5.3", + "flow/jsonpath": "~0.2", + "league/factory-muffin": "^3.0", + "league/factory-muffin-faker": "^1.0", + "mongodb/mongodb": "^1.0", + "monolog/monolog": "~1.8", + "pda/pheanstalk": "~3.0", + "php-amqplib/php-amqplib": "~2.4", + "predis/predis": "^1.0", + "squizlabs/php_codesniffer": "~2.0", + "vlucas/phpdotenv": "^2.4.0" + }, + "suggest": { + "codeception/specify": "BDD-style code blocks", + "codeception/verify": "BDD-style assertions", + "flow/jsonpath": "For using JSONPath in REST module", + "league/factory-muffin": "For DataFactory module", + "league/factory-muffin-faker": "For Faker support in DataFactory module", + "phpseclib/phpseclib": "for SFTP option in FTP Module", + "symfony/phpunit-bridge": "For phpunit-bridge support" + }, + "bin": [ + "codecept" + ], + "type": "library", + "extra": { + "branch-alias": [] + }, + "autoload": { + "psr-4": { + "Codeception\\": "src\\Codeception", + "Codeception\\Extension\\": "ext" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@mail.ua", + "homepage": "http://codegyre.com" + } + ], + "description": "BDD-style testing framework", + "homepage": "http://codeception.com/", + "keywords": [ + "BDD", + "TDD", + "acceptance testing", + "functional testing", + "unit testing" + ], + "time": "2017-03-25 03:19:52" + }, + { + "name": "consolidation/annotated-command", + "version": "2.4.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "7c97c401ea81549779ce96d62f00d230ed5ff1d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7c97c401ea81549779ce96d62f00d230ed5ff1d8", + "reference": "7c97c401ea81549779ce96d62f00d230ed5ff1d8", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "^3.1.5", + "php": ">=5.4.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "psr/log": "~1", + "symfony/console": "^2.8|~3", + "symfony/event-dispatcher": "^2.5|~3", + "symfony/finder": "^2.5|~3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2017-02-28 22:50:54" + }, + { + "name": "consolidation/log", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "74ba81b4edc585616747cc5c5309ce56fec41254" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/74ba81b4edc585616747cc5c5309ce56fec41254", + "reference": "74ba81b4edc585616747cc5c5309ce56fec41254", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "psr/log": "~1.0", + "symfony/console": "~2.5|~3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2016-03-23 23:46:42" + }, + { + "name": "consolidation/output-formatters", + "version": "3.1.8", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "0b50ba1134d581fd55376f3e21508dab009ced47" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/0b50ba1134d581fd55376f3e21508dab009ced47", + "reference": "0b50ba1134d581fd55376f3e21508dab009ced47", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "symfony/console": "^2.8|~3", + "symfony/finder": "~2.5|~3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "^2.7", + "victorjonsson/markdowndocs": "^1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2017-03-01 20:54:45" + }, + { + "name": "consolidation/robo", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "de6225256b2ed88822af1cd8cc3a01bf933add8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/de6225256b2ed88822af1cd8cc3a01bf933add8c", + "reference": "de6225256b2ed88822af1cd8cc3a01bf933add8c", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.2", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.5", + "dflydev/dot-access-data": "^1.1.0", + "grasmash/yaml-expander": "^1.1", + "league/container": "^2.2", + "php": ">=5.5.0", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "~2.8|~3.0", + "symfony/event-dispatcher": "~2.5|~3.0", + "symfony/filesystem": "~2.5|~3.0", + "symfony/finder": "~2.5|~3.0", + "symfony/process": "~2.5|~3.0" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "~1", + "codeception/base": "^2.2.6", + "codeception/verify": "^0.3.2", + "henrikbjorn/lurker": "~1", + "natxet/cssmin": "~3", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.2", + "phpunit/php-code-coverage": "~2|~4", + "satooshi/php-coveralls": "~1" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying JS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "scripts/composer/ScriptHandler.php" + ], + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2017-03-31 18:23:36" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14 19:40:03" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20 21:14:22" + }, + { + "name": "doctrine/annotations", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2017-02-24 16:22:25" + }, + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09 13:34:57" + }, + { + "name": "facebook/webdriver", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/facebook/php-webdriver.git", + "reference": "3ea034c056189e11c0ce7985332a9f4b5b2b5db2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/3ea034c056189e11c0ce7985332a9f4b5b2b5db2", + "reference": "3ea034c056189e11c0ce7985332a9f4b5b2b5db2", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-zip": "*", + "php": "^5.5 || ~7.0", + "symfony/process": "^2.8 || ^3.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", + "php-mock/php-mock-phpunit": "^1.1", + "phpunit/phpunit": "4.6.* || ~5.0", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "^2.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-community": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Facebook\\WebDriver\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "A PHP client for Selenium WebDriver", + "homepage": "https://github.com/facebook/php-webdriver", + "keywords": [ + "facebook", + "php", + "selenium", + "webdriver" + ], + "time": "2017-03-22 10:56:03" + }, + { + "name": "flow/jsonpath", + "version": "0.3.4", + "source": { + "type": "git", + "url": "https://github.com/FlowCommunications/JSONPath.git", + "reference": "00aa9c361e4d0a210dd95f3c917a1e0dde3a957f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FlowCommunications/JSONPath/zipball/00aa9c361e4d0a210dd95f3c917a1e0dde3a957f", + "reference": "00aa9c361e4d0a210dd95f3c917a1e0dde3a957f", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "peekmo/jsonpath": "dev-master", + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Flow\\JSONPath": "src/", + "Flow\\JSONPath\\Test": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stephen Frank", + "email": "stephen@flowsa.com" + } + ], + "description": "JSONPath implementation for parsing, searching and flattening arrays", + "time": "2016-09-06 17:43:18" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "95f9c876ca31f31bf5bfd9c8e89cc1f065c45528" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/95f9c876ca31f31bf5bfd9c8e89cc1f065c45528", + "reference": "95f9c876ca31f31bf5bfd9c8e89cc1f065c45528", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/console": "^2.8.11|^3", + "symfony/yaml": "^2.8.11|^3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-03-24 20:31:04" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.2.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0", + "psr/log": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-02-28 22:50:30" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20 10:07:11" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20 17:10:46" + }, + { + "name": "jms/metadata", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/metadata.git", + "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab", + "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "doctrine/cache": "~1.0", + "symfony/cache": "~3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Metadata\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Class/method/property metadata management in PHP", + "keywords": [ + "annotations", + "metadata", + "xml", + "yaml" + ], + "time": "2016-12-05 10:18:33" + }, + { + "name": "jms/parser-lib", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/parser-lib.git", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "shasum": "" + }, + "require": { + "phpoption/phpoption": ">=0.9,<2.0-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "description": "A library for easily creating recursive-descent parsers.", + "time": "2012-11-18 18:08:43" + }, + { + "name": "jms/serializer", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/serializer.git", + "reference": "5e9008cbb0bac2986979d905a87ae48efcf578c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/5e9008cbb0bac2986979d905a87ae48efcf578c4", + "reference": "5e9008cbb0bac2986979d905a87ae48efcf578c4", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/instantiator": "^1.0.3", + "jms/metadata": "~1.1", + "jms/parser-lib": "1.*", + "php": ">=5.5.0", + "phpcollection/phpcollection": "~0.1", + "phpoption/phpoption": "^1.1" + }, + "conflict": { + "jms/serializer-bundle": "<1.2.1", + "twig/twig": "<1.12" + }, + "require-dev": { + "doctrine/orm": "~2.1", + "doctrine/phpcr-odm": "^1.3|^2.0", + "ext-pdo_sqlite": "*", + "jackalope/jackalope-doctrine-dbal": "^1.1.5", + "phpunit/phpunit": "^4.8|^5.0", + "propel/propel1": "~1.7", + "symfony/expression-language": "^2.6|^3.0", + "symfony/filesystem": "^2.1", + "symfony/form": "~2.1|^3.0", + "symfony/translation": "^2.1|^3.0", + "symfony/validator": "^2.2|^3.0", + "symfony/yaml": "^2.1|^3.0", + "twig/twig": "~1.12|~2.0" + }, + "suggest": { + "doctrine/cache": "Required if you like to use cache functionality.", + "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.", + "symfony/yaml": "Required if you'd like to serialize data to YAML format." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\Serializer": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", + "homepage": "http://jmsyst.com/libs/serializer", + "keywords": [ + "deserialization", + "jaxb", + "json", + "serialization", + "xml" + ], + "time": "2017-03-24 13:11:23" + }, + { + "name": "league/container", + "version": "2.4.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "5ec434f4760d83c2a479266b618fb3e3be24c974" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/5ec434f4760d83c2a479266b618fb3e3be24c974", + "reference": "5ec434f4760d83c2a479266b618fb3e3be24c974", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-03-06 15:24:06" + }, + { + "name": "moontoast/math", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/ramsey/moontoast-math.git", + "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/c2792a25df5cad4ff3d760dd37078fc5b6fccc79", + "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79", + "shasum": "" + }, + "require": { + "ext-bcmath": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "^0.9.0", + "phpunit/phpunit": "^4.7|>=5.0 <5.4", + "satooshi/php-coveralls": "^0.6.1", + "squizlabs/php_codesniffer": "^2.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Moontoast\\Math\\": "src/Moontoast/Math/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A mathematics library, providing functionality for large numbers", + "homepage": "https://github.com/ramsey/moontoast-math", + "keywords": [ + "bcmath", + "math" + ], + "time": "2017-02-16 16:54:46" + }, + { + "name": "myclabs/deep-copy", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-01-26 22:05:40" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.10", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d", + "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ], + "time": "2017-03-13 16:27:32" + }, + { + "name": "phpcollection/phpcollection", + "version": "0.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-collection.git", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "shasum": "" + }, + "require": { + "phpoption/phpoption": "1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4-dev" + } + }, + "autoload": { + "psr-0": { + "PhpCollection": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "General-Purpose Collection Library for PHP", + "keywords": [ + "collection", + "list", + "map", + "sequence", + "set" + ], + "time": "2015-05-17 12:39:23" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-09-30 07:12:33" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-11-25 06:54:22" + }, + { + "name": "phpoption/phpoption", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.7.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-0": { + "PhpOption\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "time": "2015-07-25 16:39:46" + }, + { + "name": "phpspec/prophecy", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2017-03-02 20:05:34" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "09e2277d14ea467e5a984010f501343ef29ffc69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/09e2277d14ea467e5a984010f501343ef29ffc69", + "reference": "09e2277d14ea467e5a984010f501343ef29ffc69", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-03-01 09:12:17" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03 07:40:28" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26 11:10:40" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-02-27 10:12:30" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.17", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/68752b665d3875f9a38a357e3ecb35c79f8673bf", + "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "~1.2", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0.3|~2.0", + "symfony/yaml": "~2.1|~3.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-03-19 16:52:12" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2016-12-08 20:27:08" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14 16:28:37" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06 14:39:51" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10 12:19:37" + }, + { + "name": "ramsey/uuid", + "version": "3.6.1", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "4ae32dd9ab8860a4bbd750ad269cba7f06f7934e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/4ae32dd9ab8860a4bbd750ad269cba7f06f7934e", + "reference": "4ae32dd9ab8860a4bbd750ad269cba7f06f7934e", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "^1.0|^2.0", + "php": "^5.4 || ^7.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "apigen/apigen": "^4.1", + "codeception/aspect-mock": "^1.0 | ^2.0", + "doctrine/annotations": "~1.2.0", + "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1", + "ircmaxell/random-lib": "^1.1", + "jakub-onderka/php-parallel-lint": "^0.9.0", + "mockery/mockery": "^0.9.4", + "moontoast/math": "^1.1", + "php-mock/php-mock-phpunit": "^0.3|^1.1", + "phpunit/phpunit": "^4.7|>=5.0 <5.4", + "satooshi/php-coveralls": "^0.6.1", + "squizlabs/php_codesniffer": "^2.3" + }, + "suggest": { + "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", + "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", + "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", + "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marijn Huizendveld", + "email": "marijn.huizendveld@gmail.com" + }, + { + "name": "Thibaud Fabre", + "email": "thibaud@aztech.io" + }, + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", + "homepage": "https://github.com/ramsey/uuid", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "time": "2017-03-26 20:37:53" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04 06:30:41" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29 09:50:25" + }, + { + "name": "sebastian/diff", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-12-08 07:14:41" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26 07:53:53" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-11-19 08:54:04" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12 03:26:01" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18 15:18:39" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19 07:33:16" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28 20:34:47" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03 07:35:21" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.8.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-03-01 22:17:45" + }, + { + "name": "stecman/symfony-console-completion", + "version": "0.7.0", + "source": { + "type": "git", + "url": "https://github.com/stecman/symfony-console-completion.git", + "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stecman/symfony-console-completion/zipball/5461d43e53092b3d3b9dbd9d999f2054730f4bbb", + "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/console": "~2.3 || ~3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Stecman\\Component\\Symfony\\Console\\BashCompletion\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stephen Holdaway", + "email": "stephen@stecman.co.nz" + } + ], + "description": "Automatic BASH completion for Symfony Console Component based applications.", + "time": "2016-02-24 05:08:54" + }, + { + "name": "symfony/browser-kit", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "2fe0caa60c1a1dfeefd0425741182687a9b382b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/2fe0caa60c1a1dfeefd0425741182687a9b382b8", + "reference": "2fe0caa60c1a1dfeefd0425741182687a9b382b8", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/dom-crawler": "~2.8|~3.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com", + "time": "2017-02-21 09:12:04" + }, + { + "name": "symfony/console", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "28fb243a2b5727774ca309ec2d92da240f1af0dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/28fb243a2b5727774ca309ec2d92da240f1af0dd", + "reference": "28fb243a2b5727774ca309ec2d92da240f1af0dd", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/filesystem": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-03-06 19:30:27" + }, + { + "name": "symfony/css-selector", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/a48f13dc83c168f1253a5d2a5a4fb46c36244c4c", + "reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2017-02-21 09:12:04" + }, + { + "name": "symfony/debug", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "b90c9f91ad8ac37d9f114e369042d3226b34dc1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/b90c9f91ad8ac37d9f114e369042d3226b34dc1a", + "reference": "b90c9f91ad8ac37d9f114e369042d3226b34dc1a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-02-18 17:28:00" + }, + { + "name": "symfony/dom-crawler", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/403944e294cf4ceb3b8447f54cbad88ea7b99cee", + "reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2017-02-21 09:12:04" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d", + "reference": "b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-02-21 09:12:04" + }, + { + "name": "symfony/filesystem", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e542d4765092d22552b1bf01ddccfb01d98ee325", + "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-02-18 17:06:33" + }, + { + "name": "symfony/finder", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/5fc4b5cab38b9d28be318fcffd8066988e7d9451", + "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2017-02-21 08:33:48" + }, + { + "name": "symfony/http-foundation", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "c57009887010eb4e58bfca2970314a5b820b24b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/c57009887010eb4e58bfca2970314a5b820b24b9", + "reference": "c57009887010eb4e58bfca2970314a5b820b24b9", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.1" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2017-03-04 12:23:14" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14 01:06:16" + }, + { + "name": "symfony/process", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "68bfa8c83f24c0ac04ea7193bcdcda4519f41892" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/68bfa8c83f24c0ac04ea7193bcdcda4519f41892", + "reference": "68bfa8c83f24c0ac04ea7193bcdcda4519f41892", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2017-03-04 12:23:14" + }, + { + "name": "symfony/yaml", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-03-07 16:47:02" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23 20:04:58" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "allure-framework/allure-codeception": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [] +} From 17a20f0d6fcbf245e2c93552079f53855918cc5a Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 4 Apr 2017 15:26:29 -0500 Subject: [PATCH 026/149] MTA-4132: Updated step objects to follow naming convention. --- .../Step/Backend/{Admin.php => AdminStep.php} | 2 +- .../Api/{Category.php => CategoryApiStep.php} | 2 +- .../Api/{Product.php => ProductApiStep.php} | 2 +- .../Api/{Customer.php => CustomerApiStep.php} | 2 +- .../Backend/AccessAdminPagesDirectlyCest.php | 6 ++--- .../AccessAdminPagesViaNavMenuCest.php | 26 +++++++++---------- .../Backend/OpenEachSideNavMenuCest.php | 6 ++--- .../Acceptance/Catalog/CreateCategoryCest.php | 10 +++---- .../Catalog/CreateSimpleProductCest.php | 10 +++---- .../Catalog/UpdateSimpleProductCest.php | 14 +++++----- .../Acceptance/SampleTests/TestCest.php | 8 +++--- .../SampleTests/TestStepObjectCept.php | 2 +- .../SampleTests/TestStepObjectCest.php | 6 ++--- .../User/AccessAdminLoginPageCest.php | 4 +-- .../User/AccessForgotYourPasswordCest.php | 10 +++---- .../CannotAccessAdminAfterLoggingOutCest.php | 4 +-- .../User/CannotAccessAdminPagesCest.php | 4 +-- .../User/LoginOnAdminLoginPageCest.php | 4 +-- .../Acceptance/User/LogoutAfterLoginCest.php | 4 +-- 19 files changed, 63 insertions(+), 63 deletions(-) rename tests/_support/Magento/Xxyyzz/Step/Backend/{Admin.php => AdminStep.php} (99%) rename tests/_support/Magento/Xxyyzz/Step/Catalog/Api/{Category.php => CategoryApiStep.php} (94%) rename tests/_support/Magento/Xxyyzz/Step/Catalog/Api/{Product.php => ProductApiStep.php} (94%) rename tests/_support/Magento/Xxyyzz/Step/Customer/Api/{Customer.php => CustomerApiStep.php} (89%) diff --git a/tests/_support/Magento/Xxyyzz/Step/Backend/Admin.php b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php similarity index 99% rename from tests/_support/Magento/Xxyyzz/Step/Backend/Admin.php rename to tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php index 39993c77c..e27b4f277 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Backend/Admin.php +++ b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/../../Helper/AdminUrlList.php'; -class Admin extends \Magento\Xxyyzz\AcceptanceTester +class AdminStep extends \Magento\Xxyyzz\AcceptanceTester { public function goToTheAdminLoginPage() { diff --git a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/Category.php b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php similarity index 94% rename from tests/_support/Magento/Xxyyzz/Step/Catalog/Api/Category.php rename to tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php index fd39fd480..100dbdb9c 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/Category.php +++ b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php @@ -1,7 +1,7 @@ goToTheAdminLoginPage(); $I->loginAsAdmin(); @@ -20,7 +20,7 @@ public function _before(Admin $I) * @env phantomjs * @group slow */ - public function shouldBeAbleToAccessEachAdminPageDirectly(Admin $I) + public function shouldBeAbleToAccessEachAdminPageDirectly(AdminStep $I) { $I->goToTheAdminSalesOrdersPage(); $I->shouldBeOnTheAdminSalesOrdersPage(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index 689a4764a..781132687 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -2,14 +2,14 @@ namespace Magento\Xxyyzz\Acceptance\Backend; use Magento\Xxyyzz\Page\Backend\Admin\SideNavigation as SideNav; -use Magento\Xxyyzz\Step\Backend\Admin; +use Magento\Xxyyzz\Step\Backend\AdminStep; /** * @group skip */ class AccessAdminPagesViaNavMenuCest { - public function _before(Admin $I) + public function _before(AdminStep $I) { $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); @@ -21,7 +21,7 @@ public function _before(Admin $I) * @env firefox * @group slow */ - public function shouldLandOnTheDashboardPage(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnTheDashboardPage(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the DASHBOARD Page using the Side Nav Menus'); $I->goToRandomAdminPage(); @@ -35,7 +35,7 @@ public function shouldLandOnTheDashboardPage(Admin $I, SideNav $sideNavMenu) * @env firefox * @group slow */ - public function shouldLandOnEachOfTheSalesPages(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheSalesPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the SALES Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnSalesInTheSideNavMenu($I); @@ -69,7 +69,7 @@ public function shouldLandOnEachOfTheSalesPages(Admin $I, SideNav $sideNavMenu) * @env firefox * @group slow */ - public function shouldLandOnEachOfTheProductsPages(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheProductsPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the PRODUCTS Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnProductsInTheSideNavMenu($I); @@ -87,7 +87,7 @@ public function shouldLandOnEachOfTheProductsPages(Admin $I, SideNav $sideNavMen * @env firefox * @group slow */ - public function shouldLanOnEachOfTheCustomersPages(Admin $I, SideNav $sideNavMenu) + public function shouldLanOnEachOfTheCustomersPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the CUSTOMERS Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnCustomersInTheSideNavMenu($I); @@ -105,7 +105,7 @@ public function shouldLanOnEachOfTheCustomersPages(Admin $I, SideNav $sideNavMen * @env firefox * @group slow */ - public function shouldLandOnEachOfTheMarketingPages(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheMarketingPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the MARKETING Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); @@ -159,7 +159,7 @@ public function shouldLandOnEachOfTheMarketingPages(Admin $I, SideNav $sideNavMe * @env firefox * @group slow */ - public function shouldLandOnEachOfTheContentPages(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheContentPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the CONTENT Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnContentInTheSideNavMenu($I); @@ -193,7 +193,7 @@ public function shouldLandOnEachOfTheContentPages(Admin $I, SideNav $sideNavMenu * @env firefox * @group slow */ - public function shouldLandOnEachOfTheReportsPages(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheReportsPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the REPORTS Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnReportsInTheSideNavMenu($I); @@ -295,7 +295,7 @@ public function shouldLandOnEachOfTheReportsPages(Admin $I, SideNav $sideNavMenu * @env firefox * @group slow */ - public function shouldLandOnEachOfTheStoresPages(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheStoresPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the STORES Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnStoresInTheSideNavMenu($I); @@ -353,7 +353,7 @@ public function shouldLandOnEachOfTheStoresPages(Admin $I, SideNav $sideNavMenu) * @env firefox * @group slow */ - public function shouldLandOnEachOfTheSystemPages(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnEachOfTheSystemPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the SYSTEM Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnSystemInTheSideNavMenu($I); @@ -418,7 +418,7 @@ public function shouldLandOnEachOfTheSystemPages(Admin $I, SideNav $sideNavMenu) * @env firefox * @group slow */ - public function shouldLandOnTheWebSetupWizardPage(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnTheWebSetupWizardPage(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the Web Setup Wizard Admin Page using the Side Nav Menu'); $sideNavMenu->clickOnSystemInTheSideNavMenu($I); @@ -432,7 +432,7 @@ public function shouldLandOnTheWebSetupWizardPage(Admin $I, SideNav $sideNavMenu * @env firefox * @group slow */ - public function shouldLandOnThePartnersAndExtensionsPage(Admin $I, SideNav $sideNavMenu) + public function shouldLandOnThePartnersAndExtensionsPage(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the Partners and Extensions Admin Page using the Side Nav Menu'); $sideNavMenu->clickOnFindPartnersAndExtensionsInTheSideNavMenu($I); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php index e8d7a7cd1..40cb4f1f9 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php @@ -2,14 +2,14 @@ namespace Magento\Xxyyzz\Acceptance\Backend; use Magento\Xxyyzz\Page\Backend\Admin\SideNavigation as SideNav; -use Magento\Xxyyzz\Step\Backend\Admin; +use Magento\Xxyyzz\Step\Backend\AdminStep; /** * @group skip */ class OpenEachSideNavMenuCest { - public function _before(Admin $I) + public function _before(AdminStep $I) { $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); @@ -20,7 +20,7 @@ public function _before(Admin $I) * @env firefox * @group slow */ - public function shouldBeAbleToOpenEachSideNavMenu(Admin $I, SideNav $sideNavMenu) + public function shouldBeAbleToOpenEachSideNavMenu(AdminStep $I, SideNav $sideNavMenu) { $sideNavMenu->clickOnSalesInTheSideNavMenu($I); $sideNavMenu->shouldSeeTheSalesNavMenu($I); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index 81de3216e..c837e9fc2 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -1,7 +1,7 @@ goToTheAdminLoginPage(); $I->loginAsAdmin(); } - public function _after(Admin $I) + public function _after(AdminStep $I) { $I->goToTheAdminLogoutPage(); } @@ -49,13 +49,13 @@ public function _after(Admin $I) * @env firefox * @env phantomjs * - * @param Admin $I + * @param AdminStep $I * @param AdminCategoryPage $adminCategoryPage * @param DataHelper $dataHelper * @return void */ public function createCategoryTest( - Admin $I, + AdminStep $I, AdminCategoryPage $adminCategoryPage, DataHelper $dataHelper ) { diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index 5de27ed68..750036063 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -1,7 +1,7 @@ goToTheAdminLoginPage(); $I->loginAsAdmin(); } - public function _after(Admin $I) + public function _after(AdminStep $I) { $I->goToTheAdminLogoutPage(); } @@ -49,14 +49,14 @@ public function _after(Admin $I) * @env firefox * @env phantomjs * - * @param Admin $I + * @param AdminStep $I * @param AdminProductGridPage $adminProductGridPage * @param AdminProductPage $adminProductPage * @param DataHelper $dataHelper * @return void */ public function createSimpleProductTest( - Admin $I, + AdminStep $I, AdminProductGridPage $adminProductGridPage, AdminProductPage $adminProductPage, DataHelper $dataHelper diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index bdcced2b2..66b9c574e 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -3,8 +3,8 @@ use Codeception\Scenario; use Magento\Xxyyzz\Helper\DataHelper; -use Magento\Xxyyzz\Step\Backend\Admin; -use Magento\Xxyyzz\Step\Catalog\Api\Product; +use Magento\Xxyyzz\Step\Backend\AdminStep; +use Magento\Xxyyzz\Step\Catalog\Api\ProductApiStep; use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductGridPage; use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductPage; use Yandex\Allure\Adapter\Annotation\Stories; @@ -26,7 +26,7 @@ class UpdateSimpleProductCest { /** - * @var \Magento\Xxyyzz\Step\Backend\Admin + * @var \Magento\Xxyyzz\Step\Backend\AdminStep */ protected $admin; @@ -42,12 +42,12 @@ class UpdateSimpleProductCest public function _before(Scenario $scenario, DataHelper $dataHelper) { - $this->admin = new Admin($scenario); + $this->admin = new AdminStep($scenario); $I = $this->admin; $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); $this->product = $dataHelper->getSimpleProductData(); - $apiHandler = new Product($scenario); + $apiHandler = new ProductApiStep($scenario); $this->product = array_merge($this->product, ['id' => $apiHandler->createProduct(['product' => $this->product])]); } @@ -72,13 +72,13 @@ public function _after() * @env firefox * @env phantomjs * - * @param Admin $I + * @param AdminStep $I * @param AdminProductGridPage $adminProductGridPage * @param AdminProductPage $adminProductPage * @return void */ public function updateSimpleProductTest( - Admin $I, + AdminStep $I, AdminProductGridPage $adminProductGridPage, AdminProductPage $adminProductPage ) { diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php index 50a6691e2..3d8410b77 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php @@ -1,14 +1,14 @@ goToTheAdminLoginPage(); $I->loginAsAdmin(); @@ -19,7 +19,7 @@ public function _before(Admin $I) * @env chrome * @group example */ - public function accessTheSalesOrdersPage(Admin $I) + public function accessTheSalesOrdersPage(AdminStep $I) { $I->goToTheAdminSalesOrdersPage(); $I->shouldBeOnTheAdminSalesOrdersPage(); @@ -30,7 +30,7 @@ public function accessTheSalesOrdersPage(Admin $I) * @env chrome * @group example */ - public function accessTheProductsCatalogPage(Admin $I) + public function accessTheProductsCatalogPage(AdminStep $I) { $I->goToTheAdminProductsCatalogPage(); $I->shouldBeOnTheAdminProductsCatalogPage(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php index d477c97c9..35dd13ddc 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php @@ -2,7 +2,7 @@ namespace Magento\Xxyyzz\Acceptance\SampleTests; // @group skip -$I = new \Magento\Xxyyzz\Step\Backend\Admin(\Codeception\Scenario::$scenario); +$I = new \Magento\Xxyyzz\Step\Backend\AdminStep(\Codeception\Scenario::$scenario); $I->wantTo('demo the usage of StepObject in Cept'); $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php index e99e7dd36..227b4c8e8 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php @@ -1,7 +1,7 @@ wantTo('demo the usage of StepObject in Cest'); $I->goToTheAdminLoginPage(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php index 061652ae8..dbcd793d9 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php @@ -1,7 +1,7 @@ am('an Admin'); $I->wantTo('verify that I can access the Admin Login page'); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php index cb4a1a74f..df42a2b06 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php @@ -2,7 +2,7 @@ namespace Magento\Xxyyzz\Acceptance\User; use Magento\Xxyyzz\Page\Backend\Admin\AdminLogin; -use Magento\Xxyyzz\Step\Backend\Admin; +use Magento\Xxyyzz\Step\Backend\AdminStep; use Yandex\Allure\Adapter\Annotation\Title; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Stories; @@ -18,7 +18,7 @@ */ class AccessForgotYourPasswordCest { - public function _before(Admin $I) + public function _before(AdminStep $I) { $I->goToTheAdminLoginPage(); } @@ -31,7 +31,7 @@ public function _before(Admin $I) * @Severity("critical") * @Parameter("My Param") */ - public function shouldLandOnTheForgotYourPasswordPage(Admin $I, AdminLogin $adminLogin) + public function shouldLandOnTheForgotYourPasswordPage(AdminStep $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Forgot Your Password page'); $adminLogin->clickOnForgotYourPassword($I); @@ -47,7 +47,7 @@ public function shouldLandOnTheForgotYourPasswordPage(Admin $I, AdminLogin $admi * @Title("You should land on the Login page after clicking on 'Back to Sign In'.") * @Severity("trivial") */ - public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(Admin $I, AdminLogin $adminLogin) + public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(AdminStep $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Login page from the Forgot Your Password page'); $adminLogin->clickOnForgotYourPassword($I); @@ -62,7 +62,7 @@ public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(Admin $I, Admi * @Title("You should land on the Login page after clicking on the Logo.") * @Severity("normal") */ - public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(Admin $I, AdminLogin $adminLogin) + public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(AdminStep $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Login page by clicking on the Logo'); $adminLogin->clickOnMagentoLogo($I); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php index bbfd8632a..9cac94aa6 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php @@ -1,7 +1,7 @@ wantTo('make sure you cannot access Admin pages after logging out'); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php index 6b442fab0..c77b2504a 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php @@ -1,7 +1,7 @@ wantTo('make sure you cannot access Admin pages when NOT logged in'); $I->goToTheAdminLoginPage(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php index 63da2eb2d..1ea46edc0 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php @@ -1,7 +1,7 @@ wantTo('verify that I can login via the Admin Login page'); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php index ddaceafcb..cf41358b3 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php @@ -1,7 +1,7 @@ wantTo('logout of the Admin area and land on the Login page'); From 5d15d7f43082c0b86ffff68b248f56e4e666afcf Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 10 Apr 2017 10:03:12 -0500 Subject: [PATCH 027/149] 1. Created MagentoWebDriver, MagentoRESTDriver, and MagentoDataSequence modules utilizing codeception modules; 2. Added PHP dotenv (.env.example) so that custom configurations / credentials can be loaded through environment variables. --- .env.example | 9 + .gitignore | 8 +- codeception.dist.yml | 8 +- composer.json | 3 +- composer.lock | 176 +++++++++++------- tests/_envs/chrome.yml | 6 +- tests/_envs/firefox.yml | 6 +- tests/_envs/phantomjs.yml | 6 +- tests/_output/.gitignore | 2 - .../Magento/Xxyyzz/AcceptanceTester.php | 24 +-- .../Magento/Xxyyzz/Helper/Acceptance.php | 14 +- .../Magento/Xxyyzz/Helper/AdminUiHelper.php | 77 -------- .../Magento/Xxyyzz/Helper/WebapiHelper.php | 78 -------- .../MagentoDataSequence.php} | 4 +- .../Xxyyzz/Module/MagentoRestDriver.php | 154 +++++++++++++++ .../Xxyyzz/Module/MagentoWebDriver.php | 108 +++++++++++ .../Step/Catalog/Api/CategoryApiStep.php | 20 +- .../Step/Catalog/Api/ProductApiStep.php | 20 +- .../Step/Customer/Api/CustomerApiStep.php | 10 +- tests/acceptance.suite.dist.yml | 24 ++- .../Acceptance/Catalog/CreateCategoryCest.php | 7 +- .../Catalog/CreateSimpleProductCest.php | 7 +- .../Catalog/UpdateSimpleProductCest.php | 17 +- 23 files changed, 454 insertions(+), 334 deletions(-) create mode 100644 .env.example delete mode 100644 tests/_output/.gitignore delete mode 100644 tests/_support/Magento/Xxyyzz/Helper/AdminUiHelper.php delete mode 100644 tests/_support/Magento/Xxyyzz/Helper/WebapiHelper.php rename tests/_support/Magento/Xxyyzz/{Helper/DataHelper.php => Module/MagentoDataSequence.php} (98%) create mode 100644 tests/_support/Magento/Xxyyzz/Module/MagentoRestDriver.php create mode 100644 tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..9cf46d76e --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +MAGENTO_BASE_URL=http://magento3.loc/index.php + +MAGENTO_BACKEND_NAME=admin +MAGENTO_ADMIN_USERNAME=admin +MAGENTO_ADMIN_PASSWORD=123123q + +DB_DSN='' +DB_USERNAME='' +DB_PASSWORD='' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 351679f69..35e5ea192 100755 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ -*.iml .idea composer.phar vendor/* tests/_output/* -allure-report/* -/tests/_support/Magento/Xxyyzz/_generated/ -codeception.yml +tests/_support/Magento/Xxyyzz/_generated/ +tests/_support/Magento/Xxyyzz/AcceptanceTester.php tests/acceptance.suite.yml +codeception.yml +.env \ No newline at end of file diff --git a/codeception.dist.yml b/codeception.dist.yml index 4aabf32e6..434f1510f 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -20,10 +20,12 @@ extensions: ignoredAnnotations: - env - zephyrId +params: + - .env modules: config: Db: - dsn: '' - user: '' - password: '' + dsn: "%DB_DSN%" + user: "%DB_USERNAME%" + password: "%DB_PASSWORD%" dump: tests/_data/dump.sql \ No newline at end of file diff --git a/composer.json b/composer.json index 04b03c8b3..f729fbb3d 100755 --- a/composer.json +++ b/composer.json @@ -7,7 +7,8 @@ "symfony/finder": "~2.6", "consolidation/robo": "^1.0.0", "allure-framework/allure-codeception": "dev-master", - "flow/jsonpath": ">0.2" + "flow/jsonpath": ">0.2", + "vlucas/phpdotenv": "~2.4" }, "autoload": { "psr-0": { diff --git a/composer.lock b/composer.lock index 47cb45822..d5d6c5f94 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "410ceacf5b3a4b2a47062cea3cf24a7c", - "content-hash": "bf20c944a10299d67300853866fb3777", + "hash": "0deaa92448076e655a2124e0369e35a0", + "content-hash": "5828e77f3c19b865bee2083e049d0d6b", "packages": [ { "name": "allure-framework/allure-codeception", @@ -264,26 +264,26 @@ }, { "name": "consolidation/annotated-command", - "version": "2.4.5", + "version": "2.4.8", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "7c97c401ea81549779ce96d62f00d230ed5ff1d8" + "reference": "6672ea38212f8bffb71fec7eadc8b3372154b17e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7c97c401ea81549779ce96d62f00d230ed5ff1d8", - "reference": "7c97c401ea81549779ce96d62f00d230ed5ff1d8", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/6672ea38212f8bffb71fec7eadc8b3372154b17e", + "reference": "6672ea38212f8bffb71fec7eadc8b3372154b17e", "shasum": "" }, "require": { "consolidation/output-formatters": "^3.1.5", "php": ">=5.4.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "psr/log": "~1", + "psr/log": "^1", "symfony/console": "^2.8|~3", - "symfony/event-dispatcher": "^2.5|~3", - "symfony/finder": "^2.5|~3" + "symfony/event-dispatcher": "^2.5|^3", + "symfony/finder": "^2.5|^3" }, "require-dev": { "phpunit/phpunit": "^4.8", @@ -312,7 +312,7 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-02-28 22:50:54" + "time": "2017-04-03 22:37:00" }, { "name": "consolidation/log", @@ -1752,16 +1752,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "4.0.7", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "09e2277d14ea467e5a984010f501343ef29ffc69" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/09e2277d14ea467e5a984010f501343ef29ffc69", - "reference": "09e2277d14ea467e5a984010f501343ef29ffc69", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { @@ -1811,7 +1811,7 @@ "testing", "xunit" ], - "time": "2017-03-01 09:12:17" + "time": "2017-04-02 07:44:40" }, { "name": "phpunit/php-file-iterator", @@ -2001,16 +2001,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.7.17", + "version": "5.7.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf" + "reference": "69c4f49ff376af2692bad9cebd883d17ebaa98a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/68752b665d3875f9a38a357e3ecb35c79f8673bf", - "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/69c4f49ff376af2692bad9cebd883d17ebaa98a1", + "reference": "69c4f49ff376af2692bad9cebd883d17ebaa98a1", "shasum": "" }, "require": { @@ -2079,7 +2079,7 @@ "testing", "xunit" ], - "time": "2017-03-19 16:52:12" + "time": "2017-04-03 02:22:27" }, { "name": "phpunit/phpunit-mock-objects", @@ -3006,7 +3006,7 @@ }, { "name": "symfony/browser-kit", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -3063,16 +3063,16 @@ }, { "name": "symfony/console", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "28fb243a2b5727774ca309ec2d92da240f1af0dd" + "reference": "c30243cc51f726812be3551316b109a2f5deaf8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/28fb243a2b5727774ca309ec2d92da240f1af0dd", - "reference": "28fb243a2b5727774ca309ec2d92da240f1af0dd", + "url": "https://api.github.com/repos/symfony/console/zipball/c30243cc51f726812be3551316b109a2f5deaf8d", + "reference": "c30243cc51f726812be3551316b109a2f5deaf8d", "shasum": "" }, "require": { @@ -3122,11 +3122,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-03-06 19:30:27" + "time": "2017-04-04 14:33:42" }, { "name": "symfony/css-selector", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -3179,16 +3179,16 @@ }, { "name": "symfony/debug", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "b90c9f91ad8ac37d9f114e369042d3226b34dc1a" + "reference": "56f613406446a4a0a031475cfd0a01751de22659" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/b90c9f91ad8ac37d9f114e369042d3226b34dc1a", - "reference": "b90c9f91ad8ac37d9f114e369042d3226b34dc1a", + "url": "https://api.github.com/repos/symfony/debug/zipball/56f613406446a4a0a031475cfd0a01751de22659", + "reference": "56f613406446a4a0a031475cfd0a01751de22659", "shasum": "" }, "require": { @@ -3232,11 +3232,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-02-18 17:28:00" + "time": "2017-03-28 21:38:24" }, { "name": "symfony/dom-crawler", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -3292,16 +3292,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d" + "reference": "154bb1ef7b0e42ccc792bd53edbce18ed73440ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d", - "reference": "b7a1b9e0a0f623ce43b4c8d775eb138f190c9d8d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/154bb1ef7b0e42ccc792bd53edbce18ed73440ca", + "reference": "154bb1ef7b0e42ccc792bd53edbce18ed73440ca", "shasum": "" }, "require": { @@ -3348,20 +3348,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-02-21 09:12:04" + "time": "2017-04-04 07:26:27" }, { "name": "symfony/filesystem", - "version": "v2.8.18", + "version": "v2.8.19", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325" + "reference": "31ab6827a696244094e6e20d77e7d404f8eb4252" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e542d4765092d22552b1bf01ddccfb01d98ee325", - "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/31ab6827a696244094e6e20d77e7d404f8eb4252", + "reference": "31ab6827a696244094e6e20d77e7d404f8eb4252", "shasum": "" }, "require": { @@ -3397,20 +3397,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-02-18 17:06:33" + "time": "2017-03-26 15:40:40" }, { "name": "symfony/finder", - "version": "v2.8.18", + "version": "v2.8.19", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451" + "reference": "7131327eb95d86d72039fd1216226c28f36fd02a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/5fc4b5cab38b9d28be318fcffd8066988e7d9451", - "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451", + "url": "https://api.github.com/repos/symfony/finder/zipball/7131327eb95d86d72039fd1216226c28f36fd02a", + "reference": "7131327eb95d86d72039fd1216226c28f36fd02a", "shasum": "" }, "require": { @@ -3446,20 +3446,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-02-21 08:33:48" + "time": "2017-03-20 08:46:40" }, { "name": "symfony/http-foundation", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "c57009887010eb4e58bfca2970314a5b820b24b9" + "reference": "cb0b6418f588952c9290b3df4ca650f1b7ab570a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/c57009887010eb4e58bfca2970314a5b820b24b9", - "reference": "c57009887010eb4e58bfca2970314a5b820b24b9", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cb0b6418f588952c9290b3df4ca650f1b7ab570a", + "reference": "cb0b6418f588952c9290b3df4ca650f1b7ab570a", "shasum": "" }, "require": { @@ -3499,7 +3499,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-03-04 12:23:14" + "time": "2017-04-04 15:30:56" }, { "name": "symfony/polyfill-mbstring", @@ -3562,16 +3562,16 @@ }, { "name": "symfony/process", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "68bfa8c83f24c0ac04ea7193bcdcda4519f41892" + "reference": "57fdaa55827ae14d617550ebe71a820f0a5e2282" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/68bfa8c83f24c0ac04ea7193bcdcda4519f41892", - "reference": "68bfa8c83f24c0ac04ea7193bcdcda4519f41892", + "url": "https://api.github.com/repos/symfony/process/zipball/57fdaa55827ae14d617550ebe71a820f0a5e2282", + "reference": "57fdaa55827ae14d617550ebe71a820f0a5e2282", "shasum": "" }, "require": { @@ -3607,20 +3607,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-03-04 12:23:14" + "time": "2017-03-27 18:07:02" }, { "name": "symfony/yaml", - "version": "v3.2.6", + "version": "v3.2.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" + "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", - "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "url": "https://api.github.com/repos/symfony/yaml/zipball/62b4cdb99d52cb1ff253c465eb1532a80cebb621", + "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621", "shasum": "" }, "require": { @@ -3662,7 +3662,57 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-03-07 16:47:02" + "time": "2017-03-20 09:45:15" + }, + { + "name": "vlucas/phpdotenv", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", + "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause-Attribution" + ], + "authors": [ + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "http://www.vancelucas.com" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "time": "2016-09-01 10:05:43" }, { "name": "webmozart/assert", diff --git a/tests/_envs/chrome.yml b/tests/_envs/chrome.yml index 4a745a625..6839edb67 100644 --- a/tests/_envs/chrome.yml +++ b/tests/_envs/chrome.yml @@ -1,11 +1,9 @@ # `chrome` environment config goes here modules: enabled: - - WebDriver + - \Magento\Xxyyzz\Module\MagentoWebDriver - \Magento\Xxyyzz\Helper\Acceptance - - \Magento\Xxyyzz\Helper\AdminUiHelper - - \Magento\Xxyyzz\Helper\WebapiHelper config: - WebDriver: + \Magento\Xxyyzz\Module\MagentoWebDriver: browser: chrome window_size: maximize \ No newline at end of file diff --git a/tests/_envs/firefox.yml b/tests/_envs/firefox.yml index b2ff31ffa..55ce4aa71 100644 --- a/tests/_envs/firefox.yml +++ b/tests/_envs/firefox.yml @@ -1,11 +1,9 @@ # `firefox` environment config goes here modules: enabled: - - WebDriver + - \Magento\Xxyyzz\Module\MagentoWebDriver - \Magento\Xxyyzz\Helper\Acceptance - - \Magento\Xxyyzz\Helper\AdminUiHelper - - \Magento\Xxyyzz\Helper\WebapiHelper config: - WebDriver: + \Magento\Xxyyzz\Module\MagentoWebDriver: browser: firefox window_size: maximize \ No newline at end of file diff --git a/tests/_envs/phantomjs.yml b/tests/_envs/phantomjs.yml index 6bf87154e..ef13b921c 100644 --- a/tests/_envs/phantomjs.yml +++ b/tests/_envs/phantomjs.yml @@ -1,10 +1,8 @@ # `phantomjs` environment config goes here modules: enabled: - - WebDriver + - \Magento\Xxyyzz\Module\MagentoWebDriver - \Magento\Xxyyzz\Helper\Acceptance - - \Magento\Xxyyzz\Helper\AdminUiHelper - - \Magento\Xxyyzz\Helper\WebapiHelper config: - WebDriver: + \Magento\Xxyyzz\Module\MagentoWebDriver: browser: phantomjs \ No newline at end of file diff --git a/tests/_output/.gitignore b/tests/_output/.gitignore deleted file mode 100644 index c96a04f00..000000000 --- a/tests/_output/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/AcceptanceTester.php b/tests/_support/Magento/Xxyyzz/AcceptanceTester.php index 8c4b20fe3..4c8fa87a7 100644 --- a/tests/_support/Magento/Xxyyzz/AcceptanceTester.php +++ b/tests/_support/Magento/Xxyyzz/AcceptanceTester.php @@ -15,28 +15,12 @@ * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) * * @SuppressWarnings(PHPMD) - */ +*/ class AcceptanceTester extends \Codeception\Actor { use _generated\AcceptanceTesterActions; - /** - * Magento admin username - * @var string - */ - protected static $adminUsername; - - /** - * Magento Admin password - * @var string - */ - protected static $adminPassword; - - public function __construct(\Codeception\Scenario $scenario) - { - parent::__construct($scenario); - $config = \Codeception\Configuration::suiteSettings('acceptance', \Codeception\Configuration::config()); - self::$adminUsername = $config['data']['magento']['admin_username']; - self::$adminPassword = $config['data']['magento']['admin_password']; - } + /** + * Define custom actions here + */ } diff --git a/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php b/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php index 1e8c978bb..7189bf873 100644 --- a/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php +++ b/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php @@ -18,18 +18,6 @@ class Acceptance extends \Codeception\Module */ public function changeConfiguration($config, $value) { - $this->getModule('WebDriver')->_reconfigure(array($config => $value)); - } - - /** - * Get config value for a given $configGroup by $configKey. - * - * @param string $configGroup - * @param string $configKey - * @return string | null - */ - public function getConfiguration($configGroup, $configKey) - { - return isset($this->config[$configGroup][$configKey]) ? $this->config[$configGroup][$configKey] : null; + $this->getModule('MagentoWebDriver')->_reconfigure(array($config => $value)); } } diff --git a/tests/_support/Magento/Xxyyzz/Helper/AdminUiHelper.php b/tests/_support/Magento/Xxyyzz/Helper/AdminUiHelper.php deleted file mode 100644 index 4f0d92d53..000000000 --- a/tests/_support/Magento/Xxyyzz/Helper/AdminUiHelper.php +++ /dev/null @@ -1,77 +0,0 @@ -webDriver = $this->getModule('WebDriver'); - if (!isset(self::$adminUsername) || !isset(self::$adminUsername)) { - $config = \Codeception\Configuration::suiteSettings('acceptance', \Codeception\Configuration::config()); - self::$adminUsername = $config['data']['magento']['admin_username']; - self::$adminPassword = $config['data']['magento']['admin_password']; - } - } - - /** - * Login Magento Admin with given username and password. - * - * @param string $username - * @param string $password - * @return void - */ - public function loginAsAdmin($username = null, $password = null) - { - $this->webDriver->fillField('login[username]', !is_null($username) ? $username : self::$adminUsername); - $this->webDriver->fillField('login[password]', !is_null($password) ? $password : self::$adminPassword); - $this->webDriver->click('Sign in'); - - $this->closeAdminNotification(); - } - - /** - * Close admin notification popup windows. - * - * @return void - */ - public function closeAdminNotification() - { - // Cheating here for the minute. Still working on the best method to deal with this issue. - $this->webDriver->executeJS("jQuery('.modal-popup').remove(); jQuery('.modals-overlay').remove();"); - -// try { -// $I->waitForElementVisible('._show .action-close', 1); -// $I->click('._show .action-close'); -// $I->waitForElementNotVisible('._show .action-close', 1); -// } catch (\Exception $e) { -// return false; -// } - } -} diff --git a/tests/_support/Magento/Xxyyzz/Helper/WebapiHelper.php b/tests/_support/Magento/Xxyyzz/Helper/WebapiHelper.php deleted file mode 100644 index 31dc8e565..000000000 --- a/tests/_support/Magento/Xxyyzz/Helper/WebapiHelper.php +++ /dev/null @@ -1,78 +0,0 @@ -restDriver = $this->getModule('REST'); - if (!isset(self::$adminUsername) || !isset(self::$adminUsername)) { - $config = \Codeception\Configuration::suiteSettings('acceptance', \Codeception\Configuration::config()); - self::$adminUsername = $config['data']['magento']['admin_username']; - self::$adminPassword = $config['data']['magento']['admin_password']; - } - } - - /** - * Get admin auth token by username and password. - * - * @param string $username - * @param string $password - * @param bool $newToken - * @return string - */ - public function getAdminAuthToken($username = null, $password = null, $newToken = false) - { - $username = !is_null($username) ? $username : self::$adminUsername; - $password = !is_null($password) ? $password : self::$adminPassword; - - // Use existing token if it exists - if (!$newToken - && (isset(self::$adminTokens[$username]) || array_key_exists($username, self::$adminTokens))) { - return self::$adminTokens[$username]; - } - $this->restDriver = $this->getModule('REST'); - $this->restDriver->haveHttpHeader('Content-Type', 'application/json'); - $this->restDriver->sendPOST('integration/admin/token', ['username' => $username, 'password' => $password]); - $token = substr($this->restDriver->grabResponse(), 1, strlen($this->restDriver->grabResponse())-2); - $this->restDriver->seeResponseCodeIs(200); - self::$adminTokens[$username] = $token; - return $token; - } -} diff --git a/tests/_support/Magento/Xxyyzz/Helper/DataHelper.php b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php similarity index 98% rename from tests/_support/Magento/Xxyyzz/Helper/DataHelper.php rename to tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php index 55437afeb..694b4b99a 100644 --- a/tests/_support/Magento/Xxyyzz/Helper/DataHelper.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php @@ -1,9 +1,9 @@ '', + 'username' => '', + 'password' => '' + ]; + + /** + * Admin tokens for Magento webapi access. + * + * @var array + */ + protected static $adminTokens = []; + + /** + * Before suite. + * + * @param array $settings + */ + public function _beforeSuite($settings = []) + { + parent::_beforeSuite($settings); + $this->haveHttpHeader('Content-Type', 'application/json'); + $this->sendPOST( + 'integration/admin/token', + ['username' => $this->config['username'], 'password' => $this->config['password']] + ); + $token = substr($this->grabResponse(), 1, strlen($this->grabResponse())-2); + $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + $this->haveHttpHeader('Authorization', 'Bearer ' . $token); + self::$adminTokens[$this->config['username']] = $token; + } + + /** + * After suite. + */ + public function _afterSuite() + { + parent::_afterSuite(); + $this->deleteHeader('Authorization'); + } + + /** + * Get admin auth token by username and password. + * + * @param string $username + * @param string $password + * @param bool $newToken + * @return string + * @part json + * @part xml + */ + public function getAdminAuthToken($username = null, $password = null, $newToken = false) + { + $username = !is_null($username) ? $username : $this->config['username']; + $password = !is_null($password) ? $password : $this->config['password']; + + // Use existing token if it exists + if (!$newToken + && (isset(self::$adminTokens[$username]) || array_key_exists($username, self::$adminTokens))) { + return self::$adminTokens[$username]; + } + $this->haveHttpHeader('Content-Type', 'application/json'); + $this->sendPOST('integration/admin/token', ['username' => $username, 'password' => $password]); + $token = substr($this->grabResponse(), 1, strlen($this->grabResponse())-2); + $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + self::$adminTokens[$username] = $token; + return $token; + } + + /** + * Admin token authentication for a given user. + * + * @param string $username + * @param string $password + * @param bool $newToken + * @part json + * @part xml + */ + public function amAdminTokenAuthenticated($username = null, $password = null, $newToken = false) + { + $username = !is_null($username) ? $username : $this->config['username']; + $password = !is_null($password) ? $password : $this->config['password']; + + $this->haveHttpHeader('Content-Type', 'application/json'); + if ($newToken || !isset(self::$adminTokens[$username])) { + $this->sendPOST('integration/admin/token', ['username' => $username, 'password' => $password]); + $token = substr($this->grabResponse(), 1, strlen($this->grabResponse()) - 2); + $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + self::$adminTokens[$username] = $token; + } + $this->amBearerAuthenticated(self::$adminTokens[$username]); + } +} diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php new file mode 100644 index 000000000..6eb6bc1a9 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -0,0 +1,108 @@ +config['url'])) { + throw new ModuleConfigException( + __CLASS__, + "Module connection failure. The URL for client can't bre retrieved" + ); + } + return $this->config['url']; + } + + /** + * Uri of currently opened page. + * @return string + * @api + * @throws ModuleException + */ + public function _getCurrentUri() + { + $url = $this->webDriver->getCurrentURL(); + if ($url == 'about:blank') { + throw new ModuleException($this, 'Current url is blank, no page was opened'); + } + return Uri::retrieveUri($url); + } + + /** + * Login Magento Admin with given username and password. + * + * @param string $username + * @param string $password + * @return void + */ + public function loginAsAdmin($username = null, $password = null) + { + $this->amOnPage($this->config['backend_name']); + $this->fillField('login[username]', !is_null($username) ? $username : $this->config['username']); + $this->fillField('login[password]', !is_null($password) ? $password : $this->config['password']); + $this->click('Sign in'); + + $this->closeAdminNotification(); + } + + /** + * Close admin notification popup windows. + * + * @return void + */ + public function closeAdminNotification() + { + // Cheating here for the minute. Still working on the best method to deal with this issue. + $this->executeJS("jQuery('.modal-popup').remove(); jQuery('.modals-overlay').remove();"); + +// try { +// $I->waitForElementVisible('._show .action-close', 1); +// $I->click('._show .action-close'); +// $I->waitForElementNotVisible('._show .action-close', 1); +// } catch (\Exception $e) { +// return false; +// } + } +} diff --git a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php index 100dbdb9c..71e055a9b 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php +++ b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php @@ -13,11 +13,11 @@ class CategoryApiStep extends \Magento\Xxyyzz\AcceptanceTester */ public function createCategory(array $params) { - $this->amBearerAuthenticated($this->getAdminAuthToken()); - $this->haveHttpHeader('Content-Type', 'application/json'); - $this->sendPOST($this->endpoint, $params); - $this->seeResponseCodeIs(200); - return $this->grabDataFromResponseByJsonPath('$.id')[0]; + $I = $this; + $I->amAdminTokenAuthenticated(); + $I->sendPOST($this->endpoint, $params); + $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + return $I->grabDataFromResponseByJsonPath('$.id')[0]; } /** @@ -28,10 +28,10 @@ public function createCategory(array $params) */ public function getCategory($id) { - $this->amBearerAuthenticated($this->getAdminAuthToken()); - $this->haveHttpHeader('Content-Type', 'application/json'); - $this->sendGET($this->endpoint . "/$id"); - $this->seeResponseCodeIs(200); - return $this->grabResponse(); + $I = $this; + $I->amAdminTokenAuthenticated(); + $I->sendGET($this->endpoint . "/$id"); + $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + return $I->grabResponse(); } } diff --git a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/ProductApiStep.php b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/ProductApiStep.php index 9b95a5de9..a1b97d54c 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/ProductApiStep.php +++ b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/ProductApiStep.php @@ -13,11 +13,11 @@ class ProductApiStep extends \Magento\Xxyyzz\AcceptanceTester */ public function createProduct(array $params) { - $this->amBearerAuthenticated($this->getAdminAuthToken()); - $this->haveHttpHeader('Content-Type', 'application/json'); - $this->sendPOST($this->endpoint, $params); - $this->seeResponseCodeIs(200); - return $this->grabDataFromResponseByJsonPath('$.id')[0]; + $I = $this; + $I->amAdminTokenAuthenticated(); + $I->sendPOST($this->endpoint, $params); + $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + return $I->grabDataFromResponseByJsonPath('$.id')[0]; } /** @@ -28,10 +28,10 @@ public function createProduct(array $params) */ public function getProduct($sku) { - $this->amBearerAuthenticated($this->getAdminAuthToken()); - $this->haveHttpHeader('Content-Type', 'application/json'); - $this->sendGET($this->endpoint . "/$sku"); - $this->seeResponseCodeIs(200); - return $this->grabDataFromResponseByJsonPath('$..*'); + $I = $this; + $I->amAdminTokenAuthenticated(); + $I->sendGET($this->endpoint . "/$sku"); + $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + return $I->grabDataFromResponseByJsonPath('$..*'); } } diff --git a/tests/_support/Magento/Xxyyzz/Step/Customer/Api/CustomerApiStep.php b/tests/_support/Magento/Xxyyzz/Step/Customer/Api/CustomerApiStep.php index 5dc232988..46b2240ab 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Customer/Api/CustomerApiStep.php +++ b/tests/_support/Magento/Xxyyzz/Step/Customer/Api/CustomerApiStep.php @@ -13,10 +13,10 @@ class CustomerApiStep extends \Magento\Xxyyzz\AcceptanceTester */ public function createCustomer(array $params) { - $this->amBearerAuthenticated($this->getAdminAuthToken()); - $this->haveHttpHeader('Content-Type', 'application/json'); - $this->sendPOST($this->endpoint, $params); - $this->seeResponseCodeIs(200); - return $this->grabDataFromResponseByJsonPath('$.id')[0]; + $I = $this; + $I->amAdminTokenAuthenticated(); + $I->sendPOST($this->endpoint, $params); + $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + return $I->grabDataFromResponseByJsonPath('$.id')[0]; } } diff --git a/tests/acceptance.suite.dist.yml b/tests/acceptance.suite.dist.yml index 05cbc1d0f..ad6cbf65b 100644 --- a/tests/acceptance.suite.dist.yml +++ b/tests/acceptance.suite.dist.yml @@ -8,22 +8,20 @@ class_name: AcceptanceTester namespace: Magento\Xxyyzz modules: enabled: - - WebDriver + - \Magento\Xxyyzz\Module\MagentoWebDriver - \Magento\Xxyyzz\Helper\Acceptance - - \Magento\Xxyyzz\Helper\AdminUiHelper - - \Magento\Xxyyzz\Helper\WebapiHelper - - REST: - url: http://magento.loc/index.php/rest/default/V1/ + - \Magento\Xxyyzz\Module\MagentoRESTDriver: + url: "%MAGENTO_BASE_URL%/rest/default/V1/" + username: "%MAGENTO_ADMIN_USERNAME%" + password: "%MAGENTO_ADMIN_PASSWORD%" depends: PhpBrowser part: Json - - Sequence + - \Magento\Xxyyzz\Module\MagentoDataSequence config: - WebDriver: - url: http://magento.loc/index.php + \Magento\Xxyyzz\Module\MagentoWebDriver: + url: "%MAGENTO_BASE_URL%" + backend_name: admin browser: chrome window_size: maximize -data: - magento: - url: http://magento.loc/index.php - admin_username: admin - admin_password: 123123q \ No newline at end of file + username: "%MAGENTO_ADMIN_USERNAME%" + password: "%MAGENTO_ADMIN_PASSWORD%" \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index c837e9fc2..aa3508c42 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -3,7 +3,6 @@ use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Page\Catalog\Admin\AdminCategoryPage; -use Magento\Xxyyzz\Helper\DataHelper; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Title; @@ -51,16 +50,14 @@ public function _after(AdminStep $I) * * @param AdminStep $I * @param AdminCategoryPage $adminCategoryPage - * @param DataHelper $dataHelper * @return void */ public function createCategoryTest( AdminStep $I, - AdminCategoryPage $adminCategoryPage, - DataHelper $dataHelper + AdminCategoryPage $adminCategoryPage ) { $I->wantTo('verify category creation in admin'); - $category = $dataHelper->getCategoryData(); + $category = $I->getCategoryData(); $adminCategoryPage->amOnAdminCategoryPage($I); $adminCategoryPage->addSubCategory($I); $adminCategoryPage->fillFieldCategoryName($I, $category['name']); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index 750036063..78690afa0 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -4,7 +4,6 @@ use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductGridPage; use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductPage; -use Magento\Xxyyzz\Helper\DataHelper; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Title; @@ -52,17 +51,15 @@ public function _after(AdminStep $I) * @param AdminStep $I * @param AdminProductGridPage $adminProductGridPage * @param AdminProductPage $adminProductPage - * @param DataHelper $dataHelper * @return void */ public function createSimpleProductTest( AdminStep $I, AdminProductGridPage $adminProductGridPage, - AdminProductPage $adminProductPage, - DataHelper $dataHelper + AdminProductPage $adminProductPage ) { $I->wantTo('verify simple product creation in admin'); - $product = $dataHelper->getSimpleProductData(); + $product = $I->getSimpleProductData(); $adminProductGridPage->amOnAdminProductGridPage($I); $adminProductGridPage->goToAddNewProductPage($I); $adminProductPage->amOnAdminNewProductPage($I); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index 66b9c574e..6ffb461c5 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -2,7 +2,6 @@ namespace Magento\Xxyyzz\Acceptance\Catalog; use Codeception\Scenario; -use Magento\Xxyyzz\Helper\DataHelper; use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Step\Catalog\Api\ProductApiStep; use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductGridPage; @@ -36,24 +35,20 @@ class UpdateSimpleProductCest protected $product; /** - * @param Scenario $scenario - * @param DataHelper $dataHelper + * @param AdminStep $I */ - public function _before(Scenario $scenario, DataHelper $dataHelper) + public function _before(AdminStep $I, ProductApiStep $api) { - $this->admin = new AdminStep($scenario); - $I = $this->admin; $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); - $this->product = $dataHelper->getSimpleProductData(); - $apiHandler = new ProductApiStep($scenario); - $this->product = array_merge($this->product, ['id' => $apiHandler->createProduct(['product' => $this->product])]); + $this->product = $I->getSimpleProductData(); + $api->amAdminTokenAuthenticated(); + $this->product = array_merge($this->product, ['id' => $api->createProduct(['product' => $this->product])]); } - public function _after() + public function _after(AdminStep $I) { - $I = $this->admin; $I->goToTheAdminLogoutPage(); } From 1da4799c0f00ee59a07d8c8f1a31f0bdc30b850a Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 10 Apr 2017 11:41:59 -0500 Subject: [PATCH 028/149] Updated README.md. --- README.md | 68 ++++++++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 75d1f6949..399809a96 100755 --- a/README.md +++ b/README.md @@ -1,62 +1,59 @@ # Welcome to the example of Codeception + Robo + Allure! - ### Prerequisites * **Codeception**, **Allure** and **Robo** are PHP based applications installed via **Composer**, so you will need to have **Composer** installed in order to run the following. Please visit the [Composer](https://getcomposer.org/) homepage for installation instructions. - * Some settings need to be adjusted to meet the build environment settings in the appropriate `XXX.suite.yml` file in the `[PROJECT_ROOT]/tests/` directory: `[PROJECT_ROOT]/tests/XXXXXXX.suite.yml` +### Configuration +* Create .env file by copying existing .env.example file at project root directory - -##### [PROJECT_ROOT]/tests/acceptance.suite.yml -* Edit the following section of code to set the Storefront URL: ``` - ... - url: "http://127.0.0.1:32769" - ... + cp .env.example .env ``` - -##### [PROJECT_ROOT]/tests/_support/AcceptanceTester.php -* Edit the following section of code at the bottom of the `AcceptanceTester.php` file to set the **Admin Credentials**: - +* Configure the following environment variables according to Magento application being tested. ``` - ... - public function loginAsAnExistingAdmin() { - $I = $this; - $I->fillField('login[username]', 'admin'); - $I->fillField('login[password]', 'admin123'); - $I->click('Sign in'); - $I->closeAdminNotification(); - } - ... + MAGENTO_BASE_URL=http://magento.loc/index.php + + MAGENTO_BACKEND_NAME=admin + MAGENTO_ADMIN_USERNAME=admin + MAGENTO_ADMIN_PASSWORD=123123q + + DB_DSN='' + DB_USERNAME='' + DB_PASSWORD='' + ``` +* **[Optional]** If you wish to customize entire test suite locally, you can create codeception.yml by copying existing codeception.dist.yml, and make change in codeception.yml. + ``` + cp codeception.dist.yml codeception.yml + ``` +* **[Optional]** If you wish to customize acceptance test suite locally, you can create acceptance.suite.yml by copying existing acceptance.suite.dist.yml, and make change in acceptance.suite.yml. + ``` + cp acceptance.suite.dist.yml acceptance.suite.yml ``` - ### Running the Tests * Open a Terminal Window. CD to the Project Directory. Run the following command to install the project dependencies: - ``` cd [LOCATION_OF_GITHUB_REPO] composer install ``` - +* Build + ``` + vendor/bin/codecept build + ``` * **You will need to install Allure's CLI tool to generate the reports, please visit this page for instructions**: http://wiki.qatools.ru/display/AL/Allure+Commandline * Next you will need to start a Selenium server so we can run the tests (This will vary based on your local setup). - * Then open a New Terminal Window. - * Kick off the entire E2E Test Suite run the following command: ``` robo test ``` - * To kick off some example tests with 2 test cases run the following command: ``` robo example ``` - ### Testing using Robo * You can run the following test suites using robo: @@ -65,14 +62,12 @@ * Run the tests marked with **@group firefox**: `robo chrome` * Run the tests marked with **@group phantomjs**: `robo phantomjs` - ### Allure + Robo * You can generate an Allure report, open an Allure report or both using robo: * Generate a report from **[PROJECT_ROOT]/tests/_output/allure-results/**: `robo allure:generate` * Open a generate report from **[PROJECT_ROOT]/tests/_output/allure-report**: `robo allure:open` * Generate a report and open it: `robo allure:report` - ### Testing Environments * You can run a subset of Tests by editing a command in the file `RoboFile.php` or by running `codecept` directly: @@ -84,19 +79,14 @@ ```codecept run --env phantomjs``` ```codecept run --env chrome --group slow``` - - ### RoboFile.php -Edit the following command to change the Tests that the command `robo test` executes: +* Edit the following command to change the Tests that the command `robo test` executes: - ... + ``` $this->_exec('codecept run --env chrome'); - ... - - - -#### TROUBLESHOOTING + ``` +### TROUBLESHOOTING * TimeZone Error - http://stackoverflow.com/questions/18768276/codeception-datetime-error * TimeZone List - http://php.net/manual/en/timezones.america.php * System PATH - Make sure you have `vendor/bin/` and `vendor/` listed in your system path so you can run the `codecept` and `robo` commands directly: From e8846275a7a6343a9914cf01aaaf9da82a5b18df Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 10 Apr 2017 11:59:25 -0500 Subject: [PATCH 029/149] Updated README.md. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 399809a96..921e55f2e 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ * **Codeception**, **Allure** and **Robo** are PHP based applications installed via **Composer**, so you will need to have **Composer** installed in order to run the following. Please visit the [Composer](https://getcomposer.org/) homepage for installation instructions. * Some settings need to be adjusted to meet the build environment settings in the appropriate `XXX.suite.yml` file in the `[PROJECT_ROOT]/tests/` directory: `[PROJECT_ROOT]/tests/XXXXXXX.suite.yml` ### Configuration -* Create .env file by copying existing .env.example file at project root directory +* Create .env file by copying existing .env.example file at project root directory. ``` cp .env.example .env @@ -34,11 +34,11 @@ cd [LOCATION_OF_GITHUB_REPO] composer install ``` -* Build +* Build the project: ``` vendor/bin/codecept build ``` -* **You will need to install Allure's CLI tool to generate the reports, please visit this page for instructions**: http://wiki.qatools.ru/display/AL/Allure+Commandline +* **You will need to install Allure's CLI tool to generate the reports, please visit this page for instructions**: http://wiki.qatools.ru/display/AL/Allure+Commandline. * Next you will need to start a Selenium server so we can run the tests (This will vary based on your local setup). From b997b27369ba5751e9dee8f5f8349646b7eae4c8 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Mon, 10 Apr 2017 15:13:23 -0500 Subject: [PATCH 030/149] Removing broken test. - Removing a broken Category test. --- .gitignore | 4 +-- .../category/AddRandomCategoryCest.php | 34 ------------------- 2 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 tests/acceptance/category/AddRandomCategoryCest.php diff --git a/.gitignore b/.gitignore index 35e5ea192..1977bd5c3 100755 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,8 @@ composer.phar vendor/* tests/_output/* -tests/_support/Magento/Xxyyzz/_generated/ tests/_support/Magento/Xxyyzz/AcceptanceTester.php tests/acceptance.suite.yml codeception.yml -.env \ No newline at end of file +.env +_generated \ No newline at end of file diff --git a/tests/acceptance/category/AddRandomCategoryCest.php b/tests/acceptance/category/AddRandomCategoryCest.php deleted file mode 100644 index 3509b8909..000000000 --- a/tests/acceptance/category/AddRandomCategoryCest.php +++ /dev/null @@ -1,34 +0,0 @@ -goToTheAdminLoginPage(); - $I->loginAsAnExistingAdmin(); - $I->goToTheAdminProductsCategoriesPage(); - $I->waitForSpinnerToDisappear(); - } - - public function shouldBeAbleToAddARandomCategory(\Step\Acceptance\Admin $I, CategoryAdd $categoryAdd) - { - $categoryName = 'testCategory'; - - $I->am('an Admin'); - $I->wantTo('verify that I can add a random Category'); - - $categoryAdd->clickOnAddRootCategoryButton($I); - $I->waitForSpinnerToDisappear(); - $categoryAdd->enterCategoryName($I, $categoryName); - $categoryAdd->clickOnSaveButton($I); - $I->waitForSpinnerToDisappear(); - $categoryAdd->verifyCategoryNameTitleIsCorrect($I, $categoryName); - } -} From 282bfacb91c70421999d8d12cf8479a1c858d9b4 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 11 Apr 2017 11:54:47 -0500 Subject: [PATCH 031/149] - Implemented AbstractAdminPage and AbstractFrontendPage page objects; - Added pageload_timeout in abstract page objects; --- .../Magento/Xxyyzz/Helper/Acceptance.php | 13 +- .../Xxyyzz/Module/MagentoWebDriver.php | 5 +- .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 70 ++++ .../Xxyyzz/Page/AbstractFrontendPage.php | 60 +++ .../Xxyyzz/Page/Backend/Admin/AdminLogin.php | 117 +++--- .../Page/Backend/Admin/SideNavigation.php | 359 +++++++++++------- .../Page/Catalog/Admin/AdminCategoryPage.php | 74 ++-- .../Catalog/Admin/AdminProductEditPage.php | 82 ---- .../Catalog/Admin/AdminProductGridPage.php | 31 +- .../Page/Catalog/Admin/AdminProductPage.php | 94 ++--- .../Xxyyzz/Page/Catalog/ProductPage.php | 17 +- .../Customer/CustomerAccountDashboardPage.php | 27 +- .../Customer/CustomerAccountLoginPage.php | 27 +- .../_support/Page/Acceptance/CategoryAdd.php | 60 --- tests/acceptance.suite.dist.yml | 3 +- .../AccessAdminPagesViaNavMenuCest.php | 312 +++++++-------- .../Backend/OpenEachSideNavMenuCest.php | 34 +- .../Acceptance/Catalog/CreateCategoryCest.php | 20 +- .../Catalog/CreateSimpleProductCest.php | 31 +- .../Catalog/UpdateSimpleProductCest.php | 50 +-- .../User/AccessForgotYourPasswordCest.php | 14 +- 21 files changed, 778 insertions(+), 722 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php create mode 100644 tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php delete mode 100644 tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php delete mode 100644 tests/_support/Page/Acceptance/CategoryAdd.php diff --git a/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php b/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php index 7189bf873..e6fedaef5 100644 --- a/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php +++ b/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php @@ -18,6 +18,17 @@ class Acceptance extends \Codeception\Module */ public function changeConfiguration($config, $value) { - $this->getModule('MagentoWebDriver')->_reconfigure(array($config => $value)); + $this->getModule('\Magento\Xxyyzz\Module\MagentoWebDriver')->_reconfigure(array($config => $value)); + } + + /** + * Get WebDriver configuration. + * + * @param string $config + * @return string + */ + public function getConfiguration($config) + { + return $this->getModule('\Magento\Xxyyzz\Module\MagentoWebDriver')->_getConfig($config); } } diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php index 6eb6bc1a9..17ac70e67 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -14,13 +14,14 @@ * ``` * modules: * enabled: - * - MagentoWebDriver + * - \Magento\Xxyyzz\Module\MagentoWebDriver * config: - * MagentoWebDriver: + * \Magento\Xxyyzz\Module\MagentoWebDriver: * url: magento_base_url * backend_name: magento_backend_name * username: admin_username * password: admin_password + * browser: chrome * ``` */ class MagentoWebDriver extends WebDriver diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php new file mode 100644 index 000000000..f72b42972 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -0,0 +1,70 @@ +acceptanceTester = $I; + $this->pageloadTimeout = $I->getConfiguration('pageload_timeout'); + } + + public static function of(AcceptanceTester $I) + { + return new static($I); + } + + /** + * Basic route example for your current URL + * You can append any additional parameter to URL + * and use it in tests like: Page\Edit::route('/123-post'); + */ + public static function route($param) + { + return static::$URL.$param; + } + + public function seeInPageTitle($name) + { + $I = $this->acceptanceTester; + $I->see($name, self::$pageTitle); + } +} diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php new file mode 100644 index 000000000..4cc86683b --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php @@ -0,0 +1,60 @@ +li:nth-child(4)'; + + /** + * @var AcceptanceTester + */ + protected $acceptanceTester; + + /** + * Page load timeout in seconds. + * + * @var string + */ + protected $pageloadTimeout; + + public function __construct(AcceptanceTester $I) + { + $this->acceptanceTester = $I; + $this->pageloadTimeout = $I->getConfiguration('pageload_timeout'); + } + + public static function of(AcceptanceTester $I) + { + return new static($I); + } + + /** + * Basic route example for your current URL + * You can append any additional parameter to URL + * and use it in tests like: Page\Edit::route('/123-post'); + */ + public static function route($param) + { + return static::$URL.$param; + } + + public function seeInPageTitle($name) + { + $I = $this->acceptanceTester; + $I->see($name, self::$pageTitle); + } +} diff --git a/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php b/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php index 5bf5b44b1..41b4b292f 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php +++ b/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php @@ -1,13 +1,10 @@ acceptanceTester = $I; - } - - public function clickOnMagentoLogo(AcceptanceTester $I) + public function clickOnMagentoLogo() { + $I = $this->acceptanceTester; $I->click(self::$logoImage); } - public function clickOnForgotYourPassword(AcceptanceTester $I) + public function clickOnForgotYourPassword() { + $I = $this->acceptanceTester; $I->click(self::$forgotYourPassword); } - public function clickOnSignIn(AcceptanceTester $I) + public function clickOnSignIn() { + $I = $this->acceptanceTester; $I->click(self::$signIn); } - public function enterTheUsername(AcceptanceTester $I, $username) + public function enterTheUsername($username) { + $I = $this->acceptanceTester; $I->fillField(self::$username, $username); } - public function enterThePassword(AcceptanceTester $I, $password) + public function enterThePassword($password) { + $I = $this->acceptanceTester; $I->fillField(self::$password, $password); } - public function enterTheLoginCredentials(AcceptanceTester $I, $username, $password) + public function enterTheLoginCredentials($username, $password) { - $this->enterTheUsername($I, $username); - $this->enterThePassword($I, $password); + $I = $this->acceptanceTester; + $this->enterTheUsername($username); + $this->enterThePassword($password); } - public function shouldSeeTheLoginMainArea(AcceptanceTester $I) + public function shouldSeeTheLoginMainArea() { + $I = $this->acceptanceTester; $I->seeElement(self::$mainArea); } - public function shouldSeeTheLoginLogoLink(AcceptanceTester $I) + public function shouldSeeTheLoginLogoLink() { + $I = $this->acceptanceTester; $I->seeElement(self::$logoLink); } - public function shouldSeeTheLoginLogoImage(AcceptanceTester $I) + public function shouldSeeTheLoginLogoImage() { + $I = $this->acceptanceTester; $I->seeElement(self::$logoImage); } - public function shouldSeeTheLoginTitle(AcceptanceTester $I) + public function shouldSeeTheLoginTitle() { + $I = $this->acceptanceTester; $I->seeElement(self::$title); } - public function shouldSeeTheLoginUsernameTitle(AcceptanceTester $I) + public function shouldSeeTheLoginUsernameTitle() { + $I = $this->acceptanceTester; $I->seeElement(self::$usernameTitle); } - public function shouldSeeTheLoginUsernameField(AcceptanceTester $I) + public function shouldSeeTheLoginUsernameField() { + $I = $this->acceptanceTester; $I->seeElement(self::$username); } - public function shouldSeeTheLoginPasswordTitle(AcceptanceTester $I) + public function shouldSeeTheLoginPasswordTitle() { + $I = $this->acceptanceTester; $I->seeElement(self::$passwordTitle); } - public function shouldSeeTheLoginPasswordField(AcceptanceTester $I) + public function shouldSeeTheLoginPasswordField() { + $I = $this->acceptanceTester; $I->seeElement(self::$password); } - public function shouldSeeTheLoginForgotPasswordLink(AcceptanceTester $I) + public function shouldSeeTheLoginForgotPasswordLink() { $I->seeElement(self::$forgotYourPassword); } - public function shouldSeeTheLoginSignInButton(AcceptanceTester $I) + public function shouldSeeTheLoginSignInButton() { + $I = $this->acceptanceTester; $I->seeElement(self::$signIn); } - public function shouldSeeTheLoginCopyrightText(AcceptanceTester $I) + public function shouldSeeTheLoginCopyrightText() { + $I = $this->acceptanceTester; $I->seeElement(self::$copyRight); } - public function shouldSeeTheLoginPageFields(AcceptanceTester $I) + public function shouldSeeTheLoginPageFields() { - $this->shouldSeeTheLoginMainArea($I); - $this->shouldSeeTheLoginLogoLink($I); - $this->shouldSeeTheLoginLogoImage($I); - $this->shouldSeeTheLoginTitle($I); - $this->shouldSeeTheLoginUsernameTitle($I); - $this->shouldSeeTheLoginUsernameField($I); - $this->shouldSeeTheLoginPasswordTitle($I); - $this->shouldSeeTheLoginPasswordField($I); - $this->shouldSeeTheLoginForgotPasswordLink($I); - $this->shouldSeeTheLoginSignInButton($I); - $this->shouldSeeTheLoginCopyrightText($I); + $this->shouldSeeTheLoginMainArea(); + $this->shouldSeeTheLoginLogoLink(); + $this->shouldSeeTheLoginLogoImage(); + $this->shouldSeeTheLoginTitle(); + $this->shouldSeeTheLoginUsernameTitle(); + $this->shouldSeeTheLoginUsernameField(); + $this->shouldSeeTheLoginPasswordTitle(); + $this->shouldSeeTheLoginPasswordField(); + $this->shouldSeeTheLoginForgotPasswordLink(); + $this->shouldSeeTheLoginSignInButton(); + $this->shouldSeeTheLoginCopyrightText(); } - public function enterTheEmailAddress(AcceptanceTester $I, $emailAddress) + public function enterTheEmailAddress($emailAddress) { + $I = $this->acceptanceTester; $I->fillField(self::$emailAddress, $emailAddress); } - public function clickOnRetrievePassword(AcceptanceTester $I) + public function clickOnRetrievePassword() { + $I = $this->acceptanceTester; $I->click(self::$retrievePassword); } - public function clickOnBackToSignIn(AcceptanceTester $I) + public function clickOnBackToSignIn() { + $I = $this->acceptanceTester; $I->click(self::$backToSignIn); } - public function shouldSeeTheForgotYourPasswordFields(AcceptanceTester $I) + public function shouldSeeTheForgotYourPasswordFields() { + $I = $this->acceptanceTester; $I->seeElement(self::$forgotPasswordMain); $I->seeElement(self::$logoLink); $I->seeElement(self::$logoImage); diff --git a/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php b/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php index d9f6a6d7a..d537ddad1 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php +++ b/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/SideNavigation.php @@ -1,13 +1,10 @@ acceptanceTester = $I; - } - - public function clickOnDashboardInTheSideNavMenu(AcceptanceTester $I) + + public function clickOnDashboardInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$dashboardButton); } - public function clickOnSalesInTheSideNavMenu(AcceptanceTester $I) + public function clickOnSalesInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$salesButton); $I->wait(1); } - public function clickOnOrdersInTheSalesNavMenu(AcceptanceTester $I) + public function clickOnOrdersInTheSalesNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$salesNavOrders); } - public function clickOnInvoicesInTheSalesNavMenu(AcceptanceTester $I) + public function clickOnInvoicesInTheSalesNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$salesNavInvoices); } - public function clickOnShipmentsInTheSalesNavMenu(AcceptanceTester $I) + public function clickOnShipmentsInTheSalesNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$salesNavShipments); } - public function clickOnCreditMemosInTheSalesNavMenu(AcceptanceTester $I) + public function clickOnCreditMemosInTheSalesNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$salesNavCreditMemos); } - public function clickOnBillingAgreementsInTheSalesNavMenu(AcceptanceTester $I) + public function clickOnBillingAgreementsInTheSalesNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$salesNavBillingAgreements); } - public function clickOnTransactionsInTheSalesNavMenu(AcceptanceTester $I) + public function clickOnTransactionsInTheSalesNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$salesNavTransactions); } - public function clickOnProductsInTheSideNavMenu(AcceptanceTester $I) + public function clickOnProductsInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$productsButton); $I->wait(1); } - public function clickOnCatalogInTheProductNavMenu(AcceptanceTester $I) + public function clickOnCatalogInTheProductNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$productNavCatalog); } - public function clickOnCategoriesInTheProductNavMenu(AcceptanceTester $I) + public function clickOnCategoriesInTheProductNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$productNavCategories); } - public function clickOnCustomersInTheSideNavMenu(AcceptanceTester $I) + public function clickOnCustomersInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$customersButton); $I->wait(1); } - public function clickOnAllCustomersInTheCustomersNavMenu(AcceptanceTester $I) + public function clickOnAllCustomersInTheCustomersNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$customersNavAllCustomers); } - public function clickOnNowOnlineInTheCustomersNavMenu(AcceptanceTester $I) + public function clickOnNowOnlineInTheCustomersNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$customersNavNowOnline); } - public function clickOnMarketingInTheSideNavMenu(AcceptanceTester $I) + public function clickOnMarketingInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingButton); $I->wait(1); } - public function clickOnCatalogPriceRulesInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnCatalogPriceRulesInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavPromotionsCatalogPriceRule); } - public function clickOnCartPriceRulesInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnCartPriceRulesInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavPromotionsCartPriceRules); } - public function clickOnEmailTemplatesInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnEmailTemplatesInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavCommunicationsEmailTemplates); } - public function clickOnNewsletterTemplatesInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnNewsletterTemplatesInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavCommunicationsNewsletterTemplates); } - public function clickOnNewsletterQueueInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnNewsletterQueueInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavCommunicationsNewsletterQueue); } - public function clickOnNewsletterSubscribersInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnNewsletterSubscribersInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavCommunicationsNewsletterSubscribers); } - public function clickOnURLRewritesInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnURLRewritesInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavSEOSearchURLRewrites); } - public function clickOnSearchTermsInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnSearchTermsInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavSEOSearchTerms); } - public function clickOnSearchSynonymsInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnSearchSynonymsInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavSEOSearchSynonyms); } - public function clickOnSiteMapInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnSiteMapInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavSEOSearchSiteMap); } - public function clickOnContentReviewsInTheMarketingNavMenu(AcceptanceTester $I) + public function clickOnContentReviewsInTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$marketingNavUserContentReviews); } - public function clickOnContentInTheSideNavMenu(AcceptanceTester $I) + public function clickOnContentInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$contentButton); $I->wait(1); } - public function clickOnPagesInTheContentNavMenu(AcceptanceTester $I) + public function clickOnPagesInTheContentNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$contentNavElementsPages); } - public function clickOnBlocksInTheContentNavMenu(AcceptanceTester $I) + public function clickOnBlocksInTheContentNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$contentNavElementsBlocks); } - public function clickOnWidgetsInTheContentNavMenu(AcceptanceTester $I) + public function clickOnWidgetsInTheContentNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$contentNavElementsWidgets); } - public function clickOnConfigurationInTheContentNavMenu(AcceptanceTester $I) + public function clickOnConfigurationInTheContentNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$contentNavDesignConfiguration); } - public function clickOnThemesInTheContentNavMenu(AcceptanceTester $I) + public function clickOnThemesInTheContentNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$contentNavDesignThemes); } - public function clickOnScheduleInTheContentNavMenu(AcceptanceTester $I) + public function clickOnScheduleInTheContentNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$contentNavDesignSchedule); } - public function clickOnReportsInTheSideNavMenu(AcceptanceTester $I) + public function clickOnReportsInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsButton); $I->wait(1); } - public function clickOnProductsInCartInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnProductsInCartInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavMarketingProductsInCart); } - public function clickOnSearchTermsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnSearchTermsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavMarketingSearchTerms); } - public function clickOnAbandonedCartsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnAbandonedCartsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavMarketingAbandonedCarts); } - public function clickOnNewsletterProblemReportsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnNewsletterProblemReportsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavMarketingNewsletterProblemReports); } - public function clickOnByCustomersInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnByCustomersInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavReviewsByCustomers); } - public function clickOnByProductsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnByProductsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavReviewsByProducts); } - public function clickOnOrdersInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnOrdersInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesOrders); } - public function clickOTaxInTheReportsNavMenu(AcceptanceTester $I) + public function clickOTaxInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesTax); } - public function clickOnInvoicedInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnInvoicedInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesInvoiced); } - public function clickOnShippingInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnShippingInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesShipping); } - public function clickOnRefundsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnRefundsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesRefunds); } - public function clickOnCouponsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnCouponsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesCoupons); } - public function clickOnPayPalSettlementInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnPayPalSettlementInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesPayPalSettlement); } - public function clickOnBraintreeSettlementInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnBraintreeSettlementInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesBraintreeSettlement); } - public function clickOnOrderTotalInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnOrderTotalInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavCustomersOrderTotal); } - public function clickOnOrderCountInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnOrderCountInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavCustomersOrderCount); } - public function clickOnNewInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnNewInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavCustomersNew); } - public function clickOnViewsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnViewsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsViews); } - public function clickOnBestSellersInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnBestSellersInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsBestsellers); } - public function clickOnLowStockInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnLowStockInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsLowStock); } - public function clickOnOrderedInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnOrderedInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsOrdered); } - public function clickOnDownloadsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnDownloadsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsDownloads); } - public function clickOnRefreshStatisticsInTheReportsNavMenu(AcceptanceTester $I) + public function clickOnRefreshStatisticsInTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$reportsNavStatisticsRefreshStatistics); } - public function clickOnStoresInTheSideNavMenu(AcceptanceTester $I) + public function clickOnStoresInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesButton); $I->wait(1); } - public function clickOnAllStoresInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnAllStoresInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavSettingsAllStores); } - public function clickOnConfigurationInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnConfigurationInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavSettingsConfiguration); } - public function clickOnTermsAndConditionsInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnTermsAndConditionsInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavSettingsTermsAndConditions); } - public function clickOnOrderStatusInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnOrderStatusInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavSettingsOrderStatus); } - public function clickOnTaxRuleInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnTaxRuleInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavTaxesTaxRules); } - public function clickOnTaxZonesAndRatesInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnTaxZonesAndRatesInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavTaxesTaxZonesAndRates); } - public function clickOnTaxRatesInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnTaxRatesInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavCurrencyRates); } - public function clickOnTaxSymbolsInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnTaxSymbolsInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavCurrencySymbols); } - public function clickOnCurrencyRatesInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnCurrencyRatesInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavCurrencyRates); } - public function clickOnCurrencySymbolsInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnCurrencySymbolsInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavCurrencySymbols); } - public function clickOnProductInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnProductInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavAttributesProduct); } - public function clickOnAttributesSetInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnAttributesSetInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavAttributesSet); } - public function clickOnRatingsInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnRatingsInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavAttributesRating); } - public function clickOnCustomerGroupInTheStoresNavMenu(AcceptanceTester $I) + public function clickOnCustomerGroupInTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$storesNavOtherSettingsCustomerGroups); } - public function clickOnSystemInTheSideNavMenu(AcceptanceTester $I) + public function clickOnSystemInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemButton); $I->wait(1); } - public function clickOnImportInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnImportInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavDataTransferImport); } - public function clickOnExportInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnExportInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavDataTransferExport); } - public function clickOnImportExportTaxRatesInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnImportExportTaxRatesInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavDataTransferImportExportTaxRates); } - public function clickOnImportHistoryInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnImportHistoryInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavDataTransferImportHistory); } - public function clickOnIntegrationsInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnIntegrationsInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavExtensionsIntegrations); } - public function clickOnCacheManagementInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnCacheManagementInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavToolsCacheManagement); } - public function clickOnBackupsInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnBackupsInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavToolsBackups); } - public function clickOnIndexManagementInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnIndexManagementInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavToolsIndexManagement); } - public function clickOnWebSetupWizardInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnWebSetupWizardInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavToolsWebSetupWizard); $I->wait(1); } - public function clickOnAllUsersInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnAllUsersInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavPermissionsAllUsers); } - public function clickOnLockedUsersInTheSystemNavMenu(AcceptanceTester $I) { + public function clickOnLockedUsersInTheSystemNavMenu() + { + $I = $this->acceptanceTester; $I->click(self::$systemNavPermissionsLockedUsers); } - public function clickOnUserRolesInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnUserRolesInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavPermissionsUserRoles); } - public function clickOnNotificationsInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnNotificationsInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavOtherSettingsNotifications); } - public function clickOnCustomVariablesInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnCustomVariablesInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavOtherSettingsCustomVariables); } - public function clickOnManageEncryptionKeyInTheSystemNavMenu(AcceptanceTester $I) + public function clickOnManageEncryptionKeyInTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$systemNavOtherSettingsManageEncryptionKey); } - public function clickOnFindPartnersAndExtensionsInTheSideNavMenu(AcceptanceTester $I) + public function clickOnFindPartnersAndExtensionsInTheSideNavMenu() { + $I = $this->acceptanceTester; $I->click(self::$findPartnersExtensionsButton); $I->wait(1); } - public function shouldSeeTheSalesNavMainArea(AcceptanceTester $I) + public function shouldSeeTheSalesNavMainArea() { + $I = $this->acceptanceTester; $I->seeElement(self::$salesNavMainArea); } - public function shouldSeeTheSalesNavTitle(AcceptanceTester $I) + public function shouldSeeTheSalesNavTitle() { + $I = $this->acceptanceTester; $I->seeElement(self::$salesNavTitle); } - public function shouldSeeTheSalesNavOrders(AcceptanceTester $I) + public function shouldSeeTheSalesNavOrders() { + $I = $this->acceptanceTester; $I->seeElement(self::$salesNavOrders); } - public function shouldSeeTheSalesNavInvoices(AcceptanceTester $I) + public function shouldSeeTheSalesNavInvoices() { + $I = $this->acceptanceTester; $I->seeElement(self::$salesNavInvoices); } - public function shouldSeeTheSalesNavShipments(AcceptanceTester $I) + public function shouldSeeTheSalesNavShipments() { + $I = $this->acceptanceTester; $I->seeElement(self::$salesNavShipments); } - public function shouldSeeTheSalesNavCreditMemos(AcceptanceTester $I) + public function shouldSeeTheSalesNavCreditMemos() { + $I = $this->acceptanceTester; $I->seeElement(self::$salesNavCreditMemos); } - public function shouldSeeTheSalesNavBillingAgreements(AcceptanceTester $I) + public function shouldSeeTheSalesNavBillingAgreements() { + $I = $this->acceptanceTester; $I->seeElement(self::$salesNavBillingAgreements); } - public function shouldSeeTheSalesNavTransactions(AcceptanceTester $I) + public function shouldSeeTheSalesNavTransactions() { + $I = $this->acceptanceTester; $I->seeElement(self::$salesNavTransactions); } - public function shouldSeeTheSalesNavMenu(AcceptanceTester $I) + public function shouldSeeTheSalesNavMenu() { - $this->shouldSeeTheSalesNavMainArea($I); - $this->shouldSeeTheSalesNavTitle($I); - $this->shouldSeeTheSalesNavOrders($I); - $this->shouldSeeTheSalesNavInvoices($I); - $this->shouldSeeTheSalesNavShipments($I); - $this->shouldSeeTheSalesNavCreditMemos($I); - $this->shouldSeeTheSalesNavBillingAgreements($I); - $this->shouldSeeTheSalesNavTransactions($I); + $this->shouldSeeTheSalesNavMainArea(); + $this->shouldSeeTheSalesNavTitle(); + $this->shouldSeeTheSalesNavOrders(); + $this->shouldSeeTheSalesNavInvoices(); + $this->shouldSeeTheSalesNavShipments(); + $this->shouldSeeTheSalesNavCreditMemos(); + $this->shouldSeeTheSalesNavBillingAgreements(); + $this->shouldSeeTheSalesNavTransactions(); } - public function shouldSeeTheProductNavMenu(AcceptanceTester $I) + public function shouldSeeTheProductNavMenu() { + $I = $this->acceptanceTester; $I->seeElement(self::$productNavMainArea); $I->seeElement(self::$productNavTitle); $I->seeElement(self::$productNavCatalog); $I->seeElement(self::$productNavCategories); } - public function shouldSeeTheCustomersNavMenu(AcceptanceTester $I) + public function shouldSeeTheCustomersNavMenu() { + $I = $this->acceptanceTester; $I->seeElement(self::$customersNavAllCustomers); $I->seeElement(self::$customersNavNowOnline); } - public function shouldSeeTheMarketingNavMenu(AcceptanceTester $I) + public function shouldSeeTheMarketingNavMenu() { + $I = $this->acceptanceTester; $I->seeElement(self::$marketingNavPromotionsMainArea); $I->seeElement(self::$marketingNavPromotionsTitle); $I->seeElement(self::$marketingNavPromotionsCatalogPriceRule); @@ -739,8 +816,9 @@ public function shouldSeeTheMarketingNavMenu(AcceptanceTester $I) $I->seeElement(self::$marketingNavUserContentReviews); } - public function shouldSeeTheContentNavMenu(AcceptanceTester $I) + public function shouldSeeTheContentNavMenu() { + $I = $this->acceptanceTester; $I->seeElement(self::$contentNavElementsMainArea); $I->seeElement(self::$contentNavElementsTitle); $I->seeElement(self::$contentNavElementsPages); @@ -754,8 +832,9 @@ public function shouldSeeTheContentNavMenu(AcceptanceTester $I) $I->seeElement(self::$contentNavDesignSchedule); } - public function shouldSeeTheReportsNavMenu(AcceptanceTester $I) + public function shouldSeeTheReportsNavMenu() { + $I = $this->acceptanceTester; $I->seeElement(self::$reportsNavMarketingMainArea); $I->seeElement(self::$reportsNavMarketingTitle); $I->seeElement(self::$reportsNavMarketingProductsInCart); @@ -798,8 +877,9 @@ public function shouldSeeTheReportsNavMenu(AcceptanceTester $I) $I->seeElement(self::$reportsNavStatisticsRefreshStatistics); } - public function shouldSeeTheStoresNavMenu(AcceptanceTester $I) + public function shouldSeeTheStoresNavMenu() { + $I = $this->acceptanceTester; $I->seeElement(self::$storesNavSettingsMainArea); $I->seeElement(self::$storesNavSettingsTitle); $I->seeElement(self::$storesNavSettingsAllStores); @@ -828,8 +908,9 @@ public function shouldSeeTheStoresNavMenu(AcceptanceTester $I) $I->seeElement(self::$storesNavOtherSettingsCustomerGroups); } - public function shouldSeeTheSystemNavMenu(AcceptanceTester $I) + public function shouldSeeTheSystemNavMenu() { + $I = $this->acceptanceTester; $I->seeElement(self::$systemNavDataTransferMainArea); $I->seeElement(self::$systemNavDataTransferTitle); $I->seeElement(self::$systemNavDataTransferImport); diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php index a5e0ca4a9..9b029ba33 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php @@ -1,77 +1,75 @@ acceptanceTester; $I->amOnPage(self::route($param)); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageloadTimeout); } - public function amOnAdminCategoryPageById(AcceptanceTester $I, $id) + public function amOnAdminCategoryPageById($id) { + $I = $this->acceptanceTester; $I->amOnPage(self::$URL . 'edit/id/' . $id); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs - } - - public function seeCategoryNameInPageTitle(AcceptanceTester $I, $name) - { - $I->see($name, self::$pageTitle); + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageloadTimeout); } - public function addRootCategory(AcceptanceTester $I) + public function addRootCategory() { + $I = $this->acceptanceTester; $I->click(self::$addRootCategoryButton); } - public function addSubCategory(AcceptanceTester $I) + public function addSubCategory() { + $I = $this->acceptanceTester; $I->click(self::$addSubCategoryButton); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, 30); // secs + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageloadTimeout); } - public function fillFieldCategoryName(AcceptanceTester $I, $name) + public function fillFieldCategoryName($name) { + $I = $this->acceptanceTester; $I->fillField(self::$categoryName, $name); } - public function fillFieldCategoryUrlKey(AcceptanceTester $I, $name) + public function fillFieldCategoryUrlKey($name) { + $I = $this->acceptanceTester; try { $I->click(sprintf(self::$categorySearchEngineOptimToggle, 'closed')); } catch (\Exception $e) { @@ -79,10 +77,12 @@ public function fillFieldCategoryUrlKey(AcceptanceTester $I, $name) $I->fillField(self::$categoryUrlKey, $name); } - public function saveCategory(AcceptanceTester $I) + public function saveCategory() { + $I = $this->acceptanceTester; $I->click(self::$saveCategoryButton); - $I->waitForElementNotVisible(self::$catagorySavedSpinner); - $I->waitForElementVisible(self::$catagorySaveSuccessMessage); + $I->waitForElementNotVisible(self::$popupLoadingSpinner); + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner); + $I->waitForElementVisible(self::$successMessage); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php deleted file mode 100644 index ba139de38..000000000 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductEditPage.php +++ /dev/null @@ -1,82 +0,0 @@ -amOnPage(self::$URL . 'id/' . $id); - $I->waitForElementNotVisible(self::$productFormSpinner, 30); // secs - - } - - public function seeProductNameInPageTitle(AcceptanceTester $I, $name) - { - $I->see($name, self::$pageTitle); - } - - public function seeProductAttributeSet(AcceptanceTester $I, $name) - { - $I->seeOptionIsSelected(self::$producAttributeSet, $name); - } - - public function seeProductName(AcceptanceTester $I, $name) - { - $I->seeInField(self::$productName, $name); - } - - public function seeProductSku(AcceptanceTester $I, $name) - { - $I->seeInField(self::$productSku, $name); - } - - public function seeProductPrice(AcceptanceTester $I, $name) - { - $I->seeInField(self::$productPrice, $name); - } - - public function seeProductQuantity(AcceptanceTester $I, $name) - { - $I->seeInField(self::$productQuantity, $name); - } - - public function seeProductStockStatus(AcceptanceTester $I, $name) - { - $I->seeOptionIsSelected(self::$productStockStatus, $name); - } - - public function seeProductCategories(AcceptanceTester $I, $name) - { - $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); - } -} diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php index 27cc6031a..b00ff9faf 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php @@ -1,17 +1,18 @@ .spinner'; public static $addNewProductButton = '#add_new_product-button'; @@ -36,40 +37,44 @@ public static function route($param) return static::$URL . $param; } - public function amOnAdminProductGridPage(AcceptanceTester $I) + public function amOnAdminProductGridPage() { + $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); // secs + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); } - public function goToAddNewProductPage(AcceptanceTester $I) + public function goToAddNewProductPage() { + $I = $this->acceptanceTester; $I->click(self::$addNewProductButton); } - public function searchBySku(AcceptanceTester $I, $sku) + public function searchBySku($sku) { + $I = $this->acceptanceTester; try { - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); $I->click(self::$filterClearAllButton); } catch (\Codeception\Exception\ElementNotFound $e) { } try { $I->wait(5); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); $I->click(self::$filterExpandButton); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); // secs + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); } catch (\Codeception\Exception\ElementNotFound $e) { } $I->fillField(self::$filterProductSku, $sku); $I->click(self::$filterApplyButton); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, 30); // secs + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); } - public function containsInNthRow(AcceptanceTester $I, $n, $text) + public function containsInNthRow($n, $text) { + $I = $this->acceptanceTester; return $I->see($text, sprintf(self::$gridNthRow, $n)); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php index dc1cac8bc..eed4e31e1 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php @@ -1,19 +1,23 @@ acceptanceTester; $I->seeInCurrentUrl(static::$URL . 'new'); - $I->waitForElementNotVisible(self::$productFormLoadingSpinner, 30); // secs + $I->waitForElementNotVisible(self::$productFormLoadingSpinner, $this->pageloadTimeout); } - public function amOnAdminProductPageById(AcceptanceTester $I, $id) + public function amOnAdminEditProductPageById($id) { + $I = $this->acceptanceTester; $I->amOnPage(self::route('edit/id/' . $id)); - $I->waitForElementNotVisible(self::$productFormLoadingSpinner, 30); // secs - } - - // Assert existing product - public function seeProductNameInPageTitle(AcceptanceTester $I, $name) - { - $I->see($name, self::$pageTitle); + $I->waitForElementNotVisible(self::$productFormLoadingSpinner, $this->pageloadTimeout); } - public function seeProductAttributeSet(AcceptanceTester $I, $name) + public function seeProductAttributeSet($name) { + $I = $this->acceptanceTester; $I->seeOptionIsSelected(self::$producAttributeSet, $name); } - public function seeProductName(AcceptanceTester $I, $name) + public function seeProductName($name) { + $I = $this->acceptanceTester; $I->seeInField(self::$productName, $name); } - public function seeProductSku(AcceptanceTester $I, $name) + public function seeProductSku($name) { + $I = $this->acceptanceTester; $I->seeInField(self::$productSku, $name); } - public function seeProductPrice(AcceptanceTester $I, $name) + public function seeProductPrice($name) { + $I = $this->acceptanceTester; $I->seeInField(self::$productPrice, $name); } - public function seeProductQuantity(AcceptanceTester $I, $name) + public function seeProductQuantity($name) { + $I = $this->acceptanceTester; $I->seeInField(self::$productQuantity, $name); } - public function seeProductStockStatus(AcceptanceTester $I, $name) + public function seeProductStockStatus($name) { + $I = $this->acceptanceTester; $I->seeOptionIsSelected(self::$productStockStatus, $name); } - public function seeProductCategories(AcceptanceTester $I, $name) + public function seeProductCategories($name) { + $I = $this->acceptanceTester; $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); } // Fill new product - public function fillFieldProductName(AcceptanceTester $I, $name) + public function fillFieldProductName($name) { + $I = $this->acceptanceTester; $I->fillField(self::$productName, $name); } - public function fillFieldProductSku(AcceptanceTester $I, $name) + public function fillFieldProductSku($name) { + $I = $this->acceptanceTester; $I->fillField(self::$productSku, $name); } - public function fillFieldProductPrice(AcceptanceTester $I, $name) + public function fillFieldProductPrice($name) { + $I = $this->acceptanceTester; $I->fillField(self::$productPrice, $name); } - public function fillFieldProductQuantity(AcceptanceTester $I, $name) + public function fillFieldProductQuantity($name) { + $I = $this->acceptanceTester; $I->fillField(self::$productQuantity, $name); } - public function selectProductStockStatus(AcceptanceTester $I, $name) + public function selectProductStockStatus($name) { + $I = $this->acceptanceTester; $I->selectOption(self::$productStockStatus, $name); } - public function fillFieldProductCategories(AcceptanceTester $I, $name) + public function fillFieldProductCategories($name) { + $I = $this->acceptanceTester; $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); } - public function saveProduct(AcceptanceTester $I) + public function saveProduct() { + $I = $this->acceptanceTester; $I->click(self::$productSaveButton); - $I->waitForElementNotVisible(self::$productSavedSpinner); - $I->waitForElementVisible(self::$productSaveSuccessMessage); + $I->waitForElementNotVisible(self::$popupLoadingSpinner); + $I->waitForElementNotVisible(self::$productFormLoadingSpinner); + $I->waitForElementVisible(self::$successMessage); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php index efefac966..6e9f02b1f 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php @@ -1,11 +1,10 @@ span'; public static $createNewAccountLink = '.action.create.primary>span'; - /** - * Basic route example for your current URL - * You can append any additional parameter to URL - * and use it in tests like: Page\Edit::route('/123-post'); - */ - public static function route($param) - { - return static::$URL . $param; - } - - public function amOnCustomerAccountLoginPage(AcceptanceTester $I) + public function amOnCustomerAccountLoginPage() { + $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementVisible(self::$customerLoginForm, 30); + $I->waitForElementVisible(self::$customerLoginForm, $this->pageloadTimeout); } - public function signInWithCredentials(AcceptanceTester $I, $email, $password) + public function signInWithCredentials($email, $password) { + $I = $this->acceptanceTester; $I->fillField(self::$customerEmailField, $email); $I->fillField(self::$customerPasswordField, $password); $I->click(self::$customerSignInButton); diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php index 5fc7547ac..1426b06ce 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php @@ -1,17 +1,18 @@ span'; public static $createNewAccountLink = '.action.create.primary>span'; - /** - * Basic route example for your current URL - * You can append any additional parameter to URL - * and use it in tests like: Page\Edit::route('/123-post'); - */ - public static function route($param) - { - return static::$URL . $param; - } - - public function amOnCustomerAccountLoginPage(AcceptanceTester $I) + public function amOnCustomerAccountLoginPage() { + $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementVisible(self::$customerLoginForm, 30); + $I->waitForElementVisible(self::$customerLoginForm, $this->pageloadTimeout); } - public function signInWithCredentials(AcceptanceTester $I, $email, $password) + public function signInWithCredentials($email, $password) { + $I = $this->acceptanceTester; $I->fillField(self::$customerEmailField, $email); $I->fillField(self::$customerPasswordField, $password); $I->click(self::$customerSignInButton); diff --git a/tests/_support/Page/Acceptance/CategoryAdd.php b/tests/_support/Page/Acceptance/CategoryAdd.php deleted file mode 100644 index a2e9b280e..000000000 --- a/tests/_support/Page/Acceptance/CategoryAdd.php +++ /dev/null @@ -1,60 +0,0 @@ -acceptanceTester = $I; - } - - public function clickOnAddRootCategoryButton(\AcceptanceTester $I) - { - $I->click(self::$addRootCategoryButton); - } - - public function enterCategoryName(\AcceptanceTester $I, $categoryName) - { - $I->fillField(self::$categoryNameField, $categoryName); - } - - public function clickOnSaveButton(\AcceptanceTester $I) - { - $I->click(self::$saveButton); - } - - public function verifyCategoryNameTitleIsCorrect(\AcceptanceTester $I, $categoryName) - { - $I->see($categoryName, self::$categoryNameTitle); - } - -} diff --git a/tests/acceptance.suite.dist.yml b/tests/acceptance.suite.dist.yml index ad6cbf65b..392ebc429 100644 --- a/tests/acceptance.suite.dist.yml +++ b/tests/acceptance.suite.dist.yml @@ -24,4 +24,5 @@ modules: browser: chrome window_size: maximize username: "%MAGENTO_ADMIN_USERNAME%" - password: "%MAGENTO_ADMIN_PASSWORD%" \ No newline at end of file + password: "%MAGENTO_ADMIN_PASSWORD%" + pageload_timeout: 30 \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index 781132687..96a2ef834 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -25,7 +25,7 @@ public function shouldLandOnTheDashboardPage(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the DASHBOARD Page using the Side Nav Menus'); $I->goToRandomAdminPage(); - $sideNavMenu->clickOnDashboardInTheSideNavMenu($I); + $sideNavMenu->clickOnDashboardInTheSideNavMenu(); $I->shouldBeOnTheAdminDashboardPage(); } @@ -38,28 +38,28 @@ public function shouldLandOnTheDashboardPage(AdminStep $I, SideNav $sideNavMenu) public function shouldLandOnEachOfTheSalesPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the SALES Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnSalesInTheSideNavMenu($I); - $sideNavMenu->clickOnOrdersInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu(); + $sideNavMenu->clickOnOrdersInTheSalesNavMenu(); $I->shouldBeOnTheAdminSalesOrdersPage(); - $sideNavMenu->clickOnSalesInTheSideNavMenu($I); - $sideNavMenu->clickOnInvoicesInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu(); + $sideNavMenu->clickOnInvoicesInTheSalesNavMenu(); $I->shouldBeOnTheAdminSalesInvoicesPage(); - $sideNavMenu->clickOnSalesInTheSideNavMenu($I); - $sideNavMenu->clickOnShipmentsInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu(); + $sideNavMenu->clickOnShipmentsInTheSalesNavMenu(); $I->shouldBeOnTheAdminSalesShipmentsPage(); - $sideNavMenu->clickOnSalesInTheSideNavMenu($I); - $sideNavMenu->clickOnCreditMemosInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu(); + $sideNavMenu->clickOnCreditMemosInTheSalesNavMenu(); $I->shouldBeOnTheAdminSalesCreditMemosPage(); - $sideNavMenu->clickOnSalesInTheSideNavMenu($I); - $sideNavMenu->clickOnBillingAgreementsInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu(); + $sideNavMenu->clickOnBillingAgreementsInTheSalesNavMenu(); $I->shouldBeOnTheAdminSalesBillingAgreementsPage(); - $sideNavMenu->clickOnSalesInTheSideNavMenu($I); - $sideNavMenu->clickOnTransactionsInTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu(); + $sideNavMenu->clickOnTransactionsInTheSalesNavMenu(); $I->shouldBeOnTheAdminSalesTransactionsPage(); } @@ -72,12 +72,12 @@ public function shouldLandOnEachOfTheSalesPages(AdminStep $I, SideNav $sideNavMe public function shouldLandOnEachOfTheProductsPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the PRODUCTS Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnProductsInTheSideNavMenu($I); - $sideNavMenu->clickOnCatalogInTheProductNavMenu($I); + $sideNavMenu->clickOnProductsInTheSideNavMenu(); + $sideNavMenu->clickOnCatalogInTheProductNavMenu(); $I->shouldBeOnTheAdminProductsCatalogPage(); - $sideNavMenu->clickOnProductsInTheSideNavMenu($I); - $sideNavMenu->clickOnCategoriesInTheProductNavMenu($I); + $sideNavMenu->clickOnProductsInTheSideNavMenu(); + $sideNavMenu->clickOnCategoriesInTheProductNavMenu(); $I->shouldBeOnTheAdminProductsCategoriesPage(); } @@ -90,12 +90,12 @@ public function shouldLandOnEachOfTheProductsPages(AdminStep $I, SideNav $sideNa public function shouldLanOnEachOfTheCustomersPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the CUSTOMERS Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnCustomersInTheSideNavMenu($I); - $sideNavMenu->clickOnAllCustomersInTheCustomersNavMenu($I); + $sideNavMenu->clickOnCustomersInTheSideNavMenu(); + $sideNavMenu->clickOnAllCustomersInTheCustomersNavMenu(); $I->shouldBeOnTheAdminCustomersAllCustomersPage(); - $sideNavMenu->clickOnCustomersInTheSideNavMenu($I); - $sideNavMenu->clickOnNowOnlineInTheCustomersNavMenu($I); + $sideNavMenu->clickOnCustomersInTheSideNavMenu(); + $sideNavMenu->clickOnNowOnlineInTheCustomersNavMenu(); $I->shouldBeOnTheAdminCustomersNowOnlinePage(); } @@ -108,48 +108,48 @@ public function shouldLanOnEachOfTheCustomersPages(AdminStep $I, SideNav $sideNa public function shouldLandOnEachOfTheMarketingPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the MARKETING Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnCatalogPriceRulesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnCatalogPriceRulesInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingCatalogPriceRulePage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnCartPriceRulesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnCartPriceRulesInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingCartPriceRulePage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnEmailTemplatesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnEmailTemplatesInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingEmailTemplatesPage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnNewsletterTemplatesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnNewsletterTemplatesInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingNewsletterTemplatePage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnNewsletterQueueInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnNewsletterQueueInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingNewsletterQueuePage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnNewsletterSubscribersInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnNewsletterSubscribersInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingNewsletterSubscribersPage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnURLRewritesInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnURLRewritesInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingURLRewritesPage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnSearchTermsInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnSearchTermsInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingSearchTermsPage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnSearchSynonymsInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnSearchSynonymsInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingSearchSynonymsPage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnSiteMapInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnSiteMapInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingSiteMapPage(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->clickOnContentReviewsInTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->clickOnContentReviewsInTheMarketingNavMenu(); $I->shouldBeOnTheAdminMarketingReviewsPage(); } @@ -162,28 +162,28 @@ public function shouldLandOnEachOfTheMarketingPages(AdminStep $I, SideNav $sideN public function shouldLandOnEachOfTheContentPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the CONTENT Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnContentInTheSideNavMenu($I); - $sideNavMenu->clickOnPagesInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu(); + $sideNavMenu->clickOnPagesInTheContentNavMenu(); $I->shouldBeOnTheAdminContentPagesPage(); - $sideNavMenu->clickOnContentInTheSideNavMenu($I); - $sideNavMenu->clickOnBlocksInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu(); + $sideNavMenu->clickOnBlocksInTheContentNavMenu(); $I->shouldBeOnTheAdminContentBlocksPage(); - $sideNavMenu->clickOnContentInTheSideNavMenu($I); - $sideNavMenu->clickOnWidgetsInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu(); + $sideNavMenu->clickOnWidgetsInTheContentNavMenu(); $I->shouldBeOnTheAdminContentWidgetsPage(); - $sideNavMenu->clickOnContentInTheSideNavMenu($I); - $sideNavMenu->clickOnConfigurationInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu(); + $sideNavMenu->clickOnConfigurationInTheContentNavMenu(); $I->shouldBeOnTheAdminContentConfigurationPage(); - $sideNavMenu->clickOnContentInTheSideNavMenu($I); - $sideNavMenu->clickOnThemesInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu(); + $sideNavMenu->clickOnThemesInTheContentNavMenu(); $I->shouldBeOnTheAdminContentThemesPage(); - $sideNavMenu->clickOnContentInTheSideNavMenu($I); - $sideNavMenu->clickOnScheduleInTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu(); + $sideNavMenu->clickOnScheduleInTheContentNavMenu(); $I->shouldBeOnTheAdminContentSchedulePage(); } @@ -196,96 +196,96 @@ public function shouldLandOnEachOfTheContentPages(AdminStep $I, SideNav $sideNav public function shouldLandOnEachOfTheReportsPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the REPORTS Admin Pages using the Side Nav Menu'); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnProductsInCartInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnProductsInCartInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsProductsInCartPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnSearchTermsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnSearchTermsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsSearchTermsPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnAbandonedCartsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnAbandonedCartsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsAbandonedCartsPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnNewsletterProblemReportsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnNewsletterProblemReportsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsNewsletterProblemReportsPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnByCustomersInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnByCustomersInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsByCustomersPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnByProductsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnByProductsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsByProductsPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnOrdersInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnOrdersInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsOrdersPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOTaxInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOTaxInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsTaxPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnInvoicedInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnInvoicedInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsInvoicedPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnShippingInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnShippingInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsShippingPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnRefundsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnRefundsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsRefundsPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnCouponsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnCouponsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsCouponsPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnPayPalSettlementInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnPayPalSettlementInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsPayPalSettlementPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnBraintreeSettlementInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnBraintreeSettlementInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsBraintreeSettlementPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnOrderTotalInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnOrderTotalInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsOrderTotalPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnOrderCountInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnOrderCountInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsOrderCountPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnNewInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnNewInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsNewPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnViewsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnViewsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsViewsPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnBestSellersInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnBestSellersInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsBestsellersPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnLowStockInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnLowStockInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsLowStockPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnOrderedInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnOrderedInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsOrderedPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnDownloadsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnDownloadsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsDownloadsPage(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->clickOnRefreshStatisticsInTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->clickOnRefreshStatisticsInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportRefreshStatisticsPage(); } @@ -298,52 +298,52 @@ public function shouldLandOnEachOfTheReportsPages(AdminStep $I, SideNav $sideNav public function shouldLandOnEachOfTheStoresPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the STORES Admin Pages using the Side Nav Menu'); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnAllStoresInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnAllStoresInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresAllStoresPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnConfigurationInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnConfigurationInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresConfigurationPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnTermsAndConditionsInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnTermsAndConditionsInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresTermsAndConditionsPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnOrderStatusInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnOrderStatusInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresOrderStatusPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnTaxRuleInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnTaxRuleInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresTaxRulesPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnTaxZonesAndRatesInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnTaxZonesAndRatesInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresTaxZonesAndRatesPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnCurrencyRatesInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnCurrencyRatesInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresCurrencyRatesPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnCurrencySymbolsInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnCurrencySymbolsInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresCurrencySymbolsPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnProductInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnProductInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresProductPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnAttributesSetInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnAttributesSetInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresAttributeSetPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnRatingsInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnRatingsInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresRatingPage(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->clickOnCustomerGroupInTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->clickOnCustomerGroupInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresCustomerGroupsPage(); } @@ -356,60 +356,60 @@ public function shouldLandOnEachOfTheStoresPages(AdminStep $I, SideNav $sideNavM public function shouldLandOnEachOfTheSystemPages(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access each of the SYSTEM Admin Pages using the Side Nav Menu'); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnImportInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnImportInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemImportPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnExportInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnExportInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemExportPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnImportExportTaxRatesInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnImportExportTaxRatesInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemImportExportTaxRatesPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnImportHistoryInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnImportHistoryInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemImportHistoryPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnIntegrationsInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnIntegrationsInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemIntegrationsPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnCacheManagementInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnCacheManagementInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemCacheManagementPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnBackupsInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnBackupsInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemBackupsPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnIndexManagementInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnIndexManagementInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemIndexManagementPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnAllUsersInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnAllUsersInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemAllUsersPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnLockedUsersInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnLockedUsersInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemLockedUsersPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnUserRolesInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnUserRolesInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemUserRolesPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnNotificationsInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnNotificationsInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemNotificationsPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnCustomVariablesInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnCustomVariablesInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemCustomVariablesPage(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnManageEncryptionKeyInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnManageEncryptionKeyInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemManageEncryptionKeyPage(); } @@ -421,8 +421,8 @@ public function shouldLandOnEachOfTheSystemPages(AdminStep $I, SideNav $sideNavM public function shouldLandOnTheWebSetupWizardPage(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the Web Setup Wizard Admin Page using the Side Nav Menu'); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->clickOnWebSetupWizardInTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->clickOnWebSetupWizardInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemWebSetupWizardPage(); $I->goToTheAdminLogoutPage(); } @@ -435,7 +435,7 @@ public function shouldLandOnTheWebSetupWizardPage(AdminStep $I, SideNav $sideNav public function shouldLandOnThePartnersAndExtensionsPage(AdminStep $I, SideNav $sideNavMenu) { $I->wantTo('see if I can access the Partners and Extensions Admin Page using the Side Nav Menu'); - $sideNavMenu->clickOnFindPartnersAndExtensionsInTheSideNavMenu($I); + $sideNavMenu->clickOnFindPartnersAndExtensionsInTheSideNavMenu(); $I->shouldBeOnTheAdminFindPartnersAndExtensionsPage(); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php index 40cb4f1f9..fb6f449ee 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php @@ -20,30 +20,30 @@ public function _before(AdminStep $I) * @env firefox * @group slow */ - public function shouldBeAbleToOpenEachSideNavMenu(AdminStep $I, SideNav $sideNavMenu) + public function shouldBeAbleToOpenEachSideNavMenu(SideNav $sideNavMenu) { - $sideNavMenu->clickOnSalesInTheSideNavMenu($I); - $sideNavMenu->shouldSeeTheSalesNavMenu($I); + $sideNavMenu->clickOnSalesInTheSideNavMenu(); + $sideNavMenu->shouldSeeTheSalesNavMenu(); - $sideNavMenu->clickOnProductsInTheSideNavMenu($I); - $sideNavMenu->shouldSeeTheProductNavMenu($I); + $sideNavMenu->clickOnProductsInTheSideNavMenu(); + $sideNavMenu->shouldSeeTheProductNavMenu(); - $sideNavMenu->clickOnCustomersInTheSideNavMenu($I); - $sideNavMenu->shouldSeeTheCustomersNavMenu($I); + $sideNavMenu->clickOnCustomersInTheSideNavMenu(); + $sideNavMenu->shouldSeeTheCustomersNavMenu(); - $sideNavMenu->clickOnMarketingInTheSideNavMenu($I); - $sideNavMenu->shouldSeeTheMarketingNavMenu($I); + $sideNavMenu->clickOnMarketingInTheSideNavMenu(); + $sideNavMenu->shouldSeeTheMarketingNavMenu(); - $sideNavMenu->clickOnContentInTheSideNavMenu($I); - $sideNavMenu->shouldSeeTheContentNavMenu($I); + $sideNavMenu->clickOnContentInTheSideNavMenu(); + $sideNavMenu->shouldSeeTheContentNavMenu(); - $sideNavMenu->clickOnReportsInTheSideNavMenu($I); - $sideNavMenu->shouldSeeTheReportsNavMenu($I); + $sideNavMenu->clickOnReportsInTheSideNavMenu(); + $sideNavMenu->shouldSeeTheReportsNavMenu(); - $sideNavMenu->clickOnStoresInTheSideNavMenu($I); - $sideNavMenu->shouldSeeTheStoresNavMenu($I); + $sideNavMenu->clickOnStoresInTheSideNavMenu(); + $sideNavMenu->shouldSeeTheStoresNavMenu(); - $sideNavMenu->clickOnSystemInTheSideNavMenu($I); - $sideNavMenu->shouldSeeTheSystemNavMenu($I); + $sideNavMenu->clickOnSystemInTheSideNavMenu(); + $sideNavMenu->shouldSeeTheSystemNavMenu(); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index aa3508c42..93df61cdf 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -39,8 +39,6 @@ public function _after(AdminStep $I) * @Description("Method Description: Create sub category with required fields") * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "Admin", value = "$I") - * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") - * @Parameter(name = "DataHelper", value = "$dataHelper") * * Codeception annotations * @group catalog @@ -49,20 +47,18 @@ public function _after(AdminStep $I) * @env phantomjs * * @param AdminStep $I - * @param AdminCategoryPage $adminCategoryPage * @return void */ public function createCategoryTest( - AdminStep $I, - AdminCategoryPage $adminCategoryPage + AdminStep $I ) { - $I->wantTo('verify category creation in admin'); + $I->wantTo('create sub category with required fields in admin Category page.'); $category = $I->getCategoryData(); - $adminCategoryPage->amOnAdminCategoryPage($I); - $adminCategoryPage->addSubCategory($I); - $adminCategoryPage->fillFieldCategoryName($I, $category['name']); - $adminCategoryPage->fillFieldCategoryUrlKey($I, $category['custom_attributes'][0]['value']); - $adminCategoryPage->saveCategory($I); - $I->seeElement(AdminCategoryPage::$catagorySaveSuccessMessage); + AdminCategoryPage::of($I)->amOnAdminCategoryPage(); + AdminCategoryPage::of($I)->addSubCategory(); + AdminCategoryPage::of($I)->fillFieldCategoryName($category['name']); + AdminCategoryPage::of($I)->fillFieldCategoryUrlKey($category['custom_attributes'][0]['value']); + AdminCategoryPage::of($I)->saveCategory(); + $I->seeElement(AdminCategoryPage::$successMessage); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index 78690afa0..e851967eb 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -39,8 +39,6 @@ public function _after(AdminStep $I) * @Description("Method Description: Create simple product with required fields") * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "Admin", value = "$I") - * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") - * @Parameter(name = "AdminProductPage", value = "$adminProductPage") * * Codeception annotations * @group catalog @@ -49,30 +47,25 @@ public function _after(AdminStep $I) * @env phantomjs * * @param AdminStep $I - * @param AdminProductGridPage $adminProductGridPage - * @param AdminProductPage $adminProductPage * @return void */ public function createSimpleProductTest( - AdminStep $I, - AdminProductGridPage $adminProductGridPage, - AdminProductPage $adminProductPage + AdminStep $I ) { - $I->wantTo('verify simple product creation in admin'); + $I->wantTo('create simple product with required fields in admin product page.'); $product = $I->getSimpleProductData(); - $adminProductGridPage->amOnAdminProductGridPage($I); - $adminProductGridPage->goToAddNewProductPage($I); - $adminProductPage->amOnAdminNewProductPage($I); + AdminProductGridPage::of($I)->amOnAdminProductGridPage(); + AdminProductGridPage::of($I)->goToAddNewProductPage(); + AdminProductPage::of($I)->amOnAdminNewProductPage(); - $adminProductPage->fillFieldProductName($I, $product['name']); - $adminProductPage->fillFieldProductSku($I, $product['sku']); - $adminProductPage->fillFieldProductPrice($I, $product['price']); - $adminProductPage->fillFieldProductQuantity($I, $product['extension_attributes']['stock_item']['qty']); - $adminProductPage->selectProductStockStatus( - $I, + AdminProductPage::of($I)->fillFieldProductName($product['name']); + AdminProductPage::of($I)->fillFieldProductSku($product['sku']); + AdminProductPage::of($I)->fillFieldProductPrice($product['price']); + AdminProductPage::of($I)->fillFieldProductQuantity($product['extension_attributes']['stock_item']['qty']); + AdminProductPage::of($I)->selectProductStockStatus( $product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' ); - $adminProductPage->saveProduct($I); - $I->seeElement(AdminProductPage::$productSaveSuccessMessage); + AdminProductPage::of($I)->saveProduct(); + $I->seeElement(AdminProductPage::$successMessage); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index 6ffb461c5..ac50e2321 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -77,37 +77,37 @@ public function updateSimpleProductTest( AdminProductGridPage $adminProductGridPage, AdminProductPage $adminProductPage ) { - $I->wantTo('verify product updated in admin'); - $adminProductGridPage->amOnAdminProductGridPage($I); + $I->wantTo('update simple product in admin'); + AdminProductGridPage::of($I)->amOnAdminProductGridPage(); //$adminProductGridPage->searchBySku($I, $this->product['sku']); $I->wantTo('verify product created visible in product form in admin'); - $adminProductPage->amOnAdminProductPageById($I, $this->product['id']); - $adminProductPage->seeProductNameInPageTitle($I, $this->product['name']); - $adminProductPage->seeProductAttributeSet($I, 'Default'); - $adminProductPage->seeProductName($I, $this->product['name']); - $adminProductPage->seeProductSku($I, $this->product['sku']); - $adminProductPage->seeProductPrice($I, $this->product['price']); - $adminProductPage->seeProductQuantity($I, $this->product['extension_attributes']['stock_item']['qty']); - $adminProductPage->seeProductStockStatus( - $I, + AdminProductPage::of($I)->amOnAdminEditProductPageById($this->product['id']); + AdminProductPage::of($I)->seeInPageTitle($this->product['name']); + AdminProductPage::of($I)->seeProductAttributeSet('Default'); + AdminProductPage::of($I)->seeProductName($this->product['name']); + AdminProductPage::of($I)->seeProductSku($this->product['sku']); + AdminProductPage::of($I)->seeProductPrice($this->product['price']); + AdminProductPage::of($I)->seeProductQuantity($this->product['extension_attributes']['stock_item']['qty']); + AdminProductPage::of($I)->seeProductStockStatus( $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' ); $I->wantTo('verify product updated in admin'); - $adminProductPage->fillFieldProductName($I, $this->product['name'] . '-updated'); - $adminProductPage->fillFieldProductSku($I, $this->product['sku'] . '-updated'); - $adminProductPage->fillFieldProductPrice($I, $this->product['price']+10); - $adminProductPage->fillFieldProductQuantity($I, $this->product['extension_attributes']['stock_item']['qty']+100); - $adminProductPage->saveProduct($I); + AdminProductPage::of($I)->fillFieldProductName($this->product['name'] . '-updated'); + AdminProductPage::of($I)->fillFieldProductSku($this->product['sku'] . '-updated'); + AdminProductPage::of($I)->fillFieldProductPrice($this->product['price']+10); + AdminProductPage::of($I)->fillFieldProductQuantity( + $this->product['extension_attributes']['stock_item']['qty']+100 + ); + AdminProductPage::of($I)->saveProduct(); $I->wantTo('verify product created visible in product form in admin'); - $adminProductPage->amOnAdminProductPageById($I, $this->product['id']); - $adminProductPage->seeProductNameInPageTitle($I, $this->product['name']. '-updated'); - $adminProductPage->seeProductAttributeSet($I, 'Default'); - $adminProductPage->seeProductName($I, $this->product['name']. '-updated'); - $adminProductPage->seeProductSku($I, $this->product['sku']. '-updated'); - $adminProductPage->seeProductPrice($I, $this->product['price']+10); - $adminProductPage->seeProductQuantity($I, $this->product['extension_attributes']['stock_item']['qty']+100); - $adminProductPage->seeProductStockStatus( - $I, + AdminProductPage::of($I)->amOnAdminEditProductPageById($this->product['id']); + AdminProductPage::of($I)->seeInPageTitle($this->product['name']. '-updated'); + AdminProductPage::of($I)->seeProductAttributeSet('Default'); + AdminProductPage::of($I)->seeProductName($this->product['name']. '-updated'); + AdminProductPage::of($I)->seeProductSku($this->product['sku']. '-updated'); + AdminProductPage::of($I)->seeProductPrice($this->product['price']+10); + AdminProductPage::of($I)->seeProductQuantity($this->product['extension_attributes']['stock_item']['qty']+100); + AdminProductPage::of($I)->seeProductStockStatus( $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' ); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php index df42a2b06..c5f34384a 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php @@ -34,9 +34,9 @@ public function _before(AdminStep $I) public function shouldLandOnTheForgotYourPasswordPage(AdminStep $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Forgot Your Password page'); - $adminLogin->clickOnForgotYourPassword($I); + $adminLogin->clickOnForgotYourPassword(); $I->shouldBeOnTheForgotYourPasswordPage(); - $adminLogin->shouldSeeTheForgotYourPasswordFields($I); + $adminLogin->shouldSeeTheForgotYourPasswordFields(); $I->see('Password Help'); } @@ -50,8 +50,8 @@ public function shouldLandOnTheForgotYourPasswordPage(AdminStep $I, AdminLogin $ public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(AdminStep $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Login page from the Forgot Your Password page'); - $adminLogin->clickOnForgotYourPassword($I); - $adminLogin->clickOnBackToSignIn($I); + $adminLogin->clickOnForgotYourPassword(); + $adminLogin->clickOnBackToSignIn(); $I->shouldBeOnTheAdminLoginPage(); } @@ -65,11 +65,11 @@ public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(AdminStep $I, public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(AdminStep $I, AdminLogin $adminLogin) { $I->wantTo('see if I can access the Login page by clicking on the Logo'); - $adminLogin->clickOnMagentoLogo($I); + $adminLogin->clickOnMagentoLogo(); $I->shouldBeOnTheAdminLoginPage(); - $adminLogin->clickOnForgotYourPassword($I); - $adminLogin->clickOnMagentoLogo($I); + $adminLogin->clickOnForgotYourPassword(); + $adminLogin->clickOnMagentoLogo(); $I->shouldBeOnTheAdminLoginPage(); } } From 39a609c9c79d41fa78dbc8a284d7f7239dd0a966 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 14 Apr 2017 15:26:23 -0500 Subject: [PATCH 032/149] Cleaning up closeAdminNotification function, adding Admin Grid PO, editing variable name. - I cleaned up the closeAdminNotification function by removing the commended out old code. The new version works with the try/catch added. - Adding the Admin Grid page object. - Edited a variable name, changed it from pageloadTimeout => pageLoadTimeout. --- .../Xxyyzz/Module/MagentoWebDriver.php | 12 +- .../Xxyyzz/Page/AbstractAdminGridPage.php | 259 ++++++++++++++++++ .../Page/Catalog/Admin/AdminCategoryPage.php | 6 +- .../Catalog/Admin/AdminProductGridPage.php | 10 +- .../Page/Catalog/Admin/AdminProductPage.php | 4 +- 5 files changed, 272 insertions(+), 19 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php index 17ac70e67..2c01cd945 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -96,14 +96,8 @@ public function loginAsAdmin($username = null, $password = null) public function closeAdminNotification() { // Cheating here for the minute. Still working on the best method to deal with this issue. - $this->executeJS("jQuery('.modal-popup').remove(); jQuery('.modals-overlay').remove();"); - -// try { -// $I->waitForElementVisible('._show .action-close', 1); -// $I->click('._show .action-close'); -// $I->waitForElementNotVisible('._show .action-close', 1); -// } catch (\Exception $e) { -// return false; -// } + try { + $this->executeJS("jQuery('.modal-popup').remove(); jQuery('.modals-overlay').remove();"); + } catch (\Exception $e) {} } } diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php new file mode 100644 index 000000000..27ea448e2 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php @@ -0,0 +1,259 @@ +acceptanceTester = $I; + $this->pageLoadTimeout = $I->getConfiguration('pageload_timeout'); + } + + public static function of(AcceptanceTester $I) + { + return new static($I); + } + + public function enterSearchKeyword($searchKeyboard) + { + $I = $this->acceptanceTester; + $I->fillField(self::$searchByField, $searchKeyboard); + } + + public function clickOnTheSearchButton() + { + $I = $this->acceptanceTester; + $I->click(self::$searchByButton); + } + + public function performSearchByKeyword($searchKeyword) + { + self::enterSearchKeyword($searchKeyword); + self::clickOnTheSearchButton(); + } + + public function clickOnFiltersButton() + { + $I = $this->acceptanceTester; + $I->click(self::$filtersButton); + } + + // TODO: Add Filter methods + + public function clickOnViewButton() + { + $I = $this->acceptanceTester; + $I->click(self::$viewButton); + } + + public function clickOnSpecificView($viewName) + { + $I = $this->acceptanceTester; + $I->click(self::$viewDropDownOption, $viewName); + } + + public function clickOnSaveViewAsLink() + { + $I = $this->acceptanceTester; + $I->click(self::$viewSaveViewAsLink); + } + + public function enterNewViewName($newViewName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$newViewField, $newViewName); + } + + public function clickOnNewViewSaveButton() + { + $I = $this->acceptanceTester; + $I->click(self::$newViewButton); + } + + public function saveTheCurrentView($newViewName) + { + self::clickOnViewButton(); + self::clickOnSaveViewAsLink(); + self::enterNewViewName($newViewName); + self::clickOnNewViewSaveButton(); + } + + public function clickOnColumnsButton() + { + $I = $this->acceptanceTester; + $I->click(self::$columnsButton); + } + + public function clickOnSpecificColumnName($columnName) + { + $I = $this->acceptanceTester; + $I->click(self::$columnName, $columnName); + } + + public function clickOnColumnReset() + { + $I = $this->acceptanceTester; + $I->click(self::$columnsResetButton); + } + + public function clickOnColumnCancel() + { + $I = $this->acceptanceTester; + $I->click(self::$columnsCancelButton); + } + + public function clickExportButton() + { + $I = $this->acceptanceTester; + $I->click(self::$exportButton); + } + + public function clickOnCsvLink() + { + $I = $this->acceptanceTester; + $I->click(self::$exportLinks, 'CSV'); + } + + public function clickOnExcelXmlLink() + { + $I = $this->acceptanceTester; + $I->click(self::$exportLinks, 'Excel XML'); + } + + public function clickOnExportCancel() + { + $I = $this->acceptanceTester; + $I->click(self::$exportCancelButton); + } + + public function clickOnExportExport() + { + $I = $this->acceptanceTester; + $I->click(self::$exportExportButton); + } + + public function clickOnActionsButton() + { + $I = $this->acceptanceTester; + $I->click(self::$actionsButton); + } + + public function clickOnSpecificActionLink($actionName) + { + $I = $this->acceptanceTester; + $I->click(self::$actionsMenuItem, $actionName); + } + + public function clickOnPerPageButton() + { + $I = $this->acceptanceTester; + $I->click(self::$perPageCountButton); + $I->wait(1); + } + + public function clickOnSpecificPerPageCount($itemsPerPage) + { + $I = $this->acceptanceTester; + $I->click($itemsPerPage); + } + + public function clickOnCustomPerPageCountLink() + { + $I = $this->acceptanceTester; + $I->click(self::$perPageCustomLink); + } + + public function enterCustomerPerPageLink($customPerPageCount) + { + $I = $this->acceptanceTester; + $I->fillField(self::$perPageCustomField, $customPerPageCount); + } + + public function clickOnCustomPerPageSaveLink() + { + $I = $this->acceptanceTester; + $I->click(self::$perPageCustomButton); + } + + public function clickOnPageBackButton() + { + $I = $this->acceptanceTester; + $I->click(self::$backPageButton); + } + + public function enterPageNumber($pageNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$pageNumberField, $pageNumber); + } + + public function clickOnPageNextButton() + { + $I = $this->acceptanceTester; + $I->click(self::$nextPageButton); + } + + public function clickOnSpecificGridColumnHeader($columnHeaderName) + { + $I = $this->acceptanceTester; + $I->click(self::$gridHeaderName, $columnHeaderName); + } +} \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php index 9b029ba33..37145462b 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php @@ -38,14 +38,14 @@ public function amOnAdminCategoryPage($param = '') { $I = $this->acceptanceTester; $I->amOnPage(self::route($param)); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageLoadTimeout); } public function amOnAdminCategoryPageById($id) { $I = $this->acceptanceTester; $I->amOnPage(self::$URL . 'edit/id/' . $id); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageLoadTimeout); } public function addRootCategory() @@ -58,7 +58,7 @@ public function addSubCategory() { $I = $this->acceptanceTester; $I->click(self::$addSubCategoryButton); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageLoadTimeout); } public function fillFieldCategoryName($name) diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php index b00ff9faf..9770e9231 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php @@ -41,7 +41,7 @@ public function amOnAdminProductGridPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); } @@ -55,21 +55,21 @@ public function searchBySku($sku) { $I = $this->acceptanceTester; try { - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); $I->click(self::$filterClearAllButton); } catch (\Codeception\Exception\ElementNotFound $e) { } try { $I->wait(5); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); $I->click(self::$filterExpandButton); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); } catch (\Codeception\Exception\ElementNotFound $e) { } $I->fillField(self::$filterProductSku, $sku); $I->click(self::$filterApplyButton); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); } public function containsInNthRow($n, $text) diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php index eed4e31e1..87f3bbb9e 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php @@ -39,14 +39,14 @@ public function amOnAdminNewProductPage() { $I = $this->acceptanceTester; $I->seeInCurrentUrl(static::$URL . 'new'); - $I->waitForElementNotVisible(self::$productFormLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productFormLoadingSpinner, $this->pageLoadTimeout); } public function amOnAdminEditProductPageById($id) { $I = $this->acceptanceTester; $I->amOnPage(self::route('edit/id/' . $id)); - $I->waitForElementNotVisible(self::$productFormLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productFormLoadingSpinner, $this->pageLoadTimeout); } public function seeProductAttributeSet($name) From 0695dab903eec9f4b0672ed6c54eb00d2041d8a4 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 14 Apr 2017 15:55:29 -0500 Subject: [PATCH 033/149] Removing the call to goToTheAdminLoginPage from all tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - I removed the goToTheAdminLoginPage function call from all tests since it’s been added to the loginAsAdmin function. This will prevent us from visiting the Login page twice per test. --- .../Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php | 1 - .../Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php | 1 - .../Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php | 1 - .../Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php | 1 - .../Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php | 1 - .../Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php | 1 - .../Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php | 1 - .../Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php | 1 - .../Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php | 3 +-- .../Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php | 3 +-- .../Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php | 3 +-- 11 files changed, 3 insertions(+), 14 deletions(-) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php index e7793823c..88fbe41b8 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php @@ -10,7 +10,6 @@ class AccessAdminPagesDirectlyCest { public function _before(AdminStep $I) { - $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index 96a2ef834..18b859403 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -11,7 +11,6 @@ class AccessAdminPagesViaNavMenuCest { public function _before(AdminStep $I) { - $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php index fb6f449ee..b87ecac9d 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php @@ -11,7 +11,6 @@ class OpenEachSideNavMenuCest { public function _before(AdminStep $I) { - $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index 93df61cdf..759624b8c 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -23,7 +23,6 @@ class CreateCategoryCest { public function _before(AdminStep $I) { - $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index e851967eb..954650aa9 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -23,7 +23,6 @@ class CreateSimpleProductCest { public function _before(AdminStep $I) { - $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index ac50e2321..aadbd7de7 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -40,7 +40,6 @@ class UpdateSimpleProductCest public function _before(AdminStep $I, ProductApiStep $api) { - $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); $this->product = $I->getSimpleProductData(); $api->amAdminTokenAuthenticated(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php index 35dd13ddc..11e1d4d3c 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php @@ -4,5 +4,4 @@ // @group skip $I = new \Magento\Xxyyzz\Step\Backend\AdminStep(\Codeception\Scenario::$scenario); $I->wantTo('demo the usage of StepObject in Cept'); -$I->goToTheAdminLoginPage(); $I->loginAsAdmin(); \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php index 227b4c8e8..0904ed3e0 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php @@ -18,7 +18,6 @@ class AdminCest public function amStepObject(Scenario $scenario, AdminStep $I) { $I->wantTo('demo the usage of StepObject in Cest'); - $I->goToTheAdminLoginPage(); $I->loginAsAdmin(); } } \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php index 9cac94aa6..e9f6f194d 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php @@ -14,8 +14,7 @@ class CannotAccessAdminAfterLoggingOutCest public function shouldNotBeAbleToAccessAdminAfterLogout(AdminStep $I) { $I->wantTo('make sure you cannot access Admin pages after logging out'); - - $I->goToTheAdminLoginPage(); + $I->loginAsAdmin(); $I->goToTheAdminLogoutPage(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php index 1ea46edc0..bdd5a0a79 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php @@ -13,8 +13,7 @@ class LoginOnAdminLoginPageCest public function shouldBeAbleToLogin(AdminStep $I) { $I->wantTo('verify that I can login via the Admin Login page'); - - $I->goToTheAdminLoginPage(); + $I->loginAsAdmin(); $I->shouldBeOnTheAdminDashboardPage(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php index cf41358b3..c3d82ad2d 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php @@ -13,8 +13,7 @@ class LogoutAfterLoginCest public function shouldBeAbleToLogout(AdminStep $I) { $I->wantTo('logout of the Admin area and land on the Login page'); - - $I->goToTheAdminLoginPage(); + $I->loginAsAdmin(); $I->goToTheAdminLogoutPage(); $I->shouldBeOnTheAdminLoginPage(); From 52389a6adb590fce35fe8564fe149faa7be08766 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Mon, 17 Apr 2017 16:57:11 -0500 Subject: [PATCH 034/149] Adding "Content - Page" Page Object. - Adding Faker to composer - Adding a Content - Page data generator method - Adding CMS Content Page PO - Adding new method for opening a new Tab and verifying the URL - Adding Tests for the CMS Page --- composer.json | 5 +- composer.lock | 203 +++++--- .../Xxyyzz/Module/MagentoDataSequence.php | 25 + .../Xxyyzz/Page/AbstractAdminGridPage.php | 4 +- .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 89 +++- .../Page/Content/Admin/AdminCMSPage.php | 457 ++++++++++++++++++ .../Content/Storefront/StorefrontCMSPage.php | 25 + .../Magento/Xxyyzz/Step/Backend/AdminStep.php | 8 + .../Content/CreateContentPageCest.php | 153 ++++++ 9 files changed, 876 insertions(+), 93 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Page/Content/Admin/AdminCMSPage.php create mode 100644 tests/_support/Magento/Xxyyzz/Page/Content/Storefront/StorefrontCMSPage.php create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php diff --git a/composer.json b/composer.json index f729fbb3d..e6c01a7b6 100755 --- a/composer.json +++ b/composer.json @@ -8,7 +8,8 @@ "consolidation/robo": "^1.0.0", "allure-framework/allure-codeception": "dev-master", "flow/jsonpath": ">0.2", - "vlucas/phpdotenv": "~2.4" + "vlucas/phpdotenv": "~2.4", + "fzaninotto/faker": "^1.6" }, "autoload": { "psr-0": { @@ -19,4 +20,4 @@ "Magento\\Xxyyzz\\Acceptance\\": "tests/acceptance/Magento/Xxyyzz/Acceptance" } } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index d5d6c5f94..de3f86864 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "0deaa92448076e655a2124e0369e35a0", - "content-hash": "5828e77f3c19b865bee2083e049d0d6b", + "content-hash": "cfaff575db89011a5e0d0f60979dcf01", "packages": [ { "name": "allure-framework/allure-codeception", @@ -108,7 +107,7 @@ "php", "report" ], - "time": "2016-12-07 12:15:46" + "time": "2016-12-07T12:15:46+00:00" }, { "name": "behat/gherkin", @@ -167,7 +166,7 @@ "gherkin", "parser" ], - "time": "2016-10-30 11:50:56" + "time": "2016-10-30T11:50:56+00:00" }, { "name": "codeception/codeception", @@ -260,7 +259,7 @@ "functional testing", "unit testing" ], - "time": "2017-03-25 03:19:52" + "time": "2017-03-25T03:19:52+00:00" }, { "name": "consolidation/annotated-command", @@ -312,7 +311,7 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-04-03 22:37:00" + "time": "2017-04-03T22:37:00+00:00" }, { "name": "consolidation/log", @@ -359,7 +358,7 @@ } ], "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", - "time": "2016-03-23 23:46:42" + "time": "2016-03-23T23:46:42+00:00" }, { "name": "consolidation/output-formatters", @@ -408,7 +407,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-03-01 20:54:45" + "time": "2017-03-01T20:54:45+00:00" }, { "name": "consolidation/robo", @@ -487,7 +486,7 @@ } ], "description": "Modern task runner", - "time": "2017-03-31 18:23:36" + "time": "2017-03-31T18:23:36+00:00" }, { "name": "container-interop/container-interop", @@ -518,7 +517,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14 19:40:03" + "time": "2017-02-14T19:40:03+00:00" }, { "name": "dflydev/dot-access-data", @@ -577,7 +576,7 @@ "dot", "notation" ], - "time": "2017-01-20 21:14:22" + "time": "2017-01-20T21:14:22+00:00" }, { "name": "doctrine/annotations", @@ -645,7 +644,7 @@ "docblock", "parser" ], - "time": "2017-02-24 16:22:25" + "time": "2017-02-24T16:22:25+00:00" }, { "name": "doctrine/instantiator", @@ -699,7 +698,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "doctrine/lexer", @@ -753,7 +752,7 @@ "lexer", "parser" ], - "time": "2014-09-09 13:34:57" + "time": "2014-09-09T13:34:57+00:00" }, { "name": "facebook/webdriver", @@ -805,7 +804,7 @@ "selenium", "webdriver" ], - "time": "2017-03-22 10:56:03" + "time": "2017-03-22T10:56:03+00:00" }, { "name": "flow/jsonpath", @@ -846,7 +845,55 @@ } ], "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2016-09-06 17:43:18" + "time": "2016-09-06T17:43:18+00:00" + }, + { + "name": "fzaninotto/faker", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/fzaninotto/Faker.git", + "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123", + "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0" + }, + "require-dev": { + "ext-intl": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "extra": { + "branch-alias": [] + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "time": "2016-04-29T12:21:54+00:00" }, { "name": "grasmash/yaml-expander", @@ -894,7 +941,7 @@ } ], "description": "Expands internal property references in a yaml file.", - "time": "2017-03-24 20:31:04" + "time": "2017-03-24T20:31:04+00:00" }, { "name": "guzzlehttp/guzzle", @@ -956,7 +1003,7 @@ "rest", "web service" ], - "time": "2017-02-28 22:50:30" + "time": "2017-02-28T22:50:30+00:00" }, { "name": "guzzlehttp/promises", @@ -1007,7 +1054,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20 10:07:11" + "time": "2016-12-20T10:07:11+00:00" }, { "name": "guzzlehttp/psr7", @@ -1072,7 +1119,7 @@ "uri", "url" ], - "time": "2017-03-20 17:10:46" + "time": "2017-03-20T17:10:46+00:00" }, { "name": "jms/metadata", @@ -1123,7 +1170,7 @@ "xml", "yaml" ], - "time": "2016-12-05 10:18:33" + "time": "2016-12-05T10:18:33+00:00" }, { "name": "jms/parser-lib", @@ -1158,20 +1205,20 @@ "Apache2" ], "description": "A library for easily creating recursive-descent parsers.", - "time": "2012-11-18 18:08:43" + "time": "2012-11-18T18:08:43+00:00" }, { "name": "jms/serializer", - "version": "1.6.0", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "5e9008cbb0bac2986979d905a87ae48efcf578c4" + "reference": "b8683d206e7297f54034f67a877f966c14dc12ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/5e9008cbb0bac2986979d905a87ae48efcf578c4", - "reference": "5e9008cbb0bac2986979d905a87ae48efcf578c4", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/b8683d206e7297f54034f67a877f966c14dc12ea", + "reference": "b8683d206e7297f54034f67a877f966c14dc12ea", "shasum": "" }, "require": { @@ -1237,7 +1284,7 @@ "serialization", "xml" ], - "time": "2017-03-24 13:11:23" + "time": "2017-04-17T15:27:46+00:00" }, { "name": "league/container", @@ -1302,7 +1349,7 @@ "provider", "service" ], - "time": "2017-03-06 15:24:06" + "time": "2017-03-06T15:24:06+00:00" }, { "name": "moontoast/math", @@ -1351,20 +1398,20 @@ "bcmath", "math" ], - "time": "2017-02-16 16:54:46" + "time": "2017-02-16T16:54:46+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", - "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", "shasum": "" }, "require": { @@ -1393,7 +1440,7 @@ "object", "object graph" ], - "time": "2017-01-26 22:05:40" + "time": "2017-04-12T18:52:22+00:00" }, { "name": "paragonie/random_compat", @@ -1441,7 +1488,7 @@ "pseudorandom", "random" ], - "time": "2017-03-13 16:27:32" + "time": "2017-03-13T16:27:32+00:00" }, { "name": "phpcollection/phpcollection", @@ -1489,7 +1536,7 @@ "sequence", "set" ], - "time": "2015-05-17 12:39:23" + "time": "2015-05-17T12:39:23+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1543,7 +1590,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -1588,7 +1635,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30 07:12:33" + "time": "2016-09-30T07:12:33+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1635,7 +1682,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25 06:54:22" + "time": "2016-11-25T06:54:22+00:00" }, { "name": "phpoption/phpoption", @@ -1685,7 +1732,7 @@ "php", "type" ], - "time": "2015-07-25 16:39:46" + "time": "2015-07-25T16:39:46+00:00" }, { "name": "phpspec/prophecy", @@ -1748,7 +1795,7 @@ "spy", "stub" ], - "time": "2017-03-02 20:05:34" + "time": "2017-03-02T20:05:34+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1811,7 +1858,7 @@ "testing", "xunit" ], - "time": "2017-04-02 07:44:40" + "time": "2017-04-02T07:44:40+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1858,7 +1905,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -1899,7 +1946,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -1948,7 +1995,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26 11:10:40" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", @@ -1997,7 +2044,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27 10:12:30" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", @@ -2079,7 +2126,7 @@ "testing", "xunit" ], - "time": "2017-04-03 02:22:27" + "time": "2017-04-03T02:22:27+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2138,7 +2185,7 @@ "mock", "xunit" ], - "time": "2016-12-08 20:27:08" + "time": "2016-12-08T20:27:08+00:00" }, { "name": "psr/container", @@ -2187,7 +2234,7 @@ "container-interop", "psr" ], - "time": "2017-02-14 16:28:37" + "time": "2017-02-14T16:28:37+00:00" }, { "name": "psr/http-message", @@ -2237,7 +2284,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", @@ -2284,7 +2331,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "ramsey/uuid", @@ -2366,7 +2413,7 @@ "identifier", "uuid" ], - "time": "2017-03-26 20:37:53" + "time": "2017-03-26T20:37:53+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2411,7 +2458,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04 06:30:41" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", @@ -2475,7 +2522,7 @@ "compare", "equality" ], - "time": "2017-01-29 09:50:25" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", @@ -2527,7 +2574,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", @@ -2577,7 +2624,7 @@ "environment", "hhvm" ], - "time": "2016-11-26 07:53:53" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", @@ -2644,7 +2691,7 @@ "export", "exporter" ], - "time": "2016-11-19 08:54:04" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", @@ -2695,7 +2742,7 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/object-enumerator", @@ -2741,7 +2788,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18 15:18:39" + "time": "2017-02-18T15:18:39+00:00" }, { "name": "sebastian/recursion-context", @@ -2794,7 +2841,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19 07:33:16" + "time": "2016-11-19T07:33:16+00:00" }, { "name": "sebastian/resource-operations", @@ -2836,7 +2883,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", @@ -2879,7 +2926,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -2957,7 +3004,7 @@ "phpcs", "standards" ], - "time": "2017-03-01 22:17:45" + "time": "2017-03-01T22:17:45+00:00" }, { "name": "stecman/symfony-console-completion", @@ -3002,7 +3049,7 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24 05:08:54" + "time": "2016-02-24T05:08:54+00:00" }, { "name": "symfony/browser-kit", @@ -3059,7 +3106,7 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-02-21 09:12:04" + "time": "2017-02-21T09:12:04+00:00" }, { "name": "symfony/console", @@ -3122,7 +3169,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-04-04 14:33:42" + "time": "2017-04-04T14:33:42+00:00" }, { "name": "symfony/css-selector", @@ -3175,7 +3222,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-02-21 09:12:04" + "time": "2017-02-21T09:12:04+00:00" }, { "name": "symfony/debug", @@ -3232,7 +3279,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-03-28 21:38:24" + "time": "2017-03-28T21:38:24+00:00" }, { "name": "symfony/dom-crawler", @@ -3288,7 +3335,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-02-21 09:12:04" + "time": "2017-02-21T09:12:04+00:00" }, { "name": "symfony/event-dispatcher", @@ -3348,7 +3395,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-04-04 07:26:27" + "time": "2017-04-04T07:26:27+00:00" }, { "name": "symfony/filesystem", @@ -3397,7 +3444,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-03-26 15:40:40" + "time": "2017-03-26T15:40:40+00:00" }, { "name": "symfony/finder", @@ -3446,7 +3493,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-03-20 08:46:40" + "time": "2017-03-20T08:46:40+00:00" }, { "name": "symfony/http-foundation", @@ -3499,7 +3546,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-04-04 15:30:56" + "time": "2017-04-04T15:30:56+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3558,7 +3605,7 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/process", @@ -3607,7 +3654,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-03-27 18:07:02" + "time": "2017-03-27T18:07:02+00:00" }, { "name": "symfony/yaml", @@ -3662,7 +3709,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-03-20 09:45:15" + "time": "2017-03-20T09:45:15+00:00" }, { "name": "vlucas/phpdotenv", @@ -3712,7 +3759,7 @@ "env", "environment" ], - "time": "2016-09-01 10:05:43" + "time": "2016-09-01T10:05:43+00:00" }, { "name": "webmozart/assert", @@ -3762,7 +3809,7 @@ "check", "validate" ], - "time": "2016-11-23 20:04:58" + "time": "2016-11-23T20:04:58+00:00" } ], "packages-dev": [], diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php index 694b4b99a..87b66b118 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php @@ -112,6 +112,31 @@ public function getCustomerDataWithPassword($password = '') return ['customer' => self::getCustomerData(), 'password' => ($password !== '') ? $password : '123123qW']; } + /** + * Get Content Page Data. + * + * @return array + */ + public function getContentPage() + { + $faker = \Faker\Factory::create(); + + $pageContent = [ + 'pageTitle' => $faker->sentence($nbWords = 3, $variableNbWords = true), + 'contentHeading' => $faker->sentence($nbWords = 3, $variableNbWords = true), + 'contentBody' => $faker->sentence($nbWords = 10, $variableNbWords = true), + 'urlKey' => $faker->uuid, + 'metaTitle' => $faker->word, + 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), + 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true), + 'layoutUpdateXml' => '', + 'from' => $faker->date($format = 'm-d-Y', $max = 'now'), + 'to' => $faker->date($format = 'm-d-Y') + ]; + + return $pageContent; + } + /** * Get a unique sequence across suite. * diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php index 27ea448e2..73a69ba13 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php @@ -25,7 +25,7 @@ class AbstractAdminGridPage public static $columnsButton = '.admin__data-grid-action-columns'; public static $columnsCurrentCount = '.admin__data-grid-action-columns .admin__action-dropdown-menu-header'; public static $columnCheckbox = ''; - public static $columnName = '.admin__data-grid-action-columns .admin__field-label'; + public static $columnHeaderName = '.admin__data-grid-action-columns .admin__field-label'; public static $columnsResetButton = '.admin__data-grid-action-columns .admin__action-dropdown-footer-secondary-actions'; public static $columnsCancelButton = '.admin__data-grid-action-columns .admin__action-dropdown-footer-main-actions'; @@ -145,7 +145,7 @@ public function clickOnColumnsButton() public function clickOnSpecificColumnName($columnName) { $I = $this->acceptanceTester; - $I->click(self::$columnName, $columnName); + $I->click($columnName); } public function clickOnColumnReset() diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php index f72b42972..af54cd8d1 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -13,21 +13,31 @@ abstract class AbstractAdminPage /** * Declare UI map for this page here. CSS or XPath allowed. */ - public static $pageTitle = '.page-title'; + public static $systemMessage = '.message-system'; - public static $systemMessage = '.message-system'; + public static $pageTitle = '.page-title'; + public static $globalSearchButton = '#search-global'; + public static $globalSearchInput = '.search-global-input'; - public static $successMessage = '.message.message-success.success'; + public static $adminNotificationsLink = '.notifications-action'; + public static $adminNotificationsCounter = '.notifications-counter'; + public static $adminNotificationsMenu = '.notifications-wrapper .admin__action-dropdown-menu'; + public static $adminNotificationMenuItem = '.notifications-wrapper .notifications-entry'; - public static $pageMainActions = '.page-main-actions'; + public static $userActionsMenuLink = '.admin-user .admin__action-dropdown'; + public static $adminAccountSetting = '.admin-user-name'; + public static $customerView = '.store-front'; + public static $adminSignOut = '.account-signout'; - public static $globalSearchButton = '#search-global'; + public static $successMessage = '.message.message-success.success'; - public static $adminaAccountSetting = '.admin-user-name'; - public static $customerView = '.store-front'; - public static $adminSignOut = '.account-signout'; + public static $popupLoadingSpinner = '.popup.popup-loading'; - public static $popupLoadingSpinner = '.popup.popup-loading'; + public static $pageMainActionsArea = '.page-main-actions'; + public static $pageMainActionsBack = '#back'; + public static $pageMainActionsReset = '#reset'; + public static $pageMainActionsSaveAndContinue = '#save_and_continue'; + public static $pageMainActionsSave = '#save'; /** * @var AcceptanceTester @@ -39,12 +49,12 @@ abstract class AbstractAdminPage * * @var string */ - protected $pageloadTimeout; + protected $pageLoadTimeout; public function __construct(AcceptanceTester $I) { $this->acceptanceTester = $I; - $this->pageloadTimeout = $I->getConfiguration('pageload_timeout'); + $this->pageLoadTimeout = $I->getConfiguration('pageload_timeout'); } public static function of(AcceptanceTester $I) @@ -62,9 +72,66 @@ public static function route($param) return static::$URL.$param; } + public function openTabGoToAndVerifyUrl($pageUrl) + { + $I = $this->acceptanceTester; + $I->openNewTab(); + $I->amOnPage($pageUrl); + $I->seeInCurrentUrl($pageUrl); + } + public function seeInPageTitle($name) { $I = $this->acceptanceTester; $I->see($name, self::$pageTitle); } + + public function clickOnTheGlobalSearchButton() + { + $I = $this->acceptanceTester; + $I->click(self::$globalSearchButton); + } + + public function enterGlobalSearchValue($searchValue) + { + $I = $this->acceptanceTester; + $I->fillField(self::$globalSearchInput, $searchValue); + } + + public function pressEnterOnTheKeyboard() + { + $I = $this->acceptanceTester; + $I->pressKey(self::$globalSearchInput, \WebDriverKeys::ENTER); + } + + public function performGlobalSearchFor($searchValue) + { + self::clickOnTheGlobalSearchButton(); + self::enterGlobalSearchValue($searchValue); + self::pressEnterOnTheKeyboard(); + } + + public function clickOnUserActionMenuLink() + { + $I = $this->acceptanceTester; + $I->click(self::$userActionsMenuLink); + } + + public function clickOnAdminAccountSetting() + { + $I = $this->acceptanceTester; + $I->click(self::$adminAccountSetting); + } + + public function clickOnCustomerView() + { + $I = $this->acceptanceTester; + $I->click(self::$customerView); + } + + public function clickOnSignOut() + { + $I = $this->acceptanceTester; + $I->click(self::$adminSignOut); + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Content/Admin/AdminCMSPage.php b/tests/_support/Magento/Xxyyzz/Page/Content/Admin/AdminCMSPage.php new file mode 100644 index 000000000..504000264 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Content/Admin/AdminCMSPage.php @@ -0,0 +1,457 @@ +acceptanceTester; + $I->amOnPage(self::route($param)); + $I->waitForElementNotVisible('.admin__data-grid-loading-mask', 30); // secs + } + + public function amOnAdminCmsPageById($id) + { + $I = $this->acceptanceTester; + $I->amOnPage(self::$URL . 'edit/page_id/' . $id); + $I->waitForElementNotVisible(self::$cmsFormLoadingSpinner, 30); // secs + } + + public function seePageNameInPageTitle($name) + { + $I = $this->acceptanceTester; + $I->see($name, self::$pageTitle); + } + + public function clickOnAddNewPageButton() + { + $I = $this->acceptanceTester; + $I->click(self::$cmsAddNewPageButton); + $I->waitForElementNotVisible(self::$cmsFormLoadingSpinner, 30); // secs + } + + public function clickOnEnablePageToggle() + { + $I = $this->acceptanceTester; + $I->click(self::$cmsEnablePageToggle); + } + + public function seeEnablePageToggleIs($expectedState) + { + $I = $this->acceptanceTester; + $I->seeCheckboxIsChecked(self::$cmsEnablePageToggle, $expectedState); + } + + public function enterPageTitle($pageTitle) + { + $I = $this->acceptanceTester; + $I->fillField(self::$pageTitleField, $pageTitle); + } + + public function verifyPageTitle($pageTitle) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$pageTitleField, $pageTitle); + } + + public function enterPageContentHeading($pageContentTitle) + { + $I = $this->acceptanceTester; + $I->fillField(self::$contentHeadingField, $pageContentTitle); + } + + public function verifyPageContentHeading($pageContentTitle) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$contentHeadingField, $pageContentTitle); + } + + public function clickOnInsertWidgetButton() + { + $I = $this->acceptanceTester; + $I->click(self::$insertWidgetButton); + } + + public function clickOnInsertImageButton() + { + $I = $this->acceptanceTester; + $I->click(self::$insertImageButton); + } + + public function clickOnInsertVariableButton() + { + $I = $this->acceptanceTester; + $I->click(self::$insertVariableButton); + } + + public function enterPageContentBody($pageContentBody) + { + $I = $this->acceptanceTester; + $I->fillField(self::$contentBodyField, $pageContentBody); + } + + public function verifyPageContentBody($pageContentBody) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$contentBodyField, $pageContentBody); + } + + public function enterUrlKey($urlKey) + { + $I = $this->acceptanceTester; + $I->fillField(self::$urlKeyField, $urlKey); + } + + public function verifyUrlKey($urlKey) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$urlKeyField, $urlKey); + } + + public function enterMetaTitle($metaTitle) + { + $I = $this->acceptanceTester; + $I->fillField(self::$metaTitleField, $metaTitle); + } + + public function verifyMetaTitle($metaTitle) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$metaTitleField, $metaTitle); + } + + public function enterMetaKeywords($metaKeywords) + { + $I = $this->acceptanceTester; + $I->fillField(self::$metaKeywordsField, $metaKeywords); + } + + public function verifyMetaKeywords($metaKeywords) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$metaKeywordsField, $metaKeywords); + } + + public function enterMetaDescription($metaDescription) + { + $I = $this->acceptanceTester; + $I->fillField(self::$metaDescriptionField, $metaDescription); + } + + public function verifyMetaDescription($metaDescription) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$metaDescriptionField, $metaDescription); + } + + public function selectStoreView($storeView) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$storeViewMainArea, $storeView); + } + + public function selectDefaultStoreView() + { + self::selectStoreView('Default Store View'); + } + + public function verifyStoreView($storeView) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$storeViewMainArea, $storeView); + } + + public function verifyDefaultStoreView() + { + self::verifyStoreView('Default Store View'); + } + + public function pressShiftOnTheKeyboard() + { + $I = $this->acceptanceTester; + $I->pressKey(self::$storeViewMainArea, \WebDriverKeys::SHIFT); + } + + public function selectMultipleStoreViews($storeViews) + { + $I = $this->acceptanceTester; + // TODO: Add multiselect support + foreach ($storeViews as &$value) { + self::pressShiftOnTheKeyboard(); + $I->selectOption(self::$storeViewMainArea, $value); + } + } + + public function selectLayout($layout) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$layoutButton, $layout); + } + + public function selectLayout1Column() + { + self::selectLayout('1 column'); + } + + public function selectLayout2ColumnsWithLeftBar() + { + self::selectLayout('2 columns with left bar'); + } + + public function selectLayout2ColumnsWithRightBar() + { + self::selectLayout('2 columns with right bar'); + } + + public function selectLayout3Column() + { + self::selectLayout('3 columns'); + } + + public function verifyLayout($layout) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$layoutButton, $layout); + } + + public function verifyLayout1Column() + { + self::verifyLayout('1 column'); + } + + public function verifyLayout2ColumnsWithLeftBar() + { + self::verifyLayout('2 columns with left bar'); + } + + public function verifyLayout2ColumnsWithRightBar() + { + self::verifyLayout('2 columns with right bar'); + } + + public function verifyLayout3Column() + { + self::verifyLayout('3 columns'); + } + + public function enterLayoutUpdateXml($layoutXml) + { + $I = $this->acceptanceTester; + $I->fillField(self::$layoutUpdateXmlField, $layoutXml); + } + + public function verifyLayoutUpdateXml($layoutXml) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$layoutUpdateXmlField, $layoutXml); + } + + public function enterFrom($fromDate) + { + $I = $this->acceptanceTester; + $I->fillField(self::$fromField, $fromDate); + // TODO: Add calendar support + } + + public function verifyFrom($fromDate) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$fromField, $fromDate); + // TODO: Add calendar support + } + + public function enterTo($toDate) + { + $I = $this->acceptanceTester; + $I->fillField(self::$toField, $toDate); + } + + public function verifyTo($toDate) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$toField, $toDate); + } + + public function selectNewTheme($newTheme) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$newThemeButton, $newTheme); + } + + public function selectNewThemeMagentoBlank() + { + self::selectNewTheme('Magento Blank'); + } + + public function selectNewThemeMagentoLuma() + { + self::selectNewTheme('Magento Luma'); + } + + public function verifyNewTheme($newTheme) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$newThemeButton, $newTheme); + } + + public function verifyNewThemeMagentoBlank() + { + self::verifyNewTheme('Magento Blank'); + } + + public function verifyNewThemeMagentoLuma() + { + self::verifyNewTheme('Magento Luma'); + } + + public function selectNewLayout($newLayout) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$newLayoutButton, $newLayout); + } + + public function selectNewLayoutEmpty() + { + self::selectNewLayout('Empty'); + } + + public function selectNewLayout1Column() + { + self::selectNewLayout('1 column'); + } + + public function selectNewLayout2ColumnsWithLeftBar() + { + self::selectNewLayout('2 columns with left bar'); + } + + public function selectNewLayout2ColumnsWithRightBar() + { + self::selectNewLayout('2 columns with right bar'); + } + + public function selectNewLayout3Columns() + { + self::selectNewLayout('3 columns'); + } + + public function verifyNewLayout($newLayout) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$newLayoutButton, $newLayout); + } + + public function verifyNewLayoutEmpty() + { + self::verifyNewLayout('Empty'); + } + + public function verifyNewLayout1Column() + { + self::verifyNewLayout('1 column'); + } + + public function verifyNewLayout2ColumnsWithLeftBar() + { + self::verifyNewLayout('2 columns with left bar'); + } + + public function verifyNewLayout2ColumnsWithRightBar() + { + self::verifyNewLayout('2 columns with right bar'); + } + + public function verifyNewLayout3Columns() + { + self::verifyNewLayout('3 columns'); + } + + public function savePage() + { + $I = $this->acceptanceTester; + $I->click(self::$savePageButton); + $I->waitForElementNotVisible(self::$pageSavedSpinner); + $I->waitForElementVisible(self::$pageSaveSuccessMessage); + } + + public function seeSaveSuccessMessage() + { + $I = $this->acceptanceTester; + $I->seeElement(self::$pageSaveSuccessMessage); + } + + public function clickOnCollapsibleArea($areaName) + { + $I = $this->acceptanceTester; + $I->click('//div[@class="fieldset-wrapper-title"]/strong/span[contains(text(), "' . $areaName . '")]'); + } + + public function clickOnPageContent() + { + self::clickOnCollapsibleArea('Content'); + } + + public function clickOnPageSearchEngineOptimisation() + { + self::clickOnCollapsibleArea('Search Engine Optimisation'); + } + + public function clickOnPagePageInWebsites() + { + self::clickOnCollapsibleArea('Page in Websites'); + } + + public function clickOnPageDesign() + { + self::clickOnCollapsibleArea('Design'); + } + + public function clickOnPageCustomDesignUpdate() + { + self::clickOnCollapsibleArea('Custom Design Update'); + } +} \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Content/Storefront/StorefrontCMSPage.php b/tests/_support/Magento/Xxyyzz/Page/Content/Storefront/StorefrontCMSPage.php new file mode 100644 index 000000000..704208d49 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Content/Storefront/StorefrontCMSPage.php @@ -0,0 +1,25 @@ +acceptanceTester; + $I->see($pageContentTitle, self::$pageTitleWrapper); + } + + public function verifyPageContentBody($pageContentBody) + { + $I = $this->acceptanceTester; + $I->see($pageContentBody, self::$pageMainContent); + } +} \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php index 95e336f53..1673eeff3 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php +++ b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php @@ -5,6 +5,14 @@ class AdminStep extends \Magento\Xxyyzz\AcceptanceTester { + public function openNewTabGoToVerify($url) + { + $I = $this; + $I->openNewTab(); + $I->amOnPage($url); + $I->seeInCurrentUrl($url); + } + public function goToTheAdminLoginPage() { $I = $this; diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php new file mode 100644 index 000000000..023e8bba4 --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php @@ -0,0 +1,153 @@ +am('an Admin'); + $I->loginAsAdmin(); + $adminCMSPage->amOnAdminCMSPage(); + $adminCMSPage->clickOnAddNewPageButton(); + $I->waitForSpinnerToDisappear(); + } + + public function _after(AdminStep $I) + { + $I->goToTheAdminLogoutPage(); + } + + /** + * Allure annotations + * @Title("Enter text into every field on the Content - Page.") + * @Description("Enter text into ALL fields and verify the contents of the fields.") + * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminCMSPage $adminCMSPage + * @return void + */ + public function verifyThatEachFieldOnTheContentPageWorks( + AdminStep $I, + AdminCMSPage $adminCMSPage + ) + { + $I->wantTo('verify that I can use all of the fields on the page.'); + $pageData = $I->getContentPage(); + + $adminCMSPage->clickOnEnablePageToggle(); + + $adminCMSPage->enterPageTitle($pageData['pageTitle']); + + $adminCMSPage->clickOnPageContent(); + $adminCMSPage->enterPageContentHeading($pageData['contentHeading']); + $adminCMSPage->enterPageContentBody($pageData['contentBody']); + + $adminCMSPage->clickOnPageSearchEngineOptimisation(); + $adminCMSPage->enterUrlKey($pageData['urlKey']); + $adminCMSPage->enterMetaTitle($pageData['metaTitle']); + $adminCMSPage->enterMetaKeywords($pageData['metaKeywords']); + $adminCMSPage->enterMetaDescription($pageData['metaDescription']); + + $adminCMSPage->clickOnPagePageInWebsites(); + $adminCMSPage->selectDefaultStoreView(); + + $adminCMSPage->clickOnPageDesign(); + $adminCMSPage->selectLayout1Column(); + $adminCMSPage->enterLayoutUpdateXml('fasdfasdf'); + + $adminCMSPage->clickOnPageCustomDesignUpdate(); + $adminCMSPage->enterFrom('04/30/2017'); + $adminCMSPage->enterTo('04/30/2017'); + $adminCMSPage->selectNewThemeMagentoLuma(); + $adminCMSPage->selectNewLayout3Columns(); + + $adminCMSPage->verifyPageTitle($pageData['pageTitle']); + + $adminCMSPage->verifyPageContentHeading($pageData['contentHeading']); + $adminCMSPage->verifyPageContentBody($pageData['contentBody']); + + $adminCMSPage->verifyUrlKey($pageData['urlKey']); + $adminCMSPage->verifyMetaTitle($pageData['metaTitle']); + $adminCMSPage->verifyMetaKeywords($pageData['metaKeywords']); + $adminCMSPage->verifyMetaDescription($pageData['metaDescription']); + + $adminCMSPage->verifyDefaultStoreView(); + + $adminCMSPage->verifyLayout1Column(); + $adminCMSPage->verifyLayoutUpdateXml('fasdfasdf'); + $adminCMSPage->verifyFrom('04/30/2017'); + $adminCMSPage->verifyTo('04/30/2017'); + $adminCMSPage->verifyNewThemeMagentoLuma(); + $adminCMSPage->verifyNewLayout3Columns(); + } + + /** + * Allure annotations + * @Title("Create a new Content - Page using the REQUIRED fields only.") + * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Storefront.") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminCMSPage $adminCMSPage + * @param StorefrontCMSPage $storefrontCMSPage + * @return void + */ + public function createContentPageTest( + AdminStep $I, + AdminCMSPage $adminCMSPage, + StorefrontCMSPage $storefrontCMSPage + ) + { + $I->wantTo('verify content page in admin'); + $page = $I->getContentPage(); + + $adminCMSPage->clickOnPageContent(); + $adminCMSPage->enterPageTitle($page['pageTitle']); + $adminCMSPage->enterPageContentHeading($page['contentHeading']); + $adminCMSPage->enterPageContentBody($page['contentBody']); + $adminCMSPage->clickOnPageSearchEngineOptimisation(); + $adminCMSPage->enterUrlKey($page['urlKey']); + + $adminCMSPage->savePage(); + $adminCMSPage->seeSaveSuccessMessage(); + + $I->openNewTabGoToVerify($page['urlKey']); + $storefrontCMSPage->verifyPageContentTitle($page['contentHeading']); + $storefrontCMSPage->verifyPageContentBody($page['contentBody']); + } +} \ No newline at end of file From 594ded05ef68a07f61795645b604c592ca5701a8 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 18 Apr 2017 11:43:42 -0500 Subject: [PATCH 035/149] MTA-4194: Framework improvements: Added Ajax requests handling and searchAndMultiSelectOption() in MagentoWebDriver. --- .../Xxyyzz/Module/MagentoDataSequence.php | 4 +- .../Xxyyzz/Module/MagentoWebDriver.php | 60 +++++++++++++++++++ tests/acceptance.suite.dist.yml | 1 + 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php index 87b66b118..f6f3c78ef 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php @@ -65,8 +65,8 @@ public function getSimpleProductData($categoryId = 0, $productData = []) 'stock_item' => ['is_in_stock' => 1, 'qty' => 1000] ], 'custom_attributes' => [ - ['attribute_code' => 'url_key', 'value' => isset($productData['sku']) - ? $productData['sku'] : 'sku'.$sq], + ['attribute_code' => 'url_key', 'value' => isset($productData['name']) + ? $productData['name'] : 'simple_product'.$sq,], ['attribute_code' => 'tax_class_id', 'value' => 2], ['attribute_code' => 'category_ids', 'value' => $categoryId], ], diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php index 2c01cd945..2c3528248 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -2,9 +2,14 @@ namespace Magento\Xxyyzz\Module; use Codeception\Module\WebDriver; +use Facebook\WebDriver\WebDriverSelect; +use Facebook\WebDriver\WebDriverBy; +use Facebook\WebDriver\Exception\NoSuchElementException; +use Codeception\Exception\ElementNotFound; use Codeception\Exception\ModuleConfigException; use Codeception\Exception\ModuleException; use Codeception\Util\Uri; +use Codeception\Util\ActionSequence; /** * MagentoWebDriver module provides common Magento web actions through Selenium WebDriver. @@ -100,4 +105,59 @@ public function closeAdminNotification() $this->executeJS("jQuery('.modal-popup').remove(); jQuery('.modals-overlay').remove();"); } catch (\Exception $e) {} } + + + /** + * @param $select + * @param array $options + * @param bool $requireAction + */ + public function searchAndMultiSelectOption($select, array $options, $requireAction = false) + { + $selectDropdown = $select . ' .action-select.admin__action-multiselect'; + $selectSearchText = $select + . ' .admin__action-multiselect-search-wrap>input[data-role="advanced-select-text"]'; + $selectSearchResult = $select . ' .admin__action-multiselect-label>span'; + + $this->waitPageLoad(); + $this->waitForElementVisible($selectDropdown); + $this->click($selectDropdown); + foreach ($options as $option) { + $this->waitPageLoad(); + $this->fillField($selectSearchText, ''); + $this->waitPageLoad(); + $this->fillField($selectSearchText, $option); + $this->waitPageLoad(); + $this->click($selectSearchResult); + } + if ($requireAction) { + $selectAction = $select . ' button[class=action-default]'; + $this->waitPageLoad(); + $this->click($selectAction); + } + } + + public function waitAjaxLoad($timeout = 15) + { + $this->waitForJS('return !!window.jQuery && window.jQuery.active == 0;', $timeout); + $this->wait(1); + $this->dontSeeJsError(); + } + + public function waitPageLoad($timeout = 15) + { + $this->waitForJS('return document.readyState == "complete"', $timeout); + $this->waitAjaxLoad($timeout); + $this->dontSeeJsError(); + } + + public function dontSeeJsError() + { + $logs = $this->webDriver->manage()->getLog('browser'); + foreach ($logs as $log) { + if ($log['level'] == 'SEVERE') { + throw new ModuleException($this, 'Errors in JavaScript: ' . json_encode($log)); + } + } + } } diff --git a/tests/acceptance.suite.dist.yml b/tests/acceptance.suite.dist.yml index 392ebc429..130c1c8a4 100644 --- a/tests/acceptance.suite.dist.yml +++ b/tests/acceptance.suite.dist.yml @@ -17,6 +17,7 @@ modules: depends: PhpBrowser part: Json - \Magento\Xxyyzz\Module\MagentoDataSequence + - Asserts config: \Magento\Xxyyzz\Module\MagentoWebDriver: url: "%MAGENTO_BASE_URL%" From ec2810cf5d72b124c34a44a44c01049f2899c9c9 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 18 Apr 2017 12:09:53 -0500 Subject: [PATCH 036/149] MTA-4150, MTA-4151, MTA-4152, MTA-4153: AdminCategory, AdminProduct, AdminProductGrid, storefront Category, storefront Product PageObjects; Category and Simple Product Test Cases. --- .../Xxyyzz/Page/AbstractFrontendPage.php | 2 + .../Page/Catalog/Admin/AdminCategoryPage.php | 2 + .../Catalog/Admin/AdminProductGridPage.php | 53 ++++++----- .../Page/Catalog/Admin/AdminProductPage.php | 74 ++++++++++++--- .../Xxyyzz/Page/Catalog/CategoryPage.php | 94 +++++++++++++++++++ .../Xxyyzz/Page/Catalog/ProductPage.php | 46 ++++++++- .../Acceptance/Catalog/CreateCategoryCest.php | 10 +- .../Catalog/CreateSimpleProductCest.php | 83 +++++++++++++--- .../Catalog/UpdateSimpleProductCest.php | 85 ++++++++++------- 9 files changed, 357 insertions(+), 92 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Page/Catalog/CategoryPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php index 4cc86683b..1909a568c 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php @@ -19,6 +19,8 @@ abstract class AbstractFrontendPage public static $createAccountLink = '.header.links>li:nth-child(4)'; + public static $pageFooterContent = '.footer.content'; + /** * @var AcceptanceTester */ diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php index 37145462b..466371840 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminCategoryPage.php @@ -15,8 +15,10 @@ class AdminCategoryPage extends AbstractAdminPage */ public static $addRootCategoryButton = '#add_root_category_button'; public static $addSubCategoryButton = '#add_subcategory_button'; + public static $scheduleNewUpdateButton = '#staging_update_new'; public static $saveCategoryButton = '#save'; + public static $categoryContentToggle = '.fieldset-wrapper[data-index=content] .fieldset-wrapper-title[data-state-collapsible=%s]'; public static $categorySearchEngineOptimToggle = diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php index 9770e9231..bcb49c4e4 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php @@ -13,39 +13,46 @@ class AdminProductGridPage extends AbstractAdminPage /** * Declare UI map for this page here. CSS or XPath allowed. */ - public static $productGridLoadingSpinner = - '.admin__data-grid-loading-mask[data-component="product_listing.product_listing.product_columns"]>.spinner'; public static $addNewProductButton = '#add_new_product-button'; + + /** + * UI map for admin data grid filter section. + */ public static $filterClearAllButton = '.admin__data-grid-header button[data-action=grid-filter-reset]'; public static $filterExpanded = '.admin__data-grid-filters-wrap._show'; - public static $filterExpandButton = - '.admin__data-grid-outer-wrap>.admin__data-grid-header button[data-action=grid-filter-expand]'; + public static $filterExpandButton + = '.admin__data-grid-outer-wrap>.admin__data-grid-header button[data-action=grid-filter-expand]'; + public static $filterApplyButton + = '.admin__data-grid-filters-footer button[data-action=grid-filter-apply]'; + public static $filterIdFrom = '.admin__form-field input[name="entity_id[from]"]'; + public static $filterIdTo = '.admin__form-field input[name="entity_id[to]"]'; + public static $filterPriceFrom = '.admin__form-field input[name="price[from]"]'; + public static $filterPriceTo = '.admin__form-field input[name="price[to]"]'; public static $filterProductName = '.admin__form-field input[name=name]'; public static $filterProductSku = '.admin__form-field input[name=sku]'; - public static $filterApplyButton = - '.admin__data-grid-filters-footer button[data-action=grid-filter-apply]'; - public static $gridNthRow = - '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s)'; /** - * Basic route example for your current URL - * You can append any additional parameter to URL - * and use it in tests like: Page\Edit::route('/123-post'); + * Spinners. */ - public static function route($param) - { - return static::$URL . $param; - } + public static $productGridProductListingLoadingSpinner + = '.admin__data-grid-loading-mask[data-component="product_listing.product_listing.product_columns"]>.spinner'; + public static $productGridNotificationLoadingSpinner + = '.admin__data-grid-loading-mask[data-component="notification_area.notification_area.columns"]>.spinner'; + + /** + * UI map for admin product grid. + */ + public static $gridNthRow + = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s)'; public function amOnAdminProductGridPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); - + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); } - public function goToAddNewProductPage() + public function clickAddNewProductPage() { $I = $this->acceptanceTester; $I->click(self::$addNewProductButton); @@ -55,21 +62,21 @@ public function searchBySku($sku) { $I = $this->acceptanceTester; try { - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); $I->click(self::$filterClearAllButton); } catch (\Codeception\Exception\ElementNotFound $e) { } try { - $I->wait(5); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); + $I->waitForElementNotVisible(self::$productGridNotificationLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); $I->click(self::$filterExpandButton); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); } catch (\Codeception\Exception\ElementNotFound $e) { } $I->fillField(self::$filterProductSku, $sku); $I->click(self::$filterApplyButton); - $I->waitForElementNotVisible(self::$productGridLoadingSpinner, $this->pageLoadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); } public function containsInNthRow($n, $text) diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php index 87f3bbb9e..f280cd0e3 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php @@ -18,41 +18,49 @@ class AdminProductPage extends AbstractAdminPage /** * Product data fields. */ - public static $producAttributeSet = - '.admin__field[data-index=attribute_set_id] .admin__action-multiselect-text'; public static $productName = '.admin__field[data-index=name] input'; public static $productSku = '.admin__field[data-index=sku] input'; public static $productPrice = '.admin__field[data-index=price] input'; public static $productQuantity = '.admin__field[data-index=quantity_and_stock_status_qty] input'; public static $productStockStatus = '.admin__field[data-index=quantity_and_stock_status] select'; - public static $productCategories = - '.admin__field[data-index=category_ids] .admin__action-multiselect-text'; public static $productTaxClass = '.admin__field[data-index=tax_class_id] select'; - + public static $producAttributeSetMultiSelect= '.admin__field[data-index=attribute_set_id]'; + public static $producAttributeMultiSelectText + = '.admin__field[data-index=attribute_set_id] .action-select.admin__action-multiselect>div'; + public static $producCategoriesMultiSelect = '.admin__field[data-index=category_ids]'; + public static $producCategoriesMultiSelectText + = '.admin__field[data-index=category_ids] .admin__action-multiselect-crumb:nth-child(%s)>span'; + + public static $productContentToggle = + '.fieldset-wrapper[data-index=content] .fieldset-wrapper-title[data-state-collapsible=%s]'; + public static $productSearchEngineOptimToggle = + '.fieldset-wrapper[data-index=search-engine-optimization] .fieldset-wrapper-title[data-state-collapsible=%s]'; /** * Product form loading spinner. */ - public static $productFormLoadingSpinner = - '.admin__form-loading-mask[data-component="product_form.product_form"] .spinner'; + public static $productFormLoadingSpinner + = '.admin__form-loading-mask[data-component="product_form.product_form"] .spinner'; + + public static $productUrlKey = '.admin__field[data-index=url_key] input'; public function amOnAdminNewProductPage() { $I = $this->acceptanceTester; + $I->waitForElementVisible(self::$productName, $this->pageloadTimeout); $I->seeInCurrentUrl(static::$URL . 'new'); - $I->waitForElementNotVisible(self::$productFormLoadingSpinner, $this->pageLoadTimeout); } public function amOnAdminEditProductPageById($id) { $I = $this->acceptanceTester; $I->amOnPage(self::route('edit/id/' . $id)); - $I->waitForElementNotVisible(self::$productFormLoadingSpinner, $this->pageLoadTimeout); + $I->waitForElementVisible(self::$productName, $this->pageloadTimeout); } public function seeProductAttributeSet($name) { $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$producAttributeSet, $name); + $I->assertEquals($name, $I->grabTextFrom(self::$producAttributeMultiSelectText)); } public function seeProductName($name) @@ -85,13 +93,36 @@ public function seeProductStockStatus($name) $I->seeOptionIsSelected(self::$productStockStatus, $name); } - public function seeProductCategories($name) + /** + * @param array $names + */ + public function seeProductCategories(array $names) { $I = $this->acceptanceTester; - $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); + $count = 2; + foreach ($names as $name) { + $I->assertEquals($name, $I->grabTextFrom(sprintf(self::$producCategoriesMultiSelectText, $count))); + $count += 1; + } + } + + public function seeProductUrlKey($name) + { + $I = $this->acceptanceTester; + try { + $I->click(sprintf(self::$productSearchEngineOptimToggle, 'closed')); + } catch (\Exception $e) { + } + $I->seeInField(self::$productUrlKey, $name); } // Fill new product + public function selectProductAttributeSet($name) + { + $I = $this->acceptanceTester; + $I->searchAndMultiSelectOption(self::$producAttributeSetMultiSelect, [$name]); + } + public function fillFieldProductName($name) { $I = $this->acceptanceTester; @@ -122,16 +153,29 @@ public function selectProductStockStatus($name) $I->selectOption(self::$productStockStatus, $name); } - public function fillFieldProductCategories($name) + public function fillFieldProductUrlKey($name) + { + $I = $this->acceptanceTester; + try { + $I->click(sprintf(self::$productSearchEngineOptimToggle, 'closed')); + } catch (\Exception $e) { + } + $I->fillField(self::$productUrlKey, $name); + } + + /** + * @param array $names + */ + public function selectProductCategories(array $names) { $I = $this->acceptanceTester; - $I->seeInFormFields(self::$productCategories, ['multiselect' => [$name]]); + $I->searchAndMultiSelectOption(self::$producCategoriesMultiSelect, $names, true); } public function saveProduct() { $I = $this->acceptanceTester; - $I->click(self::$productSaveButton); + $I->performOn(self::$productSaveButton, ['click' => self::$productSaveButton]); $I->waitForElementNotVisible(self::$popupLoadingSpinner); $I->waitForElementNotVisible(self::$productFormLoadingSpinner); $I->waitForElementVisible(self::$successMessage); diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/CategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/CategoryPage.php new file mode 100644 index 000000000..740258d98 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/CategoryPage.php @@ -0,0 +1,94 @@ +span'; + + public static $compareBlock = '.block.block-compare'; + public static $wishlistBlock = '.block.block-wishlist'; + + public static $viewAsGridButton = '.modes>strong[title=Grid]'; + public static $activeGridMode = '.modes-mode.active.mode-grid'; + public static $viewAsListButton = '.modes>strong[title=List]'; + public static $activeListMode = '.modes-mode.active.mode-list'; + public static $sortByButton = '#sorter'; + public static $totalNumberOfProductsText = '#toolbar-amount>span:last-child'; + + public static $pageNextButton = './/*[contains(@class,"toolbar-products")][2]//a[@title="Next"]'; + public static $pagePreviousButton = './/*[contains(@class,"toolbar-products")][2]//a[@title="Previous"]'; + public static $activePage = '//li[@class="item current"]//span[text()=%s]'; + + public static $productListItem = '.products.list.items.product-items>li'; + public static $productLinks = '//a[contains(@href, "%s.html")]'; + public static $productName = '//a[text()[contains(.," %s ")]]'; + public static $productPrice + = '//a[text()[contains(.," %s ")]]/parent::strong/following-sibling::div[1]//*[@class="price"]'; + + public function amOnCategoryPage($categoryUrlKey, $params = '') + { + $I = $this->acceptanceTester; + $I->amOnPage(self::route($categoryUrlKey . '.html' . $params)); + $I->waitPageLoad(); + } + + public function seeCategoryNameInTitleHeading($name) + { + $I = $this->acceptanceTester; + $I->see($name, self::$pageTitleHeading); + } + + public function seeProductLinksInPage($name, $link) + { + $this->goToPageForProduct($name); + $I = $this->acceptanceTester; + $I->seeElement(sprintf(self::$productLinks, $link)); + } + + public function seeProductNameInPage($name) + { + $this->goToPageForProduct($name); + $I = $this->acceptanceTester; + $I->seeElement(sprintf(self::$productName, $name)); + } + + public function seeProductPriceInPage($name, $price) + { + $this->goToPageForProduct($name); + $I = $this->acceptanceTester; + $actualPrice = $I->grabTextFrom(sprintf(self::$productPrice, $name)); + $pos = strpos($actualPrice, '.'); + if ( $pos !== false) { + $actualPrice = substr($actualPrice, 1, $pos+2); + } + $I->assertEquals($price, $actualPrice); + } + + public function goToPageForProduct($name) + { + $I = $this->acceptanceTester; + $name = sprintf(self::$productName, $name); + do { + try { + $I->executeInSelenium(function(RemoteWebDriver $webDriver) use ($name) { + $webDriver->findElement(WebDriverBy::xpath($name)); + }); + break; + } catch (WebDriverException $e) { + try { + $I->click(self::$pageNextButton); + $I->waitPageLoad(); + } catch (WebDriverException $e) { + } + } + } while (true); + } +} diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php index 6e9f02b1f..88ee3973b 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php @@ -8,10 +8,46 @@ class ProductPage extends AbstractFrontendPage /** * Declare UI map for this page here. CSS or XPath allowed. */ - public static $pageTitle = '.page-title>span'; - public static $productFormLoadingSpinner = './/*[@data-component=\'product_form.product_form\']'; - public static $productName = '.page-title>span'; - public static $productSku = '."product attribute sku" div'; + public static $addToCartButton = '#product-addtocart-button'; + + public static $productName = '.base'; public static $productPrice = '.price'; - public static $productStockStatus = '.product-info-stock-sku span'; + public static $productStockStatus = '.stock[title=Availability]>span'; + public static $productSku = '.product.attribute.sku>.value'; + + public function amOnProductPage($categoryUrlKey) + { + $I = $this->acceptanceTester; + $I->amOnPage(self::route($categoryUrlKey . '.html')); + $I->waitPageLoad(); + } + + public function seeProductNameInPage($name) + { + $I = $this->acceptanceTester; + $I->seeElement(sprintf(self::$productName, $name)); + } + + public function seeProductPriceInPage($price) + { + $I = $this->acceptanceTester; + $actualPrice = $I->grabTextFrom(sprintf(self::$productPrice)); + $pos = strpos($actualPrice, '.'); + if ( $pos !== false) { + $actualPrice = substr($actualPrice, 1, $pos+2); + } + $I->assertEquals($price, $actualPrice); + } + + public function seeProductStockStatusInPage($status) + { + $I = $this->acceptanceTester; + $I->seeElement(sprintf(self::$productStockStatus, $status)); + } + + public function seeProductSkuInPage($sku) + { + $I = $this->acceptanceTester; + $I->seeElement(sprintf(self::$productSku, $sku)); + } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index 759624b8c..fe105a715 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -3,6 +3,7 @@ use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Page\Catalog\Admin\AdminCategoryPage; +use Magento\Xxyyzz\Page\Catalog\CategoryPage; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Title; @@ -48,9 +49,8 @@ public function _after(AdminStep $I) * @param AdminStep $I * @return void */ - public function createCategoryTest( - AdminStep $I - ) { + public function createCategoryTest(AdminStep $I) + { $I->wantTo('create sub category with required fields in admin Category page.'); $category = $I->getCategoryData(); AdminCategoryPage::of($I)->amOnAdminCategoryPage(); @@ -59,5 +59,9 @@ public function createCategoryTest( AdminCategoryPage::of($I)->fillFieldCategoryUrlKey($category['custom_attributes'][0]['value']); AdminCategoryPage::of($I)->saveCategory(); $I->seeElement(AdminCategoryPage::$successMessage); + + $I->wantTo('verify created category in frontend category page.'); + CategoryPage::of($I)->amOnCategoryPage(str_replace('_', '-', $category['custom_attributes'][0]['value'])); + CategoryPage::of($I)->seeCategoryNameInTitleHeading($category['name']); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index 954650aa9..ba8672850 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -4,6 +4,9 @@ use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductGridPage; use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductPage; +use Magento\Xxyyzz\Page\Catalog\CategoryPage; +use Magento\Xxyyzz\Page\Catalog\ProductPage; +use Magento\Xxyyzz\Step\Catalog\Api\CategoryApiStep; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Title; @@ -21,9 +24,34 @@ */ class CreateSimpleProductCest { - public function _before(AdminStep $I) + /** + * @var array + */ + protected $category; + + /** + * @var array + */ + protected $product; + + /** + * @param AdminStep $I + */ + public function _before(AdminStep $I, CategoryApiStep $api) { $I->loginAsAdmin(); + $this->category = $I->getCategoryData(); + $api->amAdminTokenAuthenticated(); + $this->category = array_merge($this->category, ['id' => $api->createCategory(['category' => $this->category])]); + $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; + $this->product = $I->getSimpleProductData(); + if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { + $this->product['stock_status'] = 'In Stock'; + $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; + } else { + $this->product['stock_status'] = 'Out of Stock'; + } + $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; } public function _after(AdminStep $I) @@ -48,23 +76,52 @@ public function _after(AdminStep $I) * @param AdminStep $I * @return void */ - public function createSimpleProductTest( - AdminStep $I - ) { + public function createSimpleProductTest(AdminStep $I) + { $I->wantTo('create simple product with required fields in admin product page.'); - $product = $I->getSimpleProductData(); AdminProductGridPage::of($I)->amOnAdminProductGridPage(); - AdminProductGridPage::of($I)->goToAddNewProductPage(); + AdminProductGridPage::of($I)->clickAddNewProductPage(); AdminProductPage::of($I)->amOnAdminNewProductPage(); + AdminProductPage::of($I)->fillFieldProductName($this->product['name']); + AdminProductPage::of($I)->fillFieldProductSku($this->product['sku']); + AdminProductPage::of($I)->fillFieldProductPrice($this->product['price']); + if (isset($this->product['qty'])) { + AdminProductPage::of($I)->fillFieldProductQuantity($this->product['qty']); + } + AdminProductPage::of($I)->selectProductStockStatus($this->product['stock_status']); + AdminProductPage::of($I)->selectProductCategories([$this->category['name']]); + AdminProductPage::of($I)->fillFieldProductUrlKey($this->product['url_key']); - AdminProductPage::of($I)->fillFieldProductName($product['name']); - AdminProductPage::of($I)->fillFieldProductSku($product['sku']); - AdminProductPage::of($I)->fillFieldProductPrice($product['price']); - AdminProductPage::of($I)->fillFieldProductQuantity($product['extension_attributes']['stock_item']['qty']); - AdminProductPage::of($I)->selectProductStockStatus( - $product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' - ); + $I->wantTo('see simple product successfully saved message.'); AdminProductPage::of($I)->saveProduct(); $I->seeElement(AdminProductPage::$successMessage); + + $I->wantTo('verify simple product data in admin product page.'); + AdminProductPage::of($I)->seeProductAttributeSet('Default'); + AdminProductPage::of($I)->seeProductName($this->product['name']); + AdminProductPage::of($I)->seeProductSku($this->product['sku']); + AdminProductPage::of($I)->seeProductPrice($this->product['price']); + if (isset($this->product['qty'])) { + AdminProductPage::of($I)->seeProductQuantity($this->product['qty']); + } + AdminProductPage::of($I)->seeProductStockStatus($this->product['stock_status']); + AdminProductPage::of($I)->seeProductCategories([$this->category['name']]); + AdminProductPage::of($I)->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); + + $I->wantTo('verify simple product data in frontend category page.'); + CategoryPage::of($I)->amOnCategoryPage($this->category['url_key']); + CategoryPage::of($I)->seeProductLinksInPage( + $this->product['name'], + str_replace('_', '-', $this->product['url_key']) + ); + CategoryPage::of($I)->seeProductNameInPage($this->product['name']); + CategoryPage::of($I)->seeProductPriceInPage($this->product['name'], $this->product['price']); + + $I->wantTo('verify simple product data in frontend product page.'); + ProductPage::of($I)->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); + ProductPage::of($I)->seeProductNameInPage($this->product['name']); + ProductPage::of($I)->seeProductPriceInPage($this->product['price']); + ProductPage::of($I)->seeProductStockStatusInPage($this->product['stock_status']); + ProductPage::of($I)->seeProductSkuInPage($this->product['sku']); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index aadbd7de7..b95a67a13 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -1,11 +1,13 @@ loginAsAdmin(); + $this->category = $I->getCategoryData(); + $categoryApi->amAdminTokenAuthenticated(); + $this->category = array_merge( + $this->category, + ['id' => $categoryApi->createCategory(['category' => $this->category])] + ); + $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; $this->product = $I->getSimpleProductData(); - $api->amAdminTokenAuthenticated(); - $this->product = array_merge($this->product, ['id' => $api->createProduct(['product' => $this->product])]); + $this->product['custom_attributes'][2]['value'] = $this->category['id']; + $productApi->amAdminTokenAuthenticated(); + $this->product = array_merge( + $this->product, + ['id' => $productApi->createProduct(['product' => $this->product])] + ); + if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { + $this->product['stock_status'] = 'In Stock'; + $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; + } else { + $this->product['stock_status'] = 'Out of Stock'; + } + $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; } public function _after(AdminStep $I) @@ -57,8 +76,6 @@ public function _after(AdminStep $I) * Allure annotations * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "Admin", value = "$I") - * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") - * @Parameter(name = "AdminProductPage", value = "$adminProductPage") * * Codeception annotations * @group catalog @@ -67,47 +84,49 @@ public function _after(AdminStep $I) * @env phantomjs * * @param AdminStep $I - * @param AdminProductGridPage $adminProductGridPage - * @param AdminProductPage $adminProductPage * @return void */ - public function updateSimpleProductTest( - AdminStep $I, - AdminProductGridPage $adminProductGridPage, - AdminProductPage $adminProductPage - ) { - $I->wantTo('update simple product in admin'); + public function updateSimpleProductTest(AdminStep $I) + { + $I->wantTo('update simple product in admin.'); AdminProductGridPage::of($I)->amOnAdminProductGridPage(); - //$adminProductGridPage->searchBySku($I, $this->product['sku']); - $I->wantTo('verify product created visible in product form in admin'); + AdminProductGridPage::of($I)->searchBySku($this->product['sku']); + + $I->wantTo('open product created from precondition.'); AdminProductPage::of($I)->amOnAdminEditProductPageById($this->product['id']); - AdminProductPage::of($I)->seeInPageTitle($this->product['name']); - AdminProductPage::of($I)->seeProductAttributeSet('Default'); - AdminProductPage::of($I)->seeProductName($this->product['name']); - AdminProductPage::of($I)->seeProductSku($this->product['sku']); - AdminProductPage::of($I)->seeProductPrice($this->product['price']); - AdminProductPage::of($I)->seeProductQuantity($this->product['extension_attributes']['stock_item']['qty']); - AdminProductPage::of($I)->seeProductStockStatus( - $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' - ); - $I->wantTo('verify product updated in admin'); + + $I->wantTo('update product data fields.'); AdminProductPage::of($I)->fillFieldProductName($this->product['name'] . '-updated'); AdminProductPage::of($I)->fillFieldProductSku($this->product['sku'] . '-updated'); AdminProductPage::of($I)->fillFieldProductPrice($this->product['price']+10); AdminProductPage::of($I)->fillFieldProductQuantity( $this->product['extension_attributes']['stock_item']['qty']+100 ); + $I->wantTo('save product data change.'); AdminProductPage::of($I)->saveProduct(); - $I->wantTo('verify product created visible in product form in admin'); + $I->seeElement(AdminProductPage::$successMessage); + + $I->wantTo('see updated product data.'); AdminProductPage::of($I)->amOnAdminEditProductPageById($this->product['id']); - AdminProductPage::of($I)->seeInPageTitle($this->product['name']. '-updated'); + AdminProductPage::of($I)->seeInPageTitle($this->product['name'] . '-updated'); AdminProductPage::of($I)->seeProductAttributeSet('Default'); - AdminProductPage::of($I)->seeProductName($this->product['name']. '-updated'); - AdminProductPage::of($I)->seeProductSku($this->product['sku']. '-updated'); + AdminProductPage::of($I)->seeProductName($this->product['name'] . '-updated'); + AdminProductPage::of($I)->seeProductSku($this->product['sku'] . '-updated'); AdminProductPage::of($I)->seeProductPrice($this->product['price']+10); AdminProductPage::of($I)->seeProductQuantity($this->product['extension_attributes']['stock_item']['qty']+100); AdminProductPage::of($I)->seeProductStockStatus( $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' ); + + $I->wantTo('verify simple product data in frontend category page.'); + CategoryPage::of($I)->amOnCategoryPage($this->category['url_key']); + CategoryPage::of($I)->seeProductNameInPage($this->product['name'] . '-updated'); + CategoryPage::of($I)->seeProductPriceInPage($this->product['name'] . '-updated', $this->product['price'] + 10); + + $I->wantTo('verify simple product data in frontend product page.'); + ProductPage::of($I)->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); + ProductPage::of($I)->seeProductNameInPage($this->product['name'] . '-updated'); + ProductPage::of($I)->seeProductPriceInPage($this->product['price'] + 10); + ProductPage::of($I)->seeProductSkuInPage($this->product['sku'] . '-updated'); } } From f23854912039f0e5e4bab2b2cc9a0d0fcd424c06 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 18 Apr 2017 12:23:00 -0500 Subject: [PATCH 037/149] MTA-4150, MTA-4151, MTA-4152, MTA-4153: Fixed variable name due to merge conflicts. --- .../Magento/Xxyyzz/Page/AbstractFrontendPage.php | 4 ++-- .../Page/Catalog/Admin/AdminProductGridPage.php | 12 ++++++------ .../Xxyyzz/Page/Catalog/Admin/AdminProductPage.php | 4 ++-- .../Page/Customer/CustomerAccountDashboardPage.php | 2 +- .../Page/Customer/CustomerAccountLoginPage.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php index 1909a568c..501a69bae 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php @@ -31,12 +31,12 @@ abstract class AbstractFrontendPage * * @var string */ - protected $pageloadTimeout; + protected $pageLoadTimeout; public function __construct(AcceptanceTester $I) { $this->acceptanceTester = $I; - $this->pageloadTimeout = $I->getConfiguration('pageload_timeout'); + $this->pageLoadTimeout = $I->getConfiguration('pageload_timeout'); } public static function of(AcceptanceTester $I) diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php index bcb49c4e4..da12472c0 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductGridPage.php @@ -49,7 +49,7 @@ public function amOnAdminProductGridPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); } public function clickAddNewProductPage() @@ -62,21 +62,21 @@ public function searchBySku($sku) { $I = $this->acceptanceTester; try { - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); $I->click(self::$filterClearAllButton); } catch (\Codeception\Exception\ElementNotFound $e) { } try { - $I->waitForElementNotVisible(self::$productGridNotificationLoadingSpinner, $this->pageloadTimeout); - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridNotificationLoadingSpinner, $this->pageLoadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); $I->click(self::$filterExpandButton); - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); } catch (\Codeception\Exception\ElementNotFound $e) { } $I->fillField(self::$filterProductSku, $sku); $I->click(self::$filterApplyButton); - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageloadTimeout); + $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); } public function containsInNthRow($n, $text) diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php index f280cd0e3..f03014c96 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/Admin/AdminProductPage.php @@ -46,7 +46,7 @@ class AdminProductPage extends AbstractAdminPage public function amOnAdminNewProductPage() { $I = $this->acceptanceTester; - $I->waitForElementVisible(self::$productName, $this->pageloadTimeout); + $I->waitForElementVisible(self::$productName, $this->pageLoadTimeout); $I->seeInCurrentUrl(static::$URL . 'new'); } @@ -54,7 +54,7 @@ public function amOnAdminEditProductPageById($id) { $I = $this->acceptanceTester; $I->amOnPage(self::route('edit/id/' . $id)); - $I->waitForElementVisible(self::$productName, $this->pageloadTimeout); + $I->waitForElementVisible(self::$productName, $this->pageLoadTimeout); } public function seeProductAttributeSet($name) diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php index 1c951eae9..9edc21619 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php @@ -24,7 +24,7 @@ public function amOnCustomerAccountLoginPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementVisible(self::$customerLoginForm, $this->pageloadTimeout); + $I->waitForElementVisible(self::$customerLoginForm, $this->pageLoadTimeout); } public function signInWithCredentials($email, $password) diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php index 1426b06ce..7ba7db6db 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php @@ -24,7 +24,7 @@ public function amOnCustomerAccountLoginPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementVisible(self::$customerLoginForm, $this->pageloadTimeout); + $I->waitForElementVisible(self::$customerLoginForm, $this->pageLoadTimeout); } public function signInWithCredentials($email, $password) From 75e3dde6c31e53abef2a18215a7f665935fa5c8a Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 18 Apr 2017 15:24:30 -0500 Subject: [PATCH 038/149] Adding Customer page object, Editing Customer Data method, Adding additional Abstract methods - Replacing sq in the Customer Data method with Faker - Adding additional Abstract Admin methods - Adding Customer page object - Moving storefront Customer pages to a Storefront directory - Updating the Create Content Page tests to use random data - Adding Create Customer tests. --- .../Xxyyzz/Module/MagentoDataSequence.php | 20 +- .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 43 +++ .../Page/Customer/Admin/CustomerPage.php | 353 ++++++++++++++++++ .../CustomerAccountDashboardPage.php | 0 .../CustomerAccountLoginPage.php | 0 .../Content/CreateContentPageCest.php | 22 +- .../Customers/CreateCustomerCest.php | 129 +++++++ 7 files changed, 549 insertions(+), 18 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Page/Customer/Admin/CustomerPage.php rename tests/_support/Magento/Xxyyzz/Page/Customer/{ => Storefront}/CustomerAccountDashboardPage.php (100%) rename tests/_support/Magento/Xxyyzz/Page/Customer/{ => Storefront}/CustomerAccountLoginPage.php (100%) create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php index f6f3c78ef..22463a4d9 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php @@ -81,14 +81,17 @@ public function getSimpleProductData($categoryId = 0, $productData = []) */ public function getCustomerData(array $additional = []) { - $sq = $this->getSqs(); + $faker = \Faker\Factory::create(); $customerData = [ - 'firstname' => 'firstname'.$sq, - 'lastname' => 'lastname'.$sq, - 'email' => 'email'.$sq.'@example.com', + 'prefix' => $faker->title, + 'firstName' => $faker->firstName, + 'middleName' => $faker->firstName, + 'lastName' => $faker->lastName, + 'suffix' => \Faker\Provider\en_US\Person::suffix(), + 'email' => $faker->email, + 'dateOfBirth' => $faker->date($format = 'm/d/Y', $max = 'now'), 'gender' => rand(0, 1), 'group_id' => 1, - 'middlename' => 'middlename'.$sq, 'store_id' => 1, 'website_id' => 1, 'custom_attributes' => [ @@ -97,6 +100,7 @@ public function getCustomerData(array $additional = []) 'value' => '0', ], ], + 'taxVatNumber' => \Faker\Provider\at_AT\Payment::vat() ]; return array_merge($customerData, $additional); } @@ -129,9 +133,9 @@ public function getContentPage() 'metaTitle' => $faker->word, 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true), - 'layoutUpdateXml' => '', - 'from' => $faker->date($format = 'm-d-Y', $max = 'now'), - 'to' => $faker->date($format = 'm-d-Y') + 'layoutUpdateXml' => "ToveJaniReminderDon't forget me this weekend!", + 'from' => $faker->date($format = 'm/d/Y', $max = 'now'), + 'to' => $faker->date($format = 'm/d/Y') ]; return $pageContent; diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php index af54cd8d1..990b59ee1 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -38,6 +38,10 @@ abstract class AbstractAdminPage public static $pageMainActionsReset = '#reset'; public static $pageMainActionsSaveAndContinue = '#save_and_continue'; public static $pageMainActionsSave = '#save'; + public static $pageMainActionsAdd = '#add'; + + public static $loadingMask = '.loading-mask'; + public static $gridLoadingMask = '.admin__data-grid-loading-mask'; /** * @var AcceptanceTester @@ -72,6 +76,13 @@ public static function route($param) return static::$URL.$param; } + public function waitForLoadingMaskToDisappear() + { + $I = $this->acceptanceTester; + $I->waitForElementNotVisible(self::$loadingMask, 30); + $I->waitForElementNotVisible(self::$gridLoadingMask, 30); + } + public function openTabGoToAndVerifyUrl($pageUrl) { $I = $this->acceptanceTester; @@ -134,4 +145,36 @@ public function clickOnSignOut() $I = $this->acceptanceTester; $I->click(self::$adminSignOut); } + + public function clickOnAdminBackButton() + { + $I = $this->acceptanceTester; + $I->click(self::$pageMainActionsBack); + } + + public function clickOnAdminResetButton() + { + $I = $this->acceptanceTester; + $I->click(self::$pageMainActionsReset); + } + + public function clickOnAdminSaveAndContinueEdit() + { + $I = $this->acceptanceTester; + $I->click(self::$pageMainActionsSaveAndContinue); + self::waitForLoadingMaskToDisappear(); + } + + public function clickOnAdminSaveButton() + { + $I = $this->acceptanceTester; + $I->click(self::$pageMainActionsSave); + self::waitForLoadingMaskToDisappear(); + } + + public function clickOnAdminAddButton() + { + $I = $this->acceptanceTester; + $I->click(self::$pageMainActionsAdd); + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/Admin/CustomerPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/Admin/CustomerPage.php new file mode 100644 index 000000000..3d097cbc9 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/Admin/CustomerPage.php @@ -0,0 +1,353 @@ +acceptanceTester; + $I->click(self::$deleteCustomerButton); + } + + public function clickOnCreateOrderButton() + { + $I = $this->acceptanceTester; + $I->click(self::$createOrderButton); + } + + public function clickOnResetPasswordButton() + { + $I = $this->acceptanceTester; + $I->click(self::$resetPasswordButton); + } + + public function clickOnForceSignInButton() + { + $I = $this->acceptanceTester; + $I->click(self::$forceSignInButton); + } + + public function clickOnCustomerViewLink() + { + $I = $this->acceptanceTester; + $I->click(self::$customerViewLink); + } + + public function clickOnAccountInformationLink() + { + $I = $this->acceptanceTester; + $I->click(self::$accountInformationLink); + } + + public function clickOnAddressesLink() + { + $I = $this->acceptanceTester; + $I->click(self::$addressesLink); + } + + public function clickOnOrdersLink() + { + $I = $this->acceptanceTester; + $I->click(self::$ordersLink); + } + + public function clickOnBillingAgreementsLink() + { + $I = $this->acceptanceTester; + $I->click(self::$billingAgreementsLink); + } + + public function clickOnNewsletterLink() + { + $I = $this->acceptanceTester; + $I->click(self::$newsletterLink); + } + + public function clickOnProductReviewsLink() + { + $I = $this->acceptanceTester; + $I->click(self::$productReviewsLink); + } + + public function clickOnWishListLink() + { + $I = $this->acceptanceTester; + $I->click(self::$wishListLink); + } + + public function selectAssociateToWebsite($associateWebsite) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$associateToWebsiteDropDown, $associateWebsite); + } + + public function verifyAssociateToWebsite($associateWebsite) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$associateToWebsiteDropDown, $associateWebsite); + } + + public function selectAssociateToWebsiteMainWebsite() + { + self::selectAssociateToWebsite('Main Website'); + } + + public function verifyAssociateToWebsiteMainWebsite() + { + self::verifyAssociateToWebsite('Main Website'); + } + + public function selectGroup($group) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$groupDropDown, $group); + } + + public function verifyGroup($group) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$groupDropDown, $group); + } + + public function selectGroupGeneral() + { + self::selectGroup('General'); + } + + public function verifyGroupGeneral() + { + self::verifyGroup('General'); + } + + public function selectGroupWholesale() + { + $I = $this->acceptanceTester; + self::selectGroup('Wholesale'); + } + + public function verifyGroupWholesale() + { + self::verifyGroup('Wholesale'); + } + + public function clickOnDisableAutomaticGroupCheckbox() + { + $I = $this->acceptanceTester; + $I->checkOption(self::$disableAutomaticGroupCheckbox); + } + + public function seeDisableAutomaticGroupIs($expectedState) + { + $I = $this->acceptanceTester; + $I->seeCheckboxIsChecked(self::$disableAutomaticGroupCheckbox, $expectedState); + } + + public function enterPrefix($prefix) + { + $I = $this->acceptanceTester; + $I->fillField(self::$prefixField, $prefix); + } + + public function verifyPrefix($prefix) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$prefixField, $prefix); + } + + public function enterFirstName($firstName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$firstNameField, $firstName); + } + + public function verifyFirstName($firstName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$firstNameField, $firstName); + } + + public function enterMiddleName($middleName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$middleNameField, $middleName); + } + + public function verifyMiddleName($middleName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$middleNameField, $middleName); + } + + public function enterLastName($lastName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$lastNameField, $lastName); + } + + public function verifyLastName($lastName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$lastNameField, $lastName); + } + + public function enterSuffix($suffix) + { + $I = $this->acceptanceTester; + $I->fillField(self::$suffixField, $suffix); + } + + public function verifySuffix($suffix) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$suffixField, $suffix); + } + + public function enterEmailAddress($emailAddress) + { + $I = $this->acceptanceTester; + $I->fillField(self::$emailField, $emailAddress); + } + + public function verifyEmailAddress($emailAddress) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$emailField, $emailAddress); + } + + public function enterDateOfBirth($dateOfBirth) + { + $I = $this->acceptanceTester; + $I->fillField(self::$dateOfBirthField, $dateOfBirth); + } + + public function verifyDateOfBirth($dateOfBirth) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$dateOfBirthField, $dateOfBirth); + } + + public function enterTaxVatNumber($taxVatNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$taxVatNumberField, $taxVatNumber); + } + + public function verifyTaxVatNumber($taxVatNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$taxVatNumberField, $taxVatNumber); + } + + public function selectGender($gender) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$genderDropDown, $gender); + } + + public function verifyGender($gender) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$genderDropDown, $gender); + } + + public function selectGenderMale() + { + self::selectGender('Male'); + } + + public function selectGenderFemale() + { + self::selectGender('Female'); + } + + public function selectGenderNotSpecified() + { + self::selectGender('Not Specified'); + } + + public function verifyGenderMale() + { + self::verifyGender('Male'); + } + + public function verifyGenderFemale() + { + self::verifyGender('Female'); + } + + public function verifyGenderNotSpecified() + { + self::verifyGender('Not Specified'); + } + + public function selectSendWelcomeEmailFrom($storeName) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$sendWelcomeEmailFromDropDown, $storeName); + } + + public function verifySendWelcomeEmailFrom($storeName) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$sendWelcomeEmailFromDropDown, $storeName); + } + + public function selectSendWelcomeEmailFromDefaultStoreView() + { + self::selectSendWelcomeEmailFrom('Default Store View'); + } + + public function verifySendWelcomeEmailFromDefaultStoreView() + { + self::verifySendWelcomeEmailFrom('Default Store View'); + } +} \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/Storefront/CustomerAccountDashboardPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php rename to tests/_support/Magento/Xxyyzz/Page/Customer/Storefront/CustomerAccountDashboardPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/Storefront/CustomerAccountLoginPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php rename to tests/_support/Magento/Xxyyzz/Page/Customer/Storefront/CustomerAccountLoginPage.php diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php index 023e8bba4..fa0f979a1 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php @@ -50,8 +50,8 @@ public function _after(AdminStep $I) * Allure annotations * @Title("Enter text into every field on the Content - Page.") * @Description("Enter text into ALL fields and verify the contents of the fields.") - * @Parameter(name = "Admin", value = "$I") - * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminCMSPage", value = "$adminCMSPage") * * Codeception annotations * @param AdminStep $I @@ -85,11 +85,11 @@ public function verifyThatEachFieldOnTheContentPageWorks( $adminCMSPage->clickOnPageDesign(); $adminCMSPage->selectLayout1Column(); - $adminCMSPage->enterLayoutUpdateXml('fasdfasdf'); + $adminCMSPage->enterLayoutUpdateXml($pageData['layoutUpdateXml']); $adminCMSPage->clickOnPageCustomDesignUpdate(); - $adminCMSPage->enterFrom('04/30/2017'); - $adminCMSPage->enterTo('04/30/2017'); + $adminCMSPage->enterFrom($pageData['from']); + $adminCMSPage->enterTo($pageData['to']); $adminCMSPage->selectNewThemeMagentoLuma(); $adminCMSPage->selectNewLayout3Columns(); @@ -106,9 +106,10 @@ public function verifyThatEachFieldOnTheContentPageWorks( $adminCMSPage->verifyDefaultStoreView(); $adminCMSPage->verifyLayout1Column(); - $adminCMSPage->verifyLayoutUpdateXml('fasdfasdf'); - $adminCMSPage->verifyFrom('04/30/2017'); - $adminCMSPage->verifyTo('04/30/2017'); + $adminCMSPage->verifyLayoutUpdateXml($pageData['layoutUpdateXml']); + + $adminCMSPage->verifyFrom($pageData['from']); + $adminCMSPage->verifyTo($pageData['to']); $adminCMSPage->verifyNewThemeMagentoLuma(); $adminCMSPage->verifyNewLayout3Columns(); } @@ -118,8 +119,9 @@ public function verifyThatEachFieldOnTheContentPageWorks( * @Title("Create a new Content - Page using the REQUIRED fields only.") * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Storefront.") * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "Admin", value = "$I") - * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminCMSPage", value = "$adminCMSPage") + * @Parameter(name = "StorefrontCMSPage", value = "$storefrontCMSPage") * * Codeception annotations * @param AdminStep $I diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php new file mode 100644 index 000000000..ad362e08c --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php @@ -0,0 +1,129 @@ +am('an Admin'); + $I->loginAsAdmin(); + $I->goToTheAdminCustomersAllCustomersPage(); + $customerPage->clickOnAddCustomerButton(); + $I->waitForSpinnerToDisappear(); + } + + /** + * Allure annotations + * @Title("Enter text into every field on the Customer - Page.") + * @Description("Enter text into ALL fields and verify the contents of the fields.") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "CustomerPage", value = "$customerPage") + * + * Codeception annotations + * @param AdminStep $I + * @param CustomerPage $customerPage + * @return void + */ + public function verifyThatEachFieldOnTheCustomerAddPageWorks( + AdminStep $I, + CustomerPage $customerPage + ) + { + $I->wantTo('verify that I can use all of the fields on the page.'); + $customerData = $I->getCustomerData(); + + $customerPage->selectAssociateToWebsiteMainWebsite(); + $customerPage->selectGroupWholesale(); + $customerPage->enterPrefix($customerData['prefix']); + $customerPage->enterFirstName($customerData['firstName']); + $customerPage->enterMiddleName($customerData['middleName']); + $customerPage->enterLastName($customerData['lastName']); + $customerPage->enterSuffix($customerData['suffix']); + $customerPage->enterEmailAddress($customerData['email']); + $customerPage->enterDateOfBirth($customerData['dateOfBirth']); + $customerPage->enterTaxVatNumber($customerData['taxVatNumber']); + $customerPage->selectGenderFemale(); + $customerPage->selectSendWelcomeEmailFromDefaultStoreView(); + + $customerPage->verifyAssociateToWebsiteMainWebsite(); + $customerPage->verifyGroupWholesale(); + $customerPage->verifyPrefix($customerData['prefix']); + $customerPage->verifyFirstName($customerData['firstName']); + $customerPage->verifyMiddleName($customerData['middleName']); + $customerPage->verifyLastName($customerData['lastName']); + $customerPage->verifySuffix($customerData['suffix']); + $customerPage->verifyEmailAddress($customerData['email']); + $customerPage->verifyDateOfBirth($customerData['dateOfBirth']); + $customerPage->verifyTaxVatNumber($customerData['taxVatNumber']); + $customerPage->verifyGenderFemale(); + $customerPage->verifySendWelcomeEmailFromDefaultStoreView(); + } + + /** + * Allure annotations + * @Title("Create a new Customer account using the REQUIRED fields only.") + * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Admin page.") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminCMSPage", value = "$adminCMSPage") + * @Parameter(name = "CustomerPage", value = "$customerPage") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminCMSPage $adminCMSPage + * @param CustomerPage $customerPage + * @group banana + * @return void + */ + public function createCustomerAccountTest( + AdminStep $I, + CustomerPage $customerPage + ) + { + $I->wantTo('verify Customer account in admin'); + $customer = $I->getCustomerData(); + + $customerPage->enterFirstName($customer['firstName']); + $customerPage->enterLastName($customer['lastName']); + $customerPage->enterEmailAddress($customer['email']); + $customerPage->selectAssociateToWebsiteMainWebsite(); + $customerPage->selectGroupGeneral(); + + $customerPage->clickOnAdminSaveAndContinueEdit(); + $customerPage->clickOnAccountInformationLink(); + + $customerPage->verifyFirstName($customer['firstName']); + $customerPage->verifyLastName($customer['lastName']); + $customerPage->verifyEmailAddress($customer['email']); + $customerPage->verifyAssociateToWebsiteMainWebsite(); + $customerPage->verifyGroupGeneral(); + } +} \ No newline at end of file From 0e9228e3dbc7a3fa9da293f3f65f6ff62b344ea5 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 18 Apr 2017 15:29:10 -0500 Subject: [PATCH 039/149] Reverting Data Name changes - Replaced the camel case names with all lower case so it works with the API per Ji. --- .../Xxyyzz/Module/MagentoDataSequence.php | 6 +++--- .../Customers/CreateCustomerCest.php | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php index 22463a4d9..f402560d3 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php @@ -84,9 +84,9 @@ public function getCustomerData(array $additional = []) $faker = \Faker\Factory::create(); $customerData = [ 'prefix' => $faker->title, - 'firstName' => $faker->firstName, - 'middleName' => $faker->firstName, - 'lastName' => $faker->lastName, + 'firstname' => $faker->firstName, + 'middlename' => $faker->firstName, + 'lastname' => $faker->lastName, 'suffix' => \Faker\Provider\en_US\Person::suffix(), 'email' => $faker->email, 'dateOfBirth' => $faker->date($format = 'm/d/Y', $max = 'now'), diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php index ad362e08c..615a6fdeb 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php @@ -63,9 +63,9 @@ public function verifyThatEachFieldOnTheCustomerAddPageWorks( $customerPage->selectAssociateToWebsiteMainWebsite(); $customerPage->selectGroupWholesale(); $customerPage->enterPrefix($customerData['prefix']); - $customerPage->enterFirstName($customerData['firstName']); - $customerPage->enterMiddleName($customerData['middleName']); - $customerPage->enterLastName($customerData['lastName']); + $customerPage->enterFirstName($customerData['firstname']); + $customerPage->enterMiddleName($customerData['middlename']); + $customerPage->enterLastName($customerData['lastname']); $customerPage->enterSuffix($customerData['suffix']); $customerPage->enterEmailAddress($customerData['email']); $customerPage->enterDateOfBirth($customerData['dateOfBirth']); @@ -76,9 +76,9 @@ public function verifyThatEachFieldOnTheCustomerAddPageWorks( $customerPage->verifyAssociateToWebsiteMainWebsite(); $customerPage->verifyGroupWholesale(); $customerPage->verifyPrefix($customerData['prefix']); - $customerPage->verifyFirstName($customerData['firstName']); - $customerPage->verifyMiddleName($customerData['middleName']); - $customerPage->verifyLastName($customerData['lastName']); + $customerPage->verifyFirstName($customerData['firstname']); + $customerPage->verifyMiddleName($customerData['middlename']); + $customerPage->verifyLastName($customerData['lastname']); $customerPage->verifySuffix($customerData['suffix']); $customerPage->verifyEmailAddress($customerData['email']); $customerPage->verifyDateOfBirth($customerData['dateOfBirth']); @@ -111,8 +111,8 @@ public function createCustomerAccountTest( $I->wantTo('verify Customer account in admin'); $customer = $I->getCustomerData(); - $customerPage->enterFirstName($customer['firstName']); - $customerPage->enterLastName($customer['lastName']); + $customerPage->enterFirstName($customer['firstname']); + $customerPage->enterLastName($customer['lastname']); $customerPage->enterEmailAddress($customer['email']); $customerPage->selectAssociateToWebsiteMainWebsite(); $customerPage->selectGroupGeneral(); @@ -120,8 +120,8 @@ public function createCustomerAccountTest( $customerPage->clickOnAdminSaveAndContinueEdit(); $customerPage->clickOnAccountInformationLink(); - $customerPage->verifyFirstName($customer['firstName']); - $customerPage->verifyLastName($customer['lastName']); + $customerPage->verifyFirstName($customer['firstname']); + $customerPage->verifyLastName($customer['lastname']); $customerPage->verifyEmailAddress($customer['email']); $customerPage->verifyAssociateToWebsiteMainWebsite(); $customerPage->verifyGroupGeneral(); From 250820648d39593b06aae2cedb0dae69b339acd0 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 19 Apr 2017 12:25:26 -0500 Subject: [PATCH 040/149] MTA-4194: Framework improvements: Adjust page objects namings and structures. --- ...oDataSequence.php => MagentoFakerData.php} | 20 +-- .../Page/Backend/{Admin => }/AdminLogin.php | 2 +- .../Backend/{Admin => }/SideNavigation.php | 2 +- .../Catalog/{Admin => }/AdminCategoryPage.php | 2 +- .../{Admin => }/AdminProductGridPage.php | 2 +- .../Catalog/{Admin => }/AdminProductPage.php | 2 +- .../AdminCMSPage.php => Cms/AdminCmsPage.php} | 6 +- .../StorefrontCmsPage.php} | 4 +- ...CustomerPage.php => AdminCustomerPage.php} | 4 +- .../CustomerAccountDashboardPage.php | 0 .../CustomerAccountLoginPage.php | 0 tests/acceptance.suite.dist.yml | 2 +- .../AccessAdminPagesViaNavMenuCest.php | 2 +- .../Backend/OpenEachSideNavMenuCest.php | 2 +- .../Acceptance/Catalog/CreateCategoryCest.php | 4 +- .../Catalog/CreateSimpleProductCest.php | 8 +- .../Catalog/UpdateSimpleProductCest.php | 8 +- .../Acceptance/Cms/CreateContentPageCest.php | 155 ++++++++++++++++++ .../Content/CreateContentPageCest.php | 155 ------------------ .../CreateCustomerCest.php | 24 ++- .../User/AccessForgotYourPasswordCest.php | 2 +- 21 files changed, 202 insertions(+), 204 deletions(-) rename tests/_support/Magento/Xxyyzz/Module/{MagentoDataSequence.php => MagentoFakerData.php} (90%) rename tests/_support/Magento/Xxyyzz/Page/Backend/{Admin => }/AdminLogin.php (99%) rename tests/_support/Magento/Xxyyzz/Page/Backend/{Admin => }/SideNavigation.php (99%) rename tests/_support/Magento/Xxyyzz/Page/Catalog/{Admin => }/AdminCategoryPage.php (98%) rename tests/_support/Magento/Xxyyzz/Page/Catalog/{Admin => }/AdminProductGridPage.php (98%) rename tests/_support/Magento/Xxyyzz/Page/Catalog/{Admin => }/AdminProductPage.php (99%) rename tests/_support/Magento/Xxyyzz/Page/{Content/Admin/AdminCMSPage.php => Cms/AdminCmsPage.php} (98%) rename tests/_support/Magento/Xxyyzz/Page/{Content/Storefront/StorefrontCMSPage.php => Cms/StorefrontCmsPage.php} (85%) rename tests/_support/Magento/Xxyyzz/Page/Customer/{Admin/CustomerPage.php => AdminCustomerPage.php} (99%) rename tests/_support/Magento/Xxyyzz/Page/Customer/{Storefront => }/CustomerAccountDashboardPage.php (100%) rename tests/_support/Magento/Xxyyzz/Page/Customer/{Storefront => }/CustomerAccountLoginPage.php (100%) create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php rename tests/acceptance/Magento/Xxyyzz/Acceptance/{Customers => Customer}/CreateCustomerCest.php (87%) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php similarity index 90% rename from tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php rename to tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index f402560d3..8e50e1349 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoDataSequence.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -3,15 +3,15 @@ use Codeception\Module\Sequence; -class MagentoDataSequence extends Sequence +class MagentoFakerData extends Sequence { /** - * Get category data. + * Get category api data. * * @param array $categoryData * @return array */ - public function getCategoryData($categoryData = []) + public function getCategoryApiData($categoryData = []) { $sq = $this->getSqs(); return [ @@ -42,13 +42,13 @@ public function getCategoryData($categoryData = []) } /** - * Get simple product data. + * Get simple product api data. * * @param integer $categoryId * @param array $productData * @return array */ - public function getSimpleProductData($categoryId = 0, $productData = []) + public function getSimpleProductApiData($categoryId = 0, $productData = []) { $sq = $this->getSqs(); return [ @@ -74,12 +74,12 @@ public function getSimpleProductData($categoryId = 0, $productData = []) } /** - * Get Customer Data. + * Get Customer Api data. * * @param array $additional * @return array */ - public function getCustomerData(array $additional = []) + public function getCustomerApiData(array $additional = []) { $faker = \Faker\Factory::create(); $customerData = [ @@ -111,9 +111,9 @@ public function getCustomerData(array $additional = []) * @param string $password * @return array */ - public function getCustomerDataWithPassword($password = '') + public function getCustomerApiDataWithPassword($password = '') { - return ['customer' => self::getCustomerData(), 'password' => ($password !== '') ? $password : '123123qW']; + return ['customer' => self::getCustomerApiData(), 'password' => ($password !== '') ? $password : '123123qW']; } /** @@ -150,4 +150,4 @@ public function getSqs() { return sqs(); } -} \ No newline at end of file +} diff --git a/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php b/tests/_support/Magento/Xxyyzz/Page/Backend/AdminLogin.php similarity index 99% rename from tests/_support/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php rename to tests/_support/Magento/Xxyyzz/Page/Backend/AdminLogin.php index 41b4b292f..d8dd4246a 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Backend/Admin/AdminLogin.php +++ b/tests/_support/Magento/Xxyyzz/Page/Backend/AdminLogin.php @@ -1,5 +1,5 @@ acceptanceTester; $I->amOnPage(self::route($param)); diff --git a/tests/_support/Magento/Xxyyzz/Page/Content/Storefront/StorefrontCMSPage.php b/tests/_support/Magento/Xxyyzz/Page/Cms/StorefrontCmsPage.php similarity index 85% rename from tests/_support/Magento/Xxyyzz/Page/Content/Storefront/StorefrontCMSPage.php rename to tests/_support/Magento/Xxyyzz/Page/Cms/StorefrontCmsPage.php index 704208d49..47b1353d0 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Content/Storefront/StorefrontCMSPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/StorefrontCmsPage.php @@ -1,9 +1,9 @@ wantTo('create sub category with required fields in admin Category page.'); - $category = $I->getCategoryData(); + $category = $I->getCategoryApiData(); AdminCategoryPage::of($I)->amOnAdminCategoryPage(); AdminCategoryPage::of($I)->addSubCategory(); AdminCategoryPage::of($I)->fillFieldCategoryName($category['name']); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index ba8672850..a28cb7b31 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -2,8 +2,8 @@ namespace Magento\Xxyyzz\Acceptance\Catalog; use Magento\Xxyyzz\Step\Backend\AdminStep; -use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductGridPage; -use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductPage; +use Magento\Xxyyzz\Page\Catalog\AdminProductGridPage; +use Magento\Xxyyzz\Page\Catalog\AdminProductPage; use Magento\Xxyyzz\Page\Catalog\CategoryPage; use Magento\Xxyyzz\Page\Catalog\ProductPage; use Magento\Xxyyzz\Step\Catalog\Api\CategoryApiStep; @@ -40,11 +40,11 @@ class CreateSimpleProductCest public function _before(AdminStep $I, CategoryApiStep $api) { $I->loginAsAdmin(); - $this->category = $I->getCategoryData(); + $this->category = $I->getCategoryApiData(); $api->amAdminTokenAuthenticated(); $this->category = array_merge($this->category, ['id' => $api->createCategory(['category' => $this->category])]); $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - $this->product = $I->getSimpleProductData(); + $this->product = $I->getSimpleProductApiData(); if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { $this->product['stock_status'] = 'In Stock'; $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index b95a67a13..e46469e9d 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -4,8 +4,8 @@ use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Step\Catalog\Api\CategoryApiStep; use Magento\Xxyyzz\Step\Catalog\Api\ProductApiStep; -use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductGridPage; -use Magento\Xxyyzz\Page\Catalog\Admin\AdminProductPage; +use Magento\Xxyyzz\Page\Catalog\AdminProductGridPage; +use Magento\Xxyyzz\Page\Catalog\AdminProductPage; use Magento\Xxyyzz\Page\Catalog\CategoryPage; use Magento\Xxyyzz\Page\Catalog\ProductPage; use Yandex\Allure\Adapter\Annotation\Stories; @@ -42,14 +42,14 @@ class UpdateSimpleProductCest public function _before(AdminStep $I, CategoryApiStep $categoryApi, ProductApiStep $productApi) { $I->loginAsAdmin(); - $this->category = $I->getCategoryData(); + $this->category = $I->getCategoryApiData(); $categoryApi->amAdminTokenAuthenticated(); $this->category = array_merge( $this->category, ['id' => $categoryApi->createCategory(['category' => $this->category])] ); $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - $this->product = $I->getSimpleProductData(); + $this->product = $I->getSimpleProductApiData(); $this->product['custom_attributes'][2]['value'] = $this->category['id']; $productApi->amAdminTokenAuthenticated(); $this->product = array_merge( diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php new file mode 100644 index 000000000..6d2499153 --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php @@ -0,0 +1,155 @@ +am('an Admin'); + $I->loginAsAdmin(); + $adminCmsPage->amOnAdminCmsPage(); + $adminCmsPage->clickOnAddNewPageButton(); + $I->waitForSpinnerToDisappear(); + } + + public function _after(AdminStep $I) + { + $I->goToTheAdminLogoutPage(); + } + + /** + * Allure annotations + * @Title("Enter text into every field on the Content - Page.") + * @Description("Enter text into ALL fields and verify the contents of the fields.") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminCmsPage", value = "$adminCmsPage") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminCmsPage $adminCmsPage + * @return void + */ + public function verifyThatEachFieldOnTheContentPageWorks( + AdminStep $I, + AdminCmsPage $adminCmsPage + ) + { + $I->wantTo('verify that I can use all of the fields on the page.'); + $pageData = $I->getContentPage(); + + $adminCmsPage->clickOnEnablePageToggle(); + + $adminCmsPage->enterPageTitle($pageData['pageTitle']); + + $adminCmsPage->clickOnPageContent(); + $adminCmsPage->enterPageContentHeading($pageData['contentHeading']); + $adminCmsPage->enterPageContentBody($pageData['contentBody']); + + $adminCmsPage->clickOnPageSearchEngineOptimisation(); + $adminCmsPage->enterUrlKey($pageData['urlKey']); + $adminCmsPage->enterMetaTitle($pageData['metaTitle']); + $adminCmsPage->enterMetaKeywords($pageData['metaKeywords']); + $adminCmsPage->enterMetaDescription($pageData['metaDescription']); + + $adminCmsPage->clickOnPagePageInWebsites(); + $adminCmsPage->selectDefaultStoreView(); + + $adminCmsPage->clickOnPageDesign(); + $adminCmsPage->selectLayout1Column(); + $adminCmsPage->enterLayoutUpdateXml($pageData['layoutUpdateXml']); + + $adminCmsPage->clickOnPageCustomDesignUpdate(); + $adminCmsPage->enterFrom($pageData['from']); + $adminCmsPage->enterTo($pageData['to']); + $adminCmsPage->selectNewThemeMagentoLuma(); + $adminCmsPage->selectNewLayout3Columns(); + + $adminCmsPage->verifyPageTitle($pageData['pageTitle']); + + $adminCmsPage->verifyPageContentHeading($pageData['contentHeading']); + $adminCmsPage->verifyPageContentBody($pageData['contentBody']); + + $adminCmsPage->verifyUrlKey($pageData['urlKey']); + $adminCmsPage->verifyMetaTitle($pageData['metaTitle']); + $adminCmsPage->verifyMetaKeywords($pageData['metaKeywords']); + $adminCmsPage->verifyMetaDescription($pageData['metaDescription']); + + $adminCmsPage->verifyDefaultStoreView(); + + $adminCmsPage->verifyLayout1Column(); + $adminCmsPage->verifyLayoutUpdateXml($pageData['layoutUpdateXml']); + + $adminCmsPage->verifyFrom($pageData['from']); + $adminCmsPage->verifyTo($pageData['to']); + $adminCmsPage->verifyNewThemeMagentoLuma(); + $adminCmsPage->verifyNewLayout3Columns(); + } + + /** + * Allure annotations + * @Title("Create a new Content - Page using the REQUIRED fields only.") + * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Storefront.") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminCmsPage", value = "$adminCmsPage") + * @Parameter(name = "StorefrontCmsPage", value = "$storefrontCmsPage") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminCmsPage $adminCmsPage + * @param StorefrontCmsPage $storefrontCmsPage + * @return void + */ + public function createContentPageTest( + AdminStep $I, + AdminCmsPage $adminCmsPage, + StorefrontCmsPage $storefrontCmsPage + ) + { + $I->wantTo('verify content page in admin'); + $page = $I->getContentPage(); + + $adminCmsPage->clickOnPageContent(); + $adminCmsPage->enterPageTitle($page['pageTitle']); + $adminCmsPage->enterPageContentHeading($page['contentHeading']); + $adminCmsPage->enterPageContentBody($page['contentBody']); + $adminCmsPage->clickOnPageSearchEngineOptimisation(); + $adminCmsPage->enterUrlKey($page['urlKey']); + + $adminCmsPage->savePage(); + $adminCmsPage->seeSaveSuccessMessage(); + + $I->openNewTabGoToVerify($page['urlKey']); + $storefrontCmsPage->verifyPageContentTitle($page['contentHeading']); + $storefrontCmsPage->verifyPageContentBody($page['contentBody']); + } +} \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php deleted file mode 100644 index fa0f979a1..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Content/CreateContentPageCest.php +++ /dev/null @@ -1,155 +0,0 @@ -am('an Admin'); - $I->loginAsAdmin(); - $adminCMSPage->amOnAdminCMSPage(); - $adminCMSPage->clickOnAddNewPageButton(); - $I->waitForSpinnerToDisappear(); - } - - public function _after(AdminStep $I) - { - $I->goToTheAdminLogoutPage(); - } - - /** - * Allure annotations - * @Title("Enter text into every field on the Content - Page.") - * @Description("Enter text into ALL fields and verify the contents of the fields.") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCMSPage", value = "$adminCMSPage") - * - * Codeception annotations - * @param AdminStep $I - * @param AdminCMSPage $adminCMSPage - * @return void - */ - public function verifyThatEachFieldOnTheContentPageWorks( - AdminStep $I, - AdminCMSPage $adminCMSPage - ) - { - $I->wantTo('verify that I can use all of the fields on the page.'); - $pageData = $I->getContentPage(); - - $adminCMSPage->clickOnEnablePageToggle(); - - $adminCMSPage->enterPageTitle($pageData['pageTitle']); - - $adminCMSPage->clickOnPageContent(); - $adminCMSPage->enterPageContentHeading($pageData['contentHeading']); - $adminCMSPage->enterPageContentBody($pageData['contentBody']); - - $adminCMSPage->clickOnPageSearchEngineOptimisation(); - $adminCMSPage->enterUrlKey($pageData['urlKey']); - $adminCMSPage->enterMetaTitle($pageData['metaTitle']); - $adminCMSPage->enterMetaKeywords($pageData['metaKeywords']); - $adminCMSPage->enterMetaDescription($pageData['metaDescription']); - - $adminCMSPage->clickOnPagePageInWebsites(); - $adminCMSPage->selectDefaultStoreView(); - - $adminCMSPage->clickOnPageDesign(); - $adminCMSPage->selectLayout1Column(); - $adminCMSPage->enterLayoutUpdateXml($pageData['layoutUpdateXml']); - - $adminCMSPage->clickOnPageCustomDesignUpdate(); - $adminCMSPage->enterFrom($pageData['from']); - $adminCMSPage->enterTo($pageData['to']); - $adminCMSPage->selectNewThemeMagentoLuma(); - $adminCMSPage->selectNewLayout3Columns(); - - $adminCMSPage->verifyPageTitle($pageData['pageTitle']); - - $adminCMSPage->verifyPageContentHeading($pageData['contentHeading']); - $adminCMSPage->verifyPageContentBody($pageData['contentBody']); - - $adminCMSPage->verifyUrlKey($pageData['urlKey']); - $adminCMSPage->verifyMetaTitle($pageData['metaTitle']); - $adminCMSPage->verifyMetaKeywords($pageData['metaKeywords']); - $adminCMSPage->verifyMetaDescription($pageData['metaDescription']); - - $adminCMSPage->verifyDefaultStoreView(); - - $adminCMSPage->verifyLayout1Column(); - $adminCMSPage->verifyLayoutUpdateXml($pageData['layoutUpdateXml']); - - $adminCMSPage->verifyFrom($pageData['from']); - $adminCMSPage->verifyTo($pageData['to']); - $adminCMSPage->verifyNewThemeMagentoLuma(); - $adminCMSPage->verifyNewLayout3Columns(); - } - - /** - * Allure annotations - * @Title("Create a new Content - Page using the REQUIRED fields only.") - * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Storefront.") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCMSPage", value = "$adminCMSPage") - * @Parameter(name = "StorefrontCMSPage", value = "$storefrontCMSPage") - * - * Codeception annotations - * @param AdminStep $I - * @param AdminCMSPage $adminCMSPage - * @param StorefrontCMSPage $storefrontCMSPage - * @return void - */ - public function createContentPageTest( - AdminStep $I, - AdminCMSPage $adminCMSPage, - StorefrontCMSPage $storefrontCMSPage - ) - { - $I->wantTo('verify content page in admin'); - $page = $I->getContentPage(); - - $adminCMSPage->clickOnPageContent(); - $adminCMSPage->enterPageTitle($page['pageTitle']); - $adminCMSPage->enterPageContentHeading($page['contentHeading']); - $adminCMSPage->enterPageContentBody($page['contentBody']); - $adminCMSPage->clickOnPageSearchEngineOptimisation(); - $adminCMSPage->enterUrlKey($page['urlKey']); - - $adminCMSPage->savePage(); - $adminCMSPage->seeSaveSuccessMessage(); - - $I->openNewTabGoToVerify($page['urlKey']); - $storefrontCMSPage->verifyPageContentTitle($page['contentHeading']); - $storefrontCMSPage->verifyPageContentBody($page['contentBody']); - } -} \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php similarity index 87% rename from tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php rename to tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php index 615a6fdeb..d85a7e8f7 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customers/CreateCustomerCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php @@ -1,9 +1,9 @@ am('an Admin'); @@ -45,20 +45,20 @@ public function _before( * @Title("Enter text into every field on the Customer - Page.") * @Description("Enter text into ALL fields and verify the contents of the fields.") * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "CustomerPage", value = "$customerPage") + * @Parameter(name = "AdminCustomerPage", value = "$customerPage") * * Codeception annotations * @param AdminStep $I - * @param CustomerPage $customerPage + * @param AdminCustomerPage $customerPage * @return void */ public function verifyThatEachFieldOnTheCustomerAddPageWorks( AdminStep $I, - CustomerPage $customerPage + AdminCustomerPage $customerPage ) { $I->wantTo('verify that I can use all of the fields on the page.'); - $customerData = $I->getCustomerData(); + $customerData = $I->getCustomerApiData(); $customerPage->selectAssociateToWebsiteMainWebsite(); $customerPage->selectGroupWholesale(); @@ -93,23 +93,21 @@ public function verifyThatEachFieldOnTheCustomerAddPageWorks( * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Admin page.") * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCMSPage", value = "$adminCMSPage") - * @Parameter(name = "CustomerPage", value = "$customerPage") + * @Parameter(name = "AdminCustomerPage", value = "$customerPage") * * Codeception annotations * @param AdminStep $I - * @param AdminCMSPage $adminCMSPage - * @param CustomerPage $customerPage + * @param AdminCustomerPage $customerPage * @group banana * @return void */ public function createCustomerAccountTest( AdminStep $I, - CustomerPage $customerPage + AdminCustomerPage $customerPage ) { $I->wantTo('verify Customer account in admin'); - $customer = $I->getCustomerData(); + $customer = $I->getCustomerApiData(); $customerPage->enterFirstName($customer['firstname']); $customerPage->enterLastName($customer['lastname']); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php index c5f34384a..d3eab36af 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php @@ -1,7 +1,7 @@ Date: Wed, 19 Apr 2017 14:07:52 -0500 Subject: [PATCH 041/149] Adding basic Customer Grid PO, Fixing a group tag on sample test, making Abstract Grid an abstract class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Converting the Abstract Grid Page to an actual abstract class - Added new methods for selecting and clicking on the “Edit” or “View” action buttons in the Grid. - Adding basic Customer Grid Page Object - Updating Create Customer test to include the Admin verification portion - Correcting the group tag for a Sample Test --- .../Xxyyzz/Page/AbstractAdminGridPage.php | 43 ++++++++++++++++++- .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 1 + .../Page/Customer/AdminCustomerGrid.php | 16 +++++++ .../Customer/CreateCustomerCest.php | 36 +++++++++------- .../Acceptance/SampleTests/TestCest.php | 2 +- 5 files changed, 80 insertions(+), 18 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php index 73a69ba13..27a2463cc 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php @@ -3,8 +3,13 @@ use Magento\Xxyyzz\AcceptanceTester; -class AbstractAdminGridPage +abstract class AbstractAdminGridPage { + /** + * Include url of current page. + */ + public static $URL = '/admin/customer/index/'; + /** * Declare UI map for this page here. CSS or XPath allowed. */ @@ -14,6 +19,7 @@ class AbstractAdminGridPage public static $filtersButton = '.data-grid-filters-action-wrap .action-default'; // TODO: Add Filter selectors + public static $clearAllFiltersLink = '.action-clear[data-action="grid-filter-reset"]'; public static $viewButton = '.admin__data-grid-action-bookmarks .admin__action-dropdown'; public static $viewDropDownMenu = '.admin__data-grid-action-bookmarks .admin__action-dropdown-menu'; @@ -30,7 +36,7 @@ class AbstractAdminGridPage public static $columnsCancelButton = '.admin__data-grid-action-columns .admin__action-dropdown-footer-main-actions'; public static $exportButton = '.admin__data-grid-action-export'; - public static $exportDropDownMenu = '..admin__data-grid-action-export-menu'; + public static $exportDropDownMenu = '.admin__data-grid-action-export-menu'; public static $exportLinks = '.admin__data-grid-action-export-menu .admin__field-label'; public static $exportCancelButton = '.admin__data-grid-action-export-menu .action-tertiary'; public static $exportExportButton = '.admin__data-grid-action-export-menu .action-secondary'; @@ -56,6 +62,9 @@ class AbstractAdminGridPage public static $gridMainArea = '.admin__data-grid-wrap'; public static $gridHeaderName = '.data-grid-th'; + public static $loadingMask = '.loading-mask'; + public static $gridLoadingMask = '.admin__data-grid-loading-mask'; + /** * @var AcceptanceTester */ @@ -72,6 +81,18 @@ public static function of(AcceptanceTester $I) return new static($I); } + public static function route($param) + { + return static::$URL.$param; + } + + public function waitForLoadingMaskToDisappear() + { + $I = $this->acceptanceTester; + $I->waitForElementNotVisible(self::$loadingMask, 30); + $I->waitForElementNotVisible(self::$gridLoadingMask, 30); + } + public function enterSearchKeyword($searchKeyboard) { $I = $this->acceptanceTester; @@ -88,6 +109,7 @@ public function performSearchByKeyword($searchKeyword) { self::enterSearchKeyword($searchKeyword); self::clickOnTheSearchButton(); + self::waitForLoadingMaskToDisappear(); } public function clickOnFiltersButton() @@ -256,4 +278,21 @@ public function clickOnSpecificGridColumnHeader($columnHeaderName) $I = $this->acceptanceTester; $I->click(self::$gridHeaderName, $columnHeaderName); } + + public function determineIndexBasedOnThisText($keyText) + { + $I = $this->acceptanceTester; + $selector = "//div[contains(@class, 'data-grid-cell-content')][contains(., '" . $keyText . "')]/parent::td/parent::tr"; + $number = $I->grabAttributeFrom($selector, 'data-repeat-index'); + return $number; + } + + public function clickOnActionLinkFor($keyText) + { + $I = $this->acceptanceTester; + $actionLinkSelector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] .action-menu-item'; + + $I->click($actionLinkSelector); + self::waitForLoadingMaskToDisappear(); + } } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php index 990b59ee1..dcde626e6 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -176,5 +176,6 @@ public function clickOnAdminAddButton() { $I = $this->acceptanceTester; $I->click(self::$pageMainActionsAdd); + self::waitForLoadingMaskToDisappear(); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php new file mode 100644 index 000000000..be14dd1fd --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php @@ -0,0 +1,16 @@ +wantTo('verify Customer account in admin'); $customer = $I->getCustomerApiData(); - $customerPage->enterFirstName($customer['firstname']); - $customerPage->enterLastName($customer['lastname']); - $customerPage->enterEmailAddress($customer['email']); - $customerPage->selectAssociateToWebsiteMainWebsite(); - $customerPage->selectGroupGeneral(); + $adminCustomerPage->enterFirstName($customer['firstname']); + $adminCustomerPage->enterLastName($customer['lastname']); + $adminCustomerPage->enterEmailAddress($customer['email']); + $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); + $adminCustomerPage->selectGroupGeneral(); + + $adminCustomerPage->clickOnAdminSaveButton(); + $adminCustomerGrid->performSearchByKeyword($customer['email']); - $customerPage->clickOnAdminSaveAndContinueEdit(); - $customerPage->clickOnAccountInformationLink(); + $adminCustomerGrid->clickOnActionLinkFor($customer['email']); + $adminCustomerPage->clickOnAccountInformationLink(); - $customerPage->verifyFirstName($customer['firstname']); - $customerPage->verifyLastName($customer['lastname']); - $customerPage->verifyEmailAddress($customer['email']); - $customerPage->verifyAssociateToWebsiteMainWebsite(); - $customerPage->verifyGroupGeneral(); + $adminCustomerPage->verifyFirstName($customer['firstname']); + $adminCustomerPage->verifyLastName($customer['lastname']); + $adminCustomerPage->verifyEmailAddress($customer['email']); + $adminCustomerPage->verifyAssociateToWebsiteMainWebsite(); + $adminCustomerPage->verifyGroupGeneral(); } } \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php index 3d8410b77..d05529cf6 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php @@ -4,7 +4,7 @@ use Magento\Xxyyzz\Step\Backend\AdminStep; /** - * group skip + * @group skip */ class TestCest { From 986ba36557129f3cb1a9acdd980d98b5fee29ada Mon Sep 17 00:00:00 2001 From: John Stennett Date: Wed, 19 Apr 2017 15:20:13 -0500 Subject: [PATCH 042/149] Adding a Customer Data generator for tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adding a Customer data generator that works for tests that isn’t tied to the API scheme. --- .../Xxyyzz/Module/MagentoFakerData.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index 8e50e1349..3c0b27726 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -116,6 +116,41 @@ public function getCustomerApiDataWithPassword($password = '') return ['customer' => self::getCustomerApiData(), 'password' => ($password !== '') ? $password : '123123qW']; } + /** + * Get Customer Api data. + * + * @param array $additional + * @return array + */ + public function getCustomerData(array $additional = []) + { + $faker = \Faker\Factory::create(); + $customerData = [ + 'prefix' => $faker->title, + 'firstname' => $faker->firstName, + 'middlename' => $faker->firstName, + 'lastname' => $faker->lastName, + 'suffix' => \Faker\Provider\en_US\Person::suffix(), + 'email' => $faker->email, + 'dateOfBirth' => $faker->date($format = 'm/d/Y', $max = 'now'), + 'gender' => rand(0, 1), + 'group_id' => 1, + 'store_id' => 1, + 'website_id' => 1, + 'taxVatNumber' => \Faker\Provider\at_AT\Payment::vat(), + 'company' => $faker->company, + 'address' => [ + 'address1' => $faker->address, + 'address2' => $faker->address, + 'city' => $faker->city, + 'country' => $faker->country, + 'state' => \Faker\Provider\en_US\Address::state(), + 'zipCode' => $faker->postcode + ] + ]; + return array_merge($customerData, $additional); + } + /** * Get Content Page Data. * From cbddbb76c31b457a0eb2229f83182e9ccae7931d Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 19 Apr 2017 16:44:45 -0500 Subject: [PATCH 043/149] MTA-4137: Added storefront new and existing customers tests. --- .../Xxyyzz/Module/MagentoFakerData.php | 22 +++-- .../Xxyyzz/Page/AbstractFrontendPage.php | 20 ++++- ...Navigation.php => AdminSideNavigation.php} | 2 +- ...oryPage.php => StorefrontCategoryPage.php} | 2 +- ...ductPage.php => StorefrontProductPage.php} | 2 +- .../Customer/CustomerAccountDashboardPage.php | 37 -------- .../StorefrontCustomerAccountCreatePage.php | 84 ++++++++++++++++++ ...StorefrontCustomerAccountDashboardPage.php | 87 +++++++++++++++++++ ...=> StorefrontCustomerAccountLoginPage.php} | 35 +++++++- .../AccessAdminPagesViaNavMenuCest.php | 2 +- .../Backend/OpenEachSideNavMenuCest.php | 2 +- .../Acceptance/Catalog/CreateCategoryCest.php | 6 +- .../Catalog/CreateSimpleProductCest.php | 22 ++--- .../Catalog/UpdateSimpleProductCest.php | 18 ++-- .../Acceptance/Cms/CreateContentPageCest.php | 2 +- .../CreateNewCustomerFrontendCest.php | 74 ++++++++++++++++ .../Customer/SignInCustomerFrontendCest.php | 74 ++++++++++++++++ 17 files changed, 408 insertions(+), 83 deletions(-) rename tests/_support/Magento/Xxyyzz/Page/Backend/{SideNavigation.php => AdminSideNavigation.php} (99%) rename tests/_support/Magento/Xxyyzz/Page/Catalog/{CategoryPage.php => StorefrontCategoryPage.php} (98%) rename tests/_support/Magento/Xxyyzz/Page/Catalog/{ProductPage.php => StorefrontProductPage.php} (96%) delete mode 100644 tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php create mode 100644 tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php create mode 100644 tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php rename tests/_support/Magento/Xxyyzz/Page/Customer/{CustomerAccountLoginPage.php => StorefrontCustomerAccountLoginPage.php} (54%) create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index 3c0b27726..20b71d605 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -13,6 +13,7 @@ class MagentoFakerData extends Sequence */ public function getCategoryApiData($categoryData = []) { + $faker = \Faker\Factory::create(); $sq = $this->getSqs(); return [ 'parent_id' => '2', @@ -24,18 +25,18 @@ public function getCategoryApiData($categoryData = []) 'custom_attributes' => [ ['attribute_code' => 'url_key', 'value' => isset($categoryData['name']) ? $categoryData['name'] : 'category'.$sq], - ['attribute_code' => 'description', 'value' => 'Custom description'], - ['attribute_code' => 'meta_title', 'value' => ''], - ['attribute_code' => 'meta_keywords', 'value' => ''], - ['attribute_code' => 'meta_description', 'value' => ''], + ['attribute_code' => 'description', 'value' => $faker->text(20)], + ['attribute_code' => 'meta_title', 'value' => $faker->text(20)], + ['attribute_code' => 'meta_keywords', 'value' => $faker->text(20)], + ['attribute_code' => 'meta_description', 'value' => $faker->text(20)], ['attribute_code' => 'display_mode', 'value' => 'PRODUCTS'], ['attribute_code' => 'landing_page', 'value' => ''], ['attribute_code' => 'is_anchor', 'value' => '0'], ['attribute_code' => 'custom_use_parent_settings', 'value' => '0'], ['attribute_code' => 'custom_apply_to_products', 'value' => '0'], ['attribute_code' => 'custom_design', 'value' => ''], - ['attribute_code' => 'custom_design_from', 'value' => ''], - ['attribute_code' => 'custom_design_to', 'value' => ''], + ['attribute_code' => 'custom_design_from', 'value' => $faker->date($format = 'm/d/Y', $max = 'now')], + ['attribute_code' => 'custom_design_to', 'value' => $faker->date($format = 'm/d/Y')], ['attribute_code' => 'page_layout', 'value' => ''], ] ]; @@ -50,6 +51,7 @@ public function getCategoryApiData($categoryData = []) */ public function getSimpleProductApiData($categoryId = 0, $productData = []) { + $faker = \Faker\Factory::create(); $sq = $this->getSqs(); return [ 'sku' => isset($productData['sku']) @@ -58,11 +60,11 @@ public function getSimpleProductApiData($categoryId = 0, $productData = []) ? $productData['name'] : 'simple_product'.$sq, 'visibility' => 4, 'type_id' => 'simple', - 'price' => 17.71, + 'price' => $faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 999), 'status' => 1, 'attribute_set_id' => 4, 'extension_attributes' => [ - 'stock_item' => ['is_in_stock' => 1, 'qty' => 1000] + 'stock_item' => ['is_in_stock' => 1, 'qty' => $faker->randomDigit] ], 'custom_attributes' => [ ['attribute_code' => 'url_key', 'value' => isset($productData['name']) @@ -83,13 +85,10 @@ public function getCustomerApiData(array $additional = []) { $faker = \Faker\Factory::create(); $customerData = [ - 'prefix' => $faker->title, 'firstname' => $faker->firstName, 'middlename' => $faker->firstName, 'lastname' => $faker->lastName, - 'suffix' => \Faker\Provider\en_US\Person::suffix(), 'email' => $faker->email, - 'dateOfBirth' => $faker->date($format = 'm/d/Y', $max = 'now'), 'gender' => rand(0, 1), 'group_id' => 1, 'store_id' => 1, @@ -100,7 +99,6 @@ public function getCustomerApiData(array $additional = []) 'value' => '0', ], ], - 'taxVatNumber' => \Faker\Provider\at_AT\Payment::vat() ]; return array_merge($customerData, $additional); } diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php index 501a69bae..0b8a6412e 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php @@ -15,8 +15,8 @@ abstract class AbstractFrontendPage */ public static $pageTitle = '.page-title'; + public static $welcomeMessage = '.greet.welcome>span'; public static $signInLink = '.authorization-link a'; - public static $createAccountLink = '.header.links>li:nth-child(4)'; public static $pageFooterContent = '.footer.content'; @@ -59,4 +59,22 @@ public function seeInPageTitle($name) $I = $this->acceptanceTester; $I->see($name, self::$pageTitle); } + + public function clickSignInLink() + { + $I = $this->acceptanceTester; + $I->click(self::$signInLink); + } + + public function clickCreateAccountLink() + { + $I = $this->acceptanceTester; + $I->click(self::$createAccountLink); + } + + public function seeWelcomeMessage($msg) + { + $I = $this->acceptanceTester; + $I->see($msg, self::$welcomeMessage); + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Backend/SideNavigation.php b/tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php similarity index 99% rename from tests/_support/Magento/Xxyyzz/Page/Backend/SideNavigation.php rename to tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php index 8fc8d1d44..b14937e77 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Backend/SideNavigation.php +++ b/tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php @@ -3,7 +3,7 @@ use Magento\Xxyyzz\Page\AbstractAdminPage; -class SideNavigation extends AbstractAdminPage +class AdminSideNavigation extends AbstractAdminPage { /** * Declare UI map for this page here. CSS or XPath allowed. diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/CategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php similarity index 98% rename from tests/_support/Magento/Xxyyzz/Page/Catalog/CategoryPage.php rename to tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php index 740258d98..8199a06cc 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/CategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php @@ -6,7 +6,7 @@ use Facebook\WebDriver\WebDriverBy; use Facebook\WebDriver\Exception\WebDriverException; -class CategoryPage extends AbstractFrontendPage +class StorefrontCategoryPage extends AbstractFrontendPage { /** * Declare UI map for this page here. CSS or XPath allowed. diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php similarity index 96% rename from tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php rename to tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php index 88ee3973b..3746b8a63 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/ProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php @@ -3,7 +3,7 @@ use Magento\Xxyyzz\Page\AbstractFrontendPage; -class ProductPage extends AbstractFrontendPage +class StorefrontProductPage extends AbstractFrontendPage { /** * Declare UI map for this page here. CSS or XPath allowed. diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php deleted file mode 100644 index 9edc21619..000000000 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountDashboardPage.php +++ /dev/null @@ -1,37 +0,0 @@ -span'; - public static $createNewAccountLink = '.action.create.primary>span'; - - public function amOnCustomerAccountLoginPage() - { - $I = $this->acceptanceTester; - $I->amOnPage(self::$URL); - $I->waitForElementVisible(self::$customerLoginForm, $this->pageLoadTimeout); - } - - public function signInWithCredentials($email, $password) - { - $I = $this->acceptanceTester; - $I->fillField(self::$customerEmailField, $email); - $I->fillField(self::$customerPasswordField, $password); - $I->click(self::$customerSignInButton); - } -} diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php new file mode 100644 index 000000000..e5e5a89a2 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php @@ -0,0 +1,84 @@ +acceptanceTester; + $I->amOnPage(self::$URL); + $I->waitPageLoad(); + } + + public function fillFieldFirstName($firstName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$customerFirstName, $firstName); + } + + public function fillFieldLastName($lastName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$customerLastName, $lastName); + } + + public function fillFieldEmail($email) + { + $I = $this->acceptanceTester; + $I->fillField(self::$customerEmail, $email); + } + + public function fillFieldPassword($password) + { + $I = $this->acceptanceTester; + $I->fillField(self::$customerPassword, $password); + } + + public function fillFieldConfirmPassword($password) + { + $I = $this->acceptanceTester; + $I->fillField(self::$customerConfirmPassword, $password); + } + + public function setNewsletterSubscribe(bool $checked) + { + $I = $this->acceptanceTester; + try { + $I->dontSeeCheckboxIsChecked(self::$newsletterSubscribe); + if ($checked) { + $I->click(self::$newsletterSubscribe); + } + } catch (\Exception $e) { + $I->seeCheckboxIsChecked(self::$newsletterSubscribe); + if ($checked) { + $I->click(self::$newsletterSubscribe); + } + } + } + + public function clickCreateAccountButton() + { + $I = $this->acceptanceTester; + $I->click(self::$createAccountSubmitButton); + $I->waitPageLoad(); + $I->seeInCurrentUrl('customer/account'); + } +} diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php new file mode 100644 index 000000000..cb319eec1 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php @@ -0,0 +1,87 @@ +span'; + public static $contactInfomationForgotPwdLink = '.box.box-information .action.change-password'; + + public static $newsletterText = '.box.box-newsletter p'; + public static $newsletterEditLink = '.box.box-newsletter .action.edit>span'; + + protected $contactInfomationName; + protected $contactInfomationEmail; + + public function amOnCustomerAccountDashboardPage() + { + $I = $this->acceptanceTester; + $I->amOnPage(self::$URL); + $I->waitPageLoad(); + $this->setCustomerContactInformation(); + } + + public function seeContactInformationName($name) + { + $this->setCustomerContactInformation(); + $I = $this->acceptanceTester; + $I->assertEquals($name, $this->contactInfomationName); + } + + public function seeContactInformationEmail($email) + { + $this->setCustomerContactInformation(); + $I = $this->acceptanceTester; + $I->assertEquals($email, $this->contactInfomationEmail); + } + + public function seeNewsletterText($text) + { + $I = $this->acceptanceTester; + $I->see($text, self::$newsletterText); + } + + public function clickContactInformationEditLink() + { + $I = $this->acceptanceTester; + $I->click(self::$contactInfomationEditLink); + $I->waitPageLoad(); + $I->seeInCurrentUrl('customer/account/edit'); + } + + public function clickContactInformationForgotPasswordLink() + { + $I = $this->acceptanceTester; + $I->click(self::$contactInfomationForgotPwdLink); + $I->waitPageLoad(); + $I->seeInCurrentUrl('customer/account/edit/changepass'); + } + + public function clickNewsletterEditLink() + { + $I = $this->acceptanceTester; + $I->click(self::$newsletterEditLink); + $I->waitPageLoad(); + $I->seeInCurrentUrl('newsletter/manage'); + } + + private function setCustomerContactInformation() + { + if(!isset($this->contactInfomationName) || !isset($this->contactInfomationEmail)) { + $I = $this->acceptanceTester; + $contacts = explode("\n", $I->grabTextFrom(self::$contactInfomationText)); + $this->contactInfomationName = $contacts[0]; + $this->contactInfomationEmail = $contacts[1]; + } + } +} diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php similarity index 54% rename from tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php rename to tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php index 7ba7db6db..7f2687e59 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/CustomerAccountLoginPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php @@ -3,7 +3,7 @@ use Magento\Xxyyzz\Page\AbstractFrontendPage; -class CustomerAccountLoginPage extends AbstractFrontendPage +class StorefrontCustomerAccountLoginPage extends AbstractFrontendPage { /** * Include url of current page. @@ -11,7 +11,7 @@ class CustomerAccountLoginPage extends AbstractFrontendPage public static $URL = '/customer/account/login/'; /** - * Declare UI map for this page here. CSS or XPath allowed. + * Declare UI map for customer login page. */ public static $customerLoginForm = '#login-form'; public static $customerEmailField = '#email'; @@ -24,14 +24,41 @@ public function amOnCustomerAccountLoginPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementVisible(self::$customerLoginForm, $this->pageLoadTimeout); + $I->waitPageLoad(); } - public function signInWithCredentials($email, $password) + public function fillFieldCustomerEmail($email) { $I = $this->acceptanceTester; $I->fillField(self::$customerEmailField, $email); + } + + public function fillFieldCustomerPassword($password) + { + $I = $this->acceptanceTester; $I->fillField(self::$customerPasswordField, $password); + } + + public function clickSignInButton() + { + $I = $this->acceptanceTester; $I->click(self::$customerSignInButton); + $I->waitPageLoad(); + $I->seeInCurrentUrl('customer/account'); + } + + public function clickCreateAccountButton() + { + $I = $this->acceptanceTester; + $I->click(self::$createNewAccountLink); + $I->waitPageLoad(); + $I->seeInCurrentUrl('customer/account/create'); + } + + public function signInWithCredentials($email, $password) + { + $this->fillFieldCustomerEmail($email); + $this->fillFieldCustomerPassword($password); + $this->clickSignInButton(); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index b39098104..b811bda04 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -1,7 +1,7 @@ seeElement(AdminCategoryPage::$successMessage); $I->wantTo('verify created category in frontend category page.'); - CategoryPage::of($I)->amOnCategoryPage(str_replace('_', '-', $category['custom_attributes'][0]['value'])); - CategoryPage::of($I)->seeCategoryNameInTitleHeading($category['name']); + StorefrontCategoryPage::of($I)->amOnCategoryPage(str_replace('_', '-', $category['custom_attributes'][0]['value'])); + StorefrontCategoryPage::of($I)->seeCategoryNameInTitleHeading($category['name']); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index a28cb7b31..4238bdaea 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -4,8 +4,8 @@ use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Page\Catalog\AdminProductGridPage; use Magento\Xxyyzz\Page\Catalog\AdminProductPage; -use Magento\Xxyyzz\Page\Catalog\CategoryPage; -use Magento\Xxyyzz\Page\Catalog\ProductPage; +use Magento\Xxyyzz\Page\Catalog\StorefrontCategoryPage; +use Magento\Xxyyzz\Page\Catalog\StorefrontProductPage; use Magento\Xxyyzz\Step\Catalog\Api\CategoryApiStep; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; @@ -109,19 +109,19 @@ public function createSimpleProductTest(AdminStep $I) AdminProductPage::of($I)->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); $I->wantTo('verify simple product data in frontend category page.'); - CategoryPage::of($I)->amOnCategoryPage($this->category['url_key']); - CategoryPage::of($I)->seeProductLinksInPage( + StorefrontCategoryPage::of($I)->amOnCategoryPage($this->category['url_key']); + StorefrontCategoryPage::of($I)->seeProductLinksInPage( $this->product['name'], str_replace('_', '-', $this->product['url_key']) ); - CategoryPage::of($I)->seeProductNameInPage($this->product['name']); - CategoryPage::of($I)->seeProductPriceInPage($this->product['name'], $this->product['price']); + StorefrontCategoryPage::of($I)->seeProductNameInPage($this->product['name']); + StorefrontCategoryPage::of($I)->seeProductPriceInPage($this->product['name'], $this->product['price']); $I->wantTo('verify simple product data in frontend product page.'); - ProductPage::of($I)->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); - ProductPage::of($I)->seeProductNameInPage($this->product['name']); - ProductPage::of($I)->seeProductPriceInPage($this->product['price']); - ProductPage::of($I)->seeProductStockStatusInPage($this->product['stock_status']); - ProductPage::of($I)->seeProductSkuInPage($this->product['sku']); + StorefrontProductPage::of($I)->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); + StorefrontProductPage::of($I)->seeProductNameInPage($this->product['name']); + StorefrontProductPage::of($I)->seeProductPriceInPage($this->product['price']); + StorefrontProductPage::of($I)->seeProductStockStatusInPage($this->product['stock_status']); + StorefrontProductPage::of($I)->seeProductSkuInPage($this->product['sku']); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index e46469e9d..05fb6ac6e 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -6,8 +6,8 @@ use Magento\Xxyyzz\Step\Catalog\Api\ProductApiStep; use Magento\Xxyyzz\Page\Catalog\AdminProductGridPage; use Magento\Xxyyzz\Page\Catalog\AdminProductPage; -use Magento\Xxyyzz\Page\Catalog\CategoryPage; -use Magento\Xxyyzz\Page\Catalog\ProductPage; +use Magento\Xxyyzz\Page\Catalog\StorefrontCategoryPage; +use Magento\Xxyyzz\Page\Catalog\StorefrontProductPage; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Title; @@ -119,14 +119,14 @@ public function updateSimpleProductTest(AdminStep $I) ); $I->wantTo('verify simple product data in frontend category page.'); - CategoryPage::of($I)->amOnCategoryPage($this->category['url_key']); - CategoryPage::of($I)->seeProductNameInPage($this->product['name'] . '-updated'); - CategoryPage::of($I)->seeProductPriceInPage($this->product['name'] . '-updated', $this->product['price'] + 10); + StorefrontCategoryPage::of($I)->amOnCategoryPage($this->category['url_key']); + StorefrontCategoryPage::of($I)->seeProductNameInPage($this->product['name'] . '-updated'); + StorefrontCategoryPage::of($I)->seeProductPriceInPage($this->product['name'] . '-updated', $this->product['price'] + 10); $I->wantTo('verify simple product data in frontend product page.'); - ProductPage::of($I)->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); - ProductPage::of($I)->seeProductNameInPage($this->product['name'] . '-updated'); - ProductPage::of($I)->seeProductPriceInPage($this->product['price'] + 10); - ProductPage::of($I)->seeProductSkuInPage($this->product['sku'] . '-updated'); + StorefrontProductPage::of($I)->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); + StorefrontProductPage::of($I)->seeProductNameInPage($this->product['name'] . '-updated'); + StorefrontProductPage::of($I)->seeProductPriceInPage($this->product['price'] + 10); + StorefrontProductPage::of($I)->seeProductSkuInPage($this->product['sku'] . '-updated'); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php index 6d2499153..d8ff64c29 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php @@ -21,7 +21,7 @@ * @Features({"Pages"}) * * Codeception annotations - * @group content + * @group cms * @group pages * @env chrome * @env firefox diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php new file mode 100644 index 000000000..8d502469c --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php @@ -0,0 +1,74 @@ +customer = $I->getCustomerApiDataWithPassword(); + $this->customer = array_merge($this->customer['customer'], $this->customer); + unset($this->customer['customer']); + } + + /** + * Create customer. + * + * Allure annotations + * @Description("Method Description: Create customer") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "Admin", value = "$I") + * + * Codeception annotations + * @group customer + * @env chrome + * @env firefox + * @env phantomjs + * + * @param AcceptanceTester $I + * @return void + */ + public function createCustomerTest(AcceptanceTester $I) + { + $I->wantTo('create customer in frontend page.'); + StorefrontCustomerAccountCreatePage::of($I)->amOnCustomerAccountCreatePage(); + StorefrontCustomerAccountCreatePage::of($I)->fillFieldFirstName($this->customer['firstname']); + StorefrontCustomerAccountCreatePage::of($I)->fillFieldLastName($this->customer['lastname']); + StorefrontCustomerAccountCreatePage::of($I)->setNewsletterSubscribe(true); + StorefrontCustomerAccountCreatePage::of($I)->fillFieldEmail($this->customer['email']); + StorefrontCustomerAccountCreatePage::of($I)->fillFieldPassword($this->customer['password']); + StorefrontCustomerAccountCreatePage::of($I)->fillFieldConfirmPassword($this->customer['password']); + StorefrontCustomerAccountCreatePage::of($I)->clickCreateAccountButton(); + StorefrontCustomerAccountDashboardPage::of($I)->seeContactInformationName( + $this->customer['firstname'] . ' ' . $this->customer['lastname'] + ); + StorefrontCustomerAccountDashboardPage::of($I)->seeContactInformationEmail($this->customer['email']); + StorefrontCustomerAccountDashboardPage::of($I)->seeNewsletterText('subscribed'); + } +} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php new file mode 100644 index 000000000..501b5eafb --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php @@ -0,0 +1,74 @@ +customer = $I->getCustomerApiDataWithPassword(); + $api->amAdminTokenAuthenticated(); + $this->customer = array_merge($this->customer, ['id' => $api->createCustomer($this->customer)]); + $this->customer = array_merge($this->customer['customer'], $this->customer); + unset($this->customer['customer']); + } + + /** + * Create customer. + * + * Allure annotations + * @Description("Method Description: Create customer") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "Admin", value = "$I") + * + * Codeception annotations + * @group customer + * @env chrome + * @env firefox + * @env phantomjs + * + * @param AcceptanceTester $I + * @return void + */ + public function createCustomerTest(AcceptanceTester $I) + { + $I->wantTo('create customer in frontend page.'); + StorefrontCustomerAccountLoginPage::of($I)->amOnCustomerAccountLoginPage(); + StorefrontCustomerAccountLoginPage::of($I)->fillFieldCustomerEmail($this->customer['email']); + StorefrontCustomerAccountLoginPage::of($I)->fillFieldCustomerPassword($this->customer['password']); + StorefrontCustomerAccountLoginPage::of($I)->clickSignInButton(); + + StorefrontCustomerAccountDashboardPage::of($I)->seeContactInformationName( + $this->customer['firstname'] . ' ' . $this->customer['lastname'] + ); + StorefrontCustomerAccountDashboardPage::of($I)->seeContactInformationEmail($this->customer['email']); + StorefrontCustomerAccountDashboardPage::of($I)->seeNewsletterText('subscribed to'); + } +} From b13c0586dcd5293a9405dda38a52efe6ed12a404 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 20 Apr 2017 12:58:53 -0500 Subject: [PATCH 044/149] Adding Allure annotations to all Tests - Adding Allure annotations to all Tests (cherry picked from commit 06080c5) --- .../Backend/AccessAdminPagesDirectlyCest.php | 33 ++- .../AccessAdminPagesViaNavMenuCest.php | 203 ++++++++++++++---- .../Backend/OpenEachSideNavMenuCest.php | 31 ++- .../Acceptance/Catalog/CreateCategoryCest.php | 20 +- .../Catalog/CreateSimpleProductCest.php | 33 ++- .../Catalog/UpdateSimpleProductCest.php | 22 +- .../Acceptance/Cms/CreateContentPageCest.php | 58 +++-- .../Customer/CreateCustomerCest.php | 96 +++++++-- .../User/AccessAdminLoginPageCest.php | 27 ++- .../User/AccessForgotYourPasswordCest.php | 70 ++++-- .../CannotAccessAdminAfterLoggingOutCest.php | 28 ++- .../User/CannotAccessAdminPagesCest.php | 33 ++- .../User/LoginOnAdminLoginPageCest.php | 28 +++ .../Acceptance/User/LogoutAfterLoginCest.php | 27 +++ 14 files changed, 563 insertions(+), 146 deletions(-) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php index 88fbe41b8..c5062228f 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php @@ -2,9 +2,30 @@ namespace Magento\Xxyyzz\Acceptance\Backend; use Magento\Xxyyzz\Step\Backend\AdminStep; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class AccessAdminPagesDirectlyCest + * + * Allure annotations + * @Features({"Login"}) + * @Stories({"Direct Admin Access"}) + * @Title("Access each Admin page directly") + * @Description("Attempt to access all Main Admin pages directly after logging in as an Admin.") + * + * Codeception annotations * @group skip + * @group slow + * @group admin-direct-access + * @env chrome + * @env firefox + * @env phantomjs */ class AccessAdminPagesDirectlyCest { @@ -14,10 +35,14 @@ public function _before(AdminStep $I) } /** - * @env chrome - * @env firefox - * @env phantomjs - * @group slow + * Allure annotations + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "AdminStep", value = "$I") + * @TestCaseId("") + * + * Codeception annotations + * @param AdminStep $I + * @return void */ public function shouldBeAbleToAccessEachAdminPageDirectly(AdminStep $I) { diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index b811bda04..9460357bf 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -3,9 +3,29 @@ use Magento\Xxyyzz\Page\Backend\AdminSideNavigation as SideNav; use Magento\Xxyyzz\Step\Backend\AdminStep; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class AccessAdminPagesViaNavMenuCest + * + * Allure annotations + * @Features({"Admin Nav Menu"}) + * @Stories({"Access Admin pages via the Admin Nav Menu"}) + * @Title("Access each Admin page via Nav Menu") + * @Description("Attempt to access all Main Admin pages using the Nav Menu after logging in as an Admin.") + * + * Codeception annotations * @group skip + * @group slow + * @group nav-menu-access + * @env chrome + * @env firefox */ class AccessAdminPagesViaNavMenuCest { @@ -14,25 +34,41 @@ public function _before(AdminStep $I) $I->loginAsAdmin(); } - // Dashboard Menu Test /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("DASHBOARD Menu Test") + * @Description("Attempt to access the DASHBOARD via the Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnTheDashboardPage(AdminStep $I, SideNav $sideNavMenu) { - $I->wantTo('see if I can access the DASHBOARD Page using the Side Nav Menus'); + $I->wantTo('see if I can access the DASHBOARD Page using the Side Nav Menu.'); $I->goToRandomAdminPage(); $sideNavMenu->clickOnDashboardInTheSideNavMenu(); $I->shouldBeOnTheAdminDashboardPage(); } - // Sales Menu Tests /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("SALES Menu Tests") + * @Description("Attempt to access all of the SALES pages using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnEachOfTheSalesPages(AdminStep $I, SideNav $sideNavMenu) { @@ -62,15 +98,23 @@ public function shouldLandOnEachOfTheSalesPages(AdminStep $I, SideNav $sideNavMe $I->shouldBeOnTheAdminSalesTransactionsPage(); } - // Products Menu Tests /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("PRODUCT Menu Tests") + * @Description("Attempt to access all of the PRODUCT pages using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnEachOfTheProductsPages(AdminStep $I, SideNav $sideNavMenu) { - $I->wantTo('see if I can access each of the PRODUCTS Admin Pages using the Side Nav Menus'); + $I->wantTo('see if I can access each of the PRODUCT Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnProductsInTheSideNavMenu(); $sideNavMenu->clickOnCatalogInTheProductNavMenu(); $I->shouldBeOnTheAdminProductsCatalogPage(); @@ -80,15 +124,23 @@ public function shouldLandOnEachOfTheProductsPages(AdminStep $I, SideNav $sideNa $I->shouldBeOnTheAdminProductsCategoriesPage(); } - // Customers Menu Tests /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("CUSTOMER Menu Tests") + * @Description("Attempt to access all of the CUSTOMER pages using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLanOnEachOfTheCustomersPages(AdminStep $I, SideNav $sideNavMenu) { - $I->wantTo('see if I can access each of the CUSTOMERS Admin Pages using the Side Nav Menus'); + $I->wantTo('see if I can access each of the CUSTOMER Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnCustomersInTheSideNavMenu(); $sideNavMenu->clickOnAllCustomersInTheCustomersNavMenu(); $I->shouldBeOnTheAdminCustomersAllCustomersPage(); @@ -100,9 +152,18 @@ public function shouldLanOnEachOfTheCustomersPages(AdminStep $I, SideNav $sideNa // Marketing Menu Tests /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("MARKETING Menu Tests") + * @Description("Attempt to access all of the MARKETING pages using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnEachOfTheMarketingPages(AdminStep $I, SideNav $sideNavMenu) { @@ -154,9 +215,18 @@ public function shouldLandOnEachOfTheMarketingPages(AdminStep $I, SideNav $sideN // Content Menu Tests /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("CONTENT Menu Tests") + * @Description("Attempt to access all of the CONTENT pages using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnEachOfTheContentPages(AdminStep $I, SideNav $sideNavMenu) { @@ -186,15 +256,23 @@ public function shouldLandOnEachOfTheContentPages(AdminStep $I, SideNav $sideNav $I->shouldBeOnTheAdminContentSchedulePage(); } - // Reports Menu Tests /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("REPORT Menu Tests") + * @Description("Attempt to access all of the REPORT pages using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnEachOfTheReportsPages(AdminStep $I, SideNav $sideNavMenu) { - $I->wantTo('see if I can access each of the REPORTS Admin Pages using the Side Nav Menu'); + $I->wantTo('see if I can access each of the REPORT Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnProductsInCartInTheReportsNavMenu(); $I->shouldBeOnTheAdminReportsProductsInCartPage(); @@ -288,15 +366,23 @@ public function shouldLandOnEachOfTheReportsPages(AdminStep $I, SideNav $sideNav $I->shouldBeOnTheAdminReportRefreshStatisticsPage(); } - // Stores Menu Tests /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("STORE Menu Tests") + * @Description("Attempt to access all of the STORE pages using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnEachOfTheStoresPages(AdminStep $I, SideNav $sideNavMenu) { - $I->wantTo('see if I can access each of the STORES Admin Pages using the Side Nav Menu'); + $I->wantTo('see if I can access each of the STORE Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnAllStoresInTheStoresNavMenu(); $I->shouldBeOnTheAdminStoresAllStoresPage(); @@ -348,9 +434,18 @@ public function shouldLandOnEachOfTheStoresPages(AdminStep $I, SideNav $sideNavM // System Menu Tests /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("SYSTEM Menu Tests") + * @Description("Attempt to access all of the SYSTEM pages using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnEachOfTheSystemPages(AdminStep $I, SideNav $sideNavMenu) { @@ -413,13 +508,22 @@ public function shouldLandOnEachOfTheSystemPages(AdminStep $I, SideNav $sideNavM } /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("WEB SETUP WIZARD Menu Test") + * @Description("Attempt to access all of the WEB SETUP WIZARD page using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnTheWebSetupWizardPage(AdminStep $I, SideNav $sideNavMenu) { - $I->wantTo('see if I can access the Web Setup Wizard Admin Page using the Side Nav Menu'); + $I->wantTo('see if I can access the WEB SETUP WIZARD Admin Page using the Side Nav Menu'); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnWebSetupWizardInTheSystemNavMenu(); $I->shouldBeOnTheAdminSystemWebSetupWizardPage(); @@ -427,9 +531,18 @@ public function shouldLandOnTheWebSetupWizardPage(AdminStep $I, SideNav $sideNav } /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("PARTNERS & EXTENSIONS Menu Test") + * @Description("Attempt to access all of the PARTNERS & EXTENSIONS page using the Side Nav Menu.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param AdminStep $I + * @param SideNav $sideNavMenu + * @return void */ public function shouldLandOnThePartnersAndExtensionsPage(AdminStep $I, SideNav $sideNavMenu) { diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php index 95d9dcd24..8b88c8aea 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php @@ -3,9 +3,27 @@ use Magento\Xxyyzz\Page\Backend\AdminSideNavigation as SideNav; use Magento\Xxyyzz\Step\Backend\AdminStep; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class OpenEachSideNavMenuCest + * + * Allure annotations + * @Features({"Admin Nav Menu"}) + * @Stories({"Open each Admin Nav Menu"}) + * + * Codeception annotations * @group skip + * @group slow + * @group nav-menu + * @env chrome + * @env firefox */ class OpenEachSideNavMenuCest { @@ -15,9 +33,16 @@ public function _before(AdminStep $I) } /** - * @env chrome - * @env firefox - * @group slow + * Allure annotations + * @Title("Open each Admin Nav Menu") + * @Description("Attempt to open each of the Admin Nav Menus and verify all of the proper menus are displayed.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "SideNav", value = "$sideNavMenu") + * + * Codeception annotations + * @param SideNav $sideNavMenu + * @return void */ public function shouldBeAbleToOpenEachSideNavMenu(SideNav $sideNavMenu) { diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index ce774db1a..e6522f5cb 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -15,10 +15,18 @@ /** * Class CreateSubCategoryCest * - * @Stories({"Create sub category"}) - * @Features({"Create sub category"}) + * Allure annotations + * @Features({"Category"}) + * @Stories({"Create sub Category"}) * @Title("Create sub category with required fields") * @Description("Create sub category with required fields") + * + * Codeception annotations + * @group catalog + * @group add + * @env chrome + * @env firefox + * @env phantomjs */ class CreateCategoryCest { @@ -36,16 +44,12 @@ public function _after(AdminStep $I) * Create sub category in admin. * * Allure annotations + * @Title("Method Title: Create sub category with required fields") * @Description("Method Description: Create sub category with required fields") * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") * @Parameter(name = "Admin", value = "$I") * - * Codeception annotations - * @group catalog - * @env chrome - * @env firefox - * @env phantomjs - * * @param AdminStep $I * @return void */ diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index 4238bdaea..f3412a999 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -7,20 +7,27 @@ use Magento\Xxyyzz\Page\Catalog\StorefrontCategoryPage; use Magento\Xxyyzz\Page\Catalog\StorefrontProductPage; use Magento\Xxyyzz\Step\Catalog\Api\CategoryApiStep; -use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Title; use Yandex\Allure\Adapter\Annotation\Description; -use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; /** * Class CreateSimpleProductCest - * @Stories({"Create simple product"}) - * @Features({"Create simple product"}) - * @Title("Create simple product with required fields") - * @Description("Create simple product with required fields") + * + * Allure annotations + * @Features({"Catalog"}) + * @Stories({"Create a basic Product"}) + * + * Codeception annotations + * @group catalog + * @group add + * @env chrome + * @env firefox + * @env phantomjs */ class CreateSimpleProductCest { @@ -34,9 +41,6 @@ class CreateSimpleProductCest */ protected $product; - /** - * @param AdminStep $I - */ public function _before(AdminStep $I, CategoryApiStep $api) { $I->loginAsAdmin(); @@ -60,19 +64,14 @@ public function _after(AdminStep $I) } /** - * Create simple product in admin. - * * Allure annotations - * @Description("Method Description: Create simple product with required fields") + * @Title("Create a basic Product and verify on the Storefront") + * @Description("Create a basic Product in the Admin and verify the content on the Storefront.") * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") * @Parameter(name = "Admin", value = "$I") * * Codeception annotations - * @group catalog - * @env chrome - * @env firefox - * @env phantomjs - * * @param AdminStep $I * @return void */ diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index 05fb6ac6e..f962dff56 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -19,10 +19,17 @@ /** * Class UpdateSimpleProductCest * + * Allure annotations + * @Features({"Catalog"}) * @Stories({"Update simple product"}) - * @Features({"Update simple product"}) * @Title("Update simple product with required fields") * @Description("Update simple product with required fields") + * + * Codeception Annotations + * @group catalog + * @env chrome + * @env firefox + * @env phantomjs */ class UpdateSimpleProductCest { @@ -38,6 +45,8 @@ class UpdateSimpleProductCest /** * @param AdminStep $I + * @param CategoryApiStep $categoryApi + * @param ProductApiStep $productApi */ public function _before(AdminStep $I, CategoryApiStep $categoryApi, ProductApiStep $productApi) { @@ -74,14 +83,11 @@ public function _after(AdminStep $I) * Update simple product in admin. * * Allure annotations + * @Title("Mathod Title: Update simple product with required fields") + * @Description("Method Description: Update simple product with required fields") * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "Admin", value = "$I") - * - * Codeception annotations - * @group catalog - * @env chrome - * @env firefox - * @env phantomjs + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") * * @param AdminStep $I * @return void diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php index d8ff64c29..c4358f88c 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php @@ -2,23 +2,25 @@ namespace Magento\Xxyyzz\Acceptance\Cms; use Magento\Xxyyzz\Page\Cms\StorefrontCmsPage; +use Magento\Xxyyzz\Page\Cms\AdminCmsGrid; use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Page\Cms\AdminCmsPage; -use Magento\Xxyyzz\Page\AbstractFrontendPage; -use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Title; use Yandex\Allure\Adapter\Annotation\Description; -use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; /** * Class CreateContentPageCest * * Allure annotations - * @Stories({"Content - Page"}) - * @Features({"Pages"}) + * @Features({"Content"}) + * @Stories({"Exercise all Content Page fields", "Create a basic Content Page"}) + * @Title("Exercise all fields and create basic Content Page") + * @Description("Attempt to enter Text into all fields and then create a basic Content Page.") * * Codeception annotations * @group cms @@ -48,12 +50,15 @@ public function _after(AdminStep $I) /** * Allure annotations - * @Title("Enter text into every field on the Content - Page.") - * @Description("Enter text into ALL fields and verify the contents of the fields.") + * @Title("Enter text into every field on the ADD Content Page.") + * @Description("Enter text into ALL fields on the ADD Content Page and verify the content of the fields.") + * @Severity(level = SeverityLevel::NORMAL) + * @TestCaseId("") * @Parameter(name = "AdminStep", value = "$I") * @Parameter(name = "AdminCmsPage", value = "$adminCmsPage") * * Codeception annotations + * @group fields * @param AdminStep $I * @param AdminCmsPage $adminCmsPage * @return void @@ -116,40 +121,57 @@ public function verifyThatEachFieldOnTheContentPageWorks( /** * Allure annotations - * @Title("Create a new Content - Page using the REQUIRED fields only.") + * @Title("Create a basic Content Page") * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Storefront.") * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") * @Parameter(name = "AdminStep", value = "$I") * @Parameter(name = "AdminCmsPage", value = "$adminCmsPage") * @Parameter(name = "StorefrontCmsPage", value = "$storefrontCmsPage") * * Codeception annotations + * @group add * @param AdminStep $I + * @param AdminCmsGrid $adminCmsGrid * @param AdminCmsPage $adminCmsPage * @param StorefrontCmsPage $storefrontCmsPage * @return void */ public function createContentPageTest( AdminStep $I, + AdminCmsGrid $adminCmsGrid, AdminCmsPage $adminCmsPage, StorefrontCmsPage $storefrontCmsPage - ) + ) { $I->wantTo('verify content page in admin'); - $page = $I->getContentPage(); + $pageData = $I->getContentPage(); $adminCmsPage->clickOnPageContent(); - $adminCmsPage->enterPageTitle($page['pageTitle']); - $adminCmsPage->enterPageContentHeading($page['contentHeading']); - $adminCmsPage->enterPageContentBody($page['contentBody']); + $adminCmsPage->enterPageTitle($pageData['pageTitle']); + $adminCmsPage->enterPageContentHeading($pageData['contentHeading']); + $adminCmsPage->enterPageContentBody($pageData['contentBody']); + $adminCmsPage->clickOnPageSearchEngineOptimisation(); - $adminCmsPage->enterUrlKey($page['urlKey']); + $adminCmsPage->enterUrlKey($pageData['urlKey']); $adminCmsPage->savePage(); $adminCmsPage->seeSaveSuccessMessage(); - - $I->openNewTabGoToVerify($page['urlKey']); - $storefrontCmsPage->verifyPageContentTitle($page['contentHeading']); - $storefrontCmsPage->verifyPageContentBody($page['contentBody']); + + $I->openNewTabGoToVerify($pageData['urlKey']); + $storefrontCmsPage->verifyPageContentTitle($pageData['contentHeading']); + $storefrontCmsPage->verifyPageContentBody($pageData['contentBody']); + $I->closeNewTab(); + + $adminCmsGrid->performSearchByKeyword($pageData['urlKey']); + $adminCmsGrid->clickOnActionEditFor($pageData['urlKey']); + $adminCmsPage->clickOnPageContent(); + $adminCmsPage->clickOnPageSearchEngineOptimisation(); + + $adminCmsPage->verifyPageTitle($pageData['pageTitle']); + + $adminCmsPage->verifyPageContentHeading($pageData['contentHeading']); + $adminCmsPage->verifyPageContentBody($pageData['contentBody']); + $adminCmsPage->verifyUrlKey($pageData['urlKey']); } } \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php index c2dfc0e2b..cdaecfa9c 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php @@ -5,24 +5,25 @@ use Magento\Xxyyzz\Page\Customer\AdminCustomerGrid; use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Page\Cms\AdminCmsPage; -use Magento\Xxyyzz\Page\AbstractFrontendPage; -use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Title; use Yandex\Allure\Adapter\Annotation\Description; -use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; /** * Class CreateCustomerCest * * Allure annotations - * @Stories({"Customers - All Customers"}) - * @Features({"Customers"}) + * @Features({"Customer"}) + * @Stories({"Exercise all Customer fields", "Create a basic Customer", "Create a basic Customer with an Address"}) + * @Title("Exercise all fields, create basic Customer and basic Customer with an Address") + * @Description("Attempt to enter Text into all fields, create a basic Customer and create a basic Customer with an Address.") * * Codeception annotations - * @group customers + * @group customer * @env chrome * @env firefox * @env phantomjs @@ -43,12 +44,15 @@ public function _before( /** * Allure annotations - * @Title("Enter text into every field on the Customer - Page.") - * @Description("Enter text into ALL fields and verify the contents of the fields.") + * @Title("Enter text into every field on the ADD Customer page.") + * @Description("Enter text into ALL fields on the ADD Customer page and verify the contents of the fields.") + * @Severity(level = SeverityLevel::NORMAL) + * @TestCaseId("") * @Parameter(name = "AdminStep", value = "$I") * @Parameter(name = "AdminCustomerPage", value = "$customerPage") * * Codeception annotations + * @group fields * @param AdminStep $I * @param AdminCustomerPage $customerPage * @return void @@ -59,7 +63,7 @@ public function verifyThatEachFieldOnTheCustomerAddPageWorks( ) { $I->wantTo('verify that I can use all of the fields on the page.'); - $customerData = $I->getCustomerApiData(); + $customerData = $I->getCustomerData(); $customerPage->selectAssociateToWebsiteMainWebsite(); $customerPage->selectGroupWholesale(); @@ -93,24 +97,26 @@ public function verifyThatEachFieldOnTheCustomerAddPageWorks( * @Title("Create a new Customer account using the REQUIRED fields only.") * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Admin page.") * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCustomerPage", value = "$customerPage") + * @Parameter(name = "AdminCustomerPage", value = "$adminCustomerPage") + * @Parameter(name = "AdminCustomerGrid", value = "$adminCustomerGrid") * * Codeception annotations - * @group banana + * @group add * @param AdminStep $I * @param AdminCustomerPage $adminCustomerPage * @param AdminCustomerGrid $adminCustomerGrid * @return void */ - public function createCustomerAccountTest( + public function createBasicCustomerAccountTest( AdminStep $I, AdminCustomerPage $adminCustomerPage, AdminCustomerGrid $adminCustomerGrid ) { - $I->wantTo('verify Customer account in admin'); - $customer = $I->getCustomerApiData(); + $I->wantTo('verify basic Customer creation in admin'); + $customer = $I->getCustomerData(); $adminCustomerPage->enterFirstName($customer['firstname']); $adminCustomerPage->enterLastName($customer['lastname']); @@ -120,7 +126,7 @@ public function createCustomerAccountTest( $adminCustomerPage->clickOnAdminSaveButton(); $adminCustomerGrid->performSearchByKeyword($customer['email']); - + $adminCustomerGrid->clickOnActionLinkFor($customer['email']); $adminCustomerPage->clickOnAccountInformationLink(); @@ -130,4 +136,64 @@ public function createCustomerAccountTest( $adminCustomerPage->verifyAssociateToWebsiteMainWebsite(); $adminCustomerPage->verifyGroupGeneral(); } + + /** + * Allure annotations + * @Title("Create a new Customer account using the REQUIRED fields with an Address.") + * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Admin page.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminCustomerPage", value = "$adminCustomerPage") + * @Parameter(name = "AdminCustomerGrid", value = "$adminCustomerGrid") + * + * Codeception annotations + * @group skip + * @group add + * @param AdminStep $I + * @param AdminCustomerPage $adminCustomerPage + * @param AdminCustomerGrid $adminCustomerGrid + * @return void + */ + public function createBasicCustomerAccountWithAddressTest( + AdminStep $I, + AdminCustomerPage $adminCustomerPage, + AdminCustomerGrid $adminCustomerGrid + ) + { + $I->wantTo('verify basic Customer creation in admin'); + $customer = $I->getCustomerData(); + + $adminCustomerPage->enterFirstName($customer['firstname']); + $adminCustomerPage->enterLastName($customer['lastname']); + $adminCustomerPage->enterEmailAddress($customer['email']); + $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); + $adminCustomerPage->selectGroupGeneral(); + + $adminCustomerPage->clickOnAddressesLink(); + $adminCustomerPage->clickOnAddNewAddressButton(); + + $adminCustomerPage->enterAddAddressPrefix($customer['prefix']); + $adminCustomerPage->enterAddAddressFirstName($customer['firstname']); + $adminCustomerPage->enterAddAddressMiddleName($customer['middlename']); + $adminCustomerPage->enterAddAddressLastName($customer['lastname']); + $adminCustomerPage->enterAddAddressSuffix($customer['suffix']); + $adminCustomerPage->enterAddAddressCompany($customer['company']); + $adminCustomerPage->enterAddAddressAddress1($customer['address']['address1']); + $adminCustomerPage->enterAddAddressAddress2($customer['address']['address2']); + $adminCustomerPage->enterAddAddressCity($customer['address']['city']); + $adminCustomerPage->enterAddAddressCountry($customer['address']['country']); + $adminCustomerPage->enterAddAddressStateProvince($customer['address']['state']); + $adminCustomerPage->enterAddAddressZipPostalCode($customer['address']['zipCode']); + $adminCustomerPage->enterAddAddressPhoneNumber($customer['phoneNumber']); + $adminCustomerPage->enterAddAddressVatNumber($customer['taxVatNumber']); + + $adminCustomerPage->clickOnAdminSaveButton(); + $adminCustomerGrid->performSearchByKeyword($customer['email']); + + $adminCustomerGrid->clickOnActionLinkFor($customer['email']); + $adminCustomerPage->clickOnAccountInformationLink(); + + + } } \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php index dbcd793d9..b3906c4ec 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php @@ -2,15 +2,40 @@ namespace Magento\Xxyyzz\Acceptance\User; use Magento\Xxyyzz\Step\Backend\AdminStep; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class LogoutAfterLoginCest + * + * Allure annotations + * @Features({"Admin Login"}) + * @Stories({"Access Admin Login Page"}) + * + * Codeception annotations * @env chrome * @env firefox * @env phantomjs - * @group smoke */ class AccessAdminLoginPageCest { + /** + * Allure annotations + * @Title("You should be able to access the Admin Login Page") + * @Description("You should land on the Admin Login Page when you attempt to access it.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * + * Codeception annotations + * @param AdminStep $I + * @return void + */ public function shouldBeAbleToAccessTheAdminLoginPage(AdminStep $I) { $I->am('an Admin'); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php index d3eab36af..0029bc93f 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php @@ -3,18 +3,25 @@ use Magento\Xxyyzz\Page\Backend\AdminLogin; use Magento\Xxyyzz\Step\Backend\AdminStep; -use Yandex\Allure\Adapter\Annotation\Title; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Stories; -use Yandex\Allure\Adapter\Annotation\Severity; -use Yandex\Allure\Adapter\Annotation\TestCaseId; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class AccessForgotYourPasswordCest + * + * Allure annotations * @Features("Admin Login") * @Stories("Forgot Your Password") - * @TestCaseId("ZEP-1") - * @group test + * + * Codeception annotations + * @env chrome + * @env firefox + * @env phantomjs */ class AccessForgotYourPasswordCest { @@ -24,15 +31,22 @@ public function _before(AdminStep $I) } /** - * @env chrome - * @env firefox - * @env phantomjs + * Allure annotations * @Title("You should land on the Forgot Your Password page.") - * @Severity("critical") - * @Parameter("My Param") + * @Description("You should be able to access the Forgot Your Password page.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminLogin", value = "$adminLogin") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminLogin $adminLogin + * @return void */ public function shouldLandOnTheForgotYourPasswordPage(AdminStep $I, AdminLogin $adminLogin) { + $I->am('an Admin'); $I->wantTo('see if I can access the Forgot Your Password page'); $adminLogin->clickOnForgotYourPassword(); $I->shouldBeOnTheForgotYourPasswordPage(); @@ -41,14 +55,22 @@ public function shouldLandOnTheForgotYourPasswordPage(AdminStep $I, AdminLogin $ } /** - * @env chrome - * @env firefox - * @env phantomjs - * @Title("You should land on the Login page after clicking on 'Back to Sign In'.") - * @Severity("trivial") + * Allure annotations + * @Title("You should be able to access the Login page from the Forgot Your Password page") + * @Description("You should land on the Login page after clicking on 'Back to Sign In'.") + * @Severity(level = SeverityLevel::TRIVIAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminLogin", value = "$adminLogin") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminLogin $adminLogin + * @return void */ public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(AdminStep $I, AdminLogin $adminLogin) { + $I->am('an Admin'); $I->wantTo('see if I can access the Login page from the Forgot Your Password page'); $adminLogin->clickOnForgotYourPassword(); $adminLogin->clickOnBackToSignIn(); @@ -56,14 +78,22 @@ public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(AdminStep $I, } /** - * @env chrome - * @env firefox - * @env phantomjs - * @Title("You should land on the Login page after clicking on the Logo.") - * @Severity("normal") + * Allure annotations + * @Title("You should be able to access the Login page from the Forgot Your Password page") + * @Description("You should land on the Login page after clicking on the Logo.") + * @Severity(level = SeverityLevel::TRIVIAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminLogin", value = "$adminLogin") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminLogin $adminLogin + * @return void */ public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(AdminStep $I, AdminLogin $adminLogin) { + $I->am('an Admin'); $I->wantTo('see if I can access the Login page by clicking on the Logo'); $adminLogin->clickOnMagentoLogo(); $I->shouldBeOnTheAdminLoginPage(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php index e9f6f194d..28802f63c 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php @@ -2,17 +2,43 @@ namespace Magento\Xxyyzz\Acceptance\User; use Magento\Xxyyzz\Step\Backend\AdminStep; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class CannotAccessAdminAfterLoggingOutCest + * + * Allure annotations + * @Features({"Admin Login"}) + * @Stories({"Prevent access after Logging Out"}) + * + * Codeception annotations * @env chrome * @env firefox * @env phantomjs - * @group smoke */ class CannotAccessAdminAfterLoggingOutCest { + /** + * Allure annotations + * @Title("YOu should NOT be able to access an Admin page after your Logged Out.") + * @Description("Attempt to access an Admin page after Logging Out.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * + * Codeception annotations + * @param AdminStep $I + * @return void + */ public function shouldNotBeAbleToAccessAdminAfterLogout(AdminStep $I) { + $I->am('an Admin'); $I->wantTo('make sure you cannot access Admin pages after logging out'); $I->loginAsAdmin(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php index c77b2504a..9cb6c27d5 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php @@ -2,16 +2,43 @@ namespace Magento\Xxyyzz\Acceptance\User; use Magento\Xxyyzz\Step\Backend\AdminStep; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class CannotAccessAdminPagesCest + * + * Allure annotations + * @Features({"Admin Login"}) + * @Stories({"Prevent access before Logging In"}) + * + * Codeception annotations * @env chrome * @env firefox * @env phantomjs */ class CannotAccessAdminPagesCest { + /** + * Allure annotations + * @Title("You should NOT be able to access the Admin when not Logged In.") + * @Description("Attempt to access an Admin page before Logging In.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * + * Codeception annotations + * @param AdminStep $I + * @return void + */ public function shouldNotBeAbleToAccessAdminPagesWhenNotLoggedIn(AdminStep $I) { + $I->am('an Admin'); $I->wantTo('make sure you cannot access Admin pages when NOT logged in'); $I->goToTheAdminLoginPage(); @@ -23,11 +50,5 @@ public function shouldNotBeAbleToAccessAdminPagesWhenNotLoggedIn(AdminStep $I) $I->goToRandomAdminPage(); $I->shouldBeOnTheAdminLoginPage(); - - $I->goToRandomAdminPage(); - $I->shouldBeOnTheAdminLoginPage(); - - $I->goToRandomAdminPage(); - $I->shouldBeOnTheAdminLoginPage(); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php index bdd5a0a79..fb83e1f9a 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php @@ -2,16 +2,44 @@ namespace Magento\Xxyyzz\Acceptance\User; use Magento\Xxyyzz\Step\Backend\AdminStep; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class LoginOnAdminLoginPageCest + * + * Allure annotations + * @Features({"Admin Login"}) + * @Stories({"Logging In"}) + * + * Codeception annotations * @env chrome * @env firefox * @env phantomjs */ class LoginOnAdminLoginPageCest { + + /** + * Allure annotations + * @Title("You should be able to Login to the Admin") + * @Description("You should land on the Admin Dashboard after Logging In.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * + * Codeception annotations + * @param AdminStep $I + * @return void + */ public function shouldBeAbleToLogin(AdminStep $I) { + $I->am('an Admin'); $I->wantTo('verify that I can login via the Admin Login page'); $I->loginAsAdmin(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php index c3d82ad2d..0a3d65270 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php @@ -2,16 +2,43 @@ namespace Magento\Xxyyzz\Acceptance\User; use Magento\Xxyyzz\Step\Backend\AdminStep; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; /** + * Class LogoutAfterLoginCest + * + * Allure annotations + * @Features({"Admin Login"}) + * @Stories({"Logging Out"}) + * + * Codeception annotations * @env chrome * @env firefox * @env phantomjs */ class LogoutAfterLoginCest { + /** + * Allure annotations + * @Title("You should be able to Logout of the Admin") + * @Description("You should land on the Login page after Logging Out.") + * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * + * Codeception annotations + * @param AdminStep $I + * @return void + */ public function shouldBeAbleToLogout(AdminStep $I) { + $I->am('an Admin'); $I->wantTo('logout of the Admin area and land on the Login page'); $I->loginAsAdmin(); From 0ac1fea918ed0f68fb6d30056a524ba5cdc1baa6 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 20 Apr 2017 15:18:57 -0500 Subject: [PATCH 045/149] Adding reference for TestCaseId - Adding Allure references for TestCaseId - Remove extra Title and Description tags (cherry picked from commit 1602cac) --- .../Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php | 3 +-- .../Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php | 3 +-- .../Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php | 1 + .../Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php | 1 + .../Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php | 1 + .../Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php | 1 + .../Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php | 3 +-- .../Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php | 1 + .../Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php | 1 + .../Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php | 1 + .../Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php | 1 + .../Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php | 1 + .../Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php | 1 + 13 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php index c5062228f..c88525bbc 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php @@ -9,6 +9,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class AccessAdminPagesDirectlyCest @@ -16,8 +17,6 @@ * Allure annotations * @Features({"Login"}) * @Stories({"Direct Admin Access"}) - * @Title("Access each Admin page directly") - * @Description("Attempt to access all Main Admin pages directly after logging in as an Admin.") * * Codeception annotations * @group skip diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index 9460357bf..76e0ed08a 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -10,6 +10,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class AccessAdminPagesViaNavMenuCest @@ -17,8 +18,6 @@ * Allure annotations * @Features({"Admin Nav Menu"}) * @Stories({"Access Admin pages via the Admin Nav Menu"}) - * @Title("Access each Admin page via Nav Menu") - * @Description("Attempt to access all Main Admin pages using the Nav Menu after logging in as an Admin.") * * Codeception annotations * @group skip diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php index 8b88c8aea..442db1988 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php @@ -10,6 +10,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class OpenEachSideNavMenuCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index e6522f5cb..b69ca398e 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -11,6 +11,7 @@ use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class CreateSubCategoryCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index f3412a999..b7ed486fe 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -14,6 +14,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class CreateSimpleProductCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index f962dff56..3195d575d 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -15,6 +15,7 @@ use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class UpdateSimpleProductCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php index c4358f88c..0b98af8fc 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php @@ -12,6 +12,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class CreateContentPageCest @@ -19,8 +20,6 @@ * Allure annotations * @Features({"Content"}) * @Stories({"Exercise all Content Page fields", "Create a basic Content Page"}) - * @Title("Exercise all fields and create basic Content Page") - * @Description("Attempt to enter Text into all fields and then create a basic Content Page.") * * Codeception annotations * @group cms diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php index b3906c4ec..eb6f0e77e 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php @@ -9,6 +9,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class LogoutAfterLoginCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php index 0029bc93f..c268d7625 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php @@ -10,6 +10,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class AccessForgotYourPasswordCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php index 28802f63c..81d3f86f7 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php @@ -9,6 +9,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class CannotAccessAdminAfterLoggingOutCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php index 9cb6c27d5..bec537445 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php @@ -9,6 +9,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class CannotAccessAdminPagesCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php index fb83e1f9a..7a9173166 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php @@ -9,6 +9,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class LoginOnAdminLoginPageCest diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php index 0a3d65270..795f5d108 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php @@ -9,6 +9,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class LogoutAfterLoginCest From 86b42d670089f7c5bfe7173b9a42a0cab17b674c Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 20 Apr 2017 15:21:04 -0500 Subject: [PATCH 046/149] Adding closeTab/waitForLoadingMaskToDisappear/scrollToTopOfPage function. - Adding a function for closeNewTab() - Adding a waitForLoadingMaskToDisappear() function to the Acceptance Tester class - Adding scrollToTopOfPage() function to Acceptance Tester class (cherry picked from commit de4e780) --- .../_support/Magento/Xxyyzz/AcceptanceTester.php | 15 +++++++++++++++ .../Magento/Xxyyzz/Page/AbstractAdminGridPage.php | 15 ++++----------- .../Magento/Xxyyzz/Step/Backend/AdminStep.php | 6 ++++++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/AcceptanceTester.php b/tests/_support/Magento/Xxyyzz/AcceptanceTester.php index 4c8fa87a7..a82a6b385 100644 --- a/tests/_support/Magento/Xxyyzz/AcceptanceTester.php +++ b/tests/_support/Magento/Xxyyzz/AcceptanceTester.php @@ -23,4 +23,19 @@ class AcceptanceTester extends \Codeception\Actor /** * Define custom actions here */ + public static $loadingMask = '.loading-mask'; + public static $gridLoadingMask = '.admin__data-grid-loading-mask'; + + public function waitForLoadingMaskToDisappear() + { + $I = $this; + $I->waitForElementNotVisible(self::$loadingMask, 30); + $I->waitForElementNotVisible(self::$gridLoadingMask, 30); + } + + public function scrollToTopOfPage() + { + $I = $this; + $I->executeJS('window.scrollTo(0,0);'); + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php index 27a2463cc..2a630c581 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php @@ -19,7 +19,6 @@ abstract class AbstractAdminGridPage public static $filtersButton = '.data-grid-filters-action-wrap .action-default'; // TODO: Add Filter selectors - public static $clearAllFiltersLink = '.action-clear[data-action="grid-filter-reset"]'; public static $viewButton = '.admin__data-grid-action-bookmarks .admin__action-dropdown'; public static $viewDropDownMenu = '.admin__data-grid-action-bookmarks .admin__action-dropdown-menu'; @@ -86,13 +85,6 @@ public static function route($param) return static::$URL.$param; } - public function waitForLoadingMaskToDisappear() - { - $I = $this->acceptanceTester; - $I->waitForElementNotVisible(self::$loadingMask, 30); - $I->waitForElementNotVisible(self::$gridLoadingMask, 30); - } - public function enterSearchKeyword($searchKeyboard) { $I = $this->acceptanceTester; @@ -107,9 +99,11 @@ public function clickOnTheSearchButton() public function performSearchByKeyword($searchKeyword) { + $I = $this->acceptanceTester; self::enterSearchKeyword($searchKeyword); + $I->waitForLoadingMaskToDisappear(); self::clickOnTheSearchButton(); - self::waitForLoadingMaskToDisappear(); + $I->waitForLoadingMaskToDisappear(); } public function clickOnFiltersButton() @@ -228,7 +222,6 @@ public function clickOnPerPageButton() { $I = $this->acceptanceTester; $I->click(self::$perPageCountButton); - $I->wait(1); } public function clickOnSpecificPerPageCount($itemsPerPage) @@ -293,6 +286,6 @@ public function clickOnActionLinkFor($keyText) $actionLinkSelector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] .action-menu-item'; $I->click($actionLinkSelector); - self::waitForLoadingMaskToDisappear(); + $I->waitForLoadingMaskToDisappear(); } } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php index 1673eeff3..a1fdd4bd6 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php +++ b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php @@ -12,6 +12,12 @@ public function openNewTabGoToVerify($url) $I->amOnPage($url); $I->seeInCurrentUrl($url); } + + public function closeNewTab() + { + $I = $this; + $I->closeTab(); + } public function goToTheAdminLoginPage() { From 9123f7d66b2f860e03c411d0a348f8427dab4a0e Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 20 Apr 2017 15:22:16 -0500 Subject: [PATCH 047/149] Adding Customer Tests and Page Objects - Adding Customer Page Object - Adding Customer tests - Fixed the Data Type for the Data Generator (cherry picked from commit 13df094) --- .../Xxyyzz/Module/MagentoFakerData.php | 7 +- .../Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php | 52 ++++ .../Page/Customer/AdminCustomerGrid.php | 6 +- .../Page/Customer/AdminCustomerPage.php | 254 +++++++++++++++++- .../Customer/CreateCustomerCest.php | 217 ++++++++++----- 5 files changed, 459 insertions(+), 77 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index 20b71d605..bef8589f5 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -137,11 +137,12 @@ public function getCustomerData(array $additional = []) 'website_id' => 1, 'taxVatNumber' => \Faker\Provider\at_AT\Payment::vat(), 'company' => $faker->company, + 'phoneNumber' => $faker->phoneNumber, 'address' => [ - 'address1' => $faker->address, - 'address2' => $faker->address, + 'address1' => $faker->streetAddress, + 'address2' => $faker->streetAddress, 'city' => $faker->city, - 'country' => $faker->country, + 'country' => 'United States', 'state' => \Faker\Provider\en_US\Address::state(), 'zipCode' => $faker->postcode ] diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php new file mode 100644 index 000000000..1c2fadf21 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php @@ -0,0 +1,52 @@ +acceptanceTester; + $actionSelectLinkSelector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] .action-select'; + + $I->click($actionSelectLinkSelector); + } + + public function clickOnActionEditFor($keyText) + { + $I = $this->acceptanceTester; + $selector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] ' . self::$actionEdit; + + self::clickOnActionSelectLinkFor($keyText); + $I->click($selector); + self::waitForLoadingMaskToDisappear(); + } + + public function clickOnActionDeleteFor($keyText) + { + $I = $this->acceptanceTester; + $selector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] ' . self::$actionEdit; + + self::clickOnActionSelectLinkFor($keyText); + $I->click($selector); + self::waitForLoadingMaskToDisappear(); + } + + public function clickOnActionViewFor($keyText) + { + $I = $this->acceptanceTester; + $selector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] ' . self::$actionEdit; + + self::clickOnActionSelectLinkFor($keyText); + $I->click($selector); + self::waitForLoadingMaskToDisappear(); + } +} \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php index be14dd1fd..31bf2f911 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php @@ -5,12 +5,8 @@ class AdminCustomerGrid extends AbstractAdminGridPage { - /** - * Include url of current page. - */ - public static $URL = '/admin/customer/index/'; - /** * Declare UI map for this page here. CSS or XPath allowed. */ + } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php index 06865e15a..913390c89 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php @@ -1,6 +1,7 @@ acceptanceTester; + $I->scrollToTopOfPage(); $I->click(self::$accountInformationLink); } public function clickOnAddressesLink() { $I = $this->acceptanceTester; + $I->scrollToTopOfPage(); $I->click(self::$addressesLink); } @@ -350,4 +372,234 @@ public function verifySendWelcomeEmailFromDefaultStoreView() { self::verifySendWelcomeEmailFrom('Default Store View'); } + + public function clickOnAddNewAddressButton() + { + $I = $this->acceptanceTester; + $I->click(self::$addNewAddressesButton); + } + + public function clickOnAddNewAddressDefaultBillingAddress() + { + $I = $this->acceptanceTester; + $I->click(self::$newAddressDefaultBilling); + } + + public function verifyAddAddressDefaultBillingAddress($expectedState) + { + $I = $this->acceptanceTester; + if ($expectedState) { + $I->seeCheckboxIsChecked(self::$newAddressDefaultBilling); + } else { + $I->dontSeeCheckboxIsChecked(self::$newAddressDefaultBilling); + } + } + + public function verifyAddAddressDefaultShippingAddress($expectedState) + { + $I = $this->acceptanceTester; + if ($expectedState) { + $I->seeCheckboxIsChecked(self::$newAddressDefaultShipping); + } else { + $I->dontSeeCheckboxIsChecked(self::$newAddressDefaultShipping); + } + } + + public function clickOnAddNewAddressDefaultShippingAddress() + { + $I = $this->acceptanceTester; + $I->click(self::$newAddressDefaultShipping); + } + + public function enterAddAddressPrefix($prefix) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addPrefixField, $prefix); + } + + public function verifyAddAddressPrefix($prefix) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addPrefixField, $prefix); + } + + public function clickAndSendKeys($selector) + { + $I = $this->acceptanceTester; + $I->click($selector); + $I->pressKey($selector, WebDriverKeys::SPACE); + $I->pressKey($selector, WebDriverKeys::BACKSPACE); + } + + public function enterAddAddressFirstName($firstName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addFirstNameField, $firstName); + self::clickAndSendKeys(self::$addFirstNameField); + } + + public function verifyAddAddressFirstName($firstName) + { + // TODO: Find better solution for the Field Validation issue. + $I = $this->acceptanceTester; + $I->seeInField(self::$addFirstNameField, $firstName); + } + + public function enterAddAddressMiddleName($middleName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addMiddleNameField, $middleName); + } + + public function verifyAddAddressMiddleName($middleName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addMiddleNameField, $middleName); + } + + public function enterAddAddressLastName($lastName) + { + $I = $this->acceptanceTester; + self::clickAndSendKeys(self::$addLastNameField); + $I->click(self::$addLastNameField); + $I->fillField(self::$addLastNameField, $lastName); + } + + public function verifyAddAddressLastName($lastName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addLastNameField, $lastName); + } + + public function enterAddAddressSuffix($suffix) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addSuffixField, $suffix); + } + + public function verifyAddAddressSuffix($suffix) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addSuffixField, $suffix); + } + + public function enterAddAddressCompany($company) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addCompanyField, $company); + } + + public function verifyAddAddressCompany($company) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addCompanyField, $company); + } + + public function enterAddAddressAddress1($address1) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addAddress1Field, $address1); + } + + public function verifyAddAddressAddress1($address1) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addAddress1Field, $address1); + } + + public function enterAddAddressAddress2($address2) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addAddress2Field, $address2); + } + + public function verifyAddAddressAddress2($address2) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addAddress2Field, $address2); + } + + public function enterAddAddressCity($city) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addCityField, $city); + } + + public function verifyAddAddressCity($city) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addCityField, $city); + } + + public function enterAddAddressCountry($country) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$addCountryDropDown, $country); + } + + public function verifyAddAddressCountry($country) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$addCountryDropDown, $country); + } + + public function enterAddAddressState($stateProvince) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$addStateDropDown, $stateProvince); + } + + public function enterAddAddressProvince($province) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addProvinceField, $province); + } + + public function verifyAddAddressState($state) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$addStateDropDown, $state); + } + + public function verifyAddAddressProvince($province) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addProvinceField, $province); + } + + public function enterAddAddressZipPostalCode($zipCode) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addZipPostalCodeField, $zipCode); + } + + public function verifyAddAddressZipPostalCode($zipCode) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addZipPostalCodeField, $zipCode); + } + + public function enterAddAddressPhoneNumber($phoneNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addPhoneNumberField, $phoneNumber); + } + + public function verifyAddAddressPhoneNumber($phoneNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addPhoneNumberField, $phoneNumber); + } + + public function enterAddAddressVatNumber($vatNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$addVatNumberField, $vatNumber); + } + + public function verifyAddAddressVatNumber($vatNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$addVatNumberField, $vatNumber); + } } \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php index cdaecfa9c..6c46d88cd 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php @@ -4,7 +4,6 @@ use Magento\Xxyyzz\Page\Customer\AdminCustomerPage; use Magento\Xxyyzz\Page\Customer\AdminCustomerGrid; use Magento\Xxyyzz\Step\Backend\AdminStep; -use Magento\Xxyyzz\Page\Cms\AdminCmsPage; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Title; @@ -12,6 +11,7 @@ use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class CreateCustomerCest @@ -19,8 +19,6 @@ * Allure annotations * @Features({"Customer"}) * @Stories({"Exercise all Customer fields", "Create a basic Customer", "Create a basic Customer with an Address"}) - * @Title("Exercise all fields, create basic Customer and basic Customer with an Address") - * @Description("Attempt to enter Text into all fields, create a basic Customer and create a basic Customer with an Address.") * * Codeception annotations * @group customer @@ -45,51 +43,114 @@ public function _before( /** * Allure annotations * @Title("Enter text into every field on the ADD Customer page.") - * @Description("Enter text into ALL fields on the ADD Customer page and verify the contents of the fields.") + * @Description("Enter text into ALL fields on the ADD Customer page and verify the content of the fields.") * @Severity(level = SeverityLevel::NORMAL) * @TestCaseId("") * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCustomerPage", value = "$customerPage") + * @Parameter(name = "AdminCustomerPage", value = "$adminCustomerPage") * * Codeception annotations * @group fields * @param AdminStep $I - * @param AdminCustomerPage $customerPage + * @param AdminCustomerPage $adminCustomerPage * @return void */ public function verifyThatEachFieldOnTheCustomerAddPageWorks( AdminStep $I, - AdminCustomerPage $customerPage + AdminCustomerPage $adminCustomerPage ) { $I->wantTo('verify that I can use all of the fields on the page.'); $customerData = $I->getCustomerData(); - $customerPage->selectAssociateToWebsiteMainWebsite(); - $customerPage->selectGroupWholesale(); - $customerPage->enterPrefix($customerData['prefix']); - $customerPage->enterFirstName($customerData['firstname']); - $customerPage->enterMiddleName($customerData['middlename']); - $customerPage->enterLastName($customerData['lastname']); - $customerPage->enterSuffix($customerData['suffix']); - $customerPage->enterEmailAddress($customerData['email']); - $customerPage->enterDateOfBirth($customerData['dateOfBirth']); - $customerPage->enterTaxVatNumber($customerData['taxVatNumber']); - $customerPage->selectGenderFemale(); - $customerPage->selectSendWelcomeEmailFromDefaultStoreView(); - - $customerPage->verifyAssociateToWebsiteMainWebsite(); - $customerPage->verifyGroupWholesale(); - $customerPage->verifyPrefix($customerData['prefix']); - $customerPage->verifyFirstName($customerData['firstname']); - $customerPage->verifyMiddleName($customerData['middlename']); - $customerPage->verifyLastName($customerData['lastname']); - $customerPage->verifySuffix($customerData['suffix']); - $customerPage->verifyEmailAddress($customerData['email']); - $customerPage->verifyDateOfBirth($customerData['dateOfBirth']); - $customerPage->verifyTaxVatNumber($customerData['taxVatNumber']); - $customerPage->verifyGenderFemale(); - $customerPage->verifySendWelcomeEmailFromDefaultStoreView(); + $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); + $adminCustomerPage->selectGroupWholesale(); + $adminCustomerPage->enterPrefix($customerData['prefix']); + $adminCustomerPage->enterFirstName($customerData['firstname']); + $adminCustomerPage->enterMiddleName($customerData['middlename']); + $adminCustomerPage->enterLastName($customerData['lastname']); + $adminCustomerPage->enterSuffix($customerData['suffix']); + $adminCustomerPage->enterEmailAddress($customerData['email']); + $adminCustomerPage->enterDateOfBirth($customerData['dateOfBirth']); + $adminCustomerPage->enterTaxVatNumber($customerData['taxVatNumber']); + $adminCustomerPage->selectGenderFemale(); + $adminCustomerPage->selectSendWelcomeEmailFromDefaultStoreView(); + + $adminCustomerPage->verifyAssociateToWebsiteMainWebsite(); + $adminCustomerPage->verifyGroupWholesale(); + $adminCustomerPage->verifyPrefix($customerData['prefix']); + $adminCustomerPage->verifyFirstName($customerData['firstname']); + $adminCustomerPage->verifyMiddleName($customerData['middlename']); + $adminCustomerPage->verifyLastName($customerData['lastname']); + $adminCustomerPage->verifySuffix($customerData['suffix']); + $adminCustomerPage->verifyEmailAddress($customerData['email']); + $adminCustomerPage->verifyDateOfBirth($customerData['dateOfBirth']); + $adminCustomerPage->verifyTaxVatNumber($customerData['taxVatNumber']); + $adminCustomerPage->verifyGenderFemale(); + $adminCustomerPage->verifySendWelcomeEmailFromDefaultStoreView(); + } + + /** + * Allure annotations + * @Title("Enter text into every field on the ADD ADDRESS area of the Customer page.") + * @Description("Enter text into ALL fields on the ADD ADDRESS area on the Customer page and verify the content of the fields.") + * @Severity(level = SeverityLevel::NORMAL) + * @TestCaseId("") + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminCustomerPage", value = "$adminCustomerPage") + * + * Codeception annotations + * @group fields + * @param AdminStep $I + * @param AdminCustomerPage $adminCustomerPage + * @return void + */ + public function verifyThatEachFieldOnTheCustomerAddAddressAreaWorks( + AdminStep $I, + AdminCustomerPage $adminCustomerPage + ) + { + $I->wantTo('verify that I can use all of the fields in the Add Address area.'); + $customerData = $I->getCustomerData(); + + $adminCustomerPage->clickOnAddressesLink(); + $adminCustomerPage->clickOnAddNewAddressButton(); + + $adminCustomerPage->clickOnAddNewAddressDefaultBillingAddress(); + $adminCustomerPage->clickOnAddNewAddressDefaultShippingAddress(); + + $adminCustomerPage->enterAddAddressPrefix($customerData['prefix']); + $adminCustomerPage->enterAddAddressFirstName($customerData['firstname']); + $adminCustomerPage->enterAddAddressMiddleName($customerData['middlename']); + $adminCustomerPage->enterAddAddressLastName($customerData['lastname']); + $adminCustomerPage->enterAddAddressSuffix($customerData['suffix']); + $adminCustomerPage->enterAddAddressCompany($customerData['company']); + $adminCustomerPage->enterAddAddressAddress1($customerData['address']['address1']); + $adminCustomerPage->enterAddAddressAddress2($customerData['address']['address2']); + $adminCustomerPage->enterAddAddressCity($customerData['address']['city']); + $adminCustomerPage->enterAddAddressCountry($customerData['address']['country']); + $adminCustomerPage->enterAddAddressState($customerData['address']['state']); + $adminCustomerPage->enterAddAddressZipPostalCode($customerData['address']['zipCode']); + $adminCustomerPage->enterAddAddressPhoneNumber($customerData['phoneNumber']); + $adminCustomerPage->enterAddAddressVatNumber($customerData['taxVatNumber']); + + $adminCustomerPage->verifyAddAddressDefaultBillingAddress(true); + $adminCustomerPage->verifyAddAddressDefaultShippingAddress(true); + + $adminCustomerPage->verifyAddAddressPrefix($customerData['prefix']); + $adminCustomerPage->verifyAddAddressFirstName($customerData['firstname']); + $adminCustomerPage->verifyAddAddressMiddleName($customerData['middlename']); + $adminCustomerPage->verifyAddAddressLastName($customerData['lastname']); + $adminCustomerPage->verifyAddAddressSuffix($customerData['suffix']); + $adminCustomerPage->verifyAddAddressCompany($customerData['company']); + $adminCustomerPage->verifyAddAddressAddress1($customerData['address']['address1']); + $adminCustomerPage->verifyAddAddressAddress2($customerData['address']['address2']); + $adminCustomerPage->verifyAddAddressCity($customerData['address']['city']); + $adminCustomerPage->verifyAddAddressCountry($customerData['address']['country']); + $adminCustomerPage->verifyAddAddressState($customerData['address']['state']); + $adminCustomerPage->verifyAddAddressZipPostalCode($customerData['address']['zipCode']); + $adminCustomerPage->verifyAddAddressPhoneNumber($customerData['phoneNumber']); + $adminCustomerPage->verifyAddAddressVatNumber($customerData['taxVatNumber']); } /** @@ -116,23 +177,23 @@ public function createBasicCustomerAccountTest( ) { $I->wantTo('verify basic Customer creation in admin'); - $customer = $I->getCustomerData(); + $customerData = $I->getCustomerData(); - $adminCustomerPage->enterFirstName($customer['firstname']); - $adminCustomerPage->enterLastName($customer['lastname']); - $adminCustomerPage->enterEmailAddress($customer['email']); + $adminCustomerPage->enterFirstName($customerData['firstname']); + $adminCustomerPage->enterLastName($customerData['lastname']); + $adminCustomerPage->enterEmailAddress($customerData['email']); $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); $adminCustomerPage->selectGroupGeneral(); $adminCustomerPage->clickOnAdminSaveButton(); - $adminCustomerGrid->performSearchByKeyword($customer['email']); + $adminCustomerGrid->performSearchByKeyword($customerData['email']); - $adminCustomerGrid->clickOnActionLinkFor($customer['email']); + $adminCustomerGrid->clickOnActionLinkFor($customerData['email']); $adminCustomerPage->clickOnAccountInformationLink(); - $adminCustomerPage->verifyFirstName($customer['firstname']); - $adminCustomerPage->verifyLastName($customer['lastname']); - $adminCustomerPage->verifyEmailAddress($customer['email']); + $adminCustomerPage->verifyFirstName($customerData['firstname']); + $adminCustomerPage->verifyLastName($customerData['lastname']); + $adminCustomerPage->verifyEmailAddress($customerData['email']); $adminCustomerPage->verifyAssociateToWebsiteMainWebsite(); $adminCustomerPage->verifyGroupGeneral(); } @@ -148,7 +209,6 @@ public function createBasicCustomerAccountTest( * @Parameter(name = "AdminCustomerGrid", value = "$adminCustomerGrid") * * Codeception annotations - * @group skip * @group add * @param AdminStep $I * @param AdminCustomerPage $adminCustomerPage @@ -162,38 +222,59 @@ public function createBasicCustomerAccountWithAddressTest( ) { $I->wantTo('verify basic Customer creation in admin'); - $customer = $I->getCustomerData(); - - $adminCustomerPage->enterFirstName($customer['firstname']); - $adminCustomerPage->enterLastName($customer['lastname']); - $adminCustomerPage->enterEmailAddress($customer['email']); - $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); - $adminCustomerPage->selectGroupGeneral(); + $customerData = $I->getCustomerData(); $adminCustomerPage->clickOnAddressesLink(); $adminCustomerPage->clickOnAddNewAddressButton(); - - $adminCustomerPage->enterAddAddressPrefix($customer['prefix']); - $adminCustomerPage->enterAddAddressFirstName($customer['firstname']); - $adminCustomerPage->enterAddAddressMiddleName($customer['middlename']); - $adminCustomerPage->enterAddAddressLastName($customer['lastname']); - $adminCustomerPage->enterAddAddressSuffix($customer['suffix']); - $adminCustomerPage->enterAddAddressCompany($customer['company']); - $adminCustomerPage->enterAddAddressAddress1($customer['address']['address1']); - $adminCustomerPage->enterAddAddressAddress2($customer['address']['address2']); - $adminCustomerPage->enterAddAddressCity($customer['address']['city']); - $adminCustomerPage->enterAddAddressCountry($customer['address']['country']); - $adminCustomerPage->enterAddAddressStateProvince($customer['address']['state']); - $adminCustomerPage->enterAddAddressZipPostalCode($customer['address']['zipCode']); - $adminCustomerPage->enterAddAddressPhoneNumber($customer['phoneNumber']); - $adminCustomerPage->enterAddAddressVatNumber($customer['taxVatNumber']); - $adminCustomerPage->clickOnAdminSaveButton(); - $adminCustomerGrid->performSearchByKeyword($customer['email']); + $adminCustomerPage->clickOnAddNewAddressDefaultBillingAddress(); + $adminCustomerPage->clickOnAddNewAddressDefaultShippingAddress(); + + $adminCustomerPage->enterAddAddressPrefix($customerData['prefix']); + $adminCustomerPage->enterAddAddressFirstName($customerData['firstname']); + $adminCustomerPage->enterAddAddressMiddleName($customerData['middlename']); + $adminCustomerPage->enterAddAddressLastName($customerData['lastname']); + $adminCustomerPage->enterAddAddressSuffix($customerData['suffix']); + $adminCustomerPage->enterAddAddressCompany($customerData['company']); + $adminCustomerPage->enterAddAddressAddress1($customerData['address']['address1']); + $adminCustomerPage->enterAddAddressAddress2($customerData['address']['address2']); + $adminCustomerPage->enterAddAddressCity($customerData['address']['city']); + $adminCustomerPage->enterAddAddressCountry($customerData['address']['country']); + $adminCustomerPage->enterAddAddressState($customerData['address']['state']); + $adminCustomerPage->enterAddAddressZipPostalCode($customerData['address']['zipCode']); + $adminCustomerPage->enterAddAddressPhoneNumber($customerData['phoneNumber']); + $adminCustomerPage->enterAddAddressVatNumber($customerData['taxVatNumber']); - $adminCustomerGrid->clickOnActionLinkFor($customer['email']); $adminCustomerPage->clickOnAccountInformationLink(); - + $adminCustomerPage->enterFirstName($customerData['firstname']); + $adminCustomerPage->enterLastName($customerData['lastname']); + $adminCustomerPage->enterEmailAddress($customerData['email']); + $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); + $adminCustomerPage->selectGroupGeneral(); + + $adminCustomerPage->clickOnAdminSaveButton(); + $adminCustomerGrid->performSearchByKeyword($customerData['email']); + + $adminCustomerGrid->clickOnActionLinkFor($customerData['email']); + $adminCustomerPage->clickOnAddressesLink(); + + $adminCustomerPage->verifyAddAddressDefaultBillingAddress(true); + $adminCustomerPage->verifyAddAddressDefaultShippingAddress(true); + + $adminCustomerPage->verifyAddAddressPrefix($customerData['prefix']); + $adminCustomerPage->verifyAddAddressFirstName($customerData['firstname']); + $adminCustomerPage->verifyAddAddressMiddleName($customerData['middlename']); + $adminCustomerPage->verifyAddAddressLastName($customerData['lastname']); + $adminCustomerPage->verifyAddAddressSuffix($customerData['suffix']); + $adminCustomerPage->verifyAddAddressCompany($customerData['company']); + $adminCustomerPage->verifyAddAddressAddress1($customerData['address']['address1']); + $adminCustomerPage->verifyAddAddressAddress2($customerData['address']['address2']); + $adminCustomerPage->verifyAddAddressCity($customerData['address']['city']); + $adminCustomerPage->verifyAddAddressCountry($customerData['address']['country']); + $adminCustomerPage->verifyAddAddressState($customerData['address']['state']); + $adminCustomerPage->verifyAddAddressZipPostalCode($customerData['address']['zipCode']); + $adminCustomerPage->verifyAddAddressPhoneNumber($customerData['phoneNumber']); + $adminCustomerPage->verifyAddAddressVatNumber($customerData['taxVatNumber']); } } \ No newline at end of file From 7544a18f5b900dac2af579af6ff85fbcae2892d1 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 20 Apr 2017 15:55:34 -0500 Subject: [PATCH 048/149] Fixing broken references. Adding TODO items for unfinished sections. - Fixing a few broken references to the waitForLoadingMaskToDisappear() function - Adding TODO items for sections that we are not automating at this time - Adding the word Admin or Storefront to the front of some files and namespaces to make them match other files (cherry picked from commit 8a28b1b) --- .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 6 ++-- .../Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php | 6 ++-- .../Magento/Xxyyzz/Page/Cms/AdminCmsPage.php | 21 +++++++++----- .../Page/Customer/AdminCustomerPage.php | 28 +++++++++++-------- 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php index dcde626e6..6780f667a 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -162,20 +162,20 @@ public function clickOnAdminSaveAndContinueEdit() { $I = $this->acceptanceTester; $I->click(self::$pageMainActionsSaveAndContinue); - self::waitForLoadingMaskToDisappear(); + $I->waitForLoadingMaskToDisappear(); } public function clickOnAdminSaveButton() { $I = $this->acceptanceTester; $I->click(self::$pageMainActionsSave); - self::waitForLoadingMaskToDisappear(); + $I->waitForLoadingMaskToDisappear(); } public function clickOnAdminAddButton() { $I = $this->acceptanceTester; $I->click(self::$pageMainActionsAdd); - self::waitForLoadingMaskToDisappear(); + $I->waitForLoadingMaskToDisappear(); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php index 1c2fadf21..7975a76f6 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php @@ -27,7 +27,7 @@ public function clickOnActionEditFor($keyText) self::clickOnActionSelectLinkFor($keyText); $I->click($selector); - self::waitForLoadingMaskToDisappear(); + $I->waitForLoadingMaskToDisappear(); } public function clickOnActionDeleteFor($keyText) @@ -37,7 +37,7 @@ public function clickOnActionDeleteFor($keyText) self::clickOnActionSelectLinkFor($keyText); $I->click($selector); - self::waitForLoadingMaskToDisappear(); + $I->waitForLoadingMaskToDisappear(); } public function clickOnActionViewFor($keyText) @@ -47,6 +47,6 @@ public function clickOnActionViewFor($keyText) self::clickOnActionSelectLinkFor($keyText); $I->click($selector); - self::waitForLoadingMaskToDisappear(); + $I->waitForLoadingMaskToDisappear(); } } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php index 613646187..d9267b4ba 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php @@ -27,8 +27,14 @@ class AdminCmsPage extends AbstractAdminPage public static $pageTitleField = '.admin__control-text[name="title"]'; public static $contentHeadingField = '.admin__control-text[name="content_heading"]'; public static $insertWidgetButton = '.action-add-widget'; + // TODO: Add Selectors for the "Insert Widget" section and controls + public static $insertImageButton = '.action-add-image'; + // TODO: Add Selectors for the "Insert Image" section and controls + public static $insertVariableButton = '.add-variable'; + // TODO: Add Selectors for the "Insert Variable" section and controls + public static $contentBodyField = '#cms_page_form_content'; public static $urlKeyField = '.admin__control-text[name="identifier"]'; @@ -116,18 +122,24 @@ public function clickOnInsertWidgetButton() $I->click(self::$insertWidgetButton); } + // TODO: Add Methods for the "Insert Widget" section and controls + public function clickOnInsertImageButton() { $I = $this->acceptanceTester; $I->click(self::$insertImageButton); } + // TODO: Add Methods for the "Insert Image" section and controls + public function clickOnInsertVariableButton() { $I = $this->acceptanceTester; $I->click(self::$insertVariableButton); } + // TODO: Add Methods for the "Insert Variable" section and controls + public function enterPageContentBody($pageContentBody) { $I = $this->acceptanceTester; @@ -219,11 +231,7 @@ public function pressShiftOnTheKeyboard() public function selectMultipleStoreViews($storeViews) { $I = $this->acceptanceTester; - // TODO: Add multiselect support - foreach ($storeViews as &$value) { - self::pressShiftOnTheKeyboard(); - $I->selectOption(self::$storeViewMainArea, $value); - } + // TODO: Add multi-select support for the "Store View" setting } public function selectLayout($layout) @@ -290,18 +298,17 @@ public function verifyLayoutUpdateXml($layoutXml) $I->seeInField(self::$layoutUpdateXmlField, $layoutXml); } + // TODO: Add calendar modal support public function enterFrom($fromDate) { $I = $this->acceptanceTester; $I->fillField(self::$fromField, $fromDate); - // TODO: Add calendar support } public function verifyFrom($fromDate) { $I = $this->acceptanceTester; $I->seeInField(self::$fromField, $fromDate); - // TODO: Add calendar support } public function enterTo($toDate) diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php index 913390c89..89e45d84f 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php @@ -31,6 +31,8 @@ class AdminCustomerPage extends AbstractAdminPage public static $sectionTitle = '.page-title'; + // TODO: Add Selectors for the "Customer View" section and controls + public static $associateToWebsiteDropDown = '.admin__control-select[name="customer[website_id]"]'; public static $groupDropDown = '.admin__control-select[name="customer[group_id]"]'; public static $disableAutomaticGroupCheckbox = '.admin__field[data-index="disable_auto_group_change"] .admin__field-label'; @@ -67,6 +69,12 @@ class AdminCustomerPage extends AbstractAdminPage public static $addPhoneNumberField = '.address-item-edit-content .admin__control-text[name*="[telephone]"]'; public static $addVatNumberField = '.address-item-edit-content .admin__control-text[name*="[vat_id]"]'; + // TODO: Add Selectors for the "Orders" section and controls + // TODO: Add Selectors for the "Billing Agreements" section and controls + // TODO: Add Selectors for the "Newsletter" section and controls + // TODO: Add Selectors for the "Product Reviews" section and controls + // TODO: Add Selectors for the "Wish List" section and controls + public function clickOnAddCustomerButton() { self::clickOnAdminAddButton(); @@ -146,6 +154,8 @@ public function clickOnWishListLink() $I->click(self::$wishListLink); } + // TODO: Add Methods for the "Customer View" section and controls + public function selectAssociateToWebsite($associateWebsite) { $I = $this->acceptanceTester; @@ -423,24 +433,16 @@ public function verifyAddAddressPrefix($prefix) $I->seeInField(self::$addPrefixField, $prefix); } - public function clickAndSendKeys($selector) - { - $I = $this->acceptanceTester; - $I->click($selector); - $I->pressKey($selector, WebDriverKeys::SPACE); - $I->pressKey($selector, WebDriverKeys::BACKSPACE); - } + // TODO: Find better solution for the First/Last Name field validation issue. public function enterAddAddressFirstName($firstName) { $I = $this->acceptanceTester; $I->fillField(self::$addFirstNameField, $firstName); - self::clickAndSendKeys(self::$addFirstNameField); } public function verifyAddAddressFirstName($firstName) { - // TODO: Find better solution for the Field Validation issue. $I = $this->acceptanceTester; $I->seeInField(self::$addFirstNameField, $firstName); } @@ -460,8 +462,6 @@ public function verifyAddAddressMiddleName($middleName) public function enterAddAddressLastName($lastName) { $I = $this->acceptanceTester; - self::clickAndSendKeys(self::$addLastNameField); - $I->click(self::$addLastNameField); $I->fillField(self::$addLastNameField, $lastName); } @@ -602,4 +602,10 @@ public function verifyAddAddressVatNumber($vatNumber) $I = $this->acceptanceTester; $I->seeInField(self::$addVatNumberField, $vatNumber); } + + // TODO: Add Methods for the "Orders" section and controls + // TODO: Add Methods for the "Billing Agreements" section and controls + // TODO: Add Methods for the "Newsletter" section and controls + // TODO: Add Methods for the "Product Reviews" section and controls + // TODO: Add Methods for the "Wish List" section and controls } \ No newline at end of file From 258977fb2b0ee63b30b81d5274b73a1ba0ecdbe4 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 21 Apr 2017 14:16:12 -0500 Subject: [PATCH 049/149] Added money formatter to handle product price field validation. --- .../Xxyyzz/Module/MagentoFakerData.php | 4 +- .../Xxyyzz/Module/MagentoWebDriver.php | 52 +++++++++++++++++++ .../Xxyyzz/Page/Catalog/AdminProductPage.php | 41 ++++++++------- .../Page/Catalog/StorefrontCategoryPage.php | 8 +-- 4 files changed, 77 insertions(+), 28 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index bef8589f5..e34f06c23 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -60,11 +60,11 @@ public function getSimpleProductApiData($categoryId = 0, $productData = []) ? $productData['name'] : 'simple_product'.$sq, 'visibility' => 4, 'type_id' => 'simple', - 'price' => $faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 999), + 'price' => $faker->randomFloat(2, 1), 'status' => 1, 'attribute_set_id' => 4, 'extension_attributes' => [ - 'stock_item' => ['is_in_stock' => 1, 'qty' => $faker->randomDigit] + 'stock_item' => ['is_in_stock' => 1, 'qty' => $faker->numberBetween(100, 9000)] ], 'custom_attributes' => [ ['attribute_code' => 'url_key', 'value' => isset($productData['name']) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php index 2c3528248..248253fc5 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -44,6 +44,18 @@ class MagentoWebDriver extends WebDriver 'browser' ]; + /** + * @var array $localeAll + */ + protected static $localeAll = [ + LC_COLLATE => null, + LC_CTYPE => null, + LC_MONETARY => null, + LC_NUMERIC => null, + LC_TIME => null, + LC_MESSAGES => null, + ]; + /** * Returns URL of a host. * @api @@ -160,4 +172,44 @@ public function dontSeeJsError() } } } + + /** + * @param float $money + * @param string $locale + * @return array + */ + public function formatMoney(float $money, $locale = 'en_US.UTF-8') + { + $this->mSetLocale(LC_MONETARY, $locale); + $money = money_format('%.2n', $money); + $this->mResetLocale(); + $prefix = substr($money, 0, 1); + $number = substr($money, 1); + return ['prefix' => $prefix, 'number' => $number]; + } + + /** + * @param int $category + * @param string $locale + */ + public function mSetLocale(int $category, $locale) + { + if (self::$localeAll[$category] == $locale) { + return; + } + foreach (self::$localeAll as $c => $l) { + self::$localeAll[$c] = setlocale($c, 0); + } + setlocale($category, $locale); + } + + public function mResetLocale() + { + foreach (self::$localeAll as $c => $l) { + if (!is_null($l)) { + setlocale($c, $l); + self::$localeAll[$c] = null; + } + } + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php index 615d8dd08..72588add2 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php @@ -20,6 +20,7 @@ class AdminProductPage extends AbstractAdminPage */ public static $productName = '.admin__field[data-index=name] input'; public static $productSku = '.admin__field[data-index=sku] input'; + public static $productPricePrefix = '.admin__field[data-index=price] .admin__addon-prefix>span'; public static $productPrice = '.admin__field[data-index=price] input'; public static $productQuantity = '.admin__field[data-index=quantity_and_stock_status_qty] input'; public static $productStockStatus = '.admin__field[data-index=quantity_and_stock_status] select'; @@ -69,28 +70,28 @@ public function seeProductName($name) $I->seeInField(self::$productName, $name); } - public function seeProductSku($name) + public function seeProductSku($sku) { $I = $this->acceptanceTester; - $I->seeInField(self::$productSku, $name); + $I->seeInField(self::$productSku, $sku); } - public function seeProductPrice($name) + public function seeProductPrice($price) { $I = $this->acceptanceTester; - $I->seeInField(self::$productPrice, $name); + $I->seeInField(self::$productPrice, $I->formatMoney($price)['number']); } - public function seeProductQuantity($name) + public function seeProductQuantity($qty) { $I = $this->acceptanceTester; - $I->seeInField(self::$productQuantity, $name); + $I->seeInField(self::$productQuantity, $qty); } - public function seeProductStockStatus($name) + public function seeProductStockStatus($status) { $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$productStockStatus, $name); + $I->seeOptionIsSelected(self::$productStockStatus, $status); } /** @@ -106,14 +107,14 @@ public function seeProductCategories(array $names) } } - public function seeProductUrlKey($name) + public function seeProductUrlKey($urlKey) { $I = $this->acceptanceTester; try { $I->click(sprintf(self::$productSearchEngineOptimToggle, 'closed')); } catch (\Exception $e) { } - $I->seeInField(self::$productUrlKey, $name); + $I->seeInField(self::$productUrlKey, $urlKey); } // Fill new product @@ -129,38 +130,38 @@ public function fillFieldProductName($name) $I->fillField(self::$productName, $name); } - public function fillFieldProductSku($name) + public function fillFieldProductSku($sku) { $I = $this->acceptanceTester; - $I->fillField(self::$productSku, $name); + $I->fillField(self::$productSku, $sku); } - public function fillFieldProductPrice($name) + public function fillFieldProductPrice($price) { $I = $this->acceptanceTester; - $I->fillField(self::$productPrice, $name); + $I->fillField(self::$productPrice, $price); } - public function fillFieldProductQuantity($name) + public function fillFieldProductQuantity($qty) { $I = $this->acceptanceTester; - $I->fillField(self::$productQuantity, $name); + $I->fillField(self::$productQuantity, $qty); } - public function selectProductStockStatus($name) + public function selectProductStockStatus($status) { $I = $this->acceptanceTester; - $I->selectOption(self::$productStockStatus, $name); + $I->selectOption(self::$productStockStatus, $status); } - public function fillFieldProductUrlKey($name) + public function fillFieldProductUrlKey($urlKey) { $I = $this->acceptanceTester; try { $I->click(sprintf(self::$productSearchEngineOptimToggle, 'closed')); } catch (\Exception $e) { } - $I->fillField(self::$productUrlKey, $name); + $I->fillField(self::$productUrlKey, $urlKey); } /** diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php index 8199a06cc..3fb23ee4e 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php @@ -64,12 +64,8 @@ public function seeProductPriceInPage($name, $price) { $this->goToPageForProduct($name); $I = $this->acceptanceTester; - $actualPrice = $I->grabTextFrom(sprintf(self::$productPrice, $name)); - $pos = strpos($actualPrice, '.'); - if ( $pos !== false) { - $actualPrice = substr($actualPrice, 1, $pos+2); - } - $I->assertEquals($price, $actualPrice); + $actualPrice = substr($I->grabTextFrom(sprintf(self::$productPrice, $name)), 1); + $I->assertEquals(floatval($price), floatval($actualPrice), '', 0.01); } public function goToPageForProduct($name) From b2570711b386807ebe20b2380ef6bc801b4b4888 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 21 Apr 2017 14:53:48 -0500 Subject: [PATCH 050/149] Fixed Allure annotations in tests. --- .../Acceptance/Catalog/CreateCategoryCest.php | 4 +-- .../Catalog/CreateSimpleProductCest.php | 2 +- .../Catalog/UpdateSimpleProductCest.php | 4 +-- .../CreateNewCustomerFrontendCest.php | 25 ++++++++--------- .../Customer/SignInCustomerFrontendCest.php | 27 ++++++++++--------- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index b69ca398e..a20fef5e5 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -19,8 +19,6 @@ * Allure annotations * @Features({"Category"}) * @Stories({"Create sub Category"}) - * @Title("Create sub category with required fields") - * @Description("Create sub category with required fields") * * Codeception annotations * @group catalog @@ -47,8 +45,8 @@ public function _after(AdminStep $I) * Allure annotations * @Title("Method Title: Create sub category with required fields") * @Description("Method Description: Create sub category with required fields") - * @Severity(level = SeverityLevel::CRITICAL) * @TestCaseId("") + * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "Admin", value = "$I") * * @param AdminStep $I diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index b7ed486fe..866084e29 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -68,8 +68,8 @@ public function _after(AdminStep $I) * Allure annotations * @Title("Create a basic Product and verify on the Storefront") * @Description("Create a basic Product in the Admin and verify the content on the Storefront.") - * @Severity(level = SeverityLevel::CRITICAL) * @TestCaseId("") + * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "Admin", value = "$I") * * Codeception annotations diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index 3195d575d..822e1bbc1 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -23,8 +23,6 @@ * Allure annotations * @Features({"Catalog"}) * @Stories({"Update simple product"}) - * @Title("Update simple product with required fields") - * @Description("Update simple product with required fields") * * Codeception Annotations * @group catalog @@ -86,8 +84,8 @@ public function _after(AdminStep $I) * Allure annotations * @Title("Mathod Title: Update simple product with required fields") * @Description("Method Description: Update simple product with required fields") - * @Severity(level = SeverityLevel::CRITICAL) * @TestCaseId("") + * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "AdminStep", value = "$I") * * @param AdminStep $I diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php index 8d502469c..4c354c548 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php @@ -15,10 +15,15 @@ /** * Class SignInCustomerFrontendCest * - * @Stories({"Create customer"}) - * @Features({"Create customer"}) - * @Title("Create customer") - * @Description("Create customer") + * Allure annotations + * @Features({"Customer"}) + * @Stories({"Create new customer storefront"}) + * + * Codeception annotations + * @group customer + * @env chrome + * @env firefox + * @env phantomjs */ class CreateNewCustomerFrontendCest { @@ -41,15 +46,11 @@ public function _before(AcceptanceTester $I) * Create customer. * * Allure annotations - * @Description("Method Description: Create customer") + * @Title("Method Title: Create new customer storefront") + * @Description("Method Description: Create new customer storefront") + * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "Admin", value = "$I") - * - * Codeception annotations - * @group customer - * @env chrome - * @env firefox - * @env phantomjs + * @Parameter(name = "AcceptanceTester", value = "$I") * * @param AcceptanceTester $I * @return void diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php index 501b5eafb..812f225d0 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php @@ -16,10 +16,15 @@ /** * Class SignInCustomerFrontendCest * - * @Stories({"Create customer"}) - * @Features({"Create customer"}) - * @Title("Create customer") - * @Description("Create customer") + * Allure annotations + * @Features({"Customer"}) + * @Stories({"Sign in existing customer storefront"}) + * + * Codeception annotations + * @group customer + * @env chrome + * @env firefox + * @env phantomjs */ class SignInCustomerFrontendCest { @@ -41,18 +46,14 @@ public function _before(AcceptanceTester $I, CustomerApiStep $api) } /** - * Create customer. + * Sign in existing customer. * * Allure annotations - * @Description("Method Description: Create customer") + * @Title("Method Title: Sign in existing customer storefront") + * @Description("Method Description: Sign in existing customer storefront") + * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "Admin", value = "$I") - * - * Codeception annotations - * @group customer - * @env chrome - * @env firefox - * @env phantomjs + * @Parameter(name = "AcceptanceTester", value = "$I") * * @param AcceptanceTester $I * @return void From 81c259351af2134ef0aef9aa5fed7690f19dc37c Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 21 Apr 2017 16:33:36 -0500 Subject: [PATCH 051/149] Moving the waitForLoadingMaskToDisappear function to WebDriver class - Moving waitForLoadingMaskToDisappear function to the MagentoWebDriver.php fil. - Removing it from the AcceptanceTester file. - Adding a clickOnCollapsedArea function to the AbstractAdminPage so you can open up all of the collapsible areas in the Add/Edit Admin pages. --- .../_support/Magento/Xxyyzz/AcceptanceTester.php | 15 --------------- .../Magento/Xxyyzz/Module/MagentoWebDriver.php | 16 ++++++++++++++++ .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 6 ++++++ 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/AcceptanceTester.php b/tests/_support/Magento/Xxyyzz/AcceptanceTester.php index a82a6b385..4c8fa87a7 100644 --- a/tests/_support/Magento/Xxyyzz/AcceptanceTester.php +++ b/tests/_support/Magento/Xxyyzz/AcceptanceTester.php @@ -23,19 +23,4 @@ class AcceptanceTester extends \Codeception\Actor /** * Define custom actions here */ - public static $loadingMask = '.loading-mask'; - public static $gridLoadingMask = '.admin__data-grid-loading-mask'; - - public function waitForLoadingMaskToDisappear() - { - $I = $this; - $I->waitForElementNotVisible(self::$loadingMask, 30); - $I->waitForElementNotVisible(self::$gridLoadingMask, 30); - } - - public function scrollToTopOfPage() - { - $I = $this; - $I->executeJS('window.scrollTo(0,0);'); - } } diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php index 248253fc5..31213031b 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -31,6 +31,9 @@ */ class MagentoWebDriver extends WebDriver { + public static $loadingMask = '.loading-mask'; + public static $gridLoadingMask = '.admin__data-grid-loading-mask'; + /** * The module required fields, to be set in the suite .yml configuration file. * @@ -212,4 +215,17 @@ public function mResetLocale() } } } + + public function waitForLoadingMaskToDisappear() + { + $I = $this; + $I->waitForElementNotVisible(self::$loadingMask, 30); + $I->waitForElementNotVisible(self::$gridLoadingMask, 30); + } + + public function scrollToTopOfPage() + { + $I = $this; + $I->executeJS('window.scrollTo(0,0);'); + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php index 6780f667a..46eebd177 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -178,4 +178,10 @@ public function clickOnAdminAddButton() $I->click(self::$pageMainActionsAdd); $I->waitForLoadingMaskToDisappear(); } + + public function clickOnCollapsibleArea($areaName) + { + $I = $this->acceptanceTester; + $I->click('//div[@class="fieldset-wrapper-title"]/strong/span[contains(text(), "' . $areaName . '")]'); + } } From 32a31939fbdc2e9d23de5ac0d67fe6fe6390c6fc Mon Sep 17 00:00:00 2001 From: John Stennett Date: Mon, 24 Apr 2017 09:09:42 -0500 Subject: [PATCH 052/149] - Replacing the waitForElementNotVisible(self::$categoryFormLoadingSpinner) functions with waitForPageLoad. - Renamed waitPageLoad to waitForPageLoad. - Removed the waitForLoadingMaskToDisappear functions and selectors. - Updated the Category page object selectors to make them more specific. --- .../Xxyyzz/Module/MagentoWebDriver.php | 15 ++- .../Xxyyzz/Page/AbstractAdminGridPage.php | 6 +- .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 16 +-- .../Page/Backend/AdminSideNavigation.php | 97 +++++++++++++++++-- .../Xxyyzz/Page/Catalog/AdminCategoryPage.php | 61 +++++++++--- .../Page/Catalog/AdminProductGridPage.php | 11 +-- .../Xxyyzz/Page/Catalog/AdminProductPage.php | 28 +++++- .../Page/Catalog/StorefrontCategoryPage.php | 4 +- .../Page/Catalog/StorefrontProductPage.php | 2 +- .../Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php | 6 +- .../Magento/Xxyyzz/Page/Cms/AdminCmsPage.php | 36 ++++--- .../Page/Customer/AdminCustomerPage.php | 39 +++++++- .../StorefrontCustomerAccountCreatePage.php | 6 +- ...StorefrontCustomerAccountDashboardPage.php | 8 +- .../StorefrontCustomerAccountLoginPage.php | 6 +- .../Magento/Xxyyzz/Step/Backend/AdminStep.php | 88 +++++++++++++++-- .../Acceptance/Catalog/CreateCategoryCest.php | 14 +-- .../Acceptance/Cms/CreateContentPageCest.php | 1 - .../Customer/CreateCustomerCest.php | 1 - 19 files changed, 344 insertions(+), 101 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php index 31213031b..f8ec578ed 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -104,6 +104,7 @@ public function loginAsAdmin($username = null, $password = null) $this->fillField('login[username]', !is_null($username) ? $username : $this->config['username']); $this->fillField('login[password]', !is_null($password) ? $password : $this->config['password']); $this->click('Sign in'); + $this->waitForPageLoad(); $this->closeAdminNotification(); } @@ -134,20 +135,20 @@ public function searchAndMultiSelectOption($select, array $options, $requireActi . ' .admin__action-multiselect-search-wrap>input[data-role="advanced-select-text"]'; $selectSearchResult = $select . ' .admin__action-multiselect-label>span'; - $this->waitPageLoad(); + $this->waitForPageLoad(); $this->waitForElementVisible($selectDropdown); $this->click($selectDropdown); foreach ($options as $option) { - $this->waitPageLoad(); + $this->waitForPageLoad(); $this->fillField($selectSearchText, ''); - $this->waitPageLoad(); + $this->waitForPageLoad(); $this->fillField($selectSearchText, $option); - $this->waitPageLoad(); + $this->waitForPageLoad(); $this->click($selectSearchResult); } if ($requireAction) { $selectAction = $select . ' button[class=action-default]'; - $this->waitPageLoad(); + $this->waitForPageLoad(); $this->click($selectAction); } } @@ -156,14 +157,12 @@ public function waitAjaxLoad($timeout = 15) { $this->waitForJS('return !!window.jQuery && window.jQuery.active == 0;', $timeout); $this->wait(1); - $this->dontSeeJsError(); } - public function waitPageLoad($timeout = 15) + public function waitForPageLoad($timeout = 15) { $this->waitForJS('return document.readyState == "complete"', $timeout); $this->waitAjaxLoad($timeout); - $this->dontSeeJsError(); } public function dontSeeJsError() diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php index 2a630c581..c8c5a8cd2 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php @@ -101,9 +101,9 @@ public function performSearchByKeyword($searchKeyword) { $I = $this->acceptanceTester; self::enterSearchKeyword($searchKeyword); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); self::clickOnTheSearchButton(); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); } public function clickOnFiltersButton() @@ -286,6 +286,6 @@ public function clickOnActionLinkFor($keyText) $actionLinkSelector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] .action-menu-item'; $I->click($actionLinkSelector); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); } } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php index 46eebd177..0b182c892 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -40,9 +40,6 @@ abstract class AbstractAdminPage public static $pageMainActionsSave = '#save'; public static $pageMainActionsAdd = '#add'; - public static $loadingMask = '.loading-mask'; - public static $gridLoadingMask = '.admin__data-grid-loading-mask'; - /** * @var AcceptanceTester */ @@ -76,13 +73,6 @@ public static function route($param) return static::$URL.$param; } - public function waitForLoadingMaskToDisappear() - { - $I = $this->acceptanceTester; - $I->waitForElementNotVisible(self::$loadingMask, 30); - $I->waitForElementNotVisible(self::$gridLoadingMask, 30); - } - public function openTabGoToAndVerifyUrl($pageUrl) { $I = $this->acceptanceTester; @@ -162,21 +152,21 @@ public function clickOnAdminSaveAndContinueEdit() { $I = $this->acceptanceTester; $I->click(self::$pageMainActionsSaveAndContinue); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); } public function clickOnAdminSaveButton() { $I = $this->acceptanceTester; $I->click(self::$pageMainActionsSave); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); } public function clickOnAdminAddButton() { $I = $this->acceptanceTester; $I->click(self::$pageMainActionsAdd); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); } public function clickOnCollapsibleArea($areaName) diff --git a/tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php b/tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php index b14937e77..708fc8a99 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php +++ b/tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php @@ -173,537 +173,616 @@ public function clickOnDashboardInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$dashboardButton); + $I->waitForPageLoad(); } public function clickOnSalesInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$salesButton); - $I->wait(1); + $I->waitForPageLoad(); } public function clickOnOrdersInTheSalesNavMenu() { $I = $this->acceptanceTester; $I->click(self::$salesNavOrders); + $I->waitForPageLoad(); } public function clickOnInvoicesInTheSalesNavMenu() { $I = $this->acceptanceTester; $I->click(self::$salesNavInvoices); + $I->waitForPageLoad(); } public function clickOnShipmentsInTheSalesNavMenu() { $I = $this->acceptanceTester; $I->click(self::$salesNavShipments); + $I->waitForPageLoad(); } public function clickOnCreditMemosInTheSalesNavMenu() { $I = $this->acceptanceTester; $I->click(self::$salesNavCreditMemos); + $I->waitForPageLoad(); } public function clickOnBillingAgreementsInTheSalesNavMenu() { $I = $this->acceptanceTester; $I->click(self::$salesNavBillingAgreements); + $I->waitForPageLoad(); } public function clickOnTransactionsInTheSalesNavMenu() { $I = $this->acceptanceTester; $I->click(self::$salesNavTransactions); + $I->waitForPageLoad(); } public function clickOnProductsInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$productsButton); - $I->wait(1); + $I->waitForPageLoad(); } public function clickOnCatalogInTheProductNavMenu() { $I = $this->acceptanceTester; $I->click(self::$productNavCatalog); + $I->waitForPageLoad(); } public function clickOnCategoriesInTheProductNavMenu() { $I = $this->acceptanceTester; $I->click(self::$productNavCategories); + $I->waitForPageLoad(); } public function clickOnCustomersInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$customersButton); - $I->wait(1); + $I->waitForPageLoad(); } public function clickOnAllCustomersInTheCustomersNavMenu() { $I = $this->acceptanceTester; $I->click(self::$customersNavAllCustomers); + $I->waitForPageLoad(); } public function clickOnNowOnlineInTheCustomersNavMenu() { $I = $this->acceptanceTester; $I->click(self::$customersNavNowOnline); + $I->waitForPageLoad(); } public function clickOnMarketingInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingButton); - $I->wait(1); + $I->waitForPageLoad(); } public function clickOnCatalogPriceRulesInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavPromotionsCatalogPriceRule); + $I->waitForPageLoad(); } public function clickOnCartPriceRulesInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavPromotionsCartPriceRules); + $I->waitForPageLoad(); } public function clickOnEmailTemplatesInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavCommunicationsEmailTemplates); + $I->waitForPageLoad(); } public function clickOnNewsletterTemplatesInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavCommunicationsNewsletterTemplates); + $I->waitForPageLoad(); } public function clickOnNewsletterQueueInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavCommunicationsNewsletterQueue); + $I->waitForPageLoad(); } public function clickOnNewsletterSubscribersInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavCommunicationsNewsletterSubscribers); + $I->waitForPageLoad(); } public function clickOnURLRewritesInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavSEOSearchURLRewrites); + $I->waitForPageLoad(); } public function clickOnSearchTermsInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavSEOSearchTerms); + $I->waitForPageLoad(); } public function clickOnSearchSynonymsInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavSEOSearchSynonyms); + $I->waitForPageLoad(); } public function clickOnSiteMapInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavSEOSearchSiteMap); + $I->waitForPageLoad(); } public function clickOnContentReviewsInTheMarketingNavMenu() { $I = $this->acceptanceTester; $I->click(self::$marketingNavUserContentReviews); + $I->waitForPageLoad(); } public function clickOnContentInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$contentButton); - $I->wait(1); + $I->waitForPageLoad(); } public function clickOnPagesInTheContentNavMenu() { $I = $this->acceptanceTester; $I->click(self::$contentNavElementsPages); + $I->waitForPageLoad(); } public function clickOnBlocksInTheContentNavMenu() { $I = $this->acceptanceTester; $I->click(self::$contentNavElementsBlocks); + $I->waitForPageLoad(); } public function clickOnWidgetsInTheContentNavMenu() { $I = $this->acceptanceTester; $I->click(self::$contentNavElementsWidgets); + $I->waitForPageLoad(); } public function clickOnConfigurationInTheContentNavMenu() { $I = $this->acceptanceTester; $I->click(self::$contentNavDesignConfiguration); + $I->waitForPageLoad(); } public function clickOnThemesInTheContentNavMenu() { $I = $this->acceptanceTester; $I->click(self::$contentNavDesignThemes); + $I->waitForPageLoad(); } public function clickOnScheduleInTheContentNavMenu() { $I = $this->acceptanceTester; $I->click(self::$contentNavDesignSchedule); + $I->waitForPageLoad(); } public function clickOnReportsInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsButton); - $I->wait(1); + $I->waitForPageLoad(); } public function clickOnProductsInCartInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavMarketingProductsInCart); + $I->waitForPageLoad(); } public function clickOnSearchTermsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavMarketingSearchTerms); + $I->waitForPageLoad(); } public function clickOnAbandonedCartsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavMarketingAbandonedCarts); + $I->waitForPageLoad(); } public function clickOnNewsletterProblemReportsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavMarketingNewsletterProblemReports); + $I->waitForPageLoad(); } public function clickOnByCustomersInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavReviewsByCustomers); + $I->waitForPageLoad(); } public function clickOnByProductsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavReviewsByProducts); + $I->waitForPageLoad(); } public function clickOnOrdersInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesOrders); + $I->waitForPageLoad(); } public function clickOTaxInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesTax); + $I->waitForPageLoad(); } public function clickOnInvoicedInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesInvoiced); + $I->waitForPageLoad(); } public function clickOnShippingInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesShipping); + $I->waitForPageLoad(); } public function clickOnRefundsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesRefunds); + $I->waitForPageLoad(); } public function clickOnCouponsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesCoupons); + $I->waitForPageLoad(); } public function clickOnPayPalSettlementInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesPayPalSettlement); + $I->waitForPageLoad(); } public function clickOnBraintreeSettlementInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavSalesBraintreeSettlement); + $I->waitForPageLoad(); } public function clickOnOrderTotalInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavCustomersOrderTotal); + $I->waitForPageLoad(); } public function clickOnOrderCountInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavCustomersOrderCount); + $I->waitForPageLoad(); } public function clickOnNewInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavCustomersNew); + $I->waitForPageLoad(); } public function clickOnViewsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsViews); + $I->waitForPageLoad(); } public function clickOnBestSellersInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsBestsellers); + $I->waitForPageLoad(); } public function clickOnLowStockInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsLowStock); + $I->waitForPageLoad(); } public function clickOnOrderedInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsOrdered); + $I->waitForPageLoad(); } public function clickOnDownloadsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavProductsDownloads); + $I->waitForPageLoad(); } public function clickOnRefreshStatisticsInTheReportsNavMenu() { $I = $this->acceptanceTester; $I->click(self::$reportsNavStatisticsRefreshStatistics); + $I->waitForPageLoad(); } public function clickOnStoresInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesButton); - $I->wait(1); + $I->waitForPageLoad(); } public function clickOnAllStoresInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavSettingsAllStores); + $I->waitForPageLoad(); } public function clickOnConfigurationInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavSettingsConfiguration); + $I->waitForPageLoad(); } public function clickOnTermsAndConditionsInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavSettingsTermsAndConditions); + $I->waitForPageLoad(); } public function clickOnOrderStatusInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavSettingsOrderStatus); + $I->waitForPageLoad(); } public function clickOnTaxRuleInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavTaxesTaxRules); + $I->waitForPageLoad(); } public function clickOnTaxZonesAndRatesInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavTaxesTaxZonesAndRates); + $I->waitForPageLoad(); } public function clickOnTaxRatesInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavCurrencyRates); + $I->waitForPageLoad(); } public function clickOnTaxSymbolsInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavCurrencySymbols); + $I->waitForPageLoad(); } public function clickOnCurrencyRatesInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavCurrencyRates); + $I->waitForPageLoad(); } public function clickOnCurrencySymbolsInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavCurrencySymbols); + $I->waitForPageLoad(); } public function clickOnProductInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavAttributesProduct); + $I->waitForPageLoad(); } public function clickOnAttributesSetInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavAttributesSet); + $I->waitForPageLoad(); } public function clickOnRatingsInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavAttributesRating); + $I->waitForPageLoad(); } public function clickOnCustomerGroupInTheStoresNavMenu() { $I = $this->acceptanceTester; $I->click(self::$storesNavOtherSettingsCustomerGroups); + $I->waitForPageLoad(); } public function clickOnSystemInTheSideNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemButton); - $I->wait(1); + $I->waitForPageLoad(); } public function clickOnImportInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavDataTransferImport); + $I->waitForPageLoad(); } public function clickOnExportInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavDataTransferExport); + $I->waitForPageLoad(); } public function clickOnImportExportTaxRatesInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavDataTransferImportExportTaxRates); + $I->waitForPageLoad(); } public function clickOnImportHistoryInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavDataTransferImportHistory); + $I->waitForPageLoad(); } public function clickOnIntegrationsInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavExtensionsIntegrations); + $I->waitForPageLoad(); } public function clickOnCacheManagementInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavToolsCacheManagement); + $I->waitForPageLoad(); } public function clickOnBackupsInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavToolsBackups); + $I->waitForPageLoad(); } public function clickOnIndexManagementInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavToolsIndexManagement); + $I->waitForPageLoad(); } public function clickOnWebSetupWizardInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavToolsWebSetupWizard); - $I->wait(1); + $I->waitForLoadingMaskToDisappear(); } public function clickOnAllUsersInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavPermissionsAllUsers); + $I->waitForPageLoad(); } public function clickOnLockedUsersInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavPermissionsLockedUsers); + $I->waitForPageLoad(); } public function clickOnUserRolesInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavPermissionsUserRoles); + $I->waitForPageLoad(); } public function clickOnNotificationsInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavOtherSettingsNotifications); + $I->waitForPageLoad(); } public function clickOnCustomVariablesInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavOtherSettingsCustomVariables); + $I->waitForPageLoad(); } public function clickOnManageEncryptionKeyInTheSystemNavMenu() { $I = $this->acceptanceTester; $I->click(self::$systemNavOtherSettingsManageEncryptionKey); + $I->waitForPageLoad(); } public function clickOnFindPartnersAndExtensionsInTheSideNavMenu() diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php index a091cfca4..03aeca08b 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php @@ -27,8 +27,8 @@ class AdminCategoryPage extends AbstractAdminPage /** * Category data fields. */ - public static $categoryName = '.admin__field[data-index=name] input'; - public static $categoryUrlKey = '.admin__field[data-index=url_key] input'; + public static $categoryName = '.admin__control-text[name=name]'; + public static $categoryUrlKey = '.admin__control-text[name=url_key]'; /** * Category form loading spinner. @@ -40,27 +40,58 @@ public function amOnAdminCategoryPage($param = '') { $I = $this->acceptanceTester; $I->amOnPage(self::route($param)); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageLoadTimeout); + $I->waitForPageLoad(); } public function amOnAdminCategoryPageById($id) { $I = $this->acceptanceTester; $I->amOnPage(self::$URL . 'edit/id/' . $id); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageLoadTimeout); + $I->waitForPageLoad(); } public function addRootCategory() { $I = $this->acceptanceTester; $I->click(self::$addRootCategoryButton); + $I->waitForPageLoad(); } public function addSubCategory() { $I = $this->acceptanceTester; $I->click(self::$addSubCategoryButton); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner, $this->pageLoadTimeout); + $I->waitForPageLoad(); + } + + public function clickOnContent() + { + self::clickOnCollapsibleArea('Content'); + } + + public function clickOnDisplaySettings() + { + self::clickOnCollapsibleArea('Display Settings'); + } + + public function clickOnSearchEngineOptimization() + { + self::clickOnCollapsibleArea('Search Engine Optimization'); + } + + public function clickOnProductsInCategory() + { + self::clickOnCollapsibleArea('Products in Category'); + } + + public function clickOnDesign() + { + self::clickOnCollapsibleArea('Design'); + } + + public function clickOnScheduleDesignUpdate() + { + self::clickOnCollapsibleArea('Schedule Design Update'); } public function fillFieldCategoryName($name) @@ -72,10 +103,6 @@ public function fillFieldCategoryName($name) public function fillFieldCategoryUrlKey($name) { $I = $this->acceptanceTester; - try { - $I->click(sprintf(self::$categorySearchEngineOptimToggle, 'closed')); - } catch (\Exception $e) { - } $I->fillField(self::$categoryUrlKey, $name); } @@ -83,8 +110,18 @@ public function saveCategory() { $I = $this->acceptanceTester; $I->click(self::$saveCategoryButton); - $I->waitForElementNotVisible(self::$popupLoadingSpinner); - $I->waitForElementNotVisible(self::$categoryFormLoadingSpinner); - $I->waitForElementVisible(self::$successMessage); + $I->waitForPageLoad(); + } + + public function addBasicCategory($categoryDetails) + { + self::addRootCategory(); + + self::fillFieldCategoryName($categoryDetails['categoryName']); + + self::clickOnSearchEngineOptimization(); + self::fillFieldCategoryUrlKey($categoryDetails['urlKey']); + + self::saveCategory(); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php index 4fd0fd2ea..28f67d443 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php @@ -49,7 +49,7 @@ public function amOnAdminProductGridPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); + $I->waitForPageLoad(); } public function clickAddNewProductPage() @@ -62,21 +62,20 @@ public function searchBySku($sku) { $I = $this->acceptanceTester; try { - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); + $I->waitForPageLoad(); $I->click(self::$filterClearAllButton); } catch (\Codeception\Exception\ElementNotFound $e) { } try { - $I->waitForElementNotVisible(self::$productGridNotificationLoadingSpinner, $this->pageLoadTimeout); - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); + $I->waitForPageLoad(); $I->click(self::$filterExpandButton); - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); + $I->waitForPageLoad(); } catch (\Codeception\Exception\ElementNotFound $e) { } $I->fillField(self::$filterProductSku, $sku); $I->click(self::$filterApplyButton); - $I->waitForElementNotVisible(self::$productGridProductListingLoadingSpinner, $this->pageLoadTimeout); + $I->waitForPageLoad(); } public function containsInNthRow($n, $text) diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php index 72588add2..882516fe7 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php @@ -13,6 +13,7 @@ class AdminProductPage extends AbstractAdminPage /** * Buttons in product page. */ + public static $productAddProductButton = '#add_new_product-button'; public static $productSaveButton = '#save-button'; /** @@ -47,7 +48,7 @@ class AdminProductPage extends AbstractAdminPage public function amOnAdminNewProductPage() { $I = $this->acceptanceTester; - $I->waitForElementVisible(self::$productName, $this->pageLoadTimeout); + $I->waitForPageLoad(); $I->seeInCurrentUrl(static::$URL . 'new'); } @@ -55,7 +56,14 @@ public function amOnAdminEditProductPageById($id) { $I = $this->acceptanceTester; $I->amOnPage(self::route('edit/id/' . $id)); - $I->waitForElementVisible(self::$productName, $this->pageLoadTimeout); + $I->waitForPageLoad(); + } + + public function clickOnAddProductButton() + { + $I = $this->acceptanceTester; + $I->click(self::$productAddProductButton); + $I->waitForPageLoad(); } public function seeProductAttributeSet($name) @@ -177,8 +185,18 @@ public function saveProduct() { $I = $this->acceptanceTester; $I->performOn(self::$productSaveButton, ['click' => self::$productSaveButton]); - $I->waitForElementNotVisible(self::$popupLoadingSpinner); - $I->waitForElementNotVisible(self::$productFormLoadingSpinner); - $I->waitForElementVisible(self::$successMessage); + $I->waitForPageLoad(); + } + + public function addBasicProductUnderCategory($productData, $categoryData) + { + self::clickOnAddProductButton(); + + self::fillFieldProductName($productData['productName']); + self::fillFieldProductSku($productData['sku']); + self::fillFieldProductPrice($productData['price']); + self::selectProductCategories(array($categoryData['categoryName'])); + + self::saveProduct(); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php index 3fb23ee4e..c52325dae 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php @@ -37,7 +37,7 @@ public function amOnCategoryPage($categoryUrlKey, $params = '') { $I = $this->acceptanceTester; $I->amOnPage(self::route($categoryUrlKey . '.html' . $params)); - $I->waitPageLoad(); + $I->waitForPageLoad(); } public function seeCategoryNameInTitleHeading($name) @@ -81,7 +81,7 @@ public function goToPageForProduct($name) } catch (WebDriverException $e) { try { $I->click(self::$pageNextButton); - $I->waitPageLoad(); + $I->waitForPageLoad(); } catch (WebDriverException $e) { } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php index 3746b8a63..95ad271ff 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php @@ -19,7 +19,7 @@ public function amOnProductPage($categoryUrlKey) { $I = $this->acceptanceTester; $I->amOnPage(self::route($categoryUrlKey . '.html')); - $I->waitPageLoad(); + $I->waitForPageLoad(); } public function seeProductNameInPage($name) diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php index 7975a76f6..d6ce737f2 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php @@ -27,7 +27,7 @@ public function clickOnActionEditFor($keyText) self::clickOnActionSelectLinkFor($keyText); $I->click($selector); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); } public function clickOnActionDeleteFor($keyText) @@ -37,7 +37,7 @@ public function clickOnActionDeleteFor($keyText) self::clickOnActionSelectLinkFor($keyText); $I->click($selector); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); } public function clickOnActionViewFor($keyText) @@ -47,6 +47,6 @@ public function clickOnActionViewFor($keyText) self::clickOnActionSelectLinkFor($keyText); $I->click($selector); - $I->waitForLoadingMaskToDisappear(); + $I->waitForPageLoad(); } } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php index d9267b4ba..be344eb7c 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php @@ -27,12 +27,15 @@ class AdminCmsPage extends AbstractAdminPage public static $pageTitleField = '.admin__control-text[name="title"]'; public static $contentHeadingField = '.admin__control-text[name="content_heading"]'; public static $insertWidgetButton = '.action-add-widget'; + // TODO: Add Selectors for the "Insert Widget" section and controls public static $insertImageButton = '.action-add-image'; + // TODO: Add Selectors for the "Insert Image" section and controls public static $insertVariableButton = '.add-variable'; + // TODO: Add Selectors for the "Insert Variable" section and controls public static $contentBodyField = '#cms_page_form_content'; @@ -57,14 +60,14 @@ public function amOnAdminCmsPage($param = '') { $I = $this->acceptanceTester; $I->amOnPage(self::route($param)); - $I->waitForElementNotVisible('.admin__data-grid-loading-mask', 30); // secs + $I->waitForPageLoad(); } public function amOnAdminCmsPageById($id) { $I = $this->acceptanceTester; $I->amOnPage(self::$URL . 'edit/page_id/' . $id); - $I->waitForElementNotVisible(self::$cmsFormLoadingSpinner, 30); // secs + $I->waitForPageLoad(); } public function seePageNameInPageTitle($name) @@ -77,7 +80,7 @@ public function clickOnAddNewPageButton() { $I = $this->acceptanceTester; $I->click(self::$cmsAddNewPageButton); - $I->waitForElementNotVisible(self::$cmsFormLoadingSpinner, 30); // secs + $I->waitForPageLoad(); } public function clickOnEnablePageToggle() @@ -230,7 +233,6 @@ public function pressShiftOnTheKeyboard() public function selectMultipleStoreViews($storeViews) { - $I = $this->acceptanceTester; // TODO: Add multi-select support for the "Store View" setting } @@ -299,6 +301,7 @@ public function verifyLayoutUpdateXml($layoutXml) } // TODO: Add calendar modal support + public function enterFrom($fromDate) { $I = $this->acceptanceTester; @@ -421,8 +424,7 @@ public function savePage() { $I = $this->acceptanceTester; $I->click(self::$savePageButton); - $I->waitForElementNotVisible(self::$pageSavedSpinner); - $I->waitForElementVisible(self::$pageSaveSuccessMessage); + $I->waitForPageLoad(); } public function seeSaveSuccessMessage() @@ -431,12 +433,6 @@ public function seeSaveSuccessMessage() $I->seeElement(self::$pageSaveSuccessMessage); } - public function clickOnCollapsibleArea($areaName) - { - $I = $this->acceptanceTester; - $I->click('//div[@class="fieldset-wrapper-title"]/strong/span[contains(text(), "' . $areaName . '")]'); - } - public function clickOnPageContent() { self::clickOnCollapsibleArea('Content'); @@ -461,4 +457,20 @@ public function clickOnPageCustomDesignUpdate() { self::clickOnCollapsibleArea('Custom Design Update'); } + + public function addBasicPage($pageDetails) + { + self::clickOnAddNewPageButton(); + + self::clickOnPageContent(); + + self::enterPageTitle($pageDetails['pageTitle']); + self::enterPageContentHeading($pageDetails['contentHeading']); + self::enterPageContentBody($pageDetails['contentBody']); + + self::clickOnPageSearchEngineOptimisation(); + self::enterUrlKey($pageDetails['urlKey']); + + self::savePage(); + } } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php index 89e45d84f..c907b3620 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php @@ -1,7 +1,6 @@ acceptanceTester; self::clickOnAdminAddButton(); + $I->waitForPageLoad(); } public function clickOnDeleteCustomerButton() @@ -608,4 +609,40 @@ public function verifyAddAddressVatNumber($vatNumber) // TODO: Add Methods for the "Newsletter" section and controls // TODO: Add Methods for the "Product Reviews" section and controls // TODO: Add Methods for the "Wish List" section and controls + + public function addBasicCustomerWithAddress($customerDetails) + { + self::clickOnAddCustomerButton(); + + self::clickOnAddressesLink(); + self::clickOnAddNewAddressButton(); + + self::clickOnAddNewAddressDefaultBillingAddress(); + self::clickOnAddNewAddressDefaultShippingAddress(); + + self::enterAddAddressPrefix($customerDetails['prefix']); + self::enterAddAddressFirstName($customerDetails['firstname']); + self::enterAddAddressMiddleName($customerDetails['middlename']); + self::enterAddAddressLastName($customerDetails['lastname']); + self::enterAddAddressSuffix($customerDetails['suffix']); + self::enterAddAddressCompany($customerDetails['company']); + self::enterAddAddressAddress1($customerDetails['address']['address1']); + self::enterAddAddressAddress2($customerDetails['address']['address2']); + self::enterAddAddressCity($customerDetails['address']['city']); + self::enterAddAddressCountry($customerDetails['address']['country']); + self::enterAddAddressState($customerDetails['address']['state']); + self::enterAddAddressZipPostalCode($customerDetails['address']['zipCode']); + self::enterAddAddressPhoneNumber($customerDetails['phoneNumber']); + self::enterAddAddressVatNumber($customerDetails['taxVatNumber']); + + self::clickOnAccountInformationLink(); + + self::enterFirstName($customerDetails['firstname']); + self::enterLastName($customerDetails['lastname']); + self::enterEmailAddress($customerDetails['email']); + self::selectAssociateToWebsiteMainWebsite(); + self::selectGroupGeneral(); + + self::clickOnAdminSaveButton(); + } } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php index e5e5a89a2..854cace04 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php @@ -25,7 +25,7 @@ public function amOnCustomerAccountCreatePage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitPageLoad(); + $I->waitForPageLoad(); } public function fillFieldFirstName($firstName) @@ -58,7 +58,7 @@ public function fillFieldConfirmPassword($password) $I->fillField(self::$customerConfirmPassword, $password); } - public function setNewsletterSubscribe(bool $checked) + public function setNewsletterSubscribe($checked) { $I = $this->acceptanceTester; try { @@ -78,7 +78,7 @@ public function clickCreateAccountButton() { $I = $this->acceptanceTester; $I->click(self::$createAccountSubmitButton); - $I->waitPageLoad(); + $I->waitForPageLoad(); $I->seeInCurrentUrl('customer/account'); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php index cb319eec1..c61305c00 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php @@ -27,7 +27,7 @@ public function amOnCustomerAccountDashboardPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitPageLoad(); + $I->waitForPageLoad(); $this->setCustomerContactInformation(); } @@ -55,7 +55,7 @@ public function clickContactInformationEditLink() { $I = $this->acceptanceTester; $I->click(self::$contactInfomationEditLink); - $I->waitPageLoad(); + $I->waitForPageLoad(); $I->seeInCurrentUrl('customer/account/edit'); } @@ -63,7 +63,7 @@ public function clickContactInformationForgotPasswordLink() { $I = $this->acceptanceTester; $I->click(self::$contactInfomationForgotPwdLink); - $I->waitPageLoad(); + $I->waitForPageLoad(); $I->seeInCurrentUrl('customer/account/edit/changepass'); } @@ -71,7 +71,7 @@ public function clickNewsletterEditLink() { $I = $this->acceptanceTester; $I->click(self::$newsletterEditLink); - $I->waitPageLoad(); + $I->waitForPageLoad(); $I->seeInCurrentUrl('newsletter/manage'); } diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php index 7f2687e59..d9d837bf8 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php @@ -24,7 +24,7 @@ public function amOnCustomerAccountLoginPage() { $I = $this->acceptanceTester; $I->amOnPage(self::$URL); - $I->waitPageLoad(); + $I->waitForPageLoad(); } public function fillFieldCustomerEmail($email) @@ -43,7 +43,7 @@ public function clickSignInButton() { $I = $this->acceptanceTester; $I->click(self::$customerSignInButton); - $I->waitPageLoad(); + $I->waitForPageLoad(); $I->seeInCurrentUrl('customer/account'); } @@ -51,7 +51,7 @@ public function clickCreateAccountButton() { $I = $this->acceptanceTester; $I->click(self::$createNewAccountLink); - $I->waitPageLoad(); + $I->waitForPageLoad(); $I->seeInCurrentUrl('customer/account/create'); } diff --git a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php index a1fdd4bd6..e1c120ecb 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php +++ b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php @@ -10,6 +10,7 @@ public function openNewTabGoToVerify($url) $I = $this; $I->openNewTab(); $I->amOnPage($url); + $I->waitForPageLoad(); $I->seeInCurrentUrl($url); } @@ -23,6 +24,7 @@ public function goToTheAdminLoginPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogin); + $I->waitForPageLoad(); } public function goToTheAdminLogoutPage() @@ -118,52 +120,52 @@ public function goToRandomAdminPage() $random_admin_url = array_rand($admin_url_list, 1); $I->amOnPage($admin_url_list[$random_admin_url]); + $I->waitForPageLoad(); return $admin_url_list[$random_admin_url]; } - public function waitForSpinnerToDisappear() - { - $I = $this; - $I->wait(1); - $I->waitForElementNotVisible('.admin__data-grid-loading-mask', 15); - } - // Sales public function goToTheAdminSalesOrdersPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesOrders); + $I->waitForPageLoad(); } public function goToTheAdminSalesInvoicesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesInvoices); + $I->waitForPageLoad(); } public function goToTheAdminSalesShipmentsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesShipments); + $I->waitForPageLoad(); } public function goToTheAdminSalesCreditMemosPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesCreditMemos); + $I->waitForPageLoad(); } public function goToTheAdminSalesBillingAgreementsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesBillingAgreements); + $I->waitForPageLoad(); } public function goToTheAdminSalesTransactionsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesTransactions); + $I->waitForPageLoad(); } // Products @@ -171,12 +173,14 @@ public function goToTheAdminProductsCatalogPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCatalog); + $I->waitForPageLoad(); } public function goToTheAdminProductsCategoriesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCategories); + $I->waitForPageLoad(); } // Customers @@ -184,12 +188,14 @@ public function goToTheAdminCustomersAllCustomersPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersAllCustomers); + $I->waitForPageLoad(); } public function goToTheAdminCustomersNowOnlinePage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnline); + $I->waitForPageLoad(); } // Marketing @@ -197,66 +203,77 @@ public function goToTheAdminMarketingCatalogPriceRulePage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCatalogPriceRule); + $I->waitForPageLoad(); } public function goToTheAdminMarketingCartPriceRulePage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCartPriceRules); + $I->waitForPageLoad(); } public function goToTheAdminMarketingEmailTemplatesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingEmailTemplates); + $I->waitForPageLoad(); } public function goToTheAdminMarketingNewsletterTemplatePage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterTemplate); + $I->waitForPageLoad(); } public function goToTheAdminMarketingNewsletterQueuePage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterQueue); + $I->waitForPageLoad(); } public function goToTheAdminMarketingNewsletterSubscribersPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterSubscribers); + $I->waitForPageLoad(); } public function goToTheAdminMarketingURLRewritesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingURLRewrites); + $I->waitForPageLoad(); } public function goToTheAdminMarketingSearchTermsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchTerms); + $I->waitForPageLoad(); } public function goToTheAdminMarketingSearchSynonymsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchSynonyms); + $I->waitForPageLoad(); } public function goToTheAdminMarketingSiteMapPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSiteMap); + $I->waitForPageLoad(); } public function goToTheAdminMarketingReviewsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingReviews); + $I->waitForPageLoad(); } // Content @@ -264,36 +281,42 @@ public function goToTheAdminContentPagesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentPages); + $I->waitForPageLoad(); } public function goToTheAdminContentBlocksPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentBlocks); + $I->waitForPageLoad(); } public function goToTheAdminContentWidgetsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentWidgets); + $I->waitForPageLoad(); } public function goToTheAdminContentConfigurationPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentConfiguration); + $I->waitForPageLoad(); } public function goToTheAdminContentThemesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentThemes); + $I->waitForPageLoad(); } public function goToTheAdminContentSchedulePage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentSchedule); + $I->waitForPageLoad(); } // Reports @@ -301,138 +324,161 @@ public function goToTheAdminReportsProductsInCartPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsProductsInCart); + $I->waitForPageLoad(); } public function goToTheAdminReportsSearchTermsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsSearchTerms); + $I->waitForPageLoad(); } public function goToTheAdminReportsAbandonedCartsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsAbandonedCArts); + $I->waitForPageLoad(); } public function goToTheAdminReportsNewsletterProblemReportsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNewsletterProblemReports); + $I->waitForPageLoad(); } public function goToTheAdminReportsByCustomersPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByCustomers); + $I->waitForPageLoad(); } public function goToTheAdminReportsByProductsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByProducts); + $I->waitForPageLoad(); } public function goToTheAdminReportsOrdersPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrders); + $I->waitForPageLoad(); } public function goToTheAdminReportsTaxPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsTax); + $I->waitForPageLoad(); } public function goToTheAdminReportsInvoicedPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsInvoiced); + $I->waitForPageLoad(); } public function goToTheAdminReportsShippingPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsShipping); + $I->waitForPageLoad(); } public function goToTheAdminReportsRefundsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefunds); + $I->waitForPageLoad(); } public function goToTheAdminReportsCouponsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsCoupons); + $I->waitForPageLoad(); } public function goToTheAdminReportsPayPalSettlementPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsPayPalSettlement); + $I->waitForPageLoad(); } public function goToTheAdminReportsBraintreeSettlementPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBraintreeSettlement); + $I->waitForPageLoad(); } public function goToTheAdminReportsOrderTotalPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderTotal); + $I->waitForPageLoad(); } public function goToTheAdminReportsOrderCountPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderCount); + $I->waitForPageLoad(); } public function goToTheAdminReportsNewPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNew); + $I->waitForPageLoad(); } public function goToTheAdminReportsViewsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsViews); + $I->waitForPageLoad(); } public function goToTheAdminReportsBestsellersPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBestsellers); + $I->waitForPageLoad(); } public function goToTheAdminReportsLowStockPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsLowStock); + $I->waitForPageLoad(); } public function goToTheAdminReportsOrderedPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrdered); + $I->waitForPageLoad(); } public function goToTheAdminReportsDownloadsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsDownloads); + $I->waitForPageLoad(); } public function goToTheAdminReportRefreshStatisticsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefreshStatistics); + $I->waitForPageLoad(); } // Stores @@ -440,72 +486,84 @@ public function goToTheAdminStoresAllStoresPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAllStores); + $I->waitForPageLoad(); } public function goToTheAdminStoresConfigurationPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresConfiguration); + $I->waitForPageLoad(); } public function goToTheAdminStoresTermsAndConditionsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTermsAndConditions); + $I->waitForPageLoad(); } public function goToTheAdminStoresOrderStatusPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresOrderStatus); + $I->waitForPageLoad(); } public function goToTheAdminStoresTaxRulesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxRules); + $I->waitForPageLoad(); } public function goToTheAdminStoresTaxZonesAndRatesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxZonesAndRates); + $I->waitForPageLoad(); } public function goToTheAdminStoresCurrencyRatesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencyRates); + $I->waitForPageLoad(); } public function goToTheAdminStoresCurrencySymbolsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencySymbols); + $I->waitForPageLoad(); } public function goToTheAdminStoresProductPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresProduct); + $I->waitForPageLoad(); } public function goToTheAdminStoresAttributeSetPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAttributeSet); + $I->waitForPageLoad(); } public function goToTheAdminStoresRatingPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresRating); + $I->waitForPageLoad(); } public function goToTheAdminStoresCustomerGroupsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCustomerGroups); + $I->waitForPageLoad(); } // System @@ -513,96 +571,112 @@ public function goToTheAdminSystemImportPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImport); + $I->waitForPageLoad(); } public function goToTheAdminSystemExportPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemExport); + $I->waitForPageLoad(); } public function goToTheAdminSystemImportExportTaxRatesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportExportTaxRates); + $I->waitForPageLoad(); } public function goToTheAdminSystemImportHistoryPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportHistory); + $I->waitForPageLoad(); } public function goToTheAdminSystemIntegrationsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIntegrations); + $I->waitForPageLoad(); } public function goToTheAdminSystemCacheManagementPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCacheManagement); + $I->waitForPageLoad(); } public function goToTheAdminSystemBackupsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemBackups); + $I->waitForPageLoad(); } public function goToTheAdminSystemIndexManagementPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIndexManagement); + $I->waitForPageLoad(); } public function goToTheAdminSystemWebSetupWizardPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemWebSetupWizard); + $I->waitForPageLoad(); } public function goToTheAdminSystemAllUsersPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemAllUsers); + $I->waitForPageLoad(); } public function goToTheAdminSystemLockedUsersPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemLockedUsers); + $I->waitForPageLoad(); } public function goToTheAdminSystemUserRolesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemUserRoles); + $I->waitForPageLoad(); } public function goToTheAdminSystemNotificationsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemNotifications); + $I->waitForPageLoad(); } public function goToTheAdminSystemCustomVariablesPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCustomVariables); + $I->waitForPageLoad(); } public function goToTheAdminSystemManageEncryptionKeyPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemManageEncryptionKey); + $I->waitForPageLoad(); } public function goToTheAdminFindPartnersAndExtensionsPage() { $I = $this; $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminFindPartnersAndExtensions); + $I->waitForPageLoad(); } public function shouldBeOnTheAdminLoginPage() diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index b69ca398e..cd5d14cae 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -18,9 +18,7 @@ * * Allure annotations * @Features({"Category"}) - * @Stories({"Create sub Category"}) - * @Title("Create sub category with required fields") - * @Description("Create sub category with required fields") + * @Stories({"Create a sub-Category"}) * * Codeception annotations * @group catalog @@ -42,15 +40,14 @@ public function _after(AdminStep $I) } /** - * Create sub category in admin. - * * Allure annotations - * @Title("Method Title: Create sub category with required fields") - * @Description("Method Description: Create sub category with required fields") + * @Title("Create sub category with required fields") + * @Description("Create sub category with required fields") * @Severity(level = SeverityLevel::CRITICAL) * @TestCaseId("") * @Parameter(name = "Admin", value = "$I") * + * Codeception annotations * @param AdminStep $I * @return void */ @@ -58,9 +55,12 @@ public function createCategoryTest(AdminStep $I) { $I->wantTo('create sub category with required fields in admin Category page.'); $category = $I->getCategoryApiData(); + AdminCategoryPage::of($I)->amOnAdminCategoryPage(); AdminCategoryPage::of($I)->addSubCategory(); AdminCategoryPage::of($I)->fillFieldCategoryName($category['name']); + + AdminCategoryPage::of($I)->clickOnSearchEngineOptimization(); AdminCategoryPage::of($I)->fillFieldCategoryUrlKey($category['custom_attributes'][0]['value']); AdminCategoryPage::of($I)->saveCategory(); $I->seeElement(AdminCategoryPage::$successMessage); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php index 0b98af8fc..145e0bb2f 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php @@ -39,7 +39,6 @@ public function _before( $I->loginAsAdmin(); $adminCmsPage->amOnAdminCmsPage(); $adminCmsPage->clickOnAddNewPageButton(); - $I->waitForSpinnerToDisappear(); } public function _after(AdminStep $I) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php index 6c46d88cd..6ef438c18 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php @@ -37,7 +37,6 @@ public function _before( $I->loginAsAdmin(); $I->goToTheAdminCustomersAllCustomersPage(); $customerPage->clickOnAddCustomerButton(); - $I->waitForSpinnerToDisappear(); } /** From 3f2a54268da50efb8890b82b0d5675a82dcd37b5 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Mon, 24 Apr 2017 09:12:43 -0500 Subject: [PATCH 053/149] - Updating Setup Wizard page URL. - Adding getCategoryData and getProductData functions. - Correcting Allure annotation for a few tests. - Adding a new method to Robo for cloning all local setup files. --- RoboFile.php | 8 +++- .../Magento/Xxyyzz/Helper/AdminUrlList.php | 2 +- .../Xxyyzz/Module/MagentoFakerData.php | 48 +++++++++++++++++++ .../Catalog/UpdateSimpleProductCest.php | 8 +--- .../CreateNewCustomerFrontendCest.php | 24 ++++++---- .../Customer/SignInCustomerFrontendCest.php | 4 +- 6 files changed, 74 insertions(+), 20 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index 6edb232ee..0bd47f512 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -10,6 +10,12 @@ class RoboFile extends \Robo\Tasks use Robo\Task\Base\loadShortcuts; // define public methods as commands + function cloneFiles() { + $this->_exec('cp -vn .env.example .env'); + $this->_exec('cp -vn codeception.dist.yml codeception.yml'); + $this->_exec('cp -vn tests/acceptance.suite.dist.yml tests/acceptance.suite.yml'); + } + function allureGenerate() { return $this->_exec('allure generate tests/_output/allure-results/ -o tests/_output/allure-report/'); } @@ -42,7 +48,7 @@ function example() { } function group($args = '') { - $this->taskExec('codecept run acceptance --env chrome --skip-group skip --group')->args($args)->run(); + $this->taskExec('codecept run acceptance --verbose --steps --env chrome --skip-group skip --group')->args($args)->run(); } function chrome() { diff --git a/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php b/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php index 1e80a2661..df4723e74 100644 --- a/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php +++ b/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php @@ -89,7 +89,7 @@ class AdminUrlList public static $adminSystemCacheManagement = '/admin/admin/cache/'; public static $adminSystemBackups = '/admin/backup/index/'; public static $adminSystemIndexManagement = '/admin/indexer/indexer/list/'; - public static $adminSystemWebSetupWizard = '/setup/#/home'; + public static $adminSystemWebSetupWizard = '/setup/'; public static $adminSystemAllUsers = '/admin/admin/user/'; public static $adminSystemLockedUsers = '/admin/admin/locks/'; public static $adminSystemUserRoles = '/admin/admin/user_role/'; diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index e34f06c23..733cf29e5 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -150,6 +150,54 @@ public function getCustomerData(array $additional = []) return array_merge($customerData, $additional); } + /** + * Get category data. + * + * @return array + */ + public function getCategoryData() + { + $faker = \Faker\Factory::create(); + + return [ + 'enableCategory' => $faker->boolean(), + 'includeInMenu' => $faker->boolean(), + 'categoryName' => $faker->md5, + 'categoryImage' => '', + 'description' => $faker->sentence($nbWords = 10, $variableNbWords = true), + 'addCMSBlock' => '', + + 'urlKey' => $faker->uuid, + 'metaTitle' => $faker->word, + 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), + 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true), + ]; + } + + /** + * Get simple product api data. + * + * @param integer $categoryId + * @param array $productData + * @return array + */ + public function getProductData($categoryId = 0, $productData = []) + { + $faker = \Faker\Factory::create(); + return [ + 'enableProduct' => $faker->boolean(), + 'attributeSet' => '', + 'productName' => $faker->text($maxNbChars = 20), + 'sku' => $faker->uuid, + 'price' => $faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 999), + + 'urlKey' => $faker->uuid, + 'metaTitle' => $faker->word, + 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), + 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true) + ]; + } + /** * Get Content Page Data. * diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index 3195d575d..108c0b334 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -23,8 +23,6 @@ * Allure annotations * @Features({"Catalog"}) * @Stories({"Update simple product"}) - * @Title("Update simple product with required fields") - * @Description("Update simple product with required fields") * * Codeception Annotations * @group catalog @@ -81,11 +79,9 @@ public function _after(AdminStep $I) } /** - * Update simple product in admin. - * * Allure annotations - * @Title("Mathod Title: Update simple product with required fields") - * @Description("Method Description: Update simple product with required fields") + * @Title("Update simple product with required fields") + * @Description("Update simple product with required fields") * @Severity(level = SeverityLevel::CRITICAL) * @TestCaseId("") * @Parameter(name = "AdminStep", value = "$I") diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php index 8d502469c..5456aa7e9 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php @@ -11,14 +11,21 @@ use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class SignInCustomerFrontendCest * - * @Stories({"Create customer"}) - * @Features({"Create customer"}) - * @Title("Create customer") - * @Description("Create customer") + * Allure annotations + * @Features({"Customer"}) + * @Stories({"Create Customer via Storefront"}) + * + * Codeception annotations + * @group customer + * @group add + * @env chrome + * @env firefox + * @env phantomjs */ class CreateNewCustomerFrontendCest { @@ -41,16 +48,13 @@ public function _before(AcceptanceTester $I) * Create customer. * * Allure annotations - * @Description("Method Description: Create customer") + * @Title("Create a a basic Customer - Storefront") + * @Description("Create a basic Customer via the Storefront.") * @Severity(level = SeverityLevel::CRITICAL) + * @TestCaseId("") * @Parameter(name = "Admin", value = "$I") * * Codeception annotations - * @group customer - * @env chrome - * @env firefox - * @env phantomjs - * * @param AcceptanceTester $I * @return void */ diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php index 501b5eafb..c52a8471d 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php @@ -16,10 +16,9 @@ /** * Class SignInCustomerFrontendCest * + * Allure annotations * @Stories({"Create customer"}) * @Features({"Create customer"}) - * @Title("Create customer") - * @Description("Create customer") */ class SignInCustomerFrontendCest { @@ -44,6 +43,7 @@ public function _before(AcceptanceTester $I, CustomerApiStep $api) * Create customer. * * Allure annotations + * @Title("Create Customer") * @Description("Method Description: Create customer") * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "Admin", value = "$I") From 7bf0eb81321fc04fd4c70c6fcb433400c39bff2d Mon Sep 17 00:00:00 2001 From: John Stennett Date: Mon, 24 Apr 2017 09:14:11 -0500 Subject: [PATCH 054/149] - Fixing Partners and Extensions admin page --- .../Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index 76e0ed08a..977269883 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -548,5 +548,6 @@ public function shouldLandOnThePartnersAndExtensionsPage(AdminStep $I, SideNav $ $I->wantTo('see if I can access the Partners and Extensions Admin Page using the Side Nav Menu'); $sideNavMenu->clickOnFindPartnersAndExtensionsInTheSideNavMenu(); $I->shouldBeOnTheAdminFindPartnersAndExtensionsPage(); + $I->goToTheAdminLogoutPage(); } } From 6390b7d82031872fe3faa2587d30501229a3cbe5 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 24 Apr 2017 12:04:59 -0500 Subject: [PATCH 055/149] MTA-4194: moved grid related function to AbstractAdminGridPage. --- tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php | 8 ++------ .../Magento/Xxyyzz/Page/AbstractAdminGridPage.php | 6 ++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php index f8ec578ed..05c147e99 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -32,7 +32,6 @@ class MagentoWebDriver extends WebDriver { public static $loadingMask = '.loading-mask'; - public static $gridLoadingMask = '.admin__data-grid-loading-mask'; /** * The module required fields, to be set in the suite .yml configuration file. @@ -217,14 +216,11 @@ public function mResetLocale() public function waitForLoadingMaskToDisappear() { - $I = $this; - $I->waitForElementNotVisible(self::$loadingMask, 30); - $I->waitForElementNotVisible(self::$gridLoadingMask, 30); + $this->waitForElementNotVisible(self::$loadingMask, 30); } public function scrollToTopOfPage() { - $I = $this; - $I->executeJS('window.scrollTo(0,0);'); + $this->executeJS('window.scrollTo(0,0);'); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php index c8c5a8cd2..d698f8abd 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php @@ -288,4 +288,10 @@ public function clickOnActionLinkFor($keyText) $I->click($actionLinkSelector); $I->waitForPageLoad(); } + + public function waitForGridLoadingMaskToDisappear() + { + $I = $this->acceptanceTester; + $I->waitForElementNotVisible(self::$gridLoadingMask, 30); + } } \ No newline at end of file From 6aebea5a8ac1d9bad529146c08a9ee75058d4d14 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 24 Apr 2017 15:38:59 -0500 Subject: [PATCH 056/149] MTA-4151: updated catalog tests; fixed price in float format. --- .../Xxyyzz/Module/MagentoWebDriver.php | 10 +++ .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 6 ++ .../Xxyyzz/Page/Catalog/AdminCategoryPage.php | 24 +++--- .../Page/Catalog/StorefrontCategoryPage.php | 5 +- .../Page/Catalog/StorefrontProductPage.php | 4 +- .../Acceptance/Catalog/CreateCategoryCest.php | 29 ++++--- .../Catalog/CreateSimpleProductCest.php | 76 +++++++++++-------- .../Catalog/UpdateSimpleProductCest.php | 67 +++++++++------- .../CreateNewCustomerFrontendCest.php | 33 ++++---- .../Customer/SignInCustomerFrontendCest.php | 25 +++--- 10 files changed, 172 insertions(+), 107 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php index 05c147e99..c0da3f17a 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -223,4 +223,14 @@ public function scrollToTopOfPage() { $this->executeJS('window.scrollTo(0,0);'); } + + /** + * Parse float number with thousands_sep. + * @param $floatString + * @return float + */ + function parseFloat($floatString){ + $floatString = str_replace(',', '', $floatString); + return floatval($floatString); + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php index 0b182c892..192b3d102 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -174,4 +174,10 @@ public function clickOnCollapsibleArea($areaName) $I = $this->acceptanceTester; $I->click('//div[@class="fieldset-wrapper-title"]/strong/span[contains(text(), "' . $areaName . '")]'); } + + public function seeSuccessMessage() + { + $I = $this->acceptanceTester; + $I->seeElement(self::$successMessage); + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php index 03aeca08b..a2059f577 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php @@ -13,28 +13,28 @@ class AdminCategoryPage extends AbstractAdminPage /** * Buttons in category page. */ - public static $addRootCategoryButton = '#add_root_category_button'; - public static $addSubCategoryButton = '#add_subcategory_button'; + public static $addRootCategoryButton = '#add_root_category_button'; + public static $addSubCategoryButton = '#add_subcategory_button'; - public static $scheduleNewUpdateButton = '#staging_update_new'; - public static $saveCategoryButton = '#save'; + public static $scheduleNewUpdateButton = '#staging_update_new'; + public static $saveCategoryButton = '#save'; - public static $categoryContentToggle = - '.fieldset-wrapper[data-index=content] .fieldset-wrapper-title[data-state-collapsible=%s]'; - public static $categorySearchEngineOptimToggle = - '.fieldset-wrapper[data-index=search_engine_optimization] .fieldset-wrapper-title[data-state-collapsible=%s]'; + public static $categoryContentToggle + = '.fieldset-wrapper[data-index=content] .fieldset-wrapper-title[data-state-collapsible=%s]'; + public static $categorySearchEngineOptimToggle + = '.fieldset-wrapper[data-index=search_engine_optimization] .fieldset-wrapper-title[data-state-collapsible=%s]'; /** * Category data fields. */ - public static $categoryName = '.admin__control-text[name=name]'; - public static $categoryUrlKey = '.admin__control-text[name=url_key]'; + public static $categoryName = '.admin__control-text[name=name]'; + public static $categoryUrlKey = '.admin__control-text[name=url_key]'; /** * Category form loading spinner. */ - public static $categoryFormLoadingSpinner = - '.admin__form-loading-mask[data-component="category_form.category_form"] .spinner'; + public static $categoryFormLoadingSpinner + = '.admin__form-loading-mask[data-component="category_form.category_form"] .spinner'; public function amOnAdminCategoryPage($param = '') { diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php index c52325dae..d7855571f 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php @@ -64,8 +64,9 @@ public function seeProductPriceInPage($name, $price) { $this->goToPageForProduct($name); $I = $this->acceptanceTester; - $actualPrice = substr($I->grabTextFrom(sprintf(self::$productPrice, $name)), 1); - $I->assertEquals(floatval($price), floatval($actualPrice), '', 0.01); + $actualPrice = $I->parseFloat(substr($I->grabTextFrom(sprintf(self::$productPrice, $name)), 1)); + $price = $I->parseFloat($price); + $I->assertEquals($price, $actualPrice, '', 0.01); } public function goToPageForProduct($name) diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php index 95ad271ff..46776d8fe 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php @@ -32,9 +32,11 @@ public function seeProductPriceInPage($price) { $I = $this->acceptanceTester; $actualPrice = $I->grabTextFrom(sprintf(self::$productPrice)); + $actualPrice = $I->parseFloat(substr($actualPrice, 1)); + $price = $I->parseFloat($price); $pos = strpos($actualPrice, '.'); if ( $pos !== false) { - $actualPrice = substr($actualPrice, 1, $pos+2); + $actualPrice = substr($actualPrice, 0, $pos+3); } $I->assertEquals($price, $actualPrice); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index 7ffecb139..1e64c1b35 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -47,26 +47,33 @@ public function _after(AdminStep $I) * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") + * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") * * @param AdminStep $I + * @param AdminCategoryPage $adminCategoryPage + * @param StorefrontCategoryPage $storefrontCategoryPage * @return void */ - public function createCategoryTest(AdminStep $I) - { + public function createCategoryTest( + AdminStep $I, + AdminCategoryPage $adminCategoryPage, + StorefrontCategoryPage $storefrontCategoryPage + ) { $I->wantTo('create sub category with required fields in admin Category page.'); $category = $I->getCategoryApiData(); - AdminCategoryPage::of($I)->amOnAdminCategoryPage(); - AdminCategoryPage::of($I)->addSubCategory(); - AdminCategoryPage::of($I)->fillFieldCategoryName($category['name']); + $adminCategoryPage->amOnAdminCategoryPage(); + $adminCategoryPage->addSubCategory(); + $adminCategoryPage->fillFieldCategoryName($category['name']); - AdminCategoryPage::of($I)->clickOnSearchEngineOptimization(); - AdminCategoryPage::of($I)->fillFieldCategoryUrlKey($category['custom_attributes'][0]['value']); - AdminCategoryPage::of($I)->saveCategory(); - $I->seeElement(AdminCategoryPage::$successMessage); + $adminCategoryPage->clickOnSearchEngineOptimization(); + $adminCategoryPage->fillFieldCategoryUrlKey($category['custom_attributes'][0]['value']); + $adminCategoryPage->saveCategory(); + $adminCategoryPage->seeSuccessMessage(); $I->wantTo('verify created category in frontend category page.'); - StorefrontCategoryPage::of($I)->amOnCategoryPage(str_replace('_', '-', $category['custom_attributes'][0]['value'])); - StorefrontCategoryPage::of($I)->seeCategoryNameInTitleHeading($category['name']); + $storefrontCategoryPage->amOnCategoryPage(str_replace('_', '-', $category['custom_attributes'][0]['value'])); + $storefrontCategoryPage->seeCategoryNameInTitleHeading($category['name']); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index 866084e29..d3ef6ff8c 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -71,57 +71,69 @@ public function _after(AdminStep $I) * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") + * @Parameter(name = "AdminProductPage", value = "$adminProductPage") + * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") + * @Parameter(name = "StorefrontProductPage", value = "$storefrontProductPage") * - * Codeception annotations * @param AdminStep $I + * @param AdminProductGridPage $adminProductGridPage + * @param AdminProductPage $adminProductPage + * @param StorefrontCategoryPage $storefrontCategoryPage + * @param StorefrontProductPage $storefrontProductPage * @return void */ - public function createSimpleProductTest(AdminStep $I) - { + public function createSimpleProductTest( + AdminStep $I, + AdminProductGridPage $adminProductGridPage, + AdminProductPage $adminProductPage, + StorefrontCategoryPage $storefrontCategoryPage, + StorefrontProductPage $storefrontProductPage + ) { $I->wantTo('create simple product with required fields in admin product page.'); - AdminProductGridPage::of($I)->amOnAdminProductGridPage(); - AdminProductGridPage::of($I)->clickAddNewProductPage(); - AdminProductPage::of($I)->amOnAdminNewProductPage(); - AdminProductPage::of($I)->fillFieldProductName($this->product['name']); - AdminProductPage::of($I)->fillFieldProductSku($this->product['sku']); - AdminProductPage::of($I)->fillFieldProductPrice($this->product['price']); + $adminProductGridPage->amOnAdminProductGridPage(); + $adminProductGridPage->clickAddNewProductPage(); + $adminProductPage->amOnAdminNewProductPage(); + $adminProductPage->fillFieldProductName($this->product['name']); + $adminProductPage->fillFieldProductSku($this->product['sku']); + $adminProductPage->fillFieldProductPrice($this->product['price']); if (isset($this->product['qty'])) { - AdminProductPage::of($I)->fillFieldProductQuantity($this->product['qty']); + $adminProductPage->fillFieldProductQuantity($this->product['qty']); } - AdminProductPage::of($I)->selectProductStockStatus($this->product['stock_status']); - AdminProductPage::of($I)->selectProductCategories([$this->category['name']]); - AdminProductPage::of($I)->fillFieldProductUrlKey($this->product['url_key']); + $adminProductPage->selectProductStockStatus($this->product['stock_status']); + $adminProductPage->selectProductCategories([$this->category['name']]); + $adminProductPage->fillFieldProductUrlKey($this->product['url_key']); $I->wantTo('see simple product successfully saved message.'); - AdminProductPage::of($I)->saveProduct(); - $I->seeElement(AdminProductPage::$successMessage); + $adminProductPage->saveProduct(); + $adminProductPage->seeSuccessMessage(); $I->wantTo('verify simple product data in admin product page.'); - AdminProductPage::of($I)->seeProductAttributeSet('Default'); - AdminProductPage::of($I)->seeProductName($this->product['name']); - AdminProductPage::of($I)->seeProductSku($this->product['sku']); - AdminProductPage::of($I)->seeProductPrice($this->product['price']); + $adminProductPage->seeProductAttributeSet('Default'); + $adminProductPage->seeProductName($this->product['name']); + $adminProductPage->seeProductSku($this->product['sku']); + $adminProductPage->seeProductPrice($this->product['price']); if (isset($this->product['qty'])) { - AdminProductPage::of($I)->seeProductQuantity($this->product['qty']); + $adminProductPage->seeProductQuantity($this->product['qty']); } - AdminProductPage::of($I)->seeProductStockStatus($this->product['stock_status']); - AdminProductPage::of($I)->seeProductCategories([$this->category['name']]); - AdminProductPage::of($I)->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); + $adminProductPage->seeProductStockStatus($this->product['stock_status']); + $adminProductPage->seeProductCategories([$this->category['name']]); + $adminProductPage->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); $I->wantTo('verify simple product data in frontend category page.'); - StorefrontCategoryPage::of($I)->amOnCategoryPage($this->category['url_key']); - StorefrontCategoryPage::of($I)->seeProductLinksInPage( + $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); + $storefrontCategoryPage->seeProductLinksInPage( $this->product['name'], str_replace('_', '-', $this->product['url_key']) ); - StorefrontCategoryPage::of($I)->seeProductNameInPage($this->product['name']); - StorefrontCategoryPage::of($I)->seeProductPriceInPage($this->product['name'], $this->product['price']); + $storefrontCategoryPage->seeProductNameInPage($this->product['name']); + $storefrontCategoryPage->seeProductPriceInPage($this->product['name'], $this->product['price']); $I->wantTo('verify simple product data in frontend product page.'); - StorefrontProductPage::of($I)->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); - StorefrontProductPage::of($I)->seeProductNameInPage($this->product['name']); - StorefrontProductPage::of($I)->seeProductPriceInPage($this->product['price']); - StorefrontProductPage::of($I)->seeProductStockStatusInPage($this->product['stock_status']); - StorefrontProductPage::of($I)->seeProductSkuInPage($this->product['sku']); + $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); + $storefrontProductPage->seeProductNameInPage($this->product['name']); + $storefrontProductPage->seeProductPriceInPage($this->product['price']); + $storefrontProductPage->seeProductStockStatusInPage($this->product['stock_status']); + $storefrontProductPage->seeProductSkuInPage($this->product['sku']); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index 46476c966..ab189a9ab 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -86,52 +86,65 @@ public function _after(AdminStep $I) * @Description("Update simple product with required fields") * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") + * @Parameter(name = "AdminProductPage", value = "$adminProductPage") + * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") + * @Parameter(name = "StorefrontProductPage", value = "$storefrontProductPage") * * @param AdminStep $I + * @param AdminProductGridPage $adminProductGridPage + * @param AdminProductPage $adminProductPage + * @param StorefrontCategoryPage $storefrontCategoryPage + * @param StorefrontProductPage $storefrontProductPage * @return void */ - public function updateSimpleProductTest(AdminStep $I) - { + public function updateSimpleProductTest( + AdminStep $I, + AdminProductGridPage $adminProductGridPage, + AdminProductPage $adminProductPage, + StorefrontCategoryPage $storefrontCategoryPage, + StorefrontProductPage $storefrontProductPage + ) { $I->wantTo('update simple product in admin.'); - AdminProductGridPage::of($I)->amOnAdminProductGridPage(); - AdminProductGridPage::of($I)->searchBySku($this->product['sku']); + $adminProductGridPage->amOnAdminProductGridPage(); + $adminProductGridPage->searchBySku($this->product['sku']); $I->wantTo('open product created from precondition.'); - AdminProductPage::of($I)->amOnAdminEditProductPageById($this->product['id']); + $adminProductPage->amOnAdminEditProductPageById($this->product['id']); $I->wantTo('update product data fields.'); - AdminProductPage::of($I)->fillFieldProductName($this->product['name'] . '-updated'); - AdminProductPage::of($I)->fillFieldProductSku($this->product['sku'] . '-updated'); - AdminProductPage::of($I)->fillFieldProductPrice($this->product['price']+10); - AdminProductPage::of($I)->fillFieldProductQuantity( + $adminProductPage->fillFieldProductName($this->product['name'] . '-updated'); + $adminProductPage->fillFieldProductSku($this->product['sku'] . '-updated'); + $adminProductPage->fillFieldProductPrice($this->product['price']+10); + $adminProductPage->fillFieldProductQuantity( $this->product['extension_attributes']['stock_item']['qty']+100 ); $I->wantTo('save product data change.'); - AdminProductPage::of($I)->saveProduct(); - $I->seeElement(AdminProductPage::$successMessage); + $adminProductPage->saveProduct(); + $adminProductPage->seeSuccessMessage(); $I->wantTo('see updated product data.'); - AdminProductPage::of($I)->amOnAdminEditProductPageById($this->product['id']); - AdminProductPage::of($I)->seeInPageTitle($this->product['name'] . '-updated'); - AdminProductPage::of($I)->seeProductAttributeSet('Default'); - AdminProductPage::of($I)->seeProductName($this->product['name'] . '-updated'); - AdminProductPage::of($I)->seeProductSku($this->product['sku'] . '-updated'); - AdminProductPage::of($I)->seeProductPrice($this->product['price']+10); - AdminProductPage::of($I)->seeProductQuantity($this->product['extension_attributes']['stock_item']['qty']+100); - AdminProductPage::of($I)->seeProductStockStatus( + $adminProductPage->amOnAdminEditProductPageById($this->product['id']); + $adminProductPage->seeInPageTitle($this->product['name'] . '-updated'); + $adminProductPage->seeProductAttributeSet('Default'); + $adminProductPage->seeProductName($this->product['name'] . '-updated'); + $adminProductPage->seeProductSku($this->product['sku'] . '-updated'); + $adminProductPage->seeProductPrice($this->product['price']+10); + $adminProductPage->seeProductQuantity($this->product['extension_attributes']['stock_item']['qty']+100); + $adminProductPage->seeProductStockStatus( $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' ); $I->wantTo('verify simple product data in frontend category page.'); - StorefrontCategoryPage::of($I)->amOnCategoryPage($this->category['url_key']); - StorefrontCategoryPage::of($I)->seeProductNameInPage($this->product['name'] . '-updated'); - StorefrontCategoryPage::of($I)->seeProductPriceInPage($this->product['name'] . '-updated', $this->product['price'] + 10); + $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); + $storefrontCategoryPage->seeProductNameInPage($this->product['name'] . '-updated'); + $storefrontCategoryPage->seeProductPriceInPage($this->product['name'] . '-updated', $this->product['price'] + 10); $I->wantTo('verify simple product data in frontend product page.'); - StorefrontProductPage::of($I)->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); - StorefrontProductPage::of($I)->seeProductNameInPage($this->product['name'] . '-updated'); - StorefrontProductPage::of($I)->seeProductPriceInPage($this->product['price'] + 10); - StorefrontProductPage::of($I)->seeProductSkuInPage($this->product['sku'] . '-updated'); + $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); + $storefrontProductPage->seeProductNameInPage($this->product['name'] . '-updated'); + $storefrontProductPage->seeProductPriceInPage($this->product['price'] + 10); + $storefrontProductPage->seeProductSkuInPage($this->product['sku'] . '-updated'); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php index 23421e823..077c37c6b 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php @@ -53,25 +53,32 @@ public function _before(AcceptanceTester $I) * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "AcceptanceTester", value = "$I") + * @Parameter(name = "StorefrontCustomerAccountCreatePage", value = "$customerAccountCreatePage") + * @Parameter(name = "StorefrontCustomerAccountDashboardPage", value = "$customerAccountDashboardPage") * * @param AcceptanceTester $I + * @param StorefrontCustomerAccountCreatePage $customerAccountCreatePage + * @param StorefrontCustomerAccountDashboardPage $customerAccountDashboardPage * @return void */ - public function createCustomerTest(AcceptanceTester $I) - { + public function createCustomerTest( + AcceptanceTester $I, + StorefrontCustomerAccountCreatePage $customerAccountCreatePage, + StorefrontCustomerAccountDashboardPage $customerAccountDashboardPage + ) { $I->wantTo('create customer in frontend page.'); - StorefrontCustomerAccountCreatePage::of($I)->amOnCustomerAccountCreatePage(); - StorefrontCustomerAccountCreatePage::of($I)->fillFieldFirstName($this->customer['firstname']); - StorefrontCustomerAccountCreatePage::of($I)->fillFieldLastName($this->customer['lastname']); - StorefrontCustomerAccountCreatePage::of($I)->setNewsletterSubscribe(true); - StorefrontCustomerAccountCreatePage::of($I)->fillFieldEmail($this->customer['email']); - StorefrontCustomerAccountCreatePage::of($I)->fillFieldPassword($this->customer['password']); - StorefrontCustomerAccountCreatePage::of($I)->fillFieldConfirmPassword($this->customer['password']); - StorefrontCustomerAccountCreatePage::of($I)->clickCreateAccountButton(); - StorefrontCustomerAccountDashboardPage::of($I)->seeContactInformationName( + $customerAccountCreatePage->amOnCustomerAccountCreatePage(); + $customerAccountCreatePage->fillFieldFirstName($this->customer['firstname']); + $customerAccountCreatePage->fillFieldLastName($this->customer['lastname']); + $customerAccountCreatePage->setNewsletterSubscribe(true); + $customerAccountCreatePage->fillFieldEmail($this->customer['email']); + $customerAccountCreatePage->fillFieldPassword($this->customer['password']); + $customerAccountCreatePage->fillFieldConfirmPassword($this->customer['password']); + $customerAccountCreatePage->clickCreateAccountButton(); + $customerAccountDashboardPage->seeContactInformationName( $this->customer['firstname'] . ' ' . $this->customer['lastname'] ); - StorefrontCustomerAccountDashboardPage::of($I)->seeContactInformationEmail($this->customer['email']); - StorefrontCustomerAccountDashboardPage::of($I)->seeNewsletterText('subscribed'); + $customerAccountDashboardPage->seeContactInformationEmail($this->customer['email']); + $customerAccountDashboardPage->seeNewsletterText('subscribed'); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php index b2376f00a..8f89e7de7 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php @@ -54,22 +54,29 @@ public function _before(AcceptanceTester $I, CustomerApiStep $api) * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) * @Parameter(name = "AcceptanceTester", value = "$I") + * @Parameter(name = "StorefrontCustomerAccountLoginPage", value = "$customerAccountLoginPage") + * @Parameter(name = "StorefrontCustomerAccountDashboardPage", value = "$customerAccountDashboardPage") * * @param AcceptanceTester $I + * @param StorefrontCustomerAccountLoginPage $customerAccountLoginPage + * @param StorefrontCustomerAccountDashboardPage $customerAccountDashboardPage * @return void */ - public function createCustomerTest(AcceptanceTester $I) - { + public function createCustomerTest( + AcceptanceTester $I, + StorefrontCustomerAccountLoginPage $customerAccountLoginPage, + StorefrontCustomerAccountDashboardPage $customerAccountDashboardPage + ) { $I->wantTo('create customer in frontend page.'); - StorefrontCustomerAccountLoginPage::of($I)->amOnCustomerAccountLoginPage(); - StorefrontCustomerAccountLoginPage::of($I)->fillFieldCustomerEmail($this->customer['email']); - StorefrontCustomerAccountLoginPage::of($I)->fillFieldCustomerPassword($this->customer['password']); - StorefrontCustomerAccountLoginPage::of($I)->clickSignInButton(); + $customerAccountLoginPage->amOnCustomerAccountLoginPage(); + $customerAccountLoginPage->fillFieldCustomerEmail($this->customer['email']); + $customerAccountLoginPage->fillFieldCustomerPassword($this->customer['password']); + $customerAccountLoginPage->clickSignInButton(); - StorefrontCustomerAccountDashboardPage::of($I)->seeContactInformationName( + $customerAccountDashboardPage->seeContactInformationName( $this->customer['firstname'] . ' ' . $this->customer['lastname'] ); - StorefrontCustomerAccountDashboardPage::of($I)->seeContactInformationEmail($this->customer['email']); - StorefrontCustomerAccountDashboardPage::of($I)->seeNewsletterText('subscribed to'); + $customerAccountDashboardPage->seeContactInformationEmail($this->customer['email']); + $customerAccountDashboardPage->seeNewsletterText('subscribed to'); } } From 157eb0cbb07b2b5165f96fe0adb5d0cc8ebdbd27 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 25 Apr 2017 10:27:11 -0500 Subject: [PATCH 057/149] MTA-4194: Added grid filters related functions and selectors in AdminGridPage and make it non-abstract class. --- ...actAdminGridPage.php => AdminGridPage.php} | 101 +++++++++++++++--- .../Page/Catalog/AdminProductGridPage.php | 39 +------ .../Xxyyzz/Page/Catalog/AdminProductPage.php | 8 ++ .../Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php | 4 +- .../Page/Customer/AdminCustomerGrid.php | 4 +- .../Catalog/UpdateSimpleProductCest.php | 1 + 6 files changed, 104 insertions(+), 53 deletions(-) rename tests/_support/Magento/Xxyyzz/Page/{AbstractAdminGridPage.php => AdminGridPage.php} (75%) diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php b/tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php similarity index 75% rename from tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php rename to tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php index d698f8abd..2ebc81be5 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php @@ -2,23 +2,31 @@ namespace Magento\Xxyyzz\Page; use Magento\Xxyyzz\AcceptanceTester; +use Codeception\Exception\ElementNotFound; -abstract class AbstractAdminGridPage +class AdminGridPage { /** - * Include url of current page. + * Include url of + * + * current page. */ - public static $URL = '/admin/customer/index/'; + public static $URL = '/admin/admin/'; /** * Declare UI map for this page here. CSS or XPath allowed. */ - public static $searchByField = '.data-grid-search-control'; - public static $searchByButton = '.data-grid-search-control-wrap .action-submit'; - - public static $filtersButton = '.data-grid-filters-action-wrap .action-default'; - - // TODO: Add Filter selectors + public static $searchByField = '.data-grid-search-control'; + public static $searchByButton = '.data-grid-search-control-wrap .action-submit'; + + //public static $filtersButton = 'button[data-action=grid-filter-expand]'; + public static $filtersButton + = '.admin__data-grid-outer-wrap>.admin__data-grid-header button[data-action=grid-filter-expand]'; + public static $filtersExpanded = '.admin__data-grid-filters-wrap._show'; + public static $filtersApplyButton = 'button[data-action=grid-filter-apply]'; + public static $filtersCancelButton = 'button[data-action=grid-filter-cancel]'; + //public static $filtersClearAllButton = 'button[data-action=grid-filter-reset]'; + public static $filtersClearAllButton = '.admin__data-grid-header button[data-action=grid-filter-reset]'; public static $viewButton = '.admin__data-grid-action-bookmarks .admin__action-dropdown'; public static $viewDropDownMenu = '.admin__data-grid-action-bookmarks .admin__action-dropdown-menu'; @@ -64,6 +72,9 @@ abstract class AbstractAdminGridPage public static $loadingMask = '.loading-mask'; public static $gridLoadingMask = '.admin__data-grid-loading-mask'; + public static $gridNthRow + = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s)'; + /** * @var AcceptanceTester */ @@ -106,13 +117,77 @@ public function performSearchByKeyword($searchKeyword) $I->waitForPageLoad(); } - public function clickOnFiltersButton() + public function clickOnFiltersButtonToExpand() + { + $I = $this->acceptanceTester; + try { + $I->waitForPageLoad(); + $I->dontSeeElement(self::$filtersExpanded); + $I->click(self::$filtersButton); + $I->waitForPageLoad(); + } catch (ElementNotFound $e) { + } + } + + public function clickOnFiltersButtonToClose() { $I = $this->acceptanceTester; - $I->click(self::$filtersButton); + try { + $I->waitForPageLoad(); + $I->seeElement(self::$filtersExpanded); + $I->click(self::$filtersButton); + $I->waitForPageLoad(); + } catch (ElementNotFound $e) { + } } - // TODO: Add Filter methods + public function clickOnFiltersClearAllButton() + { + $I = $this->acceptanceTester; + try { + $I->waitForPageLoad(); + $I->click(self::$filtersClearAllButton); + } catch (ElementNotFound $e) { + } + } + + /** + * Search and filter by value. + * + * @param string $value + * @param string $selector + * @param string $type + */ + public function searchAndFiltersByValue($value, $selector, $type = 'textfield') + { + $I = $this->acceptanceTester; + $this->clickOnFiltersClearAllButton(); + $this->clickOnFiltersButtonToExpand(); + + switch ($type) { + case 'dropdown': + $I->selectOption($selector, $value); + break; + case 'textfield': + default: + $I->fillField($selector, $value); + } + $I->click(self::$filtersApplyButton); + $I->waitForPageLoad(); + } + + /** + * @see text in grid nth row. + * + * @param int $n + * @param string $text + */ + public function seeInNthRow(int $n, $text) + { + $I = $this->acceptanceTester; + $I->waitForPageLoad(); + $I->see($text, sprintf(self::$gridNthRow, $n)); + } public function clickOnViewButton() { @@ -294,4 +369,4 @@ public function waitForGridLoadingMaskToDisappear() $I = $this->acceptanceTester; $I->waitForElementNotVisible(self::$gridLoadingMask, 30); } -} \ No newline at end of file +} diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php index 28f67d443..fc715e50e 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php @@ -1,9 +1,9 @@ .admin__data-grid-header button[data-action=grid-filter-expand]'; - public static $filterApplyButton - = '.admin__data-grid-filters-footer button[data-action=grid-filter-apply]'; public static $filterIdFrom = '.admin__form-field input[name="entity_id[from]"]'; public static $filterIdTo = '.admin__form-field input[name="entity_id[to]"]'; public static $filterPriceFrom = '.admin__form-field input[name="price[from]"]'; @@ -39,12 +33,6 @@ class AdminProductGridPage extends AbstractAdminPage public static $productGridNotificationLoadingSpinner = '.admin__data-grid-loading-mask[data-component="notification_area.notification_area.columns"]>.spinner'; - /** - * UI map for admin product grid. - */ - public static $gridNthRow - = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s)'; - public function amOnAdminProductGridPage() { $I = $this->acceptanceTester; @@ -60,27 +48,6 @@ public function clickAddNewProductPage() public function searchBySku($sku) { - $I = $this->acceptanceTester; - try { - $I->waitForPageLoad(); - $I->click(self::$filterClearAllButton); - } catch (\Codeception\Exception\ElementNotFound $e) { - } - try { - $I->waitForPageLoad(); - $I->click(self::$filterExpandButton); - $I->waitForPageLoad(); - } catch (\Codeception\Exception\ElementNotFound $e) { - } - - $I->fillField(self::$filterProductSku, $sku); - $I->click(self::$filterApplyButton); - $I->waitForPageLoad(); - } - - public function containsInNthRow($n, $text) - { - $I = $this->acceptanceTester; - return $I->see($text, sprintf(self::$gridNthRow, $n)); + $this->searchAndFiltersByValue($sku, self::$filterProductSku); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php index 882516fe7..40c1021c0 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php @@ -15,6 +15,7 @@ class AdminProductPage extends AbstractAdminPage */ public static $productAddProductButton = '#add_new_product-button'; public static $productSaveButton = '#save-button'; + public static $createConfigurationsButton = 'button[data-index=create_configurable_products_button]'; /** * Product data fields. @@ -199,4 +200,11 @@ public function addBasicProductUnderCategory($productData, $categoryData) self::saveProduct(); } + + public function clickCreateConfigurationsButton() + { + $I = $this->acceptanceTester; + $I->performOn(self::$createConfigurationsButton, ['click' => self::$createConfigurationsButton]); + $I->waitForPageLoad(); + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php index d6ce737f2..f8cba2e39 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php @@ -1,9 +1,9 @@ wantTo('update simple product in admin.'); $adminProductGridPage->amOnAdminProductGridPage(); $adminProductGridPage->searchBySku($this->product['sku']); + $adminProductGridPage->seeInNthRow(1, $this->product['sku']); $I->wantTo('open product created from precondition.'); $adminProductPage->amOnAdminEditProductPageById($this->product['id']); From 0579e651d71dee9c6bb946c25818013b0993c30b Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 28 Apr 2017 10:35:59 -0500 Subject: [PATCH 058/149] - Adding the Create Order via Admin Test. - Adding the Admin Sales Order page PageObjects. --- .../Xxyyzz/Page/Sales/AdminOrderAddPage.php | 949 ++++++++++++++++++ .../Page/Sales/AdminOrderDetailsPage.php | 510 ++++++++++ .../Xxyyzz/Page/Sales/AdminOrderGrid.php | 97 ++ .../Sales/CreateOrderViaAdminCest.php | 138 +++ 4 files changed, 1694 insertions(+) create mode 100644 tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php create mode 100644 tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php create mode 100644 tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php b/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php new file mode 100644 index 000000000..729e0ecea --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php @@ -0,0 +1,949 @@ +acceptanceTester; + $I->click(self::$selectCustomerCreateNewCustomerButton); + $I->waitForPageLoad(); + } + + public function clickOnCustomerSearchButton() + { + $I = $this->acceptanceTester; + $I->click(self::$selectCustomerSearchButton); + $I->waitForPageLoad(); + } + + public function clickOnCustomerResetFilterButton() + { + $I = $this->acceptanceTester; + $I->click(self::$selectCustomerResetFilterButton); + $I->waitForPageLoad(); + } + + public function enterCustomerIdSearchTerm($customerId) + { + $I = $this->acceptanceTester; + $I->fillField(self::$selectCustomerIdSearchField, $customerId); + } + + public function enterCustomerNameSearchTerm($customerName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$selectCustomerNameSearchField, $customerName); + } + + public function enterCustomerEmailSearchTerm($customerEmail) + { + $I = $this->acceptanceTester; + $I->fillField(self::$selectCustomerEmailSearchField, $customerEmail); + } + + public function enterCustomerPhoneSearchTerm($customerPhone) + { + $I = $this->acceptanceTester; + $I->fillField(self::$selectCustomerPhoneSearchField, $customerPhone); + } + + public function enterZipPostalCodeSearchTerm($zipPostalCode) + { + $I = $this->acceptanceTester; + $I->fillField(self::$selectCustomerZipPostCodeSearchField, $zipPostalCode); + } + + public function enterCustomerCountrySearchTerm($country) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$selectCustomerCountrySearchDropDown, $country); + } + + public function enterCustomerStateProvinceSearchTerm($stateProvince) + { + $I = $this->acceptanceTester; + $I->fillField(self::$selectCustomerStateProvinceSearchField, $stateProvince); + } + + public function enterSignedUpPointSearchTerm($signedUpPoint) + { + $I = $this->acceptanceTester; + $I->fillField(self::$selectCustomerSignedUpPointSearchField, $signedUpPoint); + } + + public function clickOnCustomerFor($customerEmail) + { + $I = $this->acceptanceTester; + $selector = "//td[contains(text(), '" . $customerEmail . "')]/parent::tr"; + + $I->waitForLoadingMaskToDisappear(); + $I->click($selector); + $I->waitForPageLoad(); + } + + /** + * Sales - Orders - "Please select a Store" Methods + */ + public function clickOnDefaultStoreView() + { + $I = $this->acceptanceTester; + $I->waitForLoadingMaskToDisappear(); + $I->click(self::$defaultStoreViewLink); + $I->waitForPageLoad(); + } + + /** + * Sales - Orders - "Customer's Activities" Methods - Left panel + */ + + // TODO: Add Customer's Activities methods + + /** + * Sales - Orders - "Items Ordered" Methods + */ + public function clickOnAddProductsButton() + { + $I = $this->acceptanceTester; + $I->waitForLoadingMaskToDisappear(); + $I->click(self::$addProductsToOrderButton); + $I->waitForPageLoad(); + } + + public function enterIdSearchField($productId) + { + $I = $this->acceptanceTester; + $I->fillField(self::$productIdSearchField, $productId); + } + + public function enterProductNameSearchField($productName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$productNameSearchField, $productName); + } + + public function enterProductSkuSearchField($productSku) + { + $I = $this->acceptanceTester; + $I->fillField(self::$productSkuSearchField, $productSku); + } + + public function enterProductPriceFromSearchField($productPriceFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$productPriceFromSearchField, $productPriceFrom); + } + + public function enterProductPriceToSearchField($productPriceTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$productPriceToSearchField, $productPriceTo); + } + + public function selectProductSearchField($value) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$productSelectSearchDropDown, $value); + } + + public function clickOnProductSkuFor($productSku) + { + $I = $this->acceptanceTester; + $selector = "//td[contains(@class, 'col-sku')][contains(text(), '" . $productSku . "')]/parent::tr"; + $I->click($selector); + } + + public function enterProductQtyFor($productSku, $productQty) + { + $I = $this->acceptanceTester; + $selector = "//td[contains(@class, 'col-sku')][contains(text(), '" . $productSku . "')]/parent::tr"; + $I->fillField($selector, $productQty); + } + + public function clickOnAddSelectedProductsToOrderButton() + { + $I = $this->acceptanceTester; + $I->click(self::$addSelectedProductToOrderButton); + $I->waitForLoadingMaskToDisappear(); + } + + public function clickOnProductsSearchButton() + { + $I = $this->acceptanceTester; + $I->click(self::$productsSearchButton); + $I->waitForLoadingMaskToDisappear(); + } + + public function clickOnProductsSearchResetButton() + { + $I = $this->acceptanceTester; + $I->click(self::$productsResetFilterButton); + $I->waitForLoadingMaskToDisappear(); + } + + // TODO: Add Product methods + + + /** + * Sales - Orders - "Account Information" Methods + */ + public function enterAccountInformationGroup($groupName) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$groupDropDown, $groupName); + } + + public function selectAccountInformationGroupGeneral() + { + self::enterAccountInformationGroup('General'); + } + + public function enterAccountInformationEmail($customerEmail) + { + $I = $this->acceptanceTester; + $I->fillField(self::$emailAddressField, $customerEmail); + } + + public function verifyAccountInformationEmail($customerEmail) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$emailAddressField, $customerEmail); + } + + /** + * Sales - Orders - "Address Information" Methods - Billing + */ + public function enterBillingPrefix($prefix) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingPrefixField, $prefix); + } + + public function verifyBillingPrefix($prefix) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingPrefixField, $prefix); + } + + public function enterBillingFirstName($firstName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingFirstNameField, $firstName); + } + + public function verifyBillingFirstName($firstName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingFirstNameField, $firstName); + } + + public function enterBillingMiddleName($middleName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingMiddleNameField, $middleName); + } + + public function verifyBillingMiddleName($middleName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingMiddleNameField, $middleName); + } + + public function enterBillingLastName($lastName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingLastNameField, $lastName); + } + + public function verifyBillingLastName($lastName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingLastNameField, $lastName); + } + + public function enterBillingSuffix($suffix) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingSuffixField, $suffix); + } + + public function verifyBillingSuffix($suffix) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingSuffixField, $suffix); + } + + public function enterBillingCompany($company) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingCompanyField, $company); + } + + public function verifyBillingCompany($company) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingCompanyField, $company); + } + + public function enterBillingAddress1($address1) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingAddress1Field, $address1); + } + + public function verifyBillingAddress1($address1) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingAddress1Field, $address1); + } + + public function enterBillingAddress2($address2) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingAddress2Field, $address2); + } + + public function verifyBillingAddress2($address2) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingAddress2Field, $address2); + } + + public function enterBillingCity($city) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingCityField, $city); + } + + public function verifyBillingCity($city) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingCityField, $city); + } + + public function enterBillingCountry($country) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$billingCountryDropDown, $country); + } + + public function verifyBillingCountry($country) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$billingCountryDropDown, $country); + } + + public function enterBillingState($stateProvince) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$billingStateDropDown, $stateProvince); + } + + public function enterBillingProvince($province) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingProvinceField, $province); + } + + public function verifyBillingState($state) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$billingStateDropDown, $state); + } + + public function verifyBillingProvince($province) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingProvinceField, $province); + } + + public function enterBillingZipPostalCode($zipCode) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingZipPostalCodeField, $zipCode); + } + + public function verifyBillingZipPostalCode($zipCode) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingZipPostalCodeField, $zipCode); + } + + public function enterBillingPhoneNumber($phoneNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingPhoneNumberField, $phoneNumber); + } + + public function verifyBillingPhoneNumber($phoneNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingPhoneNumberField, $phoneNumber); + } + + public function enterBillingFaxNumber($faxNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingFaxNumberField, $faxNumber); + } + + public function verifyBillingFaxNumber($faxNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingFaxNumberField, $faxNumber); + } + + public function enterBillingVatNumber($taxVatNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$billingVatNumberField, $taxVatNumber); + } + + public function verifyBillingVatNumber($taxVatNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$billingVatNumberField, $taxVatNumber); + } + + public function clickOnBillingValidateVatNumberLink() + { + $I = $this->acceptanceTester; + $I->click(self::$billingValidateVatNumberLink); + $I->waitForLoadingMaskToDisappear(); + } + + public function clickOnBillingSaveInAddressBook() + { + $I = $this->acceptanceTester; + $I->click(self::$billingSaveInAddressBook); + } + + /** + * Sales - Orders - "Address Information" Methods - Shipping + */ + public function clickOnSameAsBillingAddress() + { + $I = $this->acceptanceTester; + $I->click(self::$sameAsBillingAddressCheckbox); + } + + public function enterShippingPrefix($prefix) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingPrefixField, $prefix); + } + + public function verifyShippingPrefix($prefix) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingPrefixField, $prefix); + } + + public function enterShippingFirstName($firstName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingFirstNameField, $firstName); + } + + public function verifyShippingFirstName($firstName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingFirstNameField, $firstName); + } + + public function enterShippingMiddleName($middleName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingMiddleNameField, $middleName); + } + + public function verifyShippingMiddleName($middleName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingMiddleNameField, $middleName); + } + + public function enterShippingLastName($lastName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingLastNameField, $lastName); + } + + public function verifyShippingLastName($lastName) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingLastNameField, $lastName); + } + + public function enterShippingSuffix($suffix) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingSuffixField, $suffix); + } + + public function verifyShippingSuffix($suffix) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingSuffixField, $suffix); + } + + public function enterShippingCompany($company) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingCompanyField, $company); + } + + public function verifyShippingCompany($company) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingCompanyField, $company); + } + + public function enterShippingAddress1($address1) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingAddress1Field, $address1); + } + + public function verifyShippingAddress1($address1) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingAddress1Field, $address1); + } + + public function enterShippingAddress2($address2) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingAddress2Field, $address2); + } + + public function verifyShippingAddress2($address2) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingAddress2Field, $address2); + } + + public function enterShippingCity($city) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingCityField, $city); + } + + public function verifyShippingCity($city) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingCityField, $city); + } + + public function enterShippingCountry($country) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$shippingCountryDropDown, $country); + } + + public function verifyShippingCountry($country) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$shippingCountryDropDown, $country); + } + + public function enterShippingState($stateProvince) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$shippingStateDropDown, $stateProvince); + } + + public function enterShippingProvince($province) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingProvinceField, $province); + } + + public function verifyShippingState($state) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$shippingStateDropDown, $state); + } + + public function verifyShippingProvince($province) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingProvinceField, $province); + } + + public function enterShippingZipPostalCode($zipCode) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingZipPostalCodeField, $zipCode); + } + + public function verifyShippingZipPostalCode($zipCode) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingZipPostalCodeField, $zipCode); + } + + public function enterShippingPhoneNumber($phoneNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingPhoneNumberField, $phoneNumber); + } + + public function verifyShippingPhoneNumber($phoneNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingPhoneNumberField, $phoneNumber); + } + + public function enterShippingFaxNumber($faxNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingFaxNumberField, $faxNumber); + } + + public function verifyShippingFaxNumber($faxNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingFaxNumberField, $faxNumber); + } + + public function enterShippingVatNumber($taxVatNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$shippingVatNumberField, $taxVatNumber); + } + + public function verifyShippingVatNumber($taxVatNumber) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$shippingVatNumberField, $taxVatNumber); + } + + public function clickOnShippingValidateVatNumberLink() + { + $I = $this->acceptanceTester; + $I->click(self::$shippingValidateVatNumberLink); + $I->waitForLoadingMaskToDisappear(); + } + + public function clickOnShippingSaveInAddressBook() + { + $I = $this->acceptanceTester; + $I->click(self::$shippingSaveInAddressBookCheckbox); + } + + public function verifyBillingAddress($customerData) + { + self::verifyBillingPrefix($customerData['prefix']); + self::verifyBillingFirstName($customerData['firstname']); + self::verifyBillingMiddleName($customerData['middlename']); + self::verifyBillingLastName($customerData['lastname']); + self::verifyBillingSuffix($customerData['suffix']); + self::verifyBillingCompany($customerData['company']); + self::verifyBillingAddress1($customerData['address']['address1']); + self::verifyBillingAddress2($customerData['address']['address2']); + self::verifyBillingCity($customerData['address']['city']); + self::verifyBillingCountry($customerData['address']['country']); + self::verifyBillingState($customerData['address']['state']); + self::verifyBillingZipPostalCode($customerData['address']['zipCode']); + self::verifyBillingPhoneNumber($customerData['phoneNumber']); + self::verifyBillingFaxNumber($customerData['faxNumber']); + } + + public function verifyShippingAddress($customerData) + { + self::verifyShippingPrefix($customerData['prefix']); + self::verifyShippingFirstName($customerData['firstname']); + self::verifyShippingMiddleName($customerData['middlename']); + self::verifyShippingLastName($customerData['lastname']); + self::verifyShippingSuffix($customerData['suffix']); + self::verifyShippingCompany($customerData['company']); + self::verifyShippingAddress1($customerData['address']['address1']); + self::verifyShippingAddress2($customerData['address']['address2']); + self::verifyShippingCity($customerData['address']['city']); + self::verifyShippingCountry($customerData['address']['country']); + self::verifyShippingState($customerData['address']['state']); + self::verifyShippingZipPostalCode($customerData['address']['zipCode']); + self::verifyShippingPhoneNumber($customerData['phoneNumber']); + self::verifyShippingFaxNumber($customerData['faxNumber']); + } + + /** + * Sales - Orders - "Payment & Shipping Information" Methods + */ + public function clickOnGetShippingMethodsAndRatesLink() + { + $I = $this->acceptanceTester; + $I->click(self::$getShippingMethodsAndRatesLink); + $I->waitForLoadingMaskToDisappear(); + } + + // TODO: Add Payment Method selection Methods + + // TODO: Add more Shipping Method selection Methods + + public function clickOnShippingMethod($shippingMethodName) + { + $I = $this->acceptanceTester; + $selector = "//label[contains(@class, 'admin__field-label')][contains(text(), '" . $shippingMethodName . "')]/parent::li"; + $I->click($selector); + $I->waitForLoadingMaskToDisappear(); + } + + public function clickOnFixedShippingMethod() + { + self::clickOnShippingMethod('Fixed'); + } + + public function clickOnTableRateShippingMethod() + { + self::clickOnShippingMethod('Table Rate'); + } + + public function clickOnFreeShippingMethod() + { + self::clickOnShippingMethod('Free'); + } + + /** + * Sales - Orders - "Order Total" Methods + */ + public function enterOrderComments($comments) + { + $I = $this->acceptanceTester; + $I->fillField(self::$orderCommentsField, $comments); + } + + public function verifyOrderComments($comments) + { + $I = $this->acceptanceTester; + $I->seeInField(self::$orderCommentsField, $comments); + } + + public function getSubTotalPriceValue() + { + $I = $this->acceptanceTester; + return $I->grabTextFrom(self::$subTotalPrice); + } + + public function getShippingHandlingValue() + { + $I = $this->acceptanceTester; + return $I->grabTextFrom(self::$shippingAndHandlingPrice); + } + + public function getDiscountPriceValue() + { + $I = $this->acceptanceTester; + return $I->grabTextFrom(self::$discountPrice); + } + + public function getTaxPriceValue() + { + $I = $this->acceptanceTester; + return $I->grabTextFrom(self::$taxPrice); + } + + public function getGrandTotalPriceValue() + { + $I = $this->acceptanceTester; + return $I->grabTextFrom(self::$grandTotalPrice); + } + + public function verifySubTotalPrice($expectedValue) + { + $I = $this->acceptanceTester; + $I->assertEquals(self::getSubTotalPriceValue(), $expectedValue); + } + + public function verifyShippingHandlingPrice($expectedValue) + { + $I = $this->acceptanceTester; + $I->assertEquals(self::getShippingHandlingValue(), $expectedValue); + } + + public function verifyDiscountPrice($expectedValue) + { + $I = $this->acceptanceTester; + $I->assertEquals(self::getDiscountPriceValue(), $expectedValue); + } + + public function verifyTaxPrice($expectedValue) + { + $I = $this->acceptanceTester; + $I->assertEquals(self::getTaxPriceValue(), $expectedValue); + } + + public function verifyGrandTotalPrice($expectedValue) + { + $I = $this->acceptanceTester; + $I->assertEquals(self::getGrandTotalPriceValue(), $expectedValue); + } + + public function clickOnAppendComments() + { + $I = $this->acceptanceTester; + $I->click(self::$appendCommentsCheckbox); + } + + public function clickOnEmailOrderConfirmation() + { + $I = $this->acceptanceTester; + $I->click(self::$emailOrderConfirmationCheckbox); + } + + public function clickOnBottomSubmitButton() + { + $I = $this->acceptanceTester; + $I->click(self::$bottomSubmitOrderButton); + $I->waitForPageLoad(); + } +} \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php b/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php new file mode 100644 index 000000000..f26b184c6 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php @@ -0,0 +1,510 @@ +acceptanceTester; + $I->seeElement(self::$youCreatedAnOrderSuccessMessage); + } + + public function clickOnBackButton() + { + $I = $this->acceptanceTester; + $I->click(self::$backButton); + } + + public function clickOnCancelButton() + { + $I = $this->acceptanceTester; + $I->click(self::$cancelButton); + } + + public function clickOnSendEmailButton() + { + $I = $this->acceptanceTester; + $I->click(self::$sendEmailButton); + } + + public function clickOnHoldButton() + { + $I = $this->acceptanceTester; + $I->click(self::$holdButton); + } + + public function clickOnInvoiceButton() + { + $I = $this->acceptanceTester; + $I->click(self::$invoiceButton); + } + + public function clickOnShipButton() + { + $I = $this->acceptanceTester; + $I->click(self::$shipButton); + } + + public function clickOnReorderButton() + { + $I = $this->acceptanceTester; + $I->click(self::$reorderButton); + } + + public function clickOnEditOrderButton() + { + $I = $this->acceptanceTester; + $I->click(self::$editButton); + } + + public function clickOnInformationSection() + { + $I = $this->acceptanceTester; + $I->click(self::$informationSectionLink); + } + + public function clickOnInvoicesSection() + { + $I = $this->acceptanceTester; + $I->click(self::$invoicesSectionLink); + } + + public function clickOnCreditMemosSection() + { + $I = $this->acceptanceTester; + $I->click(self::$creditMemosSectionLink); + } + + public function clickOnShipmentsSection() + { + $I = $this->acceptanceTester; + $I->click(self::$shipmentsSectionLink); + } + + public function clickOnCommentsHistorySection() + { + $I = $this->acceptanceTester; + $I->click(self::$commentsHistoryLink); + } + + public function verifyThereIsAnOrderNumber() + { + $I = $this->acceptanceTester; + $I->see('Order #', self::$orderIdTitle); + } + + public function verifyThatTheOrderWasPlacedToday() + { + $I = $this->acceptanceTester; + $today = date("M j, Y"); + $I->see($today, self::$orderDateText); + } + + public function verifyOrderStatus($expectedStatus) + { + $I = $this->acceptanceTester; + $I->see($expectedStatus, self::$orderStatusText); + } + + public function verifyOrderStatusPending() + { + self::verifyOrderStatus('Pending'); + } + + public function verifyPurchasedFrom($expectedStore) + { + $I = $this->acceptanceTester; + $I->see($expectedStore, self::$purchasedFromText); + } + + public function verifyPurchasedFromDefaultStoreView() + { + self::verifyPurchasedFrom('Default Store View'); + } + + public function verifyCustomerName($customerName) + { + $I = $this->acceptanceTester; + $I->see($customerName, self::$customerNameText); + } + + public function verifyCustomerEmail($customerEmail) + { + $I = $this->acceptanceTester; + $I->see($customerEmail, self::$emailText); + } + + public function verifyCustomerGroup($customerGroup) + { + $I = $this->acceptanceTester; + $I->see($customerGroup, self::$customerGroupText); + } + + public function verifyBillingFirstName($billingFirstName) + { + $I = $this->acceptanceTester; + $I->see($billingFirstName, self::$billingAddressText); + } + + public function verifyBillingLastName($billingLastName) + { + $I = $this->acceptanceTester; + $I->see($billingLastName, self::$billingAddressText); + } + + public function verifyBillingCompany($billingCompany) + { + $I = $this->acceptanceTester; + $I->see($billingCompany, self::$billingAddressText); + } + + public function verifyBillingAddress1($billingAddress1) + { + $I = $this->acceptanceTester; + $I->see($billingAddress1, self::$billingAddressText); + } + + public function verifyBillingAddress2($billingAddress2) + { + $I = $this->acceptanceTester; + $I->see($billingAddress2, self::$billingAddressText); + } + + public function verifyBillingCity($billingCity) + { + $I = $this->acceptanceTester; + $I->see($billingCity, self::$billingAddressText); + } + + public function verifyBillingCountry($billingCountry) + { + $I = $this->acceptanceTester; + $I->see($billingCountry, self::$billingAddressText); + } + + public function verifyBillingState($billingState) + { + $I = $this->acceptanceTester; + $I->see($billingState, self::$billingAddressText); + } + + public function verifyBillingProvince($billingProvince) + { + $I = $this->acceptanceTester; + $I->see($billingProvince, self::$billingAddressText); + } + + public function verifyBillingZipPostalCode($billingZipPostalCode) + { + $I = $this->acceptanceTester; + $I->see($billingZipPostalCode, self::$billingAddressText); + } + + public function verifyBillingPhoneNumber($billingPhoneNumber) + { + $I = $this->acceptanceTester; + $I->see($billingPhoneNumber, self::$billingAddressText); + } + + public function verifyBillingVatTaxNumber($billingVatTaxNumber) + { + $I = $this->acceptanceTester; + $I->see($billingVatTaxNumber, self::$billingAddressText); + } + + public function verifyBillingAddressInformation($customerData) + { + self::verifyBillingFirstName($customerData['firstname']); + self::verifyBillingLastName($customerData['lastname']); + self::verifyBillingCompany($customerData['company']); + self::verifyBillingAddress1($customerData['address']['address1']); + self::verifyBillingAddress2($customerData['address']['address2']); + self::verifyBillingCity($customerData['address']['city']); + self::verifyBillingState($customerData['address']['state']); + self::verifyBillingZipPostalCode($customerData['address']['zipCode']); + self::verifyBillingCountry($customerData['address']['country']); + self::verifyBillingPhoneNumber($customerData['phoneNumber']); + self::verifyBillingVatTaxNumber($customerData['taxVatNumber']); + } + + public function verifyShippingFirstName($shippingFirstName) + { + $I = $this->acceptanceTester; + $I->see($shippingFirstName, self::$shippingAddressText); + } + + public function verifyShippingLastName($shippingLastName) + { + $I = $this->acceptanceTester; + $I->see($shippingLastName, self::$shippingAddressText); + } + + public function verifyShippingCompany($shippingCompany) + { + $I = $this->acceptanceTester; + $I->see($shippingCompany, self::$shippingAddressText); + } + + public function verifyShippingAddress1($shippingAddress1) + { + $I = $this->acceptanceTester; + $I->see($shippingAddress1, self::$shippingAddressText); + } + + public function verifyShippingAddress2($shippingAddress2) + { + $I = $this->acceptanceTester; + $I->see($shippingAddress2, self::$shippingAddressText); + } + + public function verifyShippingCity($shippingCity) + { + $I = $this->acceptanceTester; + $I->see($shippingCity, self::$shippingAddressText); + } + + public function verifyShippingCountry($shippingCountry) + { + $I = $this->acceptanceTester; + $I->see($shippingCountry, self::$shippingAddressText); + } + + public function verifyShippingState($shippingState) + { + $I = $this->acceptanceTester; + $I->see($shippingState, self::$shippingAddressText); + } + + public function verifyShippingProvince($shippingProvince) + { + $I = $this->acceptanceTester; + $I->see($shippingProvince, self::$shippingAddressText); + } + + public function verifyShippingZipPostalCode($shippingZipPostalCode) + { + $I = $this->acceptanceTester; + $I->see($shippingZipPostalCode, self::$shippingAddressText); + } + + public function verifyShippingPhoneNumber($shippingPhoneNumber) + { + $I = $this->acceptanceTester; + $I->see($shippingPhoneNumber, self::$shippingAddressText); + } + + public function verifyShippingVatTaxNumber($shippingVatTaxNumber) + { + $I = $this->acceptanceTester; + $I->see($shippingVatTaxNumber, self::$shippingAddressText); + } + + public function verifyShippingAddressInformation($customerData) + { + self::verifyShippingFirstName($customerData['firstname']); + self::verifyShippingLastName($customerData['lastname']); + self::verifyShippingCompany($customerData['company']); + self::verifyShippingAddress1($customerData['address']['address1']); + self::verifyShippingAddress2($customerData['address']['address2']); + self::verifyShippingCity($customerData['address']['city']); + self::verifyShippingState($customerData['address']['state']); + self::verifyShippingZipPostalCode($customerData['address']['zipCode']); + self::verifyShippingCountry($customerData['address']['country']); + self::verifyShippingPhoneNumber($customerData['phoneNumber']); + self::verifyShippingVatTaxNumber($customerData['taxVatNumber']); + } + + public function verifyPaymentType($expectedPaymentType) + { + $I = $this->acceptanceTester; + $I->see($expectedPaymentType, self::$paymentTypeText); + } + + public function verifyPaymentTypeCheckMoneyOrder() + { + self::verifyPaymentType('Check / Money order'); + } + + public function verifyPaymentCurrencyType($expectedCurrency) + { + $I = $this->acceptanceTester; + $I->see($expectedCurrency, self::$orderCurrencyTypeText); + } + + public function verifyPaymentCurrencyUSD() + { + self::verifyPaymentCurrencyType('USD'); + } + + public function verifyShippingMethodType($expectedShippingMethod) + { + $I = $this->acceptanceTester; + $I->see($expectedShippingMethod, self::$shippingMethodNameText); + } + + public function verifyShippingMethodFixedRate() + { + self::verifyShippingMethodType('Flat Rate - Fixed'); + } + + public function verifyShippingMethodPrice($expectedPrice) + { + $I = $this->acceptanceTester; + $I->see($expectedPrice, self::$shippingMethodPriceText); + } + + public function verifyItemsOrderedFor($productDetails) + { + $I = $this->acceptanceTester; + $selector = "//div[contains(@class, 'product-title')][contains(text(), '" . $productDetails['productName'] . "')]/parent::div/parent::td/parent::tr"; + + $I->see($productDetails['productName'], $selector); + $I->see($productDetails['sku'], $selector); + $I->see($productDetails['price'], $selector); + + // TODO: Add more "Items Ordered" Methods + } + + public function verifyOrderStatusDropDown($expectedStatus) + { + $I = $this->acceptanceTester; + $I->seeOptionIsSelected(self::$orderStatusDropDown, $expectedStatus); + } + + public function verifyOrderStatusDropDownPending() + { + self::verifyOrderStatusDropDown('Pending'); + } + + public function verifyOrderComments($expectedOrderComments) + { + $I = $this->acceptanceTester; + $I->see($expectedOrderComments, self::$orderCommentsField); + } + + public function enterOrderComments($orderComments) + { + $I = $this->acceptanceTester; + $I->fillField(self::$orderCommentsField, $orderComments); + } + + public function clickOnNotifyCustomerByEmail() + { + $I = $this->acceptanceTester; + $I->click(self::$notifyCustomerByEmailCheckbox); + } + + public function clickOnVisibleOnStorefront() + { + $I = $this->acceptanceTester; + $I->click(self::$visibleOnStorefrontCheckbox); + } + + public function clickOnSubmitCommentButton() + { + $I = $this->acceptanceTester; + $I->click(self::$submitCommentButton); + } + + public function verifySubTotalPrice($expectedSubTotal) + { + $I = $this->acceptanceTester; + $I->see($expectedSubTotal, self::$subtotalPriceText); + } + + public function verifyShippingHandlingPrice($expectedShippingHandling) + { + $I = $this->acceptanceTester; + $I->see($expectedShippingHandling, self::$shippingHandlingPriceText); + } + + public function verifyGrandTotalPrice($expectedGrandTotal) + { + $I = $this->acceptanceTester; + $I->see($expectedGrandTotal, self::$grandTotalPriceText); + } + + public function verifyTotalPaidPrice($expectedTotalPaid) + { + $I = $this->acceptanceTester; + $I->see($expectedTotalPaid, self::$totalPaidPriceText); + } + + public function verifyTotalRefundedPrice($expectedRefunded) + { + $I = $this->acceptanceTester; + $I->see($expectedRefunded, self::$totalRefundedPriceText); + } + + public function verifyTotalDuePrice($expectedTotalDue) + { + $I = $this->acceptanceTester; + $I->see($expectedTotalDue, self::$totalDuePriceText); + } +} \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php b/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php new file mode 100644 index 000000000..5663eb644 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php @@ -0,0 +1,97 @@ +acceptanceTester; + $I->click(self::$createNewOrderButton); + $I->waitForPageLoad(); + } + + public function enterPurchaseDateFromFilter($purchaseDateFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterPurchaseDateFromField, $purchaseDateFrom); + } + + public function enterPurchaseDateToFilter($purchaseDateTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterPurchaseDateToField, $purchaseDateTo); + } + + public function enterGrandTotalBaseFromFilter($grandTotalBaseFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterGrandTotalBaseFromField, $grandTotalBaseFrom); + } + + public function enterGrandTotalBaseToFilter($grandTotalBaseTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterGrandTotalBaseToField, $grandTotalBaseTo); + } + + public function enterGrandTotalPurchasedFromFilter($grandTotalPurchasedFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterGrandTotalPurchasedFromField, $grandTotalPurchasedFrom); + } + + public function enterGrandTotalPurchasedToFilter($grandTotalPurchasedTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterGrandTotalPurchasedToField, $grandTotalPurchasedTo); + } + + public function selectPurchasePointFilter($purchasePoint) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$filterPurchasePointDropDownMenu, $purchasePoint); + } + + public function enterIdFilter($id) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterIdField, $id); + } + + public function enterBillToNameFilter($billToName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterBillToNameField, $billToName); + } + + public function enterShipToNameFilter($shipToName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterShipToNameField, $shipToName); + } + + public function selectStatusFilter($status) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$filterStatusDropDownMenu, $status); + } +} \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php new file mode 100644 index 000000000..33e164395 --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php @@ -0,0 +1,138 @@ +loginAsAdmin(); + } + + /** + * Allure annotations + * @Title("Create an Order via the Admin") + * @Description("Setup a Category, Product, Customer and place an Order using them via the Admin.") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminOrderGrid", value = "$adminOrderGrid") + * @Parameter(name = "AdminOrderPage", value = "$adminOrderAddPage") + * @Parameter(name = "AdminOrderDetailsPage", value = "$adminOrderDetailsPage") + * + * Codeception annotations + * @param AdminStep $I + * @param AdminCustomerPage $adminCustomerPage + * @param AdminCategoryPage $adminCategoryPage + * @param AdminProductPage $adminProductPage + * @param AdminOrderGrid $adminOrderGrid + * @param AdminOrderAddPage $adminOrderAddPage + * @param AdminOrderDetailsPage $adminOrderDetailsPage + * @return void + */ + public function createOrderViaAdmin( + AdminStep $I, + AdminCustomerPage $adminCustomerPage, + AdminCategoryPage $adminCategoryPage, + AdminProductPage $adminProductPage, + AdminOrderGrid $adminOrderGrid, + AdminOrderAddPage $adminOrderAddPage, + AdminOrderDetailsPage $adminOrderDetailsPage + ) + { + $customerDetails = $I->getCustomerData(); + $categoryDetails = $I->getCategoryData(); + $productDetails = $I->getProductData(); + + $customerName = $customerDetails['firstname'] . " " . $customerDetails['lastname']; + + $I->goToTheAdminCustomersAllCustomersPage(); + $adminCustomerPage->addBasicCustomerWithAddress($customerDetails); + + $I->goToTheAdminProductsCategoriesPage(); + $adminCategoryPage->addBasicCategory($categoryDetails); + + $I->goToTheAdminProductsCatalogPage(); + $adminProductPage->addBasicProductUnderCategory($productDetails, $categoryDetails); + + $I->goToTheAdminSalesOrdersPage(); + $adminOrderGrid->clickOnCreateNewOrderButton(); + + $adminOrderAddPage->enterCustomerEmailSearchTerm($customerDetails['email']); + $adminOrderAddPage->clickOnCustomerSearchButton(); + $adminOrderAddPage->clickOnCustomerFor($customerDetails['email']); + + $adminOrderAddPage->clickOnDefaultStoreView(); + + $adminOrderAddPage->clickOnAddProductsButton(); + $adminOrderAddPage->enterProductSkuSearchField($productDetails['sku']); + $adminOrderAddPage->clickOnProductsSearchButton(); + $adminOrderAddPage->clickOnProductSkuFor($productDetails['sku']); + $adminOrderAddPage->clickOnAddSelectedProductsToOrderButton(); + + $adminOrderAddPage->clickOnGetShippingMethodsAndRatesLink(); + $adminOrderAddPage->clickOnFixedShippingMethod(); + + $adminOrderAddPage->clickOnBottomSubmitButton(); + + $adminOrderDetailsPage->verifyThatYouCreatedAnOrderMessageIsPresent(); + $adminOrderDetailsPage->verifyThereIsAnOrderNumber(); + $adminOrderDetailsPage->verifyThatTheOrderWasPlacedToday(); + $adminOrderDetailsPage->verifyOrderStatusPending(); + $adminOrderDetailsPage->verifyPurchasedFromDefaultStoreView(); + + $adminOrderDetailsPage->verifyThatYouCreatedAnOrderMessageIsPresent(); + $adminOrderDetailsPage->verifyThatTheOrderWasPlacedToday(); + $adminOrderDetailsPage->verifyOrderStatusPending(); + $adminOrderDetailsPage->verifyPurchasedFromDefaultStoreView(); + $adminOrderDetailsPage->verifyCustomerName($customerName); + $adminOrderDetailsPage->verifyCustomerEmail($customerDetails['email']); + $adminOrderDetailsPage->verifyCustomerGroup('General'); + + $adminOrderDetailsPage->verifyBillingAddressInformation($customerDetails); + $adminOrderDetailsPage->verifyShippingAddressInformation($customerDetails); + + $adminOrderDetailsPage->verifyPaymentTypeCheckMoneyOrder(); + $adminOrderDetailsPage->verifyPaymentCurrencyUSD(); + + $adminOrderDetailsPage->verifyShippingMethodFixedRate(); + $adminOrderDetailsPage->verifyShippingHandlingPrice('$0.00'); + + // TODO: Add verification for Product Details in the Order + $adminOrderDetailsPage->verifyItemsOrderedFor($productDetails); + + $adminOrderDetailsPage->verifyOrderStatusDropDownPending(); + $adminOrderDetailsPage->verifyOrderComments(''); + + $adminOrderDetailsPage->verifySubTotalPrice($productDetails['price']); + $adminOrderDetailsPage->verifyShippingHandlingPrice('$0.00'); + } +} \ No newline at end of file From 139312336fac401012a1987f4707446b3ad24100 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 28 Apr 2017 10:38:04 -0500 Subject: [PATCH 059/149] - Updating the Product Data Generator sku, switched from UUID to a Unix time stamp. UUID was too long. - Adding a quantity field to the generator. --- tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index 733cf29e5..b31b42429 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -188,8 +188,9 @@ public function getProductData($categoryId = 0, $productData = []) 'enableProduct' => $faker->boolean(), 'attributeSet' => '', 'productName' => $faker->text($maxNbChars = 20), - 'sku' => $faker->uuid, + 'sku' => \Faker\Provider\DateTime::unixTime($max = 'now'), 'price' => $faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 999), + 'quantity' => $faker->numberBetween($min = 1, $max = 999), 'urlKey' => $faker->uuid, 'metaTitle' => $faker->word, From ca2c0553bf4e8c2373a00b6878a31d5a0981c238 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 28 Apr 2017 10:52:42 -0500 Subject: [PATCH 060/149] - I used the AdminStep object to navigate to the page instead of the duplicate function in the PageObject. --- .../Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php | 6 +++--- .../Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php | 3 ++- .../Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index 1e64c1b35..fcf016cd8 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -19,6 +19,7 @@ * Allure annotations * @Features({"Category"}) * @Stories({"Create a sub-Category"}) + * * Codeception annotations * @group catalog * @group add @@ -39,8 +40,6 @@ public function _after(AdminStep $I) } /** - * Create sub category in admin. - * * Allure annotations * @Title("Create sub category with required fields") * @Description("Create sub category with required fields") @@ -50,6 +49,7 @@ public function _after(AdminStep $I) * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") * + * Codeception annotations * @param AdminStep $I * @param AdminCategoryPage $adminCategoryPage * @param StorefrontCategoryPage $storefrontCategoryPage @@ -63,7 +63,7 @@ public function createCategoryTest( $I->wantTo('create sub category with required fields in admin Category page.'); $category = $I->getCategoryApiData(); - $adminCategoryPage->amOnAdminCategoryPage(); + $I->goToTheAdminProductsCategoriesPage(); $adminCategoryPage->addSubCategory(); $adminCategoryPage->fillFieldCategoryName($category['name']); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index d3ef6ff8c..508294c26 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -45,6 +45,8 @@ class CreateSimpleProductCest public function _before(AdminStep $I, CategoryApiStep $api) { $I->loginAsAdmin(); + $I->goToTheAdminProductsCatalogPage(); + $this->category = $I->getCategoryApiData(); $api->amAdminTokenAuthenticated(); $this->category = array_merge($this->category, ['id' => $api->createCategory(['category' => $this->category])]); @@ -91,7 +93,6 @@ public function createSimpleProductTest( StorefrontProductPage $storefrontProductPage ) { $I->wantTo('create simple product with required fields in admin product page.'); - $adminProductGridPage->amOnAdminProductGridPage(); $adminProductGridPage->clickAddNewProductPage(); $adminProductPage->amOnAdminNewProductPage(); $adminProductPage->fillFieldProductName($this->product['name']); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index 29a2a2045..a99043c4c 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -50,6 +50,8 @@ class UpdateSimpleProductCest public function _before(AdminStep $I, CategoryApiStep $categoryApi, ProductApiStep $productApi) { $I->loginAsAdmin(); + $I->goToTheAdminProductsCatalogPage(); + $this->category = $I->getCategoryApiData(); $categoryApi->amAdminTokenAuthenticated(); $this->category = array_merge( @@ -107,7 +109,6 @@ public function updateSimpleProductTest( StorefrontProductPage $storefrontProductPage ) { $I->wantTo('update simple product in admin.'); - $adminProductGridPage->amOnAdminProductGridPage(); $adminProductGridPage->searchBySku($this->product['sku']); $adminProductGridPage->seeInNthRow(1, $this->product['sku']); From ed64f73596b0d65981222d5d8eb731dc6266b0fe Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 28 Apr 2017 10:53:54 -0500 Subject: [PATCH 061/149] - Adding the Admin Customer Grip PageObject. - Adding a selector for the Save button in the Customer PageObject. --- .../Page/Customer/AdminCustomerGrid.php | 125 +++++++++++++++++- .../Page/Customer/AdminCustomerPage.php | 8 ++ 2 files changed, 132 insertions(+), 1 deletion(-) diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php index 2b52ed949..a50a66889 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php @@ -8,5 +8,128 @@ class AdminCustomerGrid extends AdminGridPage /** * Declare UI map for this page here. CSS or XPath allowed. */ - + public static $addNewCustomerButton = '#add'; + + /** + * UI map for admin data grid filter section. + */ + public static $filterIdFromField = '.admin__control-text[name="entity_id[from]"]'; + public static $filterIdToField = '.admin__control-text[name="entity_id[to]"]'; + public static $filterCustomerSinceFromField = '.admin__control-text[name="created_at[from]"]'; + public static $filterCustomerSinceToField = '.admin__control-text[name="created_at[to]"]'; + public static $filterDateOfBirthFromField = '.admin__control-text[name="dob[from]"]'; + public static $filterDateOfBirthToField = '.admin__control-text[name="dob[to]"]'; + public static $filterNameField = '.admin__control-text[name="name"]'; + public static $filterEmailField = '.admin__control-text[name="email"]'; + public static $filterGroupDropDown = '.admin__control-select[name="group_id"]'; + public static $filterPhoneField = '.admin__control-text[name="billing_telephone"]'; + public static $filterZipCodeField = '.admin__control-text[name="billing_postcode"]'; + public static $filterCountryDropDown = '.admin__control-select[name="billing_country_id"]'; + public static $filterStateProvinceField = '.admin__control-text[name="billing_region"]'; + public static $filterWebSiteDropDown = '.admin__control-select[name="website_id"]'; + public static $filterTaxVatNumberField = '.admin__control-text[name="taxvat"]'; + public static $filterGenderDropDown = '.admin__control-select[name="gender"]'; + + public function clickOnAddNewCustomerButton() + { + $I = $this->acceptanceTester; + $I->click(self::$addNewCustomerButton); + $I->waitForPageLoad(); + } + + public function enterFilterIdFrom($idFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterIdFromField, $idFrom); + } + + public function enterFilterIdTo($idTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterIdToField, $idTo); + } + + public function enterFilterCustomerSinceFrom($customerSinceFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterCustomerSinceFromField, $customerSinceFrom); + } + + public function enterFilterCustomerSinceTo($customerSinceTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterCustomerSinceToField, $customerSinceTo); + } + + public function enterFilterDateOfBirthFrom($dateOfBirthFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterDateOfBirthFromField, $dateOfBirthFrom); + } + + public function enterFilterDateOfBirthTo($dateOfBirthTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterDateOfBirthToField, $dateOfBirthTo); + } + + public function enterFilterName($name) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterNameField, $name); + } + + public function enterFilterEmail($email) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterEmailField, $email); + } + + public function selectFilterGroup($group) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$filterGroupDropDown, $group); + } + + public function enterFilterPhone($phoneNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterPhoneField, $phoneNumber); + } + + public function enterFilterZipCode($zipCode) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterZipCodeField, $zipCode); + } + + public function selectFilterCountry($country) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$filterCountryDropDown, $country); + } + + public function enterFilterStateProvince($stateProvince) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterStateProvinceField, $stateProvince); + } + + public function selectFilterWebSite($website) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$filterWebSiteDropDown, $website); + } + + public function enterFilterTaxVatNumber($taxVatNumber) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterTaxVatNumberField, $taxVatNumber); + } + + public function selectFilterGender($gender) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$filterGenderDropDown, $gender); + } } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php index c907b3620..f75923d0f 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php @@ -13,6 +13,7 @@ class AdminCustomerPage extends AbstractAdminPage /** * Declare UI map for this page here. CSS or XPath allowed. */ + public static $saveCustomerButton = '#save'; public static $deleteCustomerButton = '#customer-edit-delete-button'; public static $createOrderButton = '#customer-edit-delete-button'; public static $resetPasswordButton = '#resetPassword'; @@ -80,6 +81,13 @@ public function clickOnAddCustomerButton() self::clickOnAdminAddButton(); $I->waitForPageLoad(); } + + public function clickOnSaveCustomerButton() + { + $I = $this->acceptanceTester; + $I->click(self::$saveCustomerButton); + $I->waitForPageLoad(); + } public function clickOnDeleteCustomerButton() { From 9ba7a0572d1ea36b01669bf319a0f3c4d63a0866 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 28 Apr 2017 11:00:59 -0500 Subject: [PATCH 062/149] - Adding a reference to the Allure TestCaseId tag for a test that was missing it. - Cleaned up the Catalog PageObjects, removed the of() functions, updated a few selectors, added a few new selectors and methods for them. - Removed references to spinners since we have a global function for that. - Removed methods that were duplicates of ones in the Admin Step object for GoToXXXPage and VerifyXXXPage. --- .../Xxyyzz/Page/Catalog/AdminCategoryPage.php | 18 ---- .../Page/Catalog/AdminProductGridPage.php | 93 ++++++++++++++----- .../Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php | 20 +++- .../Magento/Xxyyzz/Page/Cms/AdminCmsPage.php | 4 +- .../Acceptance/Cms/CreateContentPageCest.php | 10 +- .../Customer/CreateCustomerCest.php | 16 ++-- .../Customer/SignInCustomerFrontendCest.php | 1 + 7 files changed, 100 insertions(+), 62 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php index a2059f577..8b119733e 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php @@ -5,11 +5,6 @@ class AdminCategoryPage extends AbstractAdminPage { - /** - * Include url of current page. - */ - public static $URL = '/admin/catalog/category/'; - /** * Buttons in category page. */ @@ -30,19 +25,6 @@ class AdminCategoryPage extends AbstractAdminPage public static $categoryName = '.admin__control-text[name=name]'; public static $categoryUrlKey = '.admin__control-text[name=url_key]'; - /** - * Category form loading spinner. - */ - public static $categoryFormLoadingSpinner - = '.admin__form-loading-mask[data-component="category_form.category_form"] .spinner'; - - public function amOnAdminCategoryPage($param = '') - { - $I = $this->acceptanceTester; - $I->amOnPage(self::route($param)); - $I->waitForPageLoad(); - } - public function amOnAdminCategoryPageById($id) { $I = $this->acceptanceTester; diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php index fc715e50e..e15481f0a 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php @@ -5,49 +5,92 @@ class AdminProductGridPage extends AdminGridPage { - /** - * Include url of current page. - */ - public static $URL = '/admin/catalog/product'; - /** * Declare UI map for this page here. CSS or XPath allowed. */ - public static $addNewProductButton = '#add_new_product-button'; + public static $addNewProductButton = '#add_new_product-button'; + public static $addNewProductDropDownButton = '#add_new_product .add.action-toggle'; + + public static $addNewSimpleProductOption = '.item[data-ui-id="products-list-add-new-product-button-item-simple"]'; + public static $addNewConfigurableProductOption = '.item[data-ui-id="products-list-add-new-product-button-item-configurable"]'; + public static $addNewGroupedProductOption = '.item[data-ui-id="products-list-add-new-product-button-item-grouped"]'; + public static $addNewVirtualProductOption = '.item[data-ui-id="products-list-add-new-product-button-item-virtual"]'; + public static $addNewBundleProductOption = '.item[data-ui-id="products-list-add-new-product-button-item-bundle"]'; + public static $addNewDownloadableProductOption = '.item[data-ui-id="products-list-add-new-product-button-item-downloadable"]'; /** * UI map for admin data grid filter section. */ - public static $filterIdFrom = '.admin__form-field input[name="entity_id[from]"]'; - public static $filterIdTo = '.admin__form-field input[name="entity_id[to]"]'; - public static $filterPriceFrom = '.admin__form-field input[name="price[from]"]'; - public static $filterPriceTo = '.admin__form-field input[name="price[to]"]'; - public static $filterProductName = '.admin__form-field input[name=name]'; - public static $filterProductSku = '.admin__form-field input[name=sku]'; + public static $filterIdFromField = '.admin__control-text[name="entity_id[from]"]'; + public static $filterIdToField = '.admin__control-text[name="entity_id[to]"]'; + public static $filterPriceFromField = '.admin__control-text[name="price[from]"]'; + public static $filterPriceToField = '.admin__control-text[name="price[to]"]'; + public static $filterQuantityFromField = '.admin__control-text[name="qty[from]"]'; + public static $filterQuantityToField = '.admin__control-text[name="qty[to]"]'; + public static $filterStoreViewDropDown = '.admin__control-select[name="store_id"]'; + public static $filterProductName = '.admin__form-field input[name=name]'; + public static $filterProductTypeDropDown = '.admin__control-select[name="type_id"]'; + public static $filterProductAttributeSetDropDown = '.admin__control-select[name="attribute_set_id"]'; + public static $filterProductSkuField = '.admin__form-field input[name=sku]'; + public static $filterProductVisibilityDropDown = '.admin__control-select[name="visibility"]'; + public static $filterProductStatusDropDown = '.admin__control-select[name="status"]'; - /** - * Spinners. - */ - public static $productGridProductListingLoadingSpinner - = '.admin__data-grid-loading-mask[data-component="product_listing.product_listing.product_columns"]>.spinner'; - public static $productGridNotificationLoadingSpinner - = '.admin__data-grid-loading-mask[data-component="notification_area.notification_area.columns"]>.spinner'; + public function clickAddNewProductPage() + { + $I = $this->acceptanceTester; + $I->click(self::$addNewProductButton); + } - public function amOnAdminProductGridPage() + public function clickOnAddNewProductDropDown() { $I = $this->acceptanceTester; - $I->amOnPage(self::$URL); - $I->waitForPageLoad(); + $I->click(self::$addNewProductDropDownButton); } - public function clickAddNewProductPage() + public function clickOnAddSimpleProductOption() { $I = $this->acceptanceTester; - $I->click(self::$addNewProductButton); + self::clickOnAddNewProductDropDown(); + $I->click(self::$addNewSimpleProductOption); + } + + public function clickOnAddConfigurableProductOption() + { + $I = $this->acceptanceTester; + self::clickOnAddNewProductDropDown(); + $I->click(self::$addNewConfigurableProductOption); + } + + public function clickOnAddGroupedProductOption() + { + $I = $this->acceptanceTester; + self::clickOnAddNewProductDropDown(); + $I->click(self::$addNewGroupedProductOption); + } + + public function clickOnAddVirtualProductOption() + { + $I = $this->acceptanceTester; + self::clickOnAddNewProductDropDown(); + $I->click(self::$addNewVirtualProductOption); + } + + public function clickOnAddBundleProductOption() + { + $I = $this->acceptanceTester; + self::clickOnAddNewProductDropDown(); + $I->click(self::$addNewBundleProductOption); + } + + public function clickOnAddDownloadableProductOption() + { + $I = $this->acceptanceTester; + self::clickOnAddNewProductDropDown(); + $I->click(self::$addNewDownloadableProductOption); } public function searchBySku($sku) { - $this->searchAndFiltersByValue($sku, self::$filterProductSku); + $this->searchAndFiltersByValue($sku, self::$filterProductSkuField); } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php index f8cba2e39..2ff2ba34d 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php @@ -8,16 +8,26 @@ class AdminCmsGrid extends AdminGridPage /** * Declare UI map for this page here. CSS or XPath allowed. */ - public static $actionEdit = '.action-menu-item[data-action="item-edit"]'; - public static $actionDelete = '.action-menu-item[data-action="item-delete"]'; - public static $actionView = '.action-menu-item[data-action="item-preview"]'; + public static $addNewPageButton = '#add'; + + public static $actionEdit = '.action-menu-item[data-action="item-edit"]'; + public static $actionDelete = '.action-menu-item[data-action="item-delete"]'; + public static $actionView = '.action-menu-item[data-action="item-preview"]'; + + public function clickOnAddPageButton() + { + $I = $this->acceptanceTester; + $I->click(self::$addNewPageButton); + $I->waitForPageLoad(); + } public function clickOnActionSelectLinkFor($keyText) { $I = $this->acceptanceTester; - $actionSelectLinkSelector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] .action-select'; + $selector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] .action-select'; - $I->click($actionSelectLinkSelector); + $I->click($selector); + $I->waitForPageLoad(); } public function clickOnActionEditFor($keyText) diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php index be344eb7c..f66818d4e 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php @@ -420,7 +420,7 @@ public function verifyNewLayout3Columns() self::verifyNewLayout('3 columns'); } - public function savePage() + public function clickOnSavePageButton() { $I = $this->acceptanceTester; $I->click(self::$savePageButton); @@ -471,6 +471,6 @@ public function addBasicPage($pageDetails) self::clickOnPageSearchEngineOptimisation(); self::enterUrlKey($pageDetails['urlKey']); - self::savePage(); + self::clickOnSavePageButton(); } } \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php index 145e0bb2f..42d5e9397 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php @@ -32,13 +32,14 @@ class CreateContentPageCest { public function _before( AdminStep $I, - AdminCmsPage $adminCmsPage + AdminCmsGrid $adminCmsGrid ) { $I->am('an Admin'); $I->loginAsAdmin(); - $adminCmsPage->amOnAdminCmsPage(); - $adminCmsPage->clickOnAddNewPageButton(); + $I->goToTheAdminContentPagesPage(); + + $adminCmsGrid->clickOnAddPageButton(); } public function _after(AdminStep $I) @@ -153,7 +154,7 @@ public function createContentPageTest( $adminCmsPage->clickOnPageSearchEngineOptimisation(); $adminCmsPage->enterUrlKey($pageData['urlKey']); - $adminCmsPage->savePage(); + $adminCmsPage->clickOnSavePageButton(); $adminCmsPage->seeSaveSuccessMessage(); $I->openNewTabGoToVerify($pageData['urlKey']); @@ -163,6 +164,7 @@ public function createContentPageTest( $adminCmsGrid->performSearchByKeyword($pageData['urlKey']); $adminCmsGrid->clickOnActionEditFor($pageData['urlKey']); + $adminCmsPage->clickOnPageContent(); $adminCmsPage->clickOnPageSearchEngineOptimisation(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php index 6ef438c18..7504a5395 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php @@ -30,13 +30,13 @@ class CreateCustomerCest { public function _before( AdminStep $I, - AdminCustomerPage $customerPage + AdminCustomerGrid $customerPageGrid ) { $I->am('an Admin'); $I->loginAsAdmin(); $I->goToTheAdminCustomersAllCustomersPage(); - $customerPage->clickOnAddCustomerButton(); + $customerPageGrid->clickOnAddNewCustomerButton(); } /** @@ -184,12 +184,12 @@ public function createBasicCustomerAccountTest( $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); $adminCustomerPage->selectGroupGeneral(); - $adminCustomerPage->clickOnAdminSaveButton(); - $adminCustomerGrid->performSearchByKeyword($customerData['email']); + $adminCustomerPage->clickOnSaveCustomerButton(); + $adminCustomerGrid->performSearchByKeyword($customerData['email']); $adminCustomerGrid->clickOnActionLinkFor($customerData['email']); - $adminCustomerPage->clickOnAccountInformationLink(); + $adminCustomerPage->clickOnAccountInformationLink(); $adminCustomerPage->verifyFirstName($customerData['firstname']); $adminCustomerPage->verifyLastName($customerData['lastname']); $adminCustomerPage->verifyEmailAddress($customerData['email']); @@ -252,12 +252,12 @@ public function createBasicCustomerAccountWithAddressTest( $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); $adminCustomerPage->selectGroupGeneral(); - $adminCustomerPage->clickOnAdminSaveButton(); - $adminCustomerGrid->performSearchByKeyword($customerData['email']); + $adminCustomerPage->clickOnSaveCustomerButton(); + $adminCustomerGrid->performSearchByKeyword($customerData['email']); $adminCustomerGrid->clickOnActionLinkFor($customerData['email']); - $adminCustomerPage->clickOnAddressesLink(); + $adminCustomerPage->clickOnAddressesLink(); $adminCustomerPage->verifyAddAddressDefaultBillingAddress(true); $adminCustomerPage->verifyAddAddressDefaultShippingAddress(true); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php index 8f89e7de7..cc72a4122 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php @@ -12,6 +12,7 @@ use Yandex\Allure\Adapter\Annotation\Severity; use Yandex\Allure\Adapter\Annotation\Parameter; use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; /** * Class SignInCustomerFrontendCest From c3adf5952cbda050c321d05681640b6c43658a40 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 1 May 2017 14:46:04 -0500 Subject: [PATCH 063/149] MTA-4194: framework improvements in: 1. In AdminGridPage, added new functions for searching and filtering grid by value, assert texts in grid, open/close filter section, clear all filters in AdminGridPage. 2. In AbstractAdminPage, added explicit functions to expandCollapsibleArea and closeCollapsibleArea function as John requested. 3. In MagentoFakerData, fixed product data for it to work with configurable products. --- .../Xxyyzz/Module/MagentoFakerData.php | 8 ++-- .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 22 +++++++++ .../Magento/Xxyyzz/Page/AdminGridPage.php | 46 +++++++++++++++++-- .../Xxyyzz/Page/Catalog/AdminCategoryPage.php | 12 +++++ .../Page/Catalog/AdminProductGridPage.php | 15 +++++- .../Xxyyzz/Page/Catalog/AdminProductPage.php | 14 +----- .../Acceptance/Catalog/CreateCategoryCest.php | 2 +- .../Catalog/CreateSimpleProductCest.php | 12 ++--- .../Catalog/UpdateSimpleProductCest.php | 7 ++- 9 files changed, 106 insertions(+), 32 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index b31b42429..9680e6c54 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -49,17 +49,17 @@ public function getCategoryApiData($categoryData = []) * @param array $productData * @return array */ - public function getSimpleProductApiData($categoryId = 0, $productData = []) + public function getProductApiData($type = 'simple', $categoryId = 0, $productData = []) { $faker = \Faker\Factory::create(); $sq = $this->getSqs(); return [ 'sku' => isset($productData['sku']) - ? $productData['sku'] : 'simple_product_sku'.$sq, + ? $productData['sku'] : $type . '_product_sku'.$sq, 'name' => isset($productData['name']) - ? $productData['name'] : 'simple_product'.$sq, + ? $productData['name'] : $type . '_product'.$sq, 'visibility' => 4, - 'type_id' => 'simple', + 'type_id' => $type, 'price' => $faker->randomFloat(2, 1), 'status' => 1, 'attribute_set_id' => 4, diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php index 192b3d102..8aa67330f 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php @@ -175,6 +175,28 @@ public function clickOnCollapsibleArea($areaName) $I->click('//div[@class="fieldset-wrapper-title"]/strong/span[contains(text(), "' . $areaName . '")]'); } + public function expandCollapsibleArea($areaIndex) + { + $I = $this->acceptanceTester; + $context = sprintf('.fieldset-wrapper[data-index=%s]', $areaIndex); + try { + $I->seeElement($context . ' .fieldset-wrapper-title[data-state-collapsible=closed]'); + $I->click($context . ' .admin__collapsible-title>span'); + } catch (\PHPUnit_Framework_AssertionFailedError $e) { + } + } + + public function closeCollapsibleArea($areaIndex) + { + $I = $this->acceptanceTester; + $context = sprintf('.fieldset-wrapper[data-index=%s]', $areaIndex); + try { + $I->seeElement($context . ' .fieldset-wrapper-title[data-state-collapsible=open]'); + $I->click($context . ' .admin__collapsible-title>span'); + } catch (\PHPUnit_Framework_AssertionFailedError $e) { + } + } + public function seeSuccessMessage() { $I = $this->acceptanceTester; diff --git a/tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php b/tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php index 2ebc81be5..5d8eb21c3 100644 --- a/tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php @@ -72,9 +72,15 @@ class AdminGridPage public static $loadingMask = '.loading-mask'; public static $gridLoadingMask = '.admin__data-grid-loading-mask'; + public static $grid + = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap'; + public static $gridNthRow = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s)'; + public static $checkboxInGridNthRow + = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s) .admin__control-checkbox'; + /** * @var AcceptanceTester */ @@ -177,16 +183,48 @@ public function searchAndFiltersByValue($value, $selector, $type = 'textfield') } /** - * @see text in grid nth row. + * @see texts in currently visible grid's nth row. * * @param int $n - * @param string $text + * @param array $texts + */ + public function seeInCurrentGridNthRow(int $n, array $texts) + { + $I = $this->acceptanceTester; + $I->waitForPageLoad(); + foreach ($texts as $text) { + $I->see($text, sprintf(self::$gridNthRow, $n)); + } + } + + /** + * @see texts in currently visible grid. + * + * @param array $texts */ - public function seeInNthRow(int $n, $text) + public function seeInCurrentGrid(array $texts) { $I = $this->acceptanceTester; $I->waitForPageLoad(); - $I->see($text, sprintf(self::$gridNthRow, $n)); + foreach ($texts as $text) { + $I->see($text, self::$grid); + } + } + + /** + * Check the checkbox in currently visible grid's nth row. + * + * @param int $n + */ + public function checkCheckboxInCurrentNthRow(int $n) + { + $I = $this->acceptanceTester; + $I->waitForPageLoad(); + try { + $I->dontSeeCheckboxIsChecked(sprintf(self::$checkboxInGridNthRow, 1)); + $I->click(sprintf(self::$checkboxInGridNthRow, 1)); + } catch (ElementNotFound $e) { + } } public function clickOnViewButton() diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php index 8b119733e..7b1d3f42a 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php @@ -5,6 +5,11 @@ class AdminCategoryPage extends AbstractAdminPage { + /** + * Include url of current page. + */ + public static $URL = '/admin/catalog/category/'; + /** * Buttons in category page. */ @@ -25,6 +30,13 @@ class AdminCategoryPage extends AbstractAdminPage public static $categoryName = '.admin__control-text[name=name]'; public static $categoryUrlKey = '.admin__control-text[name=url_key]'; + public function amOnAdminCategoryPage($param = '') + { + $I = $this->acceptanceTester; + $I->amOnPage(self::route($param)); + $I->waitForPageLoad(); + } + public function amOnAdminCategoryPageById($id) { $I = $this->acceptanceTester; diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php index e15481f0a..181f93b35 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php @@ -5,6 +5,11 @@ class AdminProductGridPage extends AdminGridPage { + /** + * Include url of current page. + */ + public static $URL = '/admin/catalog/product'; + /** * Declare UI map for this page here. CSS or XPath allowed. */ @@ -35,10 +40,18 @@ class AdminProductGridPage extends AdminGridPage public static $filterProductVisibilityDropDown = '.admin__control-select[name="visibility"]'; public static $filterProductStatusDropDown = '.admin__control-select[name="status"]'; - public function clickAddNewProductPage() + public function amOnAdminProductGridPage() + { + $I = $this->acceptanceTester; + $I->amOnPage(self::$URL); + $I->waitForPageLoad(); + } + + public function clickAddNewProductButton() { $I = $this->acceptanceTester; $I->click(self::$addNewProductButton); + $I->waitForPageLoad(); } public function clickOnAddNewProductDropDown() diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php index 40c1021c0..f4405cdd9 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php @@ -34,10 +34,6 @@ class AdminProductPage extends AbstractAdminPage public static $producCategoriesMultiSelectText = '.admin__field[data-index=category_ids] .admin__action-multiselect-crumb:nth-child(%s)>span'; - public static $productContentToggle = - '.fieldset-wrapper[data-index=content] .fieldset-wrapper-title[data-state-collapsible=%s]'; - public static $productSearchEngineOptimToggle = - '.fieldset-wrapper[data-index=search-engine-optimization] .fieldset-wrapper-title[data-state-collapsible=%s]'; /** * Product form loading spinner. */ @@ -119,10 +115,7 @@ public function seeProductCategories(array $names) public function seeProductUrlKey($urlKey) { $I = $this->acceptanceTester; - try { - $I->click(sprintf(self::$productSearchEngineOptimToggle, 'closed')); - } catch (\Exception $e) { - } + $this->expandCollapsibleArea('search-engine-optimization'); $I->seeInField(self::$productUrlKey, $urlKey); } @@ -165,11 +158,8 @@ public function selectProductStockStatus($status) public function fillFieldProductUrlKey($urlKey) { + $this->expandCollapsibleArea('search-engine-optimization'); $I = $this->acceptanceTester; - try { - $I->click(sprintf(self::$productSearchEngineOptimToggle, 'closed')); - } catch (\Exception $e) { - } $I->fillField(self::$productUrlKey, $urlKey); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index fcf016cd8..d5ee6da0c 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -45,7 +45,7 @@ public function _after(AdminStep $I) * @Description("Create sub category with required fields") * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminStep", value = "$I") * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") * diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index 508294c26..b724a43d5 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -21,7 +21,7 @@ * * Allure annotations * @Features({"Catalog"}) - * @Stories({"Create a basic Product"}) + * @Stories({"Create simple product"}) * * Codeception annotations * @group catalog @@ -51,7 +51,7 @@ public function _before(AdminStep $I, CategoryApiStep $api) $api->amAdminTokenAuthenticated(); $this->category = array_merge($this->category, ['id' => $api->createCategory(['category' => $this->category])]); $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - $this->product = $I->getSimpleProductApiData(); + $this->product = $I->getProductApiData(); if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { $this->product['stock_status'] = 'In Stock'; $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; @@ -68,11 +68,11 @@ public function _after(AdminStep $I) /** * Allure annotations - * @Title("Create a basic Product and verify on the Storefront") - * @Description("Create a basic Product in the Admin and verify the content on the Storefront.") + * @Title("Create a simple product and verify on the Storefront") + * @Description("Create a simple product in the Admin and verify the content on the Storefront.") * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminStep", value = "$I") * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") * @Parameter(name = "AdminProductPage", value = "$adminProductPage") * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") @@ -93,7 +93,7 @@ public function createSimpleProductTest( StorefrontProductPage $storefrontProductPage ) { $I->wantTo('create simple product with required fields in admin product page.'); - $adminProductGridPage->clickAddNewProductPage(); + $adminProductGridPage->clickAddNewProductButton(); $adminProductPage->amOnAdminNewProductPage(); $adminProductPage->fillFieldProductName($this->product['name']); $adminProductPage->fillFieldProductSku($this->product['sku']); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index a99043c4c..f39bddbbd 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -59,8 +59,7 @@ public function _before(AdminStep $I, CategoryApiStep $categoryApi, ProductApiSt ['id' => $categoryApi->createCategory(['category' => $this->category])] ); $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - $this->product = $I->getSimpleProductApiData(); - $this->product['custom_attributes'][2]['value'] = $this->category['id']; + $this->product = $I->getProductApiData('simple', $this->category['id']); $productApi->amAdminTokenAuthenticated(); $this->product = array_merge( $this->product, @@ -88,7 +87,7 @@ public function _after(AdminStep $I) * @Description("Update simple product with required fields") * @TestCaseId("") * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "Admin", value = "$I") + * @Parameter(name = "AdminStep", value = "$I") * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") * @Parameter(name = "AdminProductPage", value = "$adminProductPage") * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") @@ -110,7 +109,7 @@ public function updateSimpleProductTest( ) { $I->wantTo('update simple product in admin.'); $adminProductGridPage->searchBySku($this->product['sku']); - $adminProductGridPage->seeInNthRow(1, $this->product['sku']); + $adminProductGridPage->seeInCurrentGridNthRow(1, [$this->product['sku']]); $I->wantTo('open product created from precondition.'); $adminProductPage->amOnAdminEditProductPageById($this->product['id']); From 4466aeb1b622b81a217ee4f40aaa56beac7cac81 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Mon, 1 May 2017 18:25:48 -0500 Subject: [PATCH 064/149] - Removed the Navigation Menu name from the "goTo" ('gotToContentPagesPage') and "shouldBeOn" ('shouldBeOnContentPagesPage') functions. This should make them easier to use. - Added the word 'Grid' for Grid pages and 'Page' for Non-Grid pages, to the "goTo" and "shouldBeOn" fnctions, to clear up confusion. - Updated all tests with the newly named functions. --- .../Magento/Xxyyzz/Helper/AdminUrlList.php | 164 ++-- .../Magento/Xxyyzz/Step/Backend/AdminStep.php | 812 +++++++++--------- .../Backend/AccessAdminPagesDirectlyCest.php | 304 +++---- .../AccessAdminPagesViaNavMenuCest.php | 154 ++-- .../Acceptance/Catalog/CreateCategoryCest.php | 2 +- .../Catalog/CreateSimpleProductCest.php | 2 +- .../Catalog/UpdateSimpleProductCest.php | 2 +- .../Acceptance/Cms/CreateContentPageCest.php | 2 +- .../Customer/CreateCustomerCest.php | 2 +- .../Sales/CreateOrderViaAdminCest.php | 8 +- .../Acceptance/SampleTests/TestCest.php | 8 +- .../User/AccessForgotYourPasswordCest.php | 2 +- 12 files changed, 733 insertions(+), 729 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php b/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php index df4723e74..37dc99a8c 100644 --- a/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php +++ b/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php @@ -6,96 +6,96 @@ */ class AdminUrlList { - public static $adminLogin = '/admin/admin/'; - public static $adminLogout = '/admin/admin/auth/logout/'; - public static $adminForgotYourPassword = '/admin/admin/auth/forgotpassword/'; + public static $adminLoginPage = '/admin/admin/'; + public static $adminLogoutPage = '/admin/admin/auth/logout/'; + public static $adminForgotYourPasswordPage = '/admin/admin/auth/forgotpassword/'; - public static $adminDashboard = '/admin/admin/dashboard/'; + public static $adminDashboardPage = '/admin/admin/dashboard/'; - public static $adminSalesOrders = '/admin/sales/order/'; - public static $adminSalesInvoices = '/admin/sales/invoice/'; - public static $adminSalesShipments = '/admin/sales/shipment/'; - public static $adminSalesCreditMemos = '/admin/sales/creditmemo/'; - public static $adminSalesBillingAgreements = '/admin/paypal/billing_agreement/'; - public static $adminSalesTransactions = '/admin/sales/transactions/'; + public static $adminOrdersGrid = '/admin/sales/order/'; + public static $adminInvoicesGrid = '/admin/sales/invoice/'; + public static $adminShipmentsGrid = '/admin/sales/shipment/'; + public static $adminCreditMemosGrid = '/admin/sales/creditmemo/'; + public static $adminBillingAgreementsGrid = '/admin/paypal/billing_agreement/'; + public static $adminTransactionsGrid = '/admin/sales/transactions/'; - public static $adminProductsCatalog = '/admin/catalog/product/'; - public static $adminProductsCategories = '/admin/catalog/category/'; + public static $adminCatalogGrid = '/admin/catalog/product/'; + public static $adminCategoriesPage = '/admin/catalog/category/'; - public static $adminCustomersAllCustomers = '/admin/customer/index/'; - public static $adminCustomersNowOnline = '/admin/customer/online/'; + public static $adminAllCustomersGrid = '/admin/customer/index/'; + public static $adminCustomersNowOnlineGrid = '/admin/customer/online/'; - public static $adminMarketingCatalogPriceRule = '/admin/catalog_rule/promo_catalog/'; - public static $adminMarketingCartPriceRules = '/admin/sales_rule/promo_quote/'; - public static $adminMarketingEmailTemplates = '/admin/admin/email_template/'; - public static $adminMarketingNewsletterTemplate = '/admin/newsletter/template/'; - public static $adminMarketingNewsletterQueue = '/admin/newsletter/queue/'; - public static $adminMarketingNewsletterSubscribers = '/admin/newsletter/subscriber/'; - public static $adminMarketingURLRewrites = '/admin/admin/url_rewrite/index/'; - public static $adminMarketingSearchTerms = '/admin/search/term/index/'; - public static $adminMarketingSearchSynonyms = '/admin/search/synonyms/index/'; - public static $adminMarketingSiteMap = '/admin/admin/sitemap/'; - public static $adminMarketingReviews = '/admin/review/product/index/'; + public static $adminCatalogPriceRuleGrid = '/admin/catalog_rule/promo_catalog/'; + public static $adminCartPriceRulesGrid = '/admin/sales_rule/promo_quote/'; + public static $adminEmailTemplatesGrid = '/admin/admin/email_template/'; + public static $adminNewsletterTemplateGrid = '/admin/newsletter/template/'; + public static $adminNewsletterQueueGrid = '/admin/newsletter/queue/'; + public static $adminNewsletterSubscribersGrid = '/admin/newsletter/subscriber/'; + public static $adminURLRewritesGrid = '/admin/admin/url_rewrite/index/'; + public static $adminSearchTermsGrid = '/admin/search/term/index/'; + public static $adminSearchSynonymsGrid = '/admin/search/synonyms/index/'; + public static $adminSiteMapGrid = '/admin/admin/sitemap/'; + public static $adminReviewsGrid = '/admin/review/product/index/'; - public static $adminContentPages = '/admin/cms/page/'; - public static $adminContentBlocks = '/admin/cms/block/'; - public static $adminContentWidgets = '/admin/admin/widget_instance/'; - public static $adminContentConfiguration = '/admin/theme/design_config/'; - public static $adminContentThemes = '/admin/admin/system_design_theme/'; - public static $adminContentSchedule = '/admin/admin/system_design/'; + public static $adminPagesGrid = '/admin/cms/page/'; + public static $adminBlocksGrid = '/admin/cms/block/'; + public static $adminWidgetsGrid = '/admin/admin/widget_instance/'; + public static $adminDesignConfigurationGrid = '/admin/theme/design_config/'; + public static $adminThemesGrid = '/admin/admin/system_design_theme/'; + public static $adminStoreContentScheduleGrid = '/admin/admin/system_design/'; - public static $adminReportsProductsInCart = '/admin/reports/report_shopcart/product/'; - public static $adminReportsSearchTerms = '/admin/search/term/report/'; - public static $adminReportsAbandonedCArts = '/admin/reports/report_shopcart/abandoned/'; - public static $adminReportsNewsletterProblemReports = '/admin/newsletter/problem/'; - public static $adminReportsByCustomers = '/admin/reports/report_review/customer/'; - public static $adminReportsByProducts = '/admin/reports/report_review/product/'; - public static $adminReportsOrders = '/admin/reports/report_sales/sales/'; - public static $adminReportsTax = '/admin/reports/report_sales/tax/'; - public static $adminReportsInvoiced = '/admin/reports/report_sales/invoiced/'; - public static $adminReportsShipping = '/admin/reports/report_sales/shipping/'; - public static $adminReportsRefunds = '/admin/reports/report_sales/refunded/'; - public static $adminReportsCoupons = '/admin/reports/report_sales/coupons/'; - public static $adminReportsPayPalSettlement = '/admin/paypal/paypal_reports/'; - public static $adminReportsBraintreeSettlement = '/admin/braintree/report/'; - public static $adminReportsOrderTotal = '/admin/reports/report_customer/totals/'; - public static $adminReportsOrderCount = '/admin/reports/report_customer/orders/'; - public static $adminReportsNew = '/admin/reports/report_customer/accounts/'; - public static $adminReportsViews = '/admin/reports/report_product/viewed/'; - public static $adminReportsBestsellers = '/admin/reports/report_sales/bestsellers/'; - public static $adminReportsLowStock = '/admin/reports/report_product/lowstock/'; - public static $adminReportsOrdered = '/admin/reports/report_product/sold/'; - public static $adminReportsDownloads = '/admin/reports/report_product/downloads/'; - public static $adminReportsRefreshStatistics = '/admin/reports/report_statistics/'; + public static $adminProductsInCartGrid = '/admin/reports/report_shopcart/product/'; + public static $adminSearchTermsReportGrid = '/admin/search/term/report/'; + public static $adminAbandonedCartsGrid = '/admin/reports/report_shopcart/abandoned/'; + public static $adminNewsletterProblemsReportGrid = '/admin/newsletter/problem/'; + public static $adminCustomerReviewsReportGrid = '/admin/reports/report_review/customer/'; + public static $adminProductReviewsReportGrid = '/admin/reports/report_review/product/'; + public static $adminOrdersReportGrid = '/admin/reports/report_sales/sales/'; + public static $adminTaxReportGrid = '/admin/reports/report_sales/tax/'; + public static $adminInvoiceReportGrid = '/admin/reports/report_sales/invoiced/'; + public static $adminShippingReportGrid = '/admin/reports/report_sales/shipping/'; + public static $adminRefundsReportGrid = '/admin/reports/report_sales/refunded/'; + public static $adminCouponsReportGrid = '/admin/reports/report_sales/coupons/'; + public static $adminPayPalSettlementReportsGrid = '/admin/paypal/paypal_reports/'; + public static $adminBraintreeSettlementReportGrid = '/admin/braintree/report/'; + public static $adminOrderTotalReportGrid = '/admin/reports/report_customer/totals/'; + public static $adminOrderCountReportGrid = '/admin/reports/report_customer/orders/'; + public static $adminNewAccountsReportGrid = '/admin/reports/report_customer/accounts/'; + public static $adminProductViewsReportGrid = '/admin/reports/report_product/viewed/'; + public static $adminBestsellersReportGrid = '/admin/reports/report_sales/bestsellers/'; + public static $adminLowStockReportGrid = '/admin/reports/report_product/lowstock/'; + public static $adminOrderedProductsReportGrid = '/admin/reports/report_product/sold/'; + public static $adminDownloadsReportGrid = '/admin/reports/report_product/downloads/'; + public static $adminRefreshStatisticsGrid = '/admin/reports/report_statistics/'; - public static $adminStoresAllStores = '/admin/admin/system_store/'; - public static $adminStoresConfiguration = '/admin/admin/system_config/'; - public static $adminStoresTermsAndConditions = '/admin/checkout/agreement/'; - public static $adminStoresOrderStatus = '/admin/sales/order_status/'; - public static $adminStoresTaxRules = '/admin/tax/rule/'; - public static $adminStoresTaxZonesAndRates = '/admin/tax/rate/'; - public static $adminStoresCurrencyRates = '/admin/admin/system_currency/'; - public static $adminStoresCurrencySymbols = '/admin/admin/system_currencysymbol/'; - public static $adminStoresProduct = '/admin/catalog/product_attribute/'; - public static $adminStoresAttributeSet = '/admin/catalog/product_set/'; - public static $adminStoresRating = '/admin/review/rating/'; - public static $adminStoresCustomerGroups = '/admin/customer/group/'; + public static $adminAllStoresGrid = '/admin/admin/system_store/'; + public static $adminConfigurationGrid = '/admin/admin/system_config/'; + public static $adminTermsAndConditionsGrid = '/admin/checkout/agreement/'; + public static $adminOrderStatusGrid = '/admin/sales/order_status/'; + public static $adminTaxRulesGrid = '/admin/tax/rule/'; + public static $adminTaxZonesAndRatesGrid = '/admin/tax/rate/'; + public static $adminCurrencyRatesPage = '/admin/admin/system_currency/'; + public static $adminCurrencySymbolsPage = '/admin/admin/system_currencysymbol/'; + public static $adminProductAttributesGrid = '/admin/catalog/product_attribute/'; + public static $adminAttributeSetsGrid = '/admin/catalog/product_set/'; + public static $adminRatingsGrid = '/admin/review/rating/'; + public static $adminCustomerGroupsGrid = '/admin/customer/group/'; - public static $adminSystemImport = '/admin/admin/import/'; - public static $adminSystemExport = '/admin/admin/export/'; - public static $adminSystemImportExportTaxRates = '/admin/tax/rate/importExport/'; - public static $adminSystemImportHistory = '/admin/admin/history/'; - public static $adminSystemIntegrations = '/admin/admin/integration/'; - public static $adminSystemCacheManagement = '/admin/admin/cache/'; - public static $adminSystemBackups = '/admin/backup/index/'; - public static $adminSystemIndexManagement = '/admin/indexer/indexer/list/'; - public static $adminSystemWebSetupWizard = '/setup/'; - public static $adminSystemAllUsers = '/admin/admin/user/'; - public static $adminSystemLockedUsers = '/admin/admin/locks/'; - public static $adminSystemUserRoles = '/admin/admin/user_role/'; - public static $adminSystemNotifications = '/admin/admin/notification/'; - public static $adminSystemCustomVariables = '/admin/admin/system_variable/'; - public static $adminSystemManageEncryptionKey = '/admin/admin/crypt_key/'; + public static $adminImportPage = '/admin/admin/import/'; + public static $adminExportPage = '/admin/admin/export/'; + public static $adminImportAndExportTaxRatesPage = '/admin/tax/rate/importExport/'; + public static $adminImportHistoryGrid = '/admin/admin/history/'; + public static $adminIntegrationsGrid = '/admin/admin/integration/'; + public static $adminCacheManagementGrid = '/admin/admin/cache/'; + public static $adminBackupsGrid = '/admin/backup/index/'; + public static $adminIndexManagementGrid = '/admin/indexer/indexer/list/'; + public static $adminWebSetupWizardPage = '/setup/'; + public static $adminAllUsersGrid = '/admin/admin/user/'; + public static $adminLockedUsersGrid = '/admin/admin/locks/'; + public static $adminUserRolesGrid = '/admin/admin/user_role/'; + public static $adminNotificationsGrid = '/admin/admin/notification/'; + public static $adminCustomVariablesGrid = '/admin/admin/system_variable/'; + public static $adminEncryptionKeyPage = '/admin/admin/crypt_key/'; - public static $adminFindPartnersAndExtensions = '/admin/marketplace/index/'; + public static $adminFindPartnersAndExtensions = '/admin/marketplace/index/'; } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php index e1c120ecb..533fb4811 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php +++ b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php @@ -5,6 +5,8 @@ class AdminStep extends \Magento\Xxyyzz\AcceptanceTester { + public static $adminPageTitle = '.page-title'; + public function openNewTabGoToVerify($url) { $I = $this; @@ -19,20 +21,8 @@ public function closeNewTab() $I = $this; $I->closeTab(); } - - public function goToTheAdminLoginPage() - { - $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogin); - $I->waitForPageLoad(); - } - - public function goToTheAdminLogoutPage() - { - $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogout); - } + // Key Admin Pages public function goToRandomAdminPage() { $I = $this; @@ -125,550 +115,563 @@ public function goToRandomAdminPage() return $admin_url_list[$random_admin_url]; } + public function goToTheAdminLoginPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLoginPage); + $I->waitForPageLoad(); + } + + public function goToTheAdminLogoutPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogoutPage); + } + // Sales - public function goToTheAdminSalesOrdersPage() + public function goToTheAdminOrdersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesOrders); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrdersGrid); $I->waitForPageLoad(); } - public function goToTheAdminSalesInvoicesPage() + public function goToTheAdminInvoicesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesInvoices); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminInvoicesGrid); $I->waitForPageLoad(); } - public function goToTheAdminSalesShipmentsPage() + public function goToTheAdminShipmentsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesShipments); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminShipmentsGrid); $I->waitForPageLoad(); } - public function goToTheAdminSalesCreditMemosPage() + public function goToTheAdminCreditMemosGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesCreditMemos); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemosGrid); $I->waitForPageLoad(); } - public function goToTheAdminSalesBillingAgreementsPage() + public function goToTheAdminBillingAgreementsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesBillingAgreements); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBillingAgreementsGrid); $I->waitForPageLoad(); } - public function goToTheAdminSalesTransactionsPage() + public function goToTheAdminTransactionsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesTransactions); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTransactionsGrid); $I->waitForPageLoad(); } // Products - public function goToTheAdminProductsCatalogPage() + public function goToTheAdminCatalogPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCatalog); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogGrid); $I->waitForPageLoad(); } - public function goToTheAdminProductsCategoriesPage() + public function goToTheAdminCategoriesPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCategories); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoriesPage); $I->waitForPageLoad(); } // Customers - public function goToTheAdminCustomersAllCustomersPage() + public function goToTheAdminAllCustomersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersAllCustomers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllCustomersGrid); $I->waitForPageLoad(); } - public function goToTheAdminCustomersNowOnlinePage() + public function goToTheAdminCustomersNowOnlineGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnline); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); $I->waitForPageLoad(); } // Marketing - public function goToTheAdminMarketingCatalogPriceRulePage() + public function goToTheAdminCatalogPriceRuleGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCatalogPriceRule); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingCartPriceRulePage() + public function goToTheAdminCartPriceRulesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCartPriceRules); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCartPriceRulesGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingEmailTemplatesPage() + public function goToTheAdminEmailTemplatesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingEmailTemplates); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminEmailTemplatesGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingNewsletterTemplatePage() + public function goToTheAdminNewsletterTemplateGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterTemplate); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterTemplateGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingNewsletterQueuePage() + public function goToTheAdminNewsletterQueueGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterQueue); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterQueueGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingNewsletterSubscribersPage() + public function goToTheAdminNewsletterSubscribersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterSubscribers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingURLRewritesPage() + public function goToTheAdminURLRewritesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingURLRewrites); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminURLRewritesGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingSearchTermsPage() + public function goToTheAdminSearchTermsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchTerms); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermsGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingSearchSynonymsPage() + public function goToTheAdminSearchSynonymsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchSynonyms); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchSynonymsGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingSiteMapPage() + public function goToTheAdminSiteMapGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSiteMap); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSiteMapGrid); $I->waitForPageLoad(); } - public function goToTheAdminMarketingReviewsPage() + public function goToTheAdminReviewsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingReviews); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReviewsGrid); $I->waitForPageLoad(); } // Content - public function goToTheAdminContentPagesPage() + public function goToTheAdminPagesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentPages); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminPagesGrid); $I->waitForPageLoad(); } - public function goToTheAdminContentBlocksPage() + public function goToTheAdminBlocksGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentBlocks); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBlocksGrid); $I->waitForPageLoad(); } - public function goToTheAdminContentWidgetsPage() + public function goToTheAdminWidgetsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentWidgets); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminWidgetsGrid); $I->waitForPageLoad(); } - public function goToTheAdminContentConfigurationPage() + public function goToTheAdminDesignConfigurationGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentConfiguration); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDesignConfigurationGrid); $I->waitForPageLoad(); } - public function goToTheAdminContentThemesPage() + public function goToTheAdminThemesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentThemes); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminThemesGrid); $I->waitForPageLoad(); } - public function goToTheAdminContentSchedulePage() + public function goToTheAdminStoreContentScheduleGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentSchedule); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreContentScheduleGrid); $I->waitForPageLoad(); } // Reports - public function goToTheAdminReportsProductsInCartPage() + public function goToTheAdminProductsInCartGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsProductsInCart); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsInCartGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsSearchTermsPage() + public function goToTheAdminSearchTermsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsSearchTerms); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsAbandonedCartsPage() + public function goToTheAdminAbandonedCartsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsAbandonedCArts); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAbandonedCartsGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsNewsletterProblemReportsPage() + public function goToTheAdminNewsletterProblemsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNewsletterProblemReports); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsByCustomersPage() + public function goToTheAdminCustomerReviewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByCustomers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsByProductsPage() + public function goToTheAdminProductReviewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByProducts); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductReviewsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsOrdersPage() + public function goToTheAdminOrdersReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrders); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrdersReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsTaxPage() + public function goToTheAdminTaxReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsTax); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsInvoicedPage() + public function goToTheAdminInvoiceReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsInvoiced); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminInvoiceReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsShippingPage() + public function goToTheAdminShippingReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsShipping); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminShippingReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsRefundsPage() + public function goToTheAdminRefundsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefunds); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRefundsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsCouponsPage() + public function goToTheAdminCouponsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsCoupons); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCouponsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsPayPalSettlementPage() + public function goToTheAdminPayPalSettlementReportsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsPayPalSettlement); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsBraintreeSettlementPage() + public function goToTheAdminBraintreeSettlementReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBraintreeSettlement); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsOrderTotalPage() + public function goToTheAdminOrderTotalReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderTotal); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderTotalReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsOrderCountPage() + public function goToTheAdminOrderCountReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderCount); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderCountReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsNewPage() + public function goToTheAdminNewAccountsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNew); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewAccountsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsViewsPage() + public function goToTheAdminProductViewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsViews); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductViewsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsBestsellersPage() + public function goToTheAdminBestsellersReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBestsellers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBestsellersReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsLowStockPage() + public function goToTheAdminLowStockReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsLowStock); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLowStockReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsOrderedPage() + public function goToTheAdminOrderedProductsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrdered); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderedProductsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportsDownloadsPage() + public function goToTheAdminDownloadsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsDownloads); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDownloadsReportGrid); $I->waitForPageLoad(); } - public function goToTheAdminReportRefreshStatisticsPage() + public function goToTheAdminRefreshStatisticsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefreshStatistics); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRefreshStatisticsGrid); $I->waitForPageLoad(); } // Stores - public function goToTheAdminStoresAllStoresPage() + public function goToTheAdminAllStoresGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAllStores); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllStoresGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresConfigurationPage() + public function goToTheAdminConfigurationGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresConfiguration); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminConfigurationGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresTermsAndConditionsPage() + public function goToTheAdminTermsAndConditionsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTermsAndConditions); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTermsAndConditionsGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresOrderStatusPage() + public function goToTheAdminOrderStatusGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresOrderStatus); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderStatusGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresTaxRulesPage() + public function goToTheAdminTaxRulesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxRules); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxRulesGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresTaxZonesAndRatesPage() + public function goToTheAdminTaxZonesAndRatesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxZonesAndRates); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresCurrencyRatesPage() + public function goToTheAdminCurrencyRatesPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencyRates); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCurrencyRatesPage); $I->waitForPageLoad(); } - public function goToTheAdminStoresCurrencySymbolsPage() + public function goToTheAdminCurrencySymbolsPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencySymbols); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCurrencySymbolsPage); $I->waitForPageLoad(); } - public function goToTheAdminStoresProductPage() + public function goToTheAdminProductAttributesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresProduct); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductAttributesGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresAttributeSetPage() + public function goToTheAdminAttributeSetGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAttributeSet); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAttributeSetsGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresRatingPage() + public function goToTheAdminRatingGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresRating); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRatingsGrid); $I->waitForPageLoad(); } - public function goToTheAdminStoresCustomerGroupsPage() + public function goToTheAdminCustomerGroupsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCustomerGroups); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerGroupsGrid); $I->waitForPageLoad(); } // System - public function goToTheAdminSystemImportPage() + public function goToTheAdminImportPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImport); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportPage); $I->waitForPageLoad(); } - public function goToTheAdminSystemExportPage() + public function goToTheAdminExportPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemExport); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminExportPage); $I->waitForPageLoad(); } - public function goToTheAdminSystemImportExportTaxRatesPage() + public function goToTheAdminImportAndExportTaxRatesPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportExportTaxRates); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); $I->waitForPageLoad(); } - public function goToTheAdminSystemImportHistoryPage() + public function goToTheAdminImportHistoryGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportHistory); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportHistoryGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemIntegrationsPage() + public function goToTheAdminIntegrationsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIntegrations); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminIntegrationsGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemCacheManagementPage() + public function goToTheAdminCacheManagementGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCacheManagement); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCacheManagementGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemBackupsPage() + public function goToTheAdminBackupsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemBackups); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBackupsGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemIndexManagementPage() + public function goToTheAdminIndexManagementGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIndexManagement); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminIndexManagementGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemWebSetupWizardPage() + public function goToTheAdminWebSetupWizardPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemWebSetupWizard); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminWebSetupWizardPage); $I->waitForPageLoad(); } - public function goToTheAdminSystemAllUsersPage() + public function goToTheAdminAllUsersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemAllUsers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllUsersGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemLockedUsersPage() + public function goToTheAdminLockedUsersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemLockedUsers); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLockedUsersGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemUserRolesPage() + public function goToTheAdminUserRolesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemUserRoles); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserRolesGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemNotificationsPage() + public function goToTheAdminNotificationsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemNotifications); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNotificationsGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemCustomVariablesPage() + public function goToTheAdminCustomVariablesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCustomVariables); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomVariablesGrid); $I->waitForPageLoad(); } - public function goToTheAdminSystemManageEncryptionKeyPage() + public function goToTheAdminEncryptionKeyPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemManageEncryptionKey); + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminEncryptionKeyPage); $I->waitForPageLoad(); } @@ -679,575 +682,576 @@ public function goToTheAdminFindPartnersAndExtensionsPage() $I->waitForPageLoad(); } + // Key Admin Pages public function shouldBeOnTheAdminLoginPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogin); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLoginPage); } public function shouldBeOnTheAdminDashboardPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDashboard); - $I->see('Dashboard', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDashboardPage); + $I->see('Dashboard', self::$adminPageTitle); } - public function shouldBeOnTheForgotYourPasswordPage() + public function shouldBeOnTheAdminForgotYourPasswordPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminForgotYourPassword); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminForgotYourPasswordPage); } // Sales - public function shouldBeOnTheAdminSalesOrdersPage() + public function shouldBeOnTheAdminOrdersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesOrders); - $I->see('Orders', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrdersGrid); + $I->see('Orders', self::$adminPageTitle); } - public function shouldBeOnTheAdminSalesInvoicesPage() + public function shouldBeOnTheAdminInvoicesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesInvoices); - $I->see('Invoices', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminInvoicesGrid); + $I->see('Invoices', self::$adminPageTitle); } - public function shouldBeOnTheAdminSalesShipmentsPage() + public function shouldBeOnTheAdminShipmentsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesShipments); - $I->see('Shipments', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminShipmentsGrid); + $I->see('Shipments', self::$adminPageTitle); } - public function shouldBeOnTheAdminSalesCreditMemosPage() + public function shouldBeOnTheAdminCreditMemosGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesCreditMemos); - $I->see('Credit Memos', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemosGrid); + $I->see('Credit Memos', self::$adminPageTitle); } - public function shouldBeOnTheAdminSalesBillingAgreementsPage() + public function shouldBeOnTheAdminBillingAgreementsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesBillingAgreements); - $I->see('Billing Agreements', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBillingAgreementsGrid); + $I->see('Billing Agreements', self::$adminPageTitle); } - public function shouldBeOnTheAdminSalesTransactionsPage() + public function shouldBeOnTheAdminTransactionsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSalesTransactions); - $I->see('Transactions', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTransactionsGrid); + $I->see('Transactions', self::$adminPageTitle); } // Products - public function shouldBeOnTheAdminProductsCatalogPage() + public function shouldBeOnTheAdminCatalogGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCatalog); - $I->see('Catalog', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogGrid); + $I->see('Catalog', self::$adminPageTitle); } - public function shouldBeOnTheAdminProductsCategoriesPage() + public function shouldBeOnTheAdminCategoryPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsCategories); - $I->see('Default Category', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoriesPage); + $I->see('Default Category', self::$adminPageTitle); } // Customers - public function shouldBeOnTheAdminCustomersAllCustomersPage() + public function shouldBeOnTheAdminAllCustomersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersAllCustomers); - $I->see('Customers', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllCustomersGrid); + $I->see('Customers', self::$adminPageTitle); } - public function shouldBeOnTheAdminCustomersNowOnlinePage() + public function shouldBeOnTheAdminCustomersNowOnlineGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnline); - $I->see('Customers Now Online', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); + $I->see('Customers Now Online', self::$adminPageTitle); } // Marketing - public function shouldBeOnTheAdminMarketingCatalogPriceRulePage() + public function shouldBeOnTheAdminCatalogPriceRuleGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCatalogPriceRule); - $I->see('Catalog Price Rule', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); + $I->see('Catalog Price Rule', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingCartPriceRulePage() + public function shouldBeOnTheAdminCartPriceRulesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingCartPriceRules); - $I->see('Cart Price Rules', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCartPriceRulesGrid); + $I->see('Cart Price Rules', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingEmailTemplatesPage() + public function shouldBeOnTheAdminEmailTemplatesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingEmailTemplates); - $I->see('Email Templates', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminEmailTemplatesGrid); + $I->see('Email Templates', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingNewsletterTemplatePage() + public function shouldBeOnTheAdminNewsletterTemplateGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterTemplate); - $I->see('Newsletter Templates', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterTemplateGrid); + $I->see('Newsletter Templates', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingNewsletterQueuePage() + public function shouldBeOnTheAdminNewsletterQueueGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterQueue); - $I->see('Newsletter Queue', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterQueueGrid); + $I->see('Newsletter Queue', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingNewsletterSubscribersPage() + public function shouldBeOnTheAdminNewsletterSubscribersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingNewsletterSubscribers); - $I->see('Newsletter Subscribers', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); + $I->see('Newsletter Subscribers', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingURLRewritesPage() + public function shouldBeOnTheAdminURLRewritesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingURLRewrites); - $I->see('URL Rewrites', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminURLRewritesGrid); + $I->see('URL Rewrites', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingSearchTermsPage() + public function shouldBeOnTheAdminSearchTermsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchTerms); - $I->see('Search Terms', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermsGrid); + $I->see('Search Terms', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingSearchSynonymsPage() + public function shouldBeOnTheAdminSearchSynonymsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSearchSynonyms); - $I->see('Search Synonyms', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchSynonymsGrid); + $I->see('Search Synonyms', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingSiteMapPage() + public function shouldBeOnTheAdminSiteMapGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingSiteMap); - $I->see('Site Map', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSiteMapGrid); + $I->see('Site Map', self::$adminPageTitle); } - public function shouldBeOnTheAdminMarketingReviewsPage() + public function shouldBeOnTheAdminReviewsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminMarketingReviews); - $I->see('Reviews', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReviewsGrid); + $I->see('Reviews', self::$adminPageTitle); } // Content - public function shouldBeOnTheAdminContentPagesPage() + public function shouldBeOnTheAdminPagesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentPages); - $I->see('Pages', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminPagesGrid); + $I->see('Pages', self::$adminPageTitle); } - public function shouldBeOnTheAdminContentBlocksPage() + public function shouldBeOnTheAdminBlocksGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentBlocks); - $I->see('Blocks', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBlocksGrid); + $I->see('Blocks', self::$adminPageTitle); } - public function shouldBeOnTheAdminContentWidgetsPage() + public function shouldBeOnTheAdminWidgetsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentWidgets); - $I->see('Widgets', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminWidgetsGrid); + $I->see('Widgets', self::$adminPageTitle); } - public function shouldBeOnTheAdminContentConfigurationPage() + public function shouldBeOnTheAdminDesignConfigurationGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentConfiguration); - $I->see('Design Configuration', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDesignConfigurationGrid); + $I->see('Design Configuration', self::$adminPageTitle); } - public function shouldBeOnTheAdminContentThemesPage() + public function shouldBeOnTheAdminThemesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentThemes); - $I->see('Themes', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminThemesGrid); + $I->see('Themes', self::$adminPageTitle); } - public function shouldBeOnTheAdminContentSchedulePage() + public function shouldBeOnTheAdminStoreContentScheduleGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminContentSchedule); - $I->see('Store Design Schedule', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreContentScheduleGrid); + $I->see('Store Design Schedule', self::$adminPageTitle); } // Reports - public function shouldBeOnTheAdminReportsProductsInCartPage() + public function shouldBeOnTheAdminProductsInCartGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsProductsInCart); - $I->see('Products in Carts', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsInCartGrid); + $I->see('Products in Carts', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsSearchTermsPage() + public function shouldBeOnTheAdminSearchTermsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsSearchTerms); - $I->see('Search Terms Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermsReportGrid); + $I->see('Search Terms Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsAbandonedCartsPage() + public function shouldBeOnTheAdminAbandonedCartsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsAbandonedCArts); - $I->see('Abandoned Carts', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAbandonedCartsGrid); + $I->see('Abandoned Carts', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsNewsletterProblemReportsPage() + public function shouldBeOnTheAdminNewsletterProblemsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNewsletterProblemReports); - $I->see('Newsletter Problems Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); + $I->see('Newsletter Problems Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsByCustomersPage() + public function shouldBeOnTheAdminCustomerReviewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByCustomers); - $I->see('Customer Reviews Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); + $I->see('Customer Reviews Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsByProductsPage() + public function shouldBeOnTheAdminProductReviewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsByProducts); - $I->see('Product Reviews Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductReviewsReportGrid); + $I->see('Product Reviews Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsOrdersPage() + public function shouldBeOnTheAdminOrdersReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrders); - $I->see('Orders Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrdersReportGrid); + $I->see('Orders Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsTaxPage() + public function shouldBeOnTheAdminTaxReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsTax); - $I->see('Tax Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxReportGrid); + $I->see('Tax Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsInvoicedPage() + public function shouldBeOnTheAdminInvoiceReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsInvoiced); - $I->see('Invoice Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminInvoiceReportGrid); + $I->see('Invoice Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsShippingPage() + public function shouldBeOnTheAdminShippingReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsShipping); - $I->see('Shipping Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminShippingReportGrid); + $I->see('Shipping Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsRefundsPage() + public function shouldBeOnTheAdminRefundsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefunds); - $I->see('Refunds Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRefundsReportGrid); + $I->see('Refunds Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsCouponsPage() + public function shouldBeOnTheAdminCouponsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsCoupons); - $I->see('Coupons Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCouponsReportGrid); + $I->see('Coupons Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsPayPalSettlementPage() + public function shouldBeOnTheAdminPayPalSettlementReportsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsPayPalSettlement); - $I->see('PayPal Settlement Reports', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); + $I->see('PayPal Settlement Reports', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsBraintreeSettlementPage() + public function shouldBeOnTheAdminBraintreeSettlementReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBraintreeSettlement); - $I->see('Braintree Settlement Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); + $I->see('Braintree Settlement Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsOrderTotalPage() + public function shouldBeOnTheAdminOrderTotalReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderTotal); - $I->see('Order Total Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderTotalReportGrid); + $I->see('Order Total Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsOrderCountPage() + public function shouldBeOnTheAdminOrderCountReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrderCount); - $I->see('Order Count Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderCountReportGrid); + $I->see('Order Count Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsNewPage() + public function shouldBeOnTheAdminNewAccountsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsNew); - $I->see('New Accounts Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewAccountsReportGrid); + $I->see('New Accounts Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsViewsPage() + public function shouldBeOnTheAdminProductViewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsViews); - $I->see('Product Views Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductViewsReportGrid); + $I->see('Product Views Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsBestsellersPage() + public function shouldBeOnTheAdminBestsellersReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsBestsellers); - $I->see('Bestsellers Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBestsellersReportGrid); + $I->see('Bestsellers Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsLowStockPage() + public function shouldBeOnTheAdminLowStockReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsLowStock); - $I->see('Low Stock Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLowStockReportGrid); + $I->see('Low Stock Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsOrderedPage() + public function shouldBeOnTheAdminOrderedProductsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsOrdered); - $I->see('Ordered Products Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderedProductsReportGrid); + $I->see('Ordered Products Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportsDownloadsPage() + public function shouldBeOnTheAdminDownloadsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsDownloads); - $I->see('Downloads Report', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDownloadsReportGrid); + $I->see('Downloads Report', self::$adminPageTitle); } - public function shouldBeOnTheAdminReportRefreshStatisticsPage() + public function shouldBeOnTheAdminRefreshStatisticsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReportsRefreshStatistics); - $I->see('Refresh Statistics', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRefreshStatisticsGrid); + $I->see('Refresh Statistics', self::$adminPageTitle); } // Stores - public function shouldBeOnTheAdminStoresAllStoresPage() + public function shouldBeOnTheAdminAllStoresGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAllStores); - $I->see('Stores', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllStoresGrid); + $I->see('Stores', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresConfigurationPage() + public function shouldBeOnTheAdminConfigurationGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresConfiguration); - $I->see('Configuration', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminConfigurationGrid); + $I->see('Configuration', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresTermsAndConditionsPage() + public function shouldBeOnTheAdminTermsAndConditionsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTermsAndConditions); - $I->see('Terms and Conditions', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTermsAndConditionsGrid); + $I->see('Terms and Conditions', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresOrderStatusPage() + public function shouldBeOnTheAdminOrderStatusGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresOrderStatus); - $I->see('Order Status', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderStatusGrid); + $I->see('Order Status', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresTaxRulesPage() + public function shouldBeOnTheAdminTaxRulesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxRules); - $I->see('Tax Rules', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxRulesGrid); + $I->see('Tax Rules', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresTaxZonesAndRatesPage() + public function shouldBeOnTheAdminTaxZonesAndRatesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresTaxZonesAndRates); - $I->see('Tax Zones and Rates', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); + $I->see('Tax Zones and Rates', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresCurrencyRatesPage() + public function shouldBeOnTheAdminCurrencyRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencyRates); - $I->see('Currency Rates', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCurrencyRatesPage); + $I->see('Currency Rates', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresCurrencySymbolsPage() + public function shouldBeOnTheAdminCurrencySymbolsPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCurrencySymbols); - $I->see('Currency Symbols', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCurrencySymbolsPage); + $I->see('Currency Symbols', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresProductPage() + public function shouldBeOnTheAdminProductAttributesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresProduct); - $I->see('Product Attributes', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductAttributesGrid); + $I->see('Product Attributes', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresAttributeSetPage() + public function shouldBeOnTheAdminAttributeSetsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresAttributeSet); - $I->see('Attribute Sets', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAttributeSetsGrid); + $I->see('Attribute Sets', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresRatingPage() + public function shouldBeOnTheAdminRatingsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresRating); - $I->see('Ratings', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRatingsGrid); + $I->see('Ratings', self::$adminPageTitle); } - public function shouldBeOnTheAdminStoresCustomerGroupsPage() + public function shouldBeOnTheAdminCustomerGroupsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoresCustomerGroups); - $I->see('Customer Groups', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerGroupsGrid); + $I->see('Customer Groups', self::$adminPageTitle); } // System - public function shouldBeOnTheAdminSystemImportPage() + public function shouldBeOnTheAdminImportPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImport); - $I->see('Import', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportPage); + $I->see('Import', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemExportPage() + public function shouldBeOnTheAdminExportPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemExport); - $I->see('Export', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminExportPage); + $I->see('Export', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemImportExportTaxRatesPage() + public function shouldBeOnTheAdminImportAndExportTaxRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportExportTaxRates); - $I->see('Import and Export Tax Rates', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); + $I->see('Import and Export Tax Rates', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemImportHistoryPage() + public function shouldBeOnTheAdminImportHistoryGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemImportHistory); - $I->see('Import History', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportHistoryGrid); + $I->see('Import History', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemIntegrationsPage() + public function shouldBeOnTheAdminIntegrationsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIntegrations); - $I->see('Integrations', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminIntegrationsGrid); + $I->see('Integrations', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemCacheManagementPage() + public function shouldBeOnTheAdminCacheManagementGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCacheManagement); - $I->see('Cache Management', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCacheManagementGrid); + $I->see('Cache Management', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemBackupsPage() + public function shouldBeOnTheAdminBackupsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemBackups); - $I->see('Backups', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBackupsGrid); + $I->see('Backups', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemIndexManagementPage() + public function shouldBeOnTheAdminIndexManagementGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemIndexManagement); - $I->see('Index Management', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminIndexManagementGrid); + $I->see('Index Management', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemWebSetupWizardPage() + public function shouldBeOnTheAdminWebSetupWizardPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemWebSetupWizard); - $I->see('Setup Wizard', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminWebSetupWizardPage); + $I->see('Setup Wizard', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemAllUsersPage() + public function shouldBeOnTheAdminAllUsersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemAllUsers); - $I->see('Users', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllUsersGrid); + $I->see('Users', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemLockedUsersPage() + public function shouldBeOnTheAdminLockedUsersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemLockedUsers); - $I->see('Locked Users', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLockedUsersGrid); + $I->see('Locked Users', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemUserRolesPage() + public function shouldBeOnTheAdminUserRolesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemUserRoles); - $I->see('Roles', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserRolesGrid); + $I->see('Roles', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemNotificationsPage() + public function shouldBeOnTheAdminNotificationsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemNotifications); - $I->see('Notifications', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNotificationsGrid); + $I->see('Notifications', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemCustomVariablesPage() + public function shouldBeOnTheAdminCustomVariablesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemCustomVariables); - $I->see('Custom Variables', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomVariablesGrid); + $I->see('Custom Variables', self::$adminPageTitle); } - public function shouldBeOnTheAdminSystemManageEncryptionKeyPage() + public function shouldBeOnTheAdminEncryptionKeyPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSystemManageEncryptionKey); - $I->see('Encryption Key', '.page-title'); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminEncryptionKeyPage); + $I->see('Encryption Key', self::$adminPageTitle); } public function shouldBeOnTheAdminFindPartnersAndExtensionsPage() { $I = $this; $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminFindPartnersAndExtensions); - $I->see('Magento Marketplace', '.page-title'); + $I->see('Magento Marketplace', self::$adminPageTitle); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php index c88525bbc..6e195ccf2 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php @@ -45,232 +45,232 @@ public function _before(AdminStep $I) */ public function shouldBeAbleToAccessEachAdminPageDirectly(AdminStep $I) { - $I->goToTheAdminSalesOrdersPage(); - $I->shouldBeOnTheAdminSalesOrdersPage(); + $I->goToTheAdminOrdersGrid(); + $I->shouldBeOnTheAdminOrdersGrid(); - $I->goToTheAdminSalesInvoicesPage(); - $I->shouldBeOnTheAdminSalesInvoicesPage(); + $I->goToTheAdminInvoicesGrid(); + $I->shouldBeOnTheAdminInvoicesGrid(); - $I->goToTheAdminSalesShipmentsPage(); - $I->shouldBeOnTheAdminSalesShipmentsPage(); + $I->goToTheAdminShipmentsGrid(); + $I->shouldBeOnTheAdminShipmentsGrid(); - $I->goToTheAdminSalesCreditMemosPage(); - $I->shouldBeOnTheAdminSalesCreditMemosPage(); + $I->goToTheAdminCreditMemosGrid(); + $I->shouldBeOnTheAdminCreditMemosGrid(); - $I->goToTheAdminSalesBillingAgreementsPage(); - $I->shouldBeOnTheAdminSalesBillingAgreementsPage(); + $I->goToTheAdminBillingAgreementsGrid(); + $I->shouldBeOnTheAdminBillingAgreementsGrid(); - $I->goToTheAdminSalesTransactionsPage(); - $I->shouldBeOnTheAdminSalesTransactionsPage(); + $I->goToTheAdminTransactionsGrid(); + $I->shouldBeOnTheAdminTransactionsGrid(); - $I->goToTheAdminProductsCatalogPage(); - $I->shouldBeOnTheAdminProductsCatalogPage(); + $I->goToTheAdminCatalogPage(); + $I->shouldBeOnTheAdminCatalogGrid(); - $I->goToTheAdminProductsCategoriesPage(); - $I->shouldBeOnTheAdminProductsCategoriesPage(); + $I->goToTheAdminCategoriesPage(); + $I->shouldBeOnTheAdminCategoryPage(); - $I->goToTheAdminCustomersAllCustomersPage(); - $I->shouldBeOnTheAdminCustomersAllCustomersPage(); + $I->goToTheAdminAllCustomersGrid(); + $I->shouldBeOnTheAdminAllCustomersGrid(); - $I->goToTheAdminCustomersNowOnlinePage(); - $I->shouldBeOnTheAdminCustomersNowOnlinePage(); + $I->goToTheAdminCustomersNowOnlineGrid(); + $I->shouldBeOnTheAdminCustomersNowOnlineGrid(); - $I->goToTheAdminMarketingCatalogPriceRulePage(); - $I->shouldBeOnTheAdminMarketingCatalogPriceRulePage(); + $I->goToTheAdminCatalogPriceRuleGrid(); + $I->shouldBeOnTheAdminCatalogPriceRuleGrid(); - $I->goToTheAdminMarketingCartPriceRulePage(); - $I->shouldBeOnTheAdminMarketingCartPriceRulePage(); + $I->goToTheAdminCartPriceRulesGrid(); + $I->shouldBeOnTheAdminCartPriceRulesGrid(); - $I->goToTheAdminMarketingEmailTemplatesPage(); - $I->shouldBeOnTheAdminMarketingEmailTemplatesPage(); + $I->goToTheAdminEmailTemplatesGrid(); + $I->shouldBeOnTheAdminEmailTemplatesGrid(); - $I->goToTheAdminMarketingNewsletterTemplatePage(); - $I->shouldBeOnTheAdminMarketingNewsletterTemplatePage(); + $I->goToTheAdminNewsletterTemplateGrid(); + $I->shouldBeOnTheAdminNewsletterTemplateGrid(); - $I->goToTheAdminMarketingNewsletterQueuePage(); - $I->shouldBeOnTheAdminMarketingNewsletterQueuePage(); + $I->goToTheAdminNewsletterQueueGrid(); + $I->shouldBeOnTheAdminNewsletterQueueGrid(); - $I->goToTheAdminMarketingNewsletterSubscribersPage(); - $I->shouldBeOnTheAdminMarketingNewsletterSubscribersPage(); + $I->goToTheAdminNewsletterSubscribersGrid(); + $I->shouldBeOnTheAdminNewsletterSubscribersGrid(); - $I->goToTheAdminMarketingURLRewritesPage(); - $I->shouldBeOnTheAdminMarketingURLRewritesPage(); + $I->goToTheAdminURLRewritesGrid(); + $I->shouldBeOnTheAdminURLRewritesGrid(); - $I->goToTheAdminMarketingSearchTermsPage(); - $I->shouldBeOnTheAdminMarketingSearchTermsPage(); + $I->goToTheAdminSearchTermsGrid(); + $I->shouldBeOnTheAdminSearchTermsGrid(); - $I->goToTheAdminMarketingSearchSynonymsPage(); - $I->shouldBeOnTheAdminMarketingSearchSynonymsPage(); + $I->goToTheAdminSearchSynonymsGrid(); + $I->shouldBeOnTheAdminSearchSynonymsGrid(); - $I->goToTheAdminMarketingSiteMapPage(); - $I->shouldBeOnTheAdminMarketingSiteMapPage(); + $I->goToTheAdminSiteMapGrid(); + $I->shouldBeOnTheAdminSiteMapGrid(); - $I->goToTheAdminMarketingReviewsPage(); - $I->shouldBeOnTheAdminMarketingReviewsPage(); + $I->goToTheAdminReviewsGrid(); + $I->shouldBeOnTheAdminReviewsGrid(); - $I->goToTheAdminContentPagesPage(); - $I->shouldBeOnTheAdminContentPagesPage(); + $I->goToTheAdminPagesGrid(); + $I->shouldBeOnTheAdminPagesGrid(); - $I->goToTheAdminContentBlocksPage(); - $I->shouldBeOnTheAdminContentBlocksPage(); + $I->goToTheAdminBlocksGrid(); + $I->shouldBeOnTheAdminBlocksGrid(); - $I->goToTheAdminContentWidgetsPage(); - $I->shouldBeOnTheAdminContentWidgetsPage(); + $I->goToTheAdminWidgetsGrid(); + $I->shouldBeOnTheAdminWidgetsGrid(); - $I->goToTheAdminContentConfigurationPage(); - $I->shouldBeOnTheAdminContentConfigurationPage(); + $I->goToTheAdminDesignConfigurationGrid(); + $I->shouldBeOnTheAdminDesignConfigurationGrid(); - $I->goToTheAdminContentThemesPage(); - $I->shouldBeOnTheAdminContentThemesPage(); + $I->goToTheAdminThemesGrid(); + $I->shouldBeOnTheAdminThemesGrid(); - $I->goToTheAdminContentSchedulePage(); - $I->shouldBeOnTheAdminContentSchedulePage(); + $I->goToTheAdminStoreContentScheduleGrid(); + $I->shouldBeOnTheAdminStoreContentScheduleGrid(); - $I->goToTheAdminReportsProductsInCartPage(); - $I->shouldBeOnTheAdminReportsProductsInCartPage(); + $I->goToTheAdminProductsInCartGrid(); + $I->shouldBeOnTheAdminProductsInCartGrid(); - $I->goToTheAdminReportsSearchTermsPage(); - $I->shouldBeOnTheAdminReportsSearchTermsPage(); + $I->goToTheAdminSearchTermsReportGrid(); + $I->shouldBeOnTheAdminSearchTermsReportGrid(); - $I->goToTheAdminReportsAbandonedCartsPage(); - $I->shouldBeOnTheAdminReportsAbandonedCartsPage(); + $I->goToTheAdminAbandonedCartsGrid(); + $I->shouldBeOnTheAdminAbandonedCartsGrid(); - $I->goToTheAdminReportsNewsletterProblemReportsPage(); - $I->shouldBeOnTheAdminReportsNewsletterProblemReportsPage(); + $I->goToTheAdminNewsletterProblemsReportGrid(); + $I->shouldBeOnTheAdminNewsletterProblemsReportGrid(); - $I->goToTheAdminReportsByCustomersPage(); - $I->shouldBeOnTheAdminReportsByCustomersPage(); + $I->goToTheAdminCustomerReviewsReportGrid(); + $I->shouldBeOnTheAdminCustomerReviewsReportGrid(); - $I->goToTheAdminReportsByProductsPage(); - $I->shouldBeOnTheAdminReportsByProductsPage(); + $I->goToTheAdminProductReviewsReportGrid(); + $I->shouldBeOnTheAdminProductReviewsReportGrid(); - $I->goToTheAdminReportsOrdersPage(); - $I->shouldBeOnTheAdminReportsOrdersPage(); + $I->goToTheAdminOrdersReportGrid(); + $I->shouldBeOnTheAdminOrdersReportGrid(); - $I->goToTheAdminReportsTaxPage(); - $I->shouldBeOnTheAdminReportsTaxPage(); + $I->goToTheAdminTaxReportGrid(); + $I->shouldBeOnTheAdminTaxReportGrid(); - $I->goToTheAdminReportsInvoicedPage(); - $I->shouldBeOnTheAdminReportsInvoicedPage(); + $I->goToTheAdminInvoiceReportGrid(); + $I->shouldBeOnTheAdminInvoiceReportGrid(); - $I->goToTheAdminReportsShippingPage(); - $I->shouldBeOnTheAdminReportsShippingPage(); + $I->goToTheAdminShippingReportGrid(); + $I->shouldBeOnTheAdminShippingReportGrid(); - $I->goToTheAdminReportsRefundsPage(); - $I->shouldBeOnTheAdminReportsRefundsPage(); + $I->goToTheAdminRefundsReportGrid(); + $I->shouldBeOnTheAdminRefundsReportGrid(); - $I->goToTheAdminReportsCouponsPage(); - $I->shouldBeOnTheAdminReportsCouponsPage(); + $I->goToTheAdminCouponsReportGrid(); + $I->shouldBeOnTheAdminCouponsReportGrid(); - $I->goToTheAdminReportsPayPalSettlementPage(); - $I->shouldBeOnTheAdminReportsPayPalSettlementPage(); + $I->goToTheAdminPayPalSettlementReportsGrid(); + $I->shouldBeOnTheAdminPayPalSettlementReportsGrid(); - $I->goToTheAdminReportsBraintreeSettlementPage(); - $I->shouldBeOnTheAdminReportsBraintreeSettlementPage(); + $I->goToTheAdminBraintreeSettlementReportGrid(); + $I->shouldBeOnTheAdminBraintreeSettlementReportGrid(); - $I->goToTheAdminReportsOrderTotalPage(); - $I->shouldBeOnTheAdminReportsOrderTotalPage(); + $I->goToTheAdminOrderTotalReportGrid(); + $I->shouldBeOnTheAdminOrderTotalReportGrid(); - $I->goToTheAdminReportsOrderCountPage(); - $I->shouldBeOnTheAdminReportsOrderCountPage(); + $I->goToTheAdminOrderCountReportGrid(); + $I->shouldBeOnTheAdminOrderCountReportGrid(); - $I->goToTheAdminReportsNewPage(); - $I->shouldBeOnTheAdminReportsNewPage(); + $I->goToTheAdminNewAccountsReportGrid(); + $I->shouldBeOnTheAdminNewAccountsReportGrid(); - $I->goToTheAdminReportsViewsPage(); - $I->shouldBeOnTheAdminReportsViewsPage(); + $I->goToTheAdminProductViewsReportGrid(); + $I->shouldBeOnTheAdminProductViewsReportGrid(); - $I->goToTheAdminReportsBestsellersPage(); - $I->shouldBeOnTheAdminReportsBestsellersPage(); + $I->goToTheAdminBestsellersReportGrid(); + $I->shouldBeOnTheAdminBestsellersReportGrid(); - $I->goToTheAdminReportsLowStockPage(); - $I->shouldBeOnTheAdminReportsLowStockPage(); + $I->goToTheAdminLowStockReportGrid(); + $I->shouldBeOnTheAdminLowStockReportGrid(); - $I->goToTheAdminReportsOrderedPage(); - $I->shouldBeOnTheAdminReportsOrderedPage(); + $I->goToTheAdminOrderedProductsReportGrid(); + $I->shouldBeOnTheAdminOrderedProductsGrid(); - $I->goToTheAdminReportsDownloadsPage(); - $I->shouldBeOnTheAdminReportsDownloadsPage(); + $I->goToTheAdminDownloadsReportGrid(); + $I->shouldBeOnTheAdminDownloadsReportGrid(); - $I->goToTheAdminReportRefreshStatisticsPage(); - $I->shouldBeOnTheAdminReportRefreshStatisticsPage(); + $I->goToTheAdminRefreshStatisticsGrid(); + $I->shouldBeOnTheAdminRefreshStatisticsGrid(); - $I->goToTheAdminStoresAllStoresPage(); - $I->shouldBeOnTheAdminStoresAllStoresPage(); + $I->goToTheAdminAllStoresGrid(); + $I->shouldBeOnTheAdminAllStoresGrid(); - $I->goToTheAdminStoresConfigurationPage(); - $I->shouldBeOnTheAdminStoresConfigurationPage(); + $I->goToTheAdminConfigurationGrid(); + $I->shouldBeOnTheAdminConfigurationGrid(); - $I->goToTheAdminStoresTermsAndConditionsPage(); - $I->shouldBeOnTheAdminStoresTermsAndConditionsPage(); + $I->goToTheAdminTermsAndConditionsGrid(); + $I->shouldBeOnTheAdminTermsAndConditionsGrid(); - $I->goToTheAdminStoresOrderStatusPage(); - $I->shouldBeOnTheAdminStoresOrderStatusPage(); + $I->goToTheAdminOrderStatusGrid(); + $I->shouldBeOnTheAdminOrderStatusGrid(); - $I->goToTheAdminStoresTaxRulesPage(); - $I->shouldBeOnTheAdminStoresTaxRulesPage(); + $I->goToTheAdminTaxRulesGrid(); + $I->shouldBeOnTheAdminTaxRulesGrid(); - $I->goToTheAdminStoresTaxZonesAndRatesPage(); - $I->shouldBeOnTheAdminStoresTaxZonesAndRatesPage(); + $I->goToTheAdminTaxZonesAndRatesGrid(); + $I->shouldBeOnTheAdminTaxZonesAndRatesGrid(); - $I->goToTheAdminStoresCurrencyRatesPage(); - $I->shouldBeOnTheAdminStoresCurrencyRatesPage(); + $I->goToTheAdminCurrencyRatesPage(); + $I->shouldBeOnTheAdminCurrencyRatesPage(); - $I->goToTheAdminStoresCurrencySymbolsPage(); - $I->shouldBeOnTheAdminStoresCurrencySymbolsPage(); + $I->goToTheAdminCurrencySymbolsPage(); + $I->shouldBeOnTheAdminCurrencySymbolsPage(); - $I->goToTheAdminStoresProductPage(); - $I->shouldBeOnTheAdminStoresProductPage(); + $I->goToTheAdminProductAttributesGrid(); + $I->shouldBeOnTheAdminProductAttributesGrid(); - $I->goToTheAdminStoresAttributeSetPage(); - $I->shouldBeOnTheAdminStoresAttributeSetPage(); + $I->goToTheAdminAttributeSetGrid(); + $I->shouldBeOnTheAdminAttributeSetsGrid(); - $I->goToTheAdminStoresRatingPage(); - $I->shouldBeOnTheAdminStoresRatingPage(); + $I->goToTheAdminRatingGrid(); + $I->shouldBeOnTheAdminRatingsGrid(); - $I->goToTheAdminStoresCustomerGroupsPage(); - $I->shouldBeOnTheAdminStoresCustomerGroupsPage(); + $I->goToTheAdminCustomerGroupsGrid(); + $I->shouldBeOnTheAdminCustomerGroupsGrid(); - $I->goToTheAdminSystemImportPage(); - $I->shouldBeOnTheAdminSystemImportPage(); + $I->goToTheAdminImportPage(); + $I->shouldBeOnTheAdminImportPage(); - $I->goToTheAdminSystemExportPage(); - $I->shouldBeOnTheAdminSystemExportPage(); + $I->goToTheAdminExportPage(); + $I->shouldBeOnTheAdminExportPage(); - $I->goToTheAdminSystemImportExportTaxRatesPage(); - $I->shouldBeOnTheAdminSystemImportExportTaxRatesPage(); + $I->goToTheAdminImportAndExportTaxRatesPage(); + $I->shouldBeOnTheAdminImportAndExportTaxRatesPage(); - $I->goToTheAdminSystemImportHistoryPage(); - $I->shouldBeOnTheAdminSystemImportHistoryPage(); + $I->goToTheAdminImportHistoryGrid(); + $I->shouldBeOnTheAdminImportHistoryGrid(); - $I->goToTheAdminSystemIntegrationsPage(); - $I->shouldBeOnTheAdminSystemIntegrationsPage(); + $I->goToTheAdminIntegrationsGrid(); + $I->shouldBeOnTheAdminIntegrationsGrid(); - $I->goToTheAdminSystemCacheManagementPage(); - $I->shouldBeOnTheAdminSystemCacheManagementPage(); + $I->goToTheAdminCacheManagementGrid(); + $I->shouldBeOnTheAdminCacheManagementGrid(); - $I->goToTheAdminSystemBackupsPage(); - $I->shouldBeOnTheAdminSystemBackupsPage(); + $I->goToTheAdminBackupsGrid(); + $I->shouldBeOnTheAdminBackupsGrid(); - $I->goToTheAdminSystemIndexManagementPage(); - $I->shouldBeOnTheAdminSystemIndexManagementPage(); + $I->goToTheAdminIndexManagementGrid(); + $I->shouldBeOnTheAdminIndexManagementGrid(); - $I->goToTheAdminSystemAllUsersPage(); - $I->shouldBeOnTheAdminSystemAllUsersPage(); + $I->goToTheAdminAllUsersGrid(); + $I->shouldBeOnTheAdminAllUsersGrid(); - $I->goToTheAdminSystemLockedUsersPage(); - $I->shouldBeOnTheAdminSystemLockedUsersPage(); + $I->goToTheAdminLockedUsersGrid(); + $I->shouldBeOnTheAdminLockedUsersGrid(); - $I->goToTheAdminSystemUserRolesPage(); - $I->shouldBeOnTheAdminSystemUserRolesPage(); + $I->goToTheAdminUserRolesGrid(); + $I->shouldBeOnTheAdminUserRolesGrid(); - $I->goToTheAdminSystemNotificationsPage(); - $I->shouldBeOnTheAdminSystemNotificationsPage(); + $I->goToTheAdminNotificationsGrid(); + $I->shouldBeOnTheAdminNotificationsGrid(); - $I->goToTheAdminSystemCustomVariablesPage(); - $I->shouldBeOnTheAdminSystemCustomVariablesPage(); + $I->goToTheAdminCustomVariablesGrid(); + $I->shouldBeOnTheAdminCustomVariablesGrid(); - $I->goToTheAdminSystemManageEncryptionKeyPage(); - $I->shouldBeOnTheAdminSystemManageEncryptionKeyPage(); + $I->goToTheAdminEncryptionKeyPage(); + $I->shouldBeOnTheAdminEncryptionKeyPage(); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index 977269883..e0f2f3dde 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -74,27 +74,27 @@ public function shouldLandOnEachOfTheSalesPages(AdminStep $I, SideNav $sideNavMe $I->wantTo('see if I can access each of the SALES Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnSalesInTheSideNavMenu(); $sideNavMenu->clickOnOrdersInTheSalesNavMenu(); - $I->shouldBeOnTheAdminSalesOrdersPage(); + $I->shouldBeOnTheAdminOrdersGrid(); $sideNavMenu->clickOnSalesInTheSideNavMenu(); $sideNavMenu->clickOnInvoicesInTheSalesNavMenu(); - $I->shouldBeOnTheAdminSalesInvoicesPage(); + $I->shouldBeOnTheAdminInvoicesGrid(); $sideNavMenu->clickOnSalesInTheSideNavMenu(); $sideNavMenu->clickOnShipmentsInTheSalesNavMenu(); - $I->shouldBeOnTheAdminSalesShipmentsPage(); + $I->shouldBeOnTheAdminShipmentsGrid(); $sideNavMenu->clickOnSalesInTheSideNavMenu(); $sideNavMenu->clickOnCreditMemosInTheSalesNavMenu(); - $I->shouldBeOnTheAdminSalesCreditMemosPage(); + $I->shouldBeOnTheAdminCreditMemosGrid(); $sideNavMenu->clickOnSalesInTheSideNavMenu(); $sideNavMenu->clickOnBillingAgreementsInTheSalesNavMenu(); - $I->shouldBeOnTheAdminSalesBillingAgreementsPage(); + $I->shouldBeOnTheAdminBillingAgreementsGrid(); $sideNavMenu->clickOnSalesInTheSideNavMenu(); $sideNavMenu->clickOnTransactionsInTheSalesNavMenu(); - $I->shouldBeOnTheAdminSalesTransactionsPage(); + $I->shouldBeOnTheAdminTransactionsGrid(); } /** @@ -116,11 +116,11 @@ public function shouldLandOnEachOfTheProductsPages(AdminStep $I, SideNav $sideNa $I->wantTo('see if I can access each of the PRODUCT Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnProductsInTheSideNavMenu(); $sideNavMenu->clickOnCatalogInTheProductNavMenu(); - $I->shouldBeOnTheAdminProductsCatalogPage(); + $I->shouldBeOnTheAdminCatalogGrid(); $sideNavMenu->clickOnProductsInTheSideNavMenu(); $sideNavMenu->clickOnCategoriesInTheProductNavMenu(); - $I->shouldBeOnTheAdminProductsCategoriesPage(); + $I->shouldBeOnTheAdminCategoryPage(); } /** @@ -142,11 +142,11 @@ public function shouldLanOnEachOfTheCustomersPages(AdminStep $I, SideNav $sideNa $I->wantTo('see if I can access each of the CUSTOMER Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnCustomersInTheSideNavMenu(); $sideNavMenu->clickOnAllCustomersInTheCustomersNavMenu(); - $I->shouldBeOnTheAdminCustomersAllCustomersPage(); + $I->shouldBeOnTheAdminAllCustomersGrid(); $sideNavMenu->clickOnCustomersInTheSideNavMenu(); $sideNavMenu->clickOnNowOnlineInTheCustomersNavMenu(); - $I->shouldBeOnTheAdminCustomersNowOnlinePage(); + $I->shouldBeOnTheAdminCustomersNowOnlineGrid(); } // Marketing Menu Tests @@ -169,47 +169,47 @@ public function shouldLandOnEachOfTheMarketingPages(AdminStep $I, SideNav $sideN $I->wantTo('see if I can access each of the MARKETING Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnCatalogPriceRulesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingCatalogPriceRulePage(); + $I->shouldBeOnTheAdminCatalogPriceRuleGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnCartPriceRulesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingCartPriceRulePage(); + $I->shouldBeOnTheAdminCartPriceRulesGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnEmailTemplatesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingEmailTemplatesPage(); + $I->shouldBeOnTheAdminEmailTemplatesGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnNewsletterTemplatesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingNewsletterTemplatePage(); + $I->shouldBeOnTheAdminNewsletterTemplateGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnNewsletterQueueInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingNewsletterQueuePage(); + $I->shouldBeOnTheAdminNewsletterQueueGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnNewsletterSubscribersInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingNewsletterSubscribersPage(); + $I->shouldBeOnTheAdminNewsletterSubscribersGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnURLRewritesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingURLRewritesPage(); + $I->shouldBeOnTheAdminURLRewritesGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnSearchTermsInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingSearchTermsPage(); + $I->shouldBeOnTheAdminSearchTermsGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnSearchSynonymsInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingSearchSynonymsPage(); + $I->shouldBeOnTheAdminSearchSynonymsGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnSiteMapInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingSiteMapPage(); + $I->shouldBeOnTheAdminSiteMapGrid(); $sideNavMenu->clickOnMarketingInTheSideNavMenu(); $sideNavMenu->clickOnContentReviewsInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminMarketingReviewsPage(); + $I->shouldBeOnTheAdminReviewsGrid(); } // Content Menu Tests @@ -232,27 +232,27 @@ public function shouldLandOnEachOfTheContentPages(AdminStep $I, SideNav $sideNav $I->wantTo('see if I can access each of the CONTENT Admin Pages using the Side Nav Menus'); $sideNavMenu->clickOnContentInTheSideNavMenu(); $sideNavMenu->clickOnPagesInTheContentNavMenu(); - $I->shouldBeOnTheAdminContentPagesPage(); + $I->shouldBeOnTheAdminPagesGrid(); $sideNavMenu->clickOnContentInTheSideNavMenu(); $sideNavMenu->clickOnBlocksInTheContentNavMenu(); - $I->shouldBeOnTheAdminContentBlocksPage(); + $I->shouldBeOnTheAdminBlocksGrid(); $sideNavMenu->clickOnContentInTheSideNavMenu(); $sideNavMenu->clickOnWidgetsInTheContentNavMenu(); - $I->shouldBeOnTheAdminContentWidgetsPage(); + $I->shouldBeOnTheAdminWidgetsGrid(); $sideNavMenu->clickOnContentInTheSideNavMenu(); $sideNavMenu->clickOnConfigurationInTheContentNavMenu(); - $I->shouldBeOnTheAdminContentConfigurationPage(); + $I->shouldBeOnTheAdminDesignConfigurationGrid(); $sideNavMenu->clickOnContentInTheSideNavMenu(); $sideNavMenu->clickOnThemesInTheContentNavMenu(); - $I->shouldBeOnTheAdminContentThemesPage(); + $I->shouldBeOnTheAdminThemesGrid(); $sideNavMenu->clickOnContentInTheSideNavMenu(); $sideNavMenu->clickOnScheduleInTheContentNavMenu(); - $I->shouldBeOnTheAdminContentSchedulePage(); + $I->shouldBeOnTheAdminStoreContentScheduleGrid(); } /** @@ -274,95 +274,95 @@ public function shouldLandOnEachOfTheReportsPages(AdminStep $I, SideNav $sideNav $I->wantTo('see if I can access each of the REPORT Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnProductsInCartInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsProductsInCartPage(); + $I->shouldBeOnTheAdminProductsInCartGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnSearchTermsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsSearchTermsPage(); + $I->shouldBeOnTheAdminSearchTermsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnAbandonedCartsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsAbandonedCartsPage(); + $I->shouldBeOnTheAdminAbandonedCartsGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnNewsletterProblemReportsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsNewsletterProblemReportsPage(); + $I->shouldBeOnTheAdminNewsletterProblemsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnByCustomersInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsByCustomersPage(); + $I->shouldBeOnTheAdminCustomerReviewsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnByProductsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsByProductsPage(); + $I->shouldBeOnTheAdminProductReviewsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnOrdersInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsOrdersPage(); + $I->shouldBeOnTheAdminOrdersReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOTaxInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsTaxPage(); + $I->shouldBeOnTheAdminTaxReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnInvoicedInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsInvoicedPage(); + $I->shouldBeOnTheAdminInvoiceReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnShippingInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsShippingPage(); + $I->shouldBeOnTheAdminShippingReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnRefundsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsRefundsPage(); + $I->shouldBeOnTheAdminRefundsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnCouponsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsCouponsPage(); + $I->shouldBeOnTheAdminCouponsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnPayPalSettlementInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsPayPalSettlementPage(); + $I->shouldBeOnTheAdminPayPalSettlementReportsGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnBraintreeSettlementInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsBraintreeSettlementPage(); + $I->shouldBeOnTheAdminBraintreeSettlementReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnOrderTotalInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsOrderTotalPage(); + $I->shouldBeOnTheAdminOrderTotalReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnOrderCountInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsOrderCountPage(); + $I->shouldBeOnTheAdminOrderCountReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnNewInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsNewPage(); + $I->shouldBeOnTheAdminNewAccountsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnViewsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsViewsPage(); + $I->shouldBeOnTheAdminProductViewsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnBestSellersInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsBestsellersPage(); + $I->shouldBeOnTheAdminBestsellersReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnLowStockInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsLowStockPage(); + $I->shouldBeOnTheAdminLowStockReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnOrderedInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsOrderedPage(); + $I->shouldBeOnTheAdminOrderedProductsGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnDownloadsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportsDownloadsPage(); + $I->shouldBeOnTheAdminDownloadsReportGrid(); $sideNavMenu->clickOnReportsInTheSideNavMenu(); $sideNavMenu->clickOnRefreshStatisticsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminReportRefreshStatisticsPage(); + $I->shouldBeOnTheAdminRefreshStatisticsGrid(); } /** @@ -384,51 +384,51 @@ public function shouldLandOnEachOfTheStoresPages(AdminStep $I, SideNav $sideNavM $I->wantTo('see if I can access each of the STORE Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnAllStoresInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresAllStoresPage(); + $I->shouldBeOnTheAdminAllStoresGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnConfigurationInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresConfigurationPage(); + $I->shouldBeOnTheAdminConfigurationGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnTermsAndConditionsInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresTermsAndConditionsPage(); + $I->shouldBeOnTheAdminTermsAndConditionsGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnOrderStatusInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresOrderStatusPage(); + $I->shouldBeOnTheAdminOrderStatusGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnTaxRuleInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresTaxRulesPage(); + $I->shouldBeOnTheAdminTaxRulesGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnTaxZonesAndRatesInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresTaxZonesAndRatesPage(); + $I->shouldBeOnTheAdminTaxZonesAndRatesGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnCurrencyRatesInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresCurrencyRatesPage(); + $I->shouldBeOnTheAdminCurrencyRatesPage(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnCurrencySymbolsInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresCurrencySymbolsPage(); + $I->shouldBeOnTheAdminCurrencySymbolsPage(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnProductInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresProductPage(); + $I->shouldBeOnTheAdminProductAttributesGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnAttributesSetInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresAttributeSetPage(); + $I->shouldBeOnTheAdminAttributeSetsGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnRatingsInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresRatingPage(); + $I->shouldBeOnTheAdminRatingsGrid(); $sideNavMenu->clickOnStoresInTheSideNavMenu(); $sideNavMenu->clickOnCustomerGroupInTheStoresNavMenu(); - $I->shouldBeOnTheAdminStoresCustomerGroupsPage(); + $I->shouldBeOnTheAdminCustomerGroupsGrid(); } // System Menu Tests @@ -451,59 +451,59 @@ public function shouldLandOnEachOfTheSystemPages(AdminStep $I, SideNav $sideNavM $I->wantTo('see if I can access each of the SYSTEM Admin Pages using the Side Nav Menu'); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnImportInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemImportPage(); + $I->shouldBeOnTheAdminImportPage(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnExportInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemExportPage(); + $I->shouldBeOnTheAdminExportPage(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnImportExportTaxRatesInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemImportExportTaxRatesPage(); + $I->shouldBeOnTheAdminImportAndExportTaxRatesPage(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnImportHistoryInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemImportHistoryPage(); + $I->shouldBeOnTheAdminImportHistoryGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnIntegrationsInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemIntegrationsPage(); + $I->shouldBeOnTheAdminIntegrationsGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnCacheManagementInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemCacheManagementPage(); + $I->shouldBeOnTheAdminCacheManagementGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnBackupsInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemBackupsPage(); + $I->shouldBeOnTheAdminBackupsGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnIndexManagementInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemIndexManagementPage(); + $I->shouldBeOnTheAdminIndexManagementGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnAllUsersInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemAllUsersPage(); + $I->shouldBeOnTheAdminAllUsersGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnLockedUsersInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemLockedUsersPage(); + $I->shouldBeOnTheAdminLockedUsersGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnUserRolesInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemUserRolesPage(); + $I->shouldBeOnTheAdminUserRolesGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnNotificationsInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemNotificationsPage(); + $I->shouldBeOnTheAdminNotificationsGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnCustomVariablesInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemCustomVariablesPage(); + $I->shouldBeOnTheAdminCustomVariablesGrid(); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnManageEncryptionKeyInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemManageEncryptionKeyPage(); + $I->shouldBeOnTheAdminEncryptionKeyPage(); } /** @@ -525,7 +525,7 @@ public function shouldLandOnTheWebSetupWizardPage(AdminStep $I, SideNav $sideNav $I->wantTo('see if I can access the WEB SETUP WIZARD Admin Page using the Side Nav Menu'); $sideNavMenu->clickOnSystemInTheSideNavMenu(); $sideNavMenu->clickOnWebSetupWizardInTheSystemNavMenu(); - $I->shouldBeOnTheAdminSystemWebSetupWizardPage(); + $I->shouldBeOnTheAdminWebSetupWizardPage(); $I->goToTheAdminLogoutPage(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php index d5ee6da0c..398b8b3a3 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php @@ -63,7 +63,7 @@ public function createCategoryTest( $I->wantTo('create sub category with required fields in admin Category page.'); $category = $I->getCategoryApiData(); - $I->goToTheAdminProductsCategoriesPage(); + $I->goToTheAdminCategoriesPage(); $adminCategoryPage->addSubCategory(); $adminCategoryPage->fillFieldCategoryName($category['name']); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index b724a43d5..86bff86b6 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -45,7 +45,7 @@ class CreateSimpleProductCest public function _before(AdminStep $I, CategoryApiStep $api) { $I->loginAsAdmin(); - $I->goToTheAdminProductsCatalogPage(); + $I->goToTheAdminCatalogPage(); $this->category = $I->getCategoryApiData(); $api->amAdminTokenAuthenticated(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index f39bddbbd..df423889d 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -50,7 +50,7 @@ class UpdateSimpleProductCest public function _before(AdminStep $I, CategoryApiStep $categoryApi, ProductApiStep $productApi) { $I->loginAsAdmin(); - $I->goToTheAdminProductsCatalogPage(); + $I->goToTheAdminCatalogPage(); $this->category = $I->getCategoryApiData(); $categoryApi->amAdminTokenAuthenticated(); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php index 42d5e9397..eb4e7900b 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php @@ -37,7 +37,7 @@ public function _before( { $I->am('an Admin'); $I->loginAsAdmin(); - $I->goToTheAdminContentPagesPage(); + $I->goToTheAdminPagesGrid(); $adminCmsGrid->clickOnAddPageButton(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php index 7504a5395..84efbd029 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php @@ -35,7 +35,7 @@ public function _before( { $I->am('an Admin'); $I->loginAsAdmin(); - $I->goToTheAdminCustomersAllCustomersPage(); + $I->goToTheAdminAllCustomersGrid(); $customerPageGrid->clickOnAddNewCustomerButton(); } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php index 33e164395..a23642037 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php @@ -74,16 +74,16 @@ public function createOrderViaAdmin( $customerName = $customerDetails['firstname'] . " " . $customerDetails['lastname']; - $I->goToTheAdminCustomersAllCustomersPage(); + $I->goToTheAdminAllCustomersGrid(); $adminCustomerPage->addBasicCustomerWithAddress($customerDetails); - $I->goToTheAdminProductsCategoriesPage(); + $I->goToTheAdminCategoriesPage(); $adminCategoryPage->addBasicCategory($categoryDetails); - $I->goToTheAdminProductsCatalogPage(); + $I->goToTheAdminCatalogPage(); $adminProductPage->addBasicProductUnderCategory($productDetails, $categoryDetails); - $I->goToTheAdminSalesOrdersPage(); + $I->goToTheAdminOrdersGrid(); $adminOrderGrid->clickOnCreateNewOrderButton(); $adminOrderAddPage->enterCustomerEmailSearchTerm($customerDetails['email']); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php index d05529cf6..c19ef603e 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php @@ -21,8 +21,8 @@ public function _before(AdminStep $I) */ public function accessTheSalesOrdersPage(AdminStep $I) { - $I->goToTheAdminSalesOrdersPage(); - $I->shouldBeOnTheAdminSalesOrdersPage(); + $I->goToTheAdminOrdersGrid(); + $I->shouldBeOnTheAdminOrdersGrid(); } /** @@ -32,7 +32,7 @@ public function accessTheSalesOrdersPage(AdminStep $I) */ public function accessTheProductsCatalogPage(AdminStep $I) { - $I->goToTheAdminProductsCatalogPage(); - $I->shouldBeOnTheAdminProductsCatalogPage(); + $I->goToTheAdminCatalogPage(); + $I->shouldBeOnTheAdminCatalogGrid(); } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php index c268d7625..06a84595e 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php @@ -50,7 +50,7 @@ public function shouldLandOnTheForgotYourPasswordPage(AdminStep $I, AdminLogin $ $I->am('an Admin'); $I->wantTo('see if I can access the Forgot Your Password page'); $adminLogin->clickOnForgotYourPassword(); - $I->shouldBeOnTheForgotYourPasswordPage(); + $I->shouldBeOnTheAdminForgotYourPasswordPage(); $adminLogin->shouldSeeTheForgotYourPasswordFields(); $I->see('Password Help'); } From 4000805c4a57b0ef9ac696189a01b745abb9a78b Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 2 May 2017 14:13:45 -0500 Subject: [PATCH 065/149] MTA-4141: Added admin configurable product page object and create configurable product test. --- .../Xxyyzz/Module/MagentoFakerData.php | 2 +- .../Page/Catalog/StorefrontProductPage.php | 35 +- .../AdminConfigurableProductPage.php | 306 ++++++++++++++++++ .../CreateConfigurableProductCest.php | 230 +++++++++++++ 4 files changed, 569 insertions(+), 4 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php index 9680e6c54..4293d5266 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php @@ -68,7 +68,7 @@ public function getProductApiData($type = 'simple', $categoryId = 0, $productDat ], 'custom_attributes' => [ ['attribute_code' => 'url_key', 'value' => isset($productData['name']) - ? $productData['name'] : 'simple_product'.$sq,], + ? $productData['name'] : $type . '_product'.$sq,], ['attribute_code' => 'tax_class_id', 'value' => 2], ['attribute_code' => 'category_ids', 'value' => $categoryId], ], diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php index 46776d8fe..66ea873ef 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php @@ -5,16 +5,21 @@ class StorefrontProductPage extends AbstractFrontendPage { - /** - * Declare UI map for this page here. CSS or XPath allowed. - */ public static $addToCartButton = '#product-addtocart-button'; + /** + * Product data. + */ public static $productName = '.base'; public static $productPrice = '.price'; public static $productStockStatus = '.stock[title=Availability]>span'; public static $productSku = '.product.attribute.sku>.value'; + /** + * Product options data. + */ + public static $productOptionsDropDown = '#product-options-wrapper .super-attribute-select'; + public function amOnProductPage($categoryUrlKey) { $I = $this->acceptanceTester; @@ -52,4 +57,28 @@ public function seeProductSkuInPage($sku) $I = $this->acceptanceTester; $I->seeElement(sprintf(self::$productSku, $sku)); } + + public function selectProductOption($option) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$productOptionsDropDown, $option); + } + + /** + * @param array $options + */ + public function seeProductOptions(array $options) + { + $I = $this->acceptanceTester; + foreach ($options as $option) { + for($c = 2; $c < count($options)+2; $c++) { + try { + $I->see($option, self::$productOptionsDropDown . ' option:nth-child('. strval($c). ')'); + break; + } catch (\PHPUnit_Framework_AssertionFailedError $e) { + continue; + } + } + } + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php b/tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php new file mode 100644 index 000000000..af0a7d1c1 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php @@ -0,0 +1,306 @@ +tr:last-child'; + + /** + * @var AdminGridPage + */ + public static $configurableAttributesGrid; + + public function __construct(AcceptanceTester $I) + { + parent::__construct($I); + if (is_null(self::$configurableAttributesGrid)) { + self::$configurableAttributesGrid = new AdminGridPage($I); + } + } + + public function amOnCreateProductConfigurationsForm() + { + $I = $this->acceptanceTester; + $I->waitForPageLoad(); + $I->seeElement(self::$createProductConfigurationsForm); + } + + public function filterAndSelectAttributeByCode($code) + { + self::$configurableAttributesGrid->searchAndFiltersByValue($code, self::$filterAttributeCode); + } + + public function checkCheckboxInCurrentNthRow(int $n) + { + self::$configurableAttributesGrid->checkCheckboxInCurrentNthRow($n); + } + + public function clickNextButton() + { + $I = $this->acceptanceTester; + $I->click(self::$nextButton); + $I->waitForPageLoad(); + } + + public function clickCreateNewAttributeValue($attribute) + { + $I = $this->acceptanceTester; + $I->click(sprintf(self::$attributeCreateNewValueButton, $attribute)); + $I->waitForPageLoad(); + } + + public function fillFieldAttributeOptionValue($attribute, $option) + { + $I = $this->acceptanceTester; + $I->fillField(sprintf(self::$newAttributeOptionText, $attribute), $option); + $I->waitForPageLoad(); + } + + public function clickSaveAttributeOption($attribute) + { + $I = $this->acceptanceTester; + $I->click(sprintf(self::$newAttributeOptionSave, $attribute)); + $I->waitForPageLoad(); + } + + public function clickRemoveAttributeOption($attribute) + { + $I = $this->acceptanceTester; + $I->click(sprintf(self::$newAttributeOptionRemove, $attribute)); + $I->waitForPageLoad(); + } + + public function clickApplySingleImageRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$applySingleImageRadioButton); + $I->waitForPageLoad(); + } + + public function clickApplyUniqueImageRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$applyUniqueImageRadioButton); + $I->waitForPageLoad(); + } + + public function clickSkipImageRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$skipImageRadioButton); + } + + public function clickApplySinglePriceRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$applySinglePriceRadioButton); + $I->waitForPageLoad(); + } + + public function clickApplyUniquePriceRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$applyUniquePriceRadioButton); + $I->waitForPageLoad(); + } + + public function clickSkipPriceRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$skipPriceRadioButton); + } + + public function clickApplySingleQuantityRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$applySingleQuantityRadioButton); + $I->waitForPageLoad(); + } + + public function clickApplyUniqueQuantityRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$applyUniqueQuantityRadioButton); + $I->waitForPageLoad(); + } + + public function clickSkipQuantityRadioButton() + { + $I = $this->acceptanceTester; + $I->click(self::$skipQuantityRadioButton); + } + + public function fillFieldApplySinglePrice($price) + { + $I = $this->acceptanceTester; + $I->fillField(self::$applySinglePriceField, $price); + } + + public function fillFieldApplySingleQuantity($quantity) + { + $I = $this->acceptanceTester; + $I->fillField(self::$applySingleQuantityField, $quantity); + } + + /** + * @param string $attribute + */ + public function selectAttributeToApplyUniquePrice($attribute) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$applyUniquePriceDropDown, $attribute); + $I->waitForPageLoad(); + } + + /** + * @param string $attribute + */ + public function selectAttributeToApplyUniqueQuantity($attribute) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$applyUniqueQuantityDropDown, $attribute); + $I->waitForPageLoad(); + } + + /** + * @param array $prices + */ + public function fillFieldWithUniquePrice(array $prices) + { + $I = $this->acceptanceTester; + $c = 0; + foreach ($prices as $price) { + $I->fillField(sprintf(self::$applyUniquePriceField, $c), $price); + $c++; + } + } + + /** + * @param array $quantities + */ + public function fillFieldWithUniqueQuantity(array $quantities) + { + $I = $this->acceptanceTester; + for ($c = 0; $c < count($quantities); $c++) { + $I->fillField(sprintf(self::$applyUniqueQuantityField, $c), $quantities[$c]); + } + } + + /** + * check and select attribute option, create if it does not exist. + * + * @param $attribute + * @param $option + */ + public function checkAndSelectAttributeOption($attribute, $option) + { + $I = $this->acceptanceTester; + try { + $I->seeElement(sprintf(self::$attributeOption, $attribute, $option)); + try { + $I->dontSeeCheckboxIsChecked(sprintf(self::$attributeOptionCheckbox, $attribute, $option)); + $I->checkOption(sprintf(self::$attributeOptionCheckbox, $attribute, $option)); + } catch (ElementNotFound $e) { + } + } catch (\PHPUnit_Framework_AssertionFailedError $e) { + $this->clickCreateNewAttributeValue($attribute); + $this->fillFieldAttributeOptionValue($attribute, $option); + $this->clickSaveAttributeOption($attribute); + $I->checkOption(sprintf(self::$attributeOptionCheckbox, $attribute, $option)); + } + } + + public function seeProductPriceDisabled() + { + $I = $this->acceptanceTester; + $I->seeElement(self::$productPrice, ['disabled' => 'true']); + } + + public function seeProductQuantityDisabled() + { + $I = $this->acceptanceTester; + $I->seeElement(self::$productQuantity, ['disabled' => 'true']); + } + + /** + * @see $texts in configurable product variations section. + * + * @param array $texts + */ + public function seeInConfigurableVariations(array $texts) + { + $I = $this->acceptanceTester; + $I->waitForPageLoad(); + foreach ($texts as $text) { + $I->see($text, self::$configurableVariationsGrid); + } + } + + /** + * @param int $number + */ + public function assertNumberOfConfigurableVariations(int $number) + { + $I = $this->acceptanceTester; + $I->waitForPageLoad(); + $I->assertEquals($number, intval($this->getIndexForLastConfigurableVariation())+1); + } + + private function getIndexForLastConfigurableVariation() + { + $I = $this->acceptanceTester; + return $I->grabAttributeFrom(self::$lastConfigurableVariation, 'data-repeat-index'); + } +} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php new file mode 100644 index 000000000..acdb482ad --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php @@ -0,0 +1,230 @@ +loginAsAdmin(); + $this->category = $I->getCategoryApiData(); + $categoryApi->amAdminTokenAuthenticated(); + $this->category = array_merge( + $this->category, + ['id' => $categoryApi->createCategory(['category' => $this->category])] + ); + $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; + $this->product = $I->getProductApiData('configurable', $this->category['id']); + if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { + $this->product['stock_status'] = 'In Stock'; + $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; + } else { + $this->product['stock_status'] = 'Out of Stock'; + } + $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; + + $this->productVariations = [ + [ + 'attribute_code' => 'Color', + 'attribute_value' => 'red', + 'sku' => $this->product['sku'].'-red', + 'price' => '11.11', + 'qty' => $this->product['qty'], + ], + [ + 'attribute_code' => 'Color', + 'attribute_value' => 'blue', + 'sku' => $this->product['sku'].'-blue', + 'price' => '22.22', + 'qty' => $this->product['qty'], + ], + [ + 'attribute_code' => 'Color', + 'attribute_value' => 'white', + 'sku' => $this->product['sku'].'-white', + 'price' => '33.33', + 'qty' => $this->product['qty'], + ] + ]; + + for ($c = 0; $c < count($this->productVariations); $c++) { + $this->variationPrice[$c] = $this->productVariations[$c]['price']; + $this->variationQuantity[$c] = $this->productVariations[$c]['qty']; + $this->attributeValues[$c] = $this->productVariations[$c]['attribute_value']; + } + } + + public function _after(AdminStep $I) + { + //$I->goToTheAdminLogoutPage(); + } + + /** + * Allure annotations + * @Title("Create a configurable product and verify on the storefront") + * @Description("Create a configurable product and verify on the storefront.") + * @TestCaseId("") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") + * @Parameter(name = "AdminConfigurableProductPage", value = "$adminConfigurableProductPage") + * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") + * @Parameter(name = "StorefrontProductPage", value = "$storefrontProductPage") + * + * @param AdminStep $I + * @param AdminProductGridPage $adminProductGridPage + * @param AdminConfigurableProductPage $adminConfigurableProductPage + * @param StorefrontCategoryPage $storefrontCategoryPage + * @param StorefrontProductPage $storefrontProductPage + * @return void + */ + public function createConfigurableProductTest( + AdminStep $I, + AdminProductGridPage $adminProductGridPage, + AdminConfigurableProductPage $adminConfigurableProductPage, + StorefrontCategoryPage $storefrontCategoryPage, + StorefrontProductPage $storefrontProductPage + ) { + $I->wantTo('create configurable product with required fields in admin product page.'); + $adminProductGridPage->amOnAdminProductGridPage(); + $adminProductGridPage->clickOnAddConfigurableProductOption(); + $adminConfigurableProductPage->amOnAdminNewProductPage(); + $adminConfigurableProductPage->fillFieldProductName($this->product['name']); + $adminConfigurableProductPage->fillFieldProductSku($this->product['sku']); + $adminConfigurableProductPage->fillFieldProductPrice($this->product['price']); + if (isset($this->product['qty'])) { + $adminConfigurableProductPage->fillFieldProductQuantity($this->product['qty']); + } + $adminConfigurableProductPage->selectProductStockStatus($this->product['stock_status']); + $adminConfigurableProductPage->selectProductCategories([$this->category['name']]); + $adminConfigurableProductPage->fillFieldProductUrlKey($this->product['url_key']); + + $I->wantTo('create configurations for product.'); + $adminConfigurableProductPage->clickCreateConfigurationsButton(); + + $I->wantTo('on Create Product Configurations Wizard - Select Attributes...'); + $adminConfigurableProductPage->filterAndSelectAttributeByCode( + strtolower($this->productVariations[0]['attribute_code']) + ); + $adminConfigurableProductPage->checkCheckboxInCurrentNthRow(1); + $adminConfigurableProductPage->clickNextButton(); + + $I->wantTo('on Create Product Configurations Wizard - Attributes Values...'); + for ($c = 0; $c < count($this->productVariations); $c++) { + $adminConfigurableProductPage->checkAndSelectAttributeOption( + $this->productVariations[$c]['attribute_code'], + $this->productVariations[$c]['attribute_value'] + ); + } + $adminConfigurableProductPage->clickNextButton(); + + $I->wantTo('on Create Product Configurations Wizard - Bulk Images, Price and Quantity...'); + $adminConfigurableProductPage->clickApplyUniquePriceRadioButton(); + $adminConfigurableProductPage->selectAttributeToApplyUniquePrice( + $this->productVariations[0]['attribute_code'] + ); + $adminConfigurableProductPage->fillFieldWithUniquePrice($this->variationPrice); + $adminConfigurableProductPage->clickApplySingleQuantityRadioButton(); + $adminConfigurableProductPage->fillFieldApplySingleQuantity($this->variationQuantity[0]); + $adminConfigurableProductPage->clickNextButton(); + + $I->wantTo('on Create Product Configurations Wizard - Summary...'); + $I->wantTo('generate configurable products.'); + $adminConfigurableProductPage->clickNextButton(); + + $I->wantTo('see configurable product successfully saved message.'); + $adminConfigurableProductPage->saveProduct(); + $I->seeElement($adminConfigurableProductPage::$successMessage); + + $I->wantTo('verify configurable product data in admin product page.'); + $adminConfigurableProductPage->seeProductAttributeSet('Default'); + $adminConfigurableProductPage->seeProductName($this->product['name']); + $adminConfigurableProductPage->seeProductSku($this->product['sku']); + $adminConfigurableProductPage->seeProductPriceDisabled(); + $adminConfigurableProductPage->seeProductQuantityDisabled(); + $adminConfigurableProductPage->seeProductStockStatus($this->product['stock_status']); + $adminConfigurableProductPage->seeProductCategories([$this->category['name']]); + $adminConfigurableProductPage->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); + $adminConfigurableProductPage->assertNumberOfConfigurableVariations(count($this->productVariations)); + foreach ($this->productVariations as $variation) { + $adminConfigurableProductPage->seeInConfigurableVariations($variation); + } + + $I->wantTo('verify configurable product data in frontend category page.'); + $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); + $storefrontCategoryPage->seeProductLinksInPage( + $this->product['name'], + str_replace('_', '-', $this->product['url_key']) + ); + $storefrontCategoryPage->seeProductNameInPage($this->product['name']); + $storefrontCategoryPage->seeProductPriceInPage($this->product['name'], $this->variationPrice[0]); + + $I->wantTo('verify configurable product data in frontend product page.'); + $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); + $storefrontProductPage->seeProductNameInPage($this->product['name']); + $storefrontProductPage->seeProductPriceInPage($this->variationPrice[0]); + $storefrontProductPage->seeProductStockStatusInPage($this->product['stock_status']); + $storefrontProductPage->seeProductSkuInPage($this->productVariations[0]['sku']); + $storefrontProductPage->seeProductOptions($this->attributeValues); + } +} From d8ce97acea8642c59a0725c679ef85b7d1998f56 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 4 May 2017 09:14:02 -0500 Subject: [PATCH 066/149] - Updating the AdminUrlList to include the "Add" pages and "Edit" pages for each page in the Admin. - Adding the "GoToThe" and "ShouldBeOnThe" methods for each of the new "Add"/"Edit" URLs. - Adding a new Test to exercise all of the new "Add" pages. Working on the "Edit" pages but they depend on the Docker image with Sample Data. --- .../Magento/Xxyyzz/Helper/AdminUrlList.php | 245 ++-- .../Magento/Xxyyzz/Step/Backend/AdminStep.php | 1079 ++++++++++++++++- .../Backend/AccessAdminPagesDirectlyCest.php | 114 +- .../AccessAdminPagesViaNavMenuCest.php | 2 +- 4 files changed, 1341 insertions(+), 99 deletions(-) diff --git a/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php b/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php index 37dc99a8c..e49d9d71c 100644 --- a/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php +++ b/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php @@ -6,96 +6,177 @@ */ class AdminUrlList { - public static $adminLoginPage = '/admin/admin/'; - public static $adminLogoutPage = '/admin/admin/auth/logout/'; - public static $adminForgotYourPasswordPage = '/admin/admin/auth/forgotpassword/'; + public static $adminLoginPage = '/admin/admin/'; + public static $adminLogoutPage = '/admin/admin/auth/logout/'; + public static $adminForgotYourPasswordPage = '/admin/admin/auth/forgotpassword/'; - public static $adminDashboardPage = '/admin/admin/dashboard/'; + public static $adminDashboardPage = '/admin/admin/dashboard/'; - public static $adminOrdersGrid = '/admin/sales/order/'; - public static $adminInvoicesGrid = '/admin/sales/invoice/'; - public static $adminShipmentsGrid = '/admin/sales/shipment/'; - public static $adminCreditMemosGrid = '/admin/sales/creditmemo/'; - public static $adminBillingAgreementsGrid = '/admin/paypal/billing_agreement/'; - public static $adminTransactionsGrid = '/admin/sales/transactions/'; + public static $adminOrdersGrid = '/admin/sales/order/'; + public static $adminOrderByIdPage = '/admin/sales/order/view/order_id/'; + public static $adminAddOrderPage = '/admin/sales/order_create/index/'; + public static $adminAddOrderForCustomerIdPage = '/admin/sales/order_create/index/customer_id/'; + public static $adminInvoicesGrid = '/admin/sales/invoice/'; + public static $adminAddInvoiceForOrderIdPage = '/admin/sales/order_invoice/new/order_id/'; + public static $adminShipmentsGrid = '/admin/sales/shipment/'; + public static $adminShipmentForIdPage = '/admin/sales/shipment/view/shipment_id/'; + public static $adminCreditMemosGrid = '/admin/sales/creditmemo/'; + public static $adminCreditMemoForIdPage = '/admin/sales/creditmemo/view/creditmemo_id/'; + public static $adminBillingAgreementsGrid = '/admin/paypal/billing_agreement/'; + // TODO: Determine the correct address for Billing Agreements for Billing Agreement ID page URL. + public static $adminTransactionsGrid = '/admin/sales/transactions/'; + // TODO: Determine the correct address for Transactions for Transaction ID page URL. - public static $adminCatalogGrid = '/admin/catalog/product/'; - public static $adminCategoriesPage = '/admin/catalog/category/'; + public static $adminCatalogGrid = '/admin/catalog/product/'; + public static $adminProductForIdPage = '/admin/catalog/product/edit/id/'; + public static $adminAddSimpleProductPage = '/admin/catalog/product/new/set/4/type/simple/'; + public static $adminAddConfigurableProductPage = '/admin/catalog/product/new/set/4/type/configurable/'; + public static $adminAddGroupedProductPage = '/admin/catalog/product/new/set/4/type/grouped/'; + public static $adminAddVirtualProductPage = '/admin/catalog/product/new/set/4/type/virtual/'; + public static $adminAddBundleProductPage = '/admin/catalog/product/new/set/4/type/bundle/'; + public static $adminAddDownloadableProductPage = '/admin/catalog/product/new/set/4/type/downloadable/'; - public static $adminAllCustomersGrid = '/admin/customer/index/'; - public static $adminCustomersNowOnlineGrid = '/admin/customer/online/'; + public static $adminCategoriesPage = '/admin/catalog/category/'; + public static $adminCategoryForIdPage = '/admin/catalog/category/edit/id/'; + public static $adminAddRootCategoryPage = '/admin/catalog/category/add/store/0/parent/1'; + public static $adminAddSubCategoryPage = '/admin/catalog/category/add/store/0/parent/2'; - public static $adminCatalogPriceRuleGrid = '/admin/catalog_rule/promo_catalog/'; - public static $adminCartPriceRulesGrid = '/admin/sales_rule/promo_quote/'; - public static $adminEmailTemplatesGrid = '/admin/admin/email_template/'; - public static $adminNewsletterTemplateGrid = '/admin/newsletter/template/'; - public static $adminNewsletterQueueGrid = '/admin/newsletter/queue/'; - public static $adminNewsletterSubscribersGrid = '/admin/newsletter/subscriber/'; - public static $adminURLRewritesGrid = '/admin/admin/url_rewrite/index/'; - public static $adminSearchTermsGrid = '/admin/search/term/index/'; - public static $adminSearchSynonymsGrid = '/admin/search/synonyms/index/'; - public static $adminSiteMapGrid = '/admin/admin/sitemap/'; - public static $adminReviewsGrid = '/admin/review/product/index/'; + public static $adminAllCustomersGrid = '/admin/customer/index/'; + public static $adminCustomersNowOnlineGrid = '/admin/customer/online/'; + public static $adminCustomerForCustomerIdPage = '/admin/customer/index/edit/id/'; + public static $adminAddCustomerPage = '/admin/customer/index/new/'; - public static $adminPagesGrid = '/admin/cms/page/'; - public static $adminBlocksGrid = '/admin/cms/block/'; - public static $adminWidgetsGrid = '/admin/admin/widget_instance/'; - public static $adminDesignConfigurationGrid = '/admin/theme/design_config/'; - public static $adminThemesGrid = '/admin/admin/system_design_theme/'; - public static $adminStoreContentScheduleGrid = '/admin/admin/system_design/'; + public static $adminCatalogPriceRuleGrid = '/admin/catalog_rule/promo_catalog/'; + public static $adminCatalogPriceRuleForIdPage = '/admin/catalog_rule/promo_catalog/edit/id/'; + public static $adminAddCatalogPriceRulePage = '/admin/catalog_rule/promo_catalog/new/'; + public static $adminCartPriceRulesGrid = '/admin/sales_rule/promo_quote/'; + public static $adminCartPriceRuleForIdPage = '/admin/sales_rule/promo_quote/edit/id/'; + public static $adminAddCartPriceRulePage = '/admin/sales_rule/promo_quote/new/'; + public static $adminEmailTemplatesGrid = '/admin/admin/email_template/'; + public static $adminEmailTemplateForIdPage = '/admin/admin/email_template/edit/id/'; + public static $adminAddEmailTemplatePage = '/admin/admin/email_template/new/'; + public static $adminNewsletterTemplateGrid = '/admin/newsletter/template/'; + public static $adminNewsletterTemplateForIdPage = '/admin/newsletter/template/edit/id/'; + public static $adminAddNewsletterTemplatePage = '/admin/newsletter/template/new/'; + public static $adminNewsletterQueueGrid = '/admin/newsletter/queue/'; + // TODO: Determine if there is a Details page for the Newsletter Queue. + public static $adminNewsletterSubscribersGrid = '/admin/newsletter/subscriber/'; + public static $adminURLRewritesGrid = '/admin/admin/url_rewrite/index/'; + public static $adminURLRewriteForIdPage = '/admin/admin/url_rewrite/edit/id/'; + public static $adminAddURLRewritePage = '/admin/admin/url_rewrite/edit/id'; // If you don't list an ID it drops you on the Add page. + public static $adminSearchTermsGrid = '/admin/search/term/index/'; + public static $adminSearchTermForIdPage = '/admin/search/term/edit/id/'; + public static $adminAddSearchTermPage = '/admin/search/term/new/'; + public static $adminSearchSynonymsGrid = '/admin/search/synonyms/index/'; + public static $adminSearchSynonymGroupForIdPage = '/admin/search/synonyms/edit/group_id/'; + public static $adminAddSearchSynonymGroupPage = '/admin/search/synonyms/new/'; + public static $adminSiteMapGrid = '/admin/admin/sitemap/'; + public static $adminSiteMapForIdPage = '/admin/admin/sitemap/edit/sitemap_id/'; + public static $adminAddSiteMapPage = '/admin/admin/sitemap/new/'; + public static $adminReviewsGrid = '/admin/review/product/index/'; + public static $adminReviewByIdPage = '/admin/review/product/edit/id/'; + public static $adminAddReviewPage = '/admin/review/product/new/'; - public static $adminProductsInCartGrid = '/admin/reports/report_shopcart/product/'; - public static $adminSearchTermsReportGrid = '/admin/search/term/report/'; - public static $adminAbandonedCartsGrid = '/admin/reports/report_shopcart/abandoned/'; - public static $adminNewsletterProblemsReportGrid = '/admin/newsletter/problem/'; - public static $adminCustomerReviewsReportGrid = '/admin/reports/report_review/customer/'; - public static $adminProductReviewsReportGrid = '/admin/reports/report_review/product/'; - public static $adminOrdersReportGrid = '/admin/reports/report_sales/sales/'; - public static $adminTaxReportGrid = '/admin/reports/report_sales/tax/'; - public static $adminInvoiceReportGrid = '/admin/reports/report_sales/invoiced/'; - public static $adminShippingReportGrid = '/admin/reports/report_sales/shipping/'; - public static $adminRefundsReportGrid = '/admin/reports/report_sales/refunded/'; - public static $adminCouponsReportGrid = '/admin/reports/report_sales/coupons/'; - public static $adminPayPalSettlementReportsGrid = '/admin/paypal/paypal_reports/'; - public static $adminBraintreeSettlementReportGrid = '/admin/braintree/report/'; - public static $adminOrderTotalReportGrid = '/admin/reports/report_customer/totals/'; - public static $adminOrderCountReportGrid = '/admin/reports/report_customer/orders/'; - public static $adminNewAccountsReportGrid = '/admin/reports/report_customer/accounts/'; - public static $adminProductViewsReportGrid = '/admin/reports/report_product/viewed/'; - public static $adminBestsellersReportGrid = '/admin/reports/report_sales/bestsellers/'; - public static $adminLowStockReportGrid = '/admin/reports/report_product/lowstock/'; - public static $adminOrderedProductsReportGrid = '/admin/reports/report_product/sold/'; - public static $adminDownloadsReportGrid = '/admin/reports/report_product/downloads/'; - public static $adminRefreshStatisticsGrid = '/admin/reports/report_statistics/'; + public static $adminPagesGrid = '/admin/cms/page/'; + public static $adminPageForIdPage = '/admin/cms/page/edit/page_id/'; + public static $adminAddPagePage = '/admin/cms/page/new/'; + public static $adminBlocksGrid = '/admin/cms/block/'; + public static $adminBlockForIdPage = '/admin/cms/block/edit/block_id/'; + public static $adminAddBlockPage = '/admin/cms/block/new/'; + public static $adminWidgetsGrid = '/admin/admin/widget_instance/'; + // TODO: Determine how the Edit Widget URLs are generated. + public static $adminAddWidgetPage = '/admin/admin/widget_instance/new/'; + public static $adminDesignConfigurationGrid = '/admin/theme/design_config/'; + // TODO: Determine how the Design Configuration URLs are generated. + public static $adminThemesGrid = '/admin/admin/system_design_theme/'; + public static $adminThemeByIdPage = '/admin/admin/system_design_theme/edit/id/'; + public static $adminStoreContentScheduleGrid = '/admin/admin/system_design/'; + public static $adminStoreContentScheduleForIdPage = '/admin/admin/system_design/edit/id/'; + public static $adminAddStoreDesignChangePage = '/admin/admin/system_design/new/'; - public static $adminAllStoresGrid = '/admin/admin/system_store/'; - public static $adminConfigurationGrid = '/admin/admin/system_config/'; - public static $adminTermsAndConditionsGrid = '/admin/checkout/agreement/'; - public static $adminOrderStatusGrid = '/admin/sales/order_status/'; - public static $adminTaxRulesGrid = '/admin/tax/rule/'; - public static $adminTaxZonesAndRatesGrid = '/admin/tax/rate/'; - public static $adminCurrencyRatesPage = '/admin/admin/system_currency/'; - public static $adminCurrencySymbolsPage = '/admin/admin/system_currencysymbol/'; - public static $adminProductAttributesGrid = '/admin/catalog/product_attribute/'; - public static $adminAttributeSetsGrid = '/admin/catalog/product_set/'; - public static $adminRatingsGrid = '/admin/review/rating/'; - public static $adminCustomerGroupsGrid = '/admin/customer/group/'; + public static $adminProductsInCartGrid = '/admin/reports/report_shopcart/product/'; + public static $adminSearchTermsReportGrid = '/admin/search/term/report/'; + public static $adminAbandonedCartsGrid = '/admin/reports/report_shopcart/abandoned/'; + public static $adminNewsletterProblemsReportGrid = '/admin/newsletter/problem/'; + public static $adminCustomerReviewsReportGrid = '/admin/reports/report_review/customer/'; + public static $adminProductReviewsReportGrid = '/admin/reports/report_review/product/'; + public static $adminProductReviewsForProductIdPage = '/admin/review/product/index/productId/'; + public static $adminOrdersReportGrid = '/admin/reports/report_sales/sales/'; + public static $adminTaxReportGrid = '/admin/reports/report_sales/tax/'; + public static $adminInvoiceReportGrid = '/admin/reports/report_sales/invoiced/'; + public static $adminShippingReportGrid = '/admin/reports/report_sales/shipping/'; + public static $adminRefundsReportGrid = '/admin/reports/report_sales/refunded/'; + public static $adminCouponsReportGrid = '/admin/reports/report_sales/coupons/'; + public static $adminPayPalSettlementReportsGrid = '/admin/paypal/paypal_reports/'; + public static $adminBraintreeSettlementReportGrid = '/admin/braintree/report/'; + public static $adminOrderTotalReportGrid = '/admin/reports/report_customer/totals/'; + public static $adminOrderCountReportGrid = '/admin/reports/report_customer/orders/'; + public static $adminNewAccountsReportGrid = '/admin/reports/report_customer/accounts/'; + public static $adminProductViewsReportGrid = '/admin/reports/report_product/viewed/'; + public static $adminBestsellersReportGrid = '/admin/reports/report_sales/bestsellers/'; + public static $adminLowStockReportGrid = '/admin/reports/report_product/lowstock/'; + public static $adminOrderedProductsReportGrid = '/admin/reports/report_product/sold/'; + public static $adminDownloadsReportGrid = '/admin/reports/report_product/downloads/'; + public static $adminRefreshStatisticsGrid = '/admin/reports/report_statistics/'; - public static $adminImportPage = '/admin/admin/import/'; - public static $adminExportPage = '/admin/admin/export/'; - public static $adminImportAndExportTaxRatesPage = '/admin/tax/rate/importExport/'; - public static $adminImportHistoryGrid = '/admin/admin/history/'; - public static $adminIntegrationsGrid = '/admin/admin/integration/'; - public static $adminCacheManagementGrid = '/admin/admin/cache/'; - public static $adminBackupsGrid = '/admin/backup/index/'; - public static $adminIndexManagementGrid = '/admin/indexer/indexer/list/'; - public static $adminWebSetupWizardPage = '/setup/'; - public static $adminAllUsersGrid = '/admin/admin/user/'; - public static $adminLockedUsersGrid = '/admin/admin/locks/'; - public static $adminUserRolesGrid = '/admin/admin/user_role/'; - public static $adminNotificationsGrid = '/admin/admin/notification/'; - public static $adminCustomVariablesGrid = '/admin/admin/system_variable/'; - public static $adminEncryptionKeyPage = '/admin/admin/crypt_key/'; + public static $adminAllStoresGrid = '/admin/admin/system_store/'; + public static $adminCreateStoreViewPage = '/admin/admin/system_store/newStore/'; + public static $adminCreateStorePage = '/admin/admin/system_store/newGroup/'; + public static $adminCreateWebsitePage = '/admin/admin/system_store/newWebsite/'; + public static $adminWebsiteByIdPage = '/admin/admin/system_store/editWebsite/website_id/'; + public static $adminStoreViewByIdPage = '/admin/admin/system_store/editStore/store_id/'; + public static $adminStoreByIdPage = '/admin/admin/system_store/editGroup/group_id/'; + public static $adminConfigurationGrid = '/admin/admin/system_config/'; + public static $adminTermsAndConditionsGrid = '/admin/checkout/agreement/'; + public static $adminTermsAndConditionByIdPage = '/admin/checkout/agreement/edit/id/'; + public static $adminAddNewTermsAndConditionPage = '/admin/checkout/agreement/new/'; + public static $adminOrderStatusGrid = '/admin/sales/order_status/'; + public static $adminAddOrderStatusPage = '/admin/sales/order_status/new/'; + // TODO: Determine how the Order Status URLs are generated. + public static $adminTaxRulesGrid = '/admin/tax/rule/'; + public static $adminTaxRuleByIdPage = '/admin/tax/rule/edit/rule/'; + public static $adminAddTaxRulePage = '/admin/tax/rule/new/'; + public static $adminTaxZonesAndRatesGrid = '/admin/tax/rate/'; + public static $adminTaxZoneAndRateByIdPage = '/admin/tax/rate/edit/rate/'; + public static $adminAddTaxZoneAndRatePage = '/admin/tax/rate/add/'; + public static $adminCurrencyRatesPage = '/admin/admin/system_currency/'; + public static $adminCurrencySymbolsPage = '/admin/admin/system_currencysymbol/'; + public static $adminProductAttributesGrid = '/admin/catalog/product_attribute/'; + public static $adminProductAttributeForIdPage = '/admin/catalog/product_attribute/edit/attribute_id/'; + public static $adminAddProductAttributePage = '/admin/catalog/product_attribute/new/'; + public static $adminAttributeSetsGrid = '/admin/catalog/product_set/'; + public static $adminAttributeSetByIdPage = '/admin/catalog/product_set/edit/id/'; + public static $adminAddAttributeSetPage = '/admin/catalog/product_set/add/'; + public static $adminRatingsGrid = '/admin/review/rating/'; + public static $adminRatingForIdPage = '/admin/review/rating/edit/id/'; + public static $adminAddRatingPage = '/admin/review/rating/new/'; + public static $adminCustomerGroupsGrid = '/admin/customer/group/'; + public static $adminCustomerGroupByIdPage = '/admin/customer/group/edit/id/'; + public static $adminAddCustomerGroupPage = '/admin/customer/group/new/'; - public static $adminFindPartnersAndExtensions = '/admin/marketplace/index/'; + public static $adminImportPage = '/admin/admin/import/'; + public static $adminExportPage = '/admin/admin/export/'; + public static $adminImportAndExportTaxRatesPage = '/admin/tax/rate/importExport/'; + public static $adminImportHistoryGrid = '/admin/admin/history/'; + public static $adminIntegrationsGrid = '/admin/admin/integration/'; + public static $adminIntegrationByIdPage = '/admin/admin/integration/edit/id/'; + public static $adminAddIntegrationPage = '/admin/admin/integration/new/'; + public static $adminCacheManagementGrid = '/admin/admin/cache/'; + public static $adminBackupsGrid = '/admin/backup/index/'; + public static $adminIndexManagementGrid = '/admin/indexer/indexer/list/'; + public static $adminWebSetupWizardPage = '/setup/'; + public static $adminAllUsersGrid = '/admin/admin/user/'; + public static $adminUserByIdPage = '/admin/admin/user/edit/user_id/'; + public static $adminAddNewUserPage = '/admin/admin/user/new/'; + public static $adminLockedUsersGrid = '/admin/admin/locks/'; + public static $adminUserRolesGrid = '/admin/admin/user_role/'; + public static $adminUserRoleByIdPage = '/admin/admin/user_role/editrole/rid/'; + public static $adminAddUserRolePage = '/admin/admin/user_role/editrole/'; + public static $adminNotificationsGrid = '/admin/admin/notification/'; + public static $adminCustomVariablesGrid = '/admin/admin/system_variable/'; + public static $adminCustomVariableByIdPage = '/admin/admin/system_variable/edit/variable_id/'; + public static $adminAddCustomVariablePage = '/admin/admin/system_variable/new/'; + public static $adminEncryptionKeyPage = '/admin/admin/crypt_key/'; + + public static $adminFindPartnersAndExtensions = '/admin/marketplace/index/'; } \ No newline at end of file diff --git a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php index 533fb4811..184f3f86f 100644 --- a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php +++ b/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php @@ -136,6 +136,27 @@ public function goToTheAdminOrdersGrid() $I->waitForPageLoad(); } + public function goToTheAdminOrderForIdPage($orderId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddOrderPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderPage); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddOrderForCustomerIdPage($customerId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); + $I->waitForPageLoad(); + } + public function goToTheAdminInvoicesGrid() { $I = $this; @@ -143,6 +164,13 @@ public function goToTheAdminInvoicesGrid() $I->waitForPageLoad(); } + public function goToTheAdminAddInvoiceForOrderIdPage($orderId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); + $I->waitForPageLoad(); + } + public function goToTheAdminShipmentsGrid() { $I = $this; @@ -150,6 +178,13 @@ public function goToTheAdminShipmentsGrid() $I->waitForPageLoad(); } + public function goToTheAdminShipmentForIdPage($shipmentId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); + $I->waitForPageLoad(); + } + public function goToTheAdminCreditMemosGrid() { $I = $this; @@ -157,6 +192,13 @@ public function goToTheAdminCreditMemosGrid() $I->waitForPageLoad(); } + public function goToTheAdminCreditMemoForIdPage($creditMemoId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); + $I->waitForPageLoad(); + } + public function goToTheAdminBillingAgreementsGrid() { $I = $this; @@ -179,6 +221,55 @@ public function goToTheAdminCatalogPage() $I->waitForPageLoad(); } + public function goToTheAdminProductForIdPage($productId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductForIdPage . $productId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddSimpleProductPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSimpleProductPage); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddConfigurableProductPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddConfigurableProductPage); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddGroupedProductPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddGroupedProductPage); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddVirtualProductPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddVirtualProductPage); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddBundledProductPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddBundleProductPage); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddDownloadableProductPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddDownloadableProductPage); + $I->waitForPageLoad(); + } + public function goToTheAdminCategoriesPage() { $I = $this; @@ -186,6 +277,27 @@ public function goToTheAdminCategoriesPage() $I->waitForPageLoad(); } + public function goToTheAdminCategoryForIdPage($categoryId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddRootCategoryForStoreIdPage($storeId) + { + $I = $this; + $I->amOnPage(('/admin/catalog/category/add/store/' . $storeId . '/parent/1')); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddSubCategoryForStoreIdPage($storeId) + { + $I = $this; + $I->amOnPage(('/admin/catalog/category/add/store/' . $storeId . '/parent/2')); + $I->waitForPageLoad(); + } + // Customers public function goToTheAdminAllCustomersGrid() { @@ -201,6 +313,20 @@ public function goToTheAdminCustomersNowOnlineGrid() $I->waitForPageLoad(); } + public function goToTheAdminCustomerForIdPage($customerId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddCustomerPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomerPage); + $I->waitForPageLoad(); + } + // Marketing public function goToTheAdminCatalogPriceRuleGrid() { @@ -209,6 +335,20 @@ public function goToTheAdminCatalogPriceRuleGrid() $I->waitForPageLoad(); } + public function goToTheAdminCatalogPriceRuleForIdPage($catalogPriceRuleId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddCatalogPriceRulePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); + $I->waitForPageLoad(); + } + public function goToTheAdminCartPriceRulesGrid() { $I = $this; @@ -216,6 +356,20 @@ public function goToTheAdminCartPriceRulesGrid() $I->waitForPageLoad(); } + public function goToTheAdminCartPriceRuleForIdPage($cartPriceRuleId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddCartPriceRulePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCartPriceRulePage); + $I->waitForPageLoad(); + } + public function goToTheAdminEmailTemplatesGrid() { $I = $this; @@ -223,6 +377,20 @@ public function goToTheAdminEmailTemplatesGrid() $I->waitForPageLoad(); } + public function goToTheAdminEmailTemplateForIdPage($emailTemplateId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddEmailTemplatePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddEmailTemplatePage); + $I->waitForPageLoad(); + } + public function goToTheAdminNewsletterTemplateGrid() { $I = $this; @@ -230,6 +398,20 @@ public function goToTheAdminNewsletterTemplateGrid() $I->waitForPageLoad(); } + public function goToTheAdminNewsletterTemplateByIdPage($newsletterTemplateId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddNewsletterTemplatePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); + $I->waitForPageLoad(); + } + public function goToTheAdminNewsletterQueueGrid() { $I = $this; @@ -251,6 +433,20 @@ public function goToTheAdminURLRewritesGrid() $I->waitForPageLoad(); } + public function goToTheAdminURLRewriteForId($urlRewriteId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddURLRewritePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddURLRewritePage); + $I->waitForPageLoad(); + } + public function goToTheAdminSearchTermsGrid() { $I = $this; @@ -258,6 +454,20 @@ public function goToTheAdminSearchTermsGrid() $I->waitForPageLoad(); } + public function goToTheAdminSearchTermForIdPage($searchTermId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddSearchTermPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSearchTermPage); + $I->waitForPageLoad(); + } + public function goToTheAdminSearchSynonymsGrid() { $I = $this; @@ -265,6 +475,20 @@ public function goToTheAdminSearchSynonymsGrid() $I->waitForPageLoad(); } + public function goToTheAdminSearchSynonymGroupByIdPage($searchSynonymId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddSearchSynonymGroupPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); + $I->waitForPageLoad(); + } + public function goToTheAdminSiteMapGrid() { $I = $this; @@ -272,6 +496,20 @@ public function goToTheAdminSiteMapGrid() $I->waitForPageLoad(); } + public function goToTheAdminSiteMapForIdPage($siteMapId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddSiteMapPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSiteMapPage); + $I->waitForPageLoad(); + } + public function goToTheAdminReviewsGrid() { $I = $this; @@ -279,6 +517,20 @@ public function goToTheAdminReviewsGrid() $I->waitForPageLoad(); } + public function goToTheAdminReviewForIdPage($reviewId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddReviewPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddReviewPage); + $I->waitForPageLoad(); + } + // Content public function goToTheAdminPagesGrid() { @@ -287,6 +539,20 @@ public function goToTheAdminPagesGrid() $I->waitForPageLoad(); } + public function goToTheAdminPageForIdPage($pageId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddPagePage() + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddPagePage)); + $I->waitForPageLoad(); + } + public function goToTheAdminBlocksGrid() { $I = $this; @@ -294,6 +560,20 @@ public function goToTheAdminBlocksGrid() $I->waitForPageLoad(); } + public function goToTheAdminBlockForIdPage($blockId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddBlockPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddBlockPage); + $I->waitForPageLoad(); + } + public function goToTheAdminWidgetsGrid() { $I = $this; @@ -301,6 +581,13 @@ public function goToTheAdminWidgetsGrid() $I->waitForPageLoad(); } + public function goToTheAdminAddWidgetPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddWidgetPage); + $I->waitForPageLoad(); + } + public function goToTheAdminDesignConfigurationGrid() { $I = $this; @@ -315,6 +602,13 @@ public function goToTheAdminThemesGrid() $I->waitForPageLoad(); } + public function goToTheAdminThemeByIdPage($themeId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); + $I->waitForPageLoad(); + } + public function goToTheAdminStoreContentScheduleGrid() { $I = $this; @@ -322,6 +616,20 @@ public function goToTheAdminStoreContentScheduleGrid() $I->waitForPageLoad(); } + public function goToTheAdminStoreContentScheduleForIdPage($storeContentScheduleId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddStoreDesignChangePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddStoreDesignChangePage); + $I->waitForPageLoad(); + } + // Reports public function goToTheAdminProductsInCartGrid() { @@ -365,6 +673,20 @@ public function goToTheAdminProductReviewsReportGrid() $I->waitForPageLoad(); } + public function goToTheAdminProductReviewsForProductIdPage($productId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminProductReviewIdForProductIdPage($productReviewId, $productId) + { + $I = $this; + $I->amOnPage(('/admin/review/product/edit/id/' . $productReviewId . '/productId/' . $productId)); + $I->waitForPageLoad(); + } + public function goToTheAdminOrdersReportGrid() { $I = $this; @@ -492,6 +814,48 @@ public function goToTheAdminAllStoresGrid() $I->waitForPageLoad(); } + public function goToTheAdminCreateStoreViewPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateStoreViewPage); + $I->waitForPageLoad(); + } + + public function goToTheAdminCreateStorePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateStorePage); + $I->waitForPageLoad(); + } + + public function goToTheAdminCreateWebsitePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateWebsitePage); + $I->waitForPageLoad(); + } + + public function goToTheAdminWebsiteForIdPage($websiteId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminStoreViewForIdPage($storeViewId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminStoreForIdPage($storeId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); + $I->waitForPageLoad(); + } + public function goToTheAdminConfigurationGrid() { $I = $this; @@ -506,6 +870,20 @@ public function goToTheAdminTermsAndConditionsGrid() $I->waitForPageLoad(); } + public function goToTheAdminTermsAndConditionForIdPage($termsAndConditionsId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddNewTermsAndConditionsPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); + $I->waitForPageLoad(); + } + public function goToTheAdminOrderStatusGrid() { $I = $this; @@ -513,6 +891,13 @@ public function goToTheAdminOrderStatusGrid() $I->waitForPageLoad(); } + public function goToTheAdminAddOrderStatusPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderStatusPage); + $I->waitForPageLoad(); + } + public function goToTheAdminTaxRulesGrid() { $I = $this; @@ -520,6 +905,20 @@ public function goToTheAdminTaxRulesGrid() $I->waitForPageLoad(); } + public function goToTheAdminTaxRuleForIdPage($taxRuleId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddTaxRulePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddTaxRulePage); + $I->waitForPageLoad(); + } + public function goToTheAdminTaxZonesAndRatesGrid() { $I = $this; @@ -527,6 +926,20 @@ public function goToTheAdminTaxZonesAndRatesGrid() $I->waitForPageLoad(); } + public function goToTheAdminTaxZoneAndRateForIdPage($taxZoneAndRateId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddTaxZoneAndRatePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); + $I->waitForPageLoad(); + } + public function goToTheAdminCurrencyRatesPage() { $I = $this; @@ -548,6 +961,20 @@ public function goToTheAdminProductAttributesGrid() $I->waitForPageLoad(); } + public function goToTheAdminProductAttributeForIdPage($productAttributeId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddProductAttributePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddProductAttributePage); + $I->waitForPageLoad(); + } + public function goToTheAdminAttributeSetGrid() { $I = $this; @@ -555,6 +982,20 @@ public function goToTheAdminAttributeSetGrid() $I->waitForPageLoad(); } + public function goToTheAdminAttributeSetByIdPage($attributeSetId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddAttributeSetPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddAttributeSetPage); + $I->waitForPageLoad(); + } + public function goToTheAdminRatingGrid() { $I = $this; @@ -562,6 +1003,20 @@ public function goToTheAdminRatingGrid() $I->waitForPageLoad(); } + public function goToTheAdminRatingForIdPage($ratingId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddRatingPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddRatingPage); + $I->waitForPageLoad(); + } + public function goToTheAdminCustomerGroupsGrid() { $I = $this; @@ -569,6 +1024,20 @@ public function goToTheAdminCustomerGroupsGrid() $I->waitForPageLoad(); } + public function goToTheAdminCustomerGroupForIdPage($customerGroupId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddCustomerGroupPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomerGroupPage); + $I->waitForPageLoad(); + } + // System public function goToTheAdminImportPage() { @@ -605,6 +1074,20 @@ public function goToTheAdminIntegrationsGrid() $I->waitForPageLoad(); } + public function goToTheAdminIntegrationForIdPage($integrationId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddIntegrationPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddIntegrationPage); + $I->waitForPageLoad(); + } + public function goToTheAdminCacheManagementGrid() { $I = $this; @@ -640,6 +1123,20 @@ public function goToTheAdminAllUsersGrid() $I->waitForPageLoad(); } + public function goToTheAdminUserForIdPage($userId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserByIdPage . $userId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddUserPage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewUserPage); + $I->waitForPageLoad(); + } + public function goToTheAdminLockedUsersGrid() { $I = $this; @@ -654,6 +1151,20 @@ public function goToTheAdminUserRolesGrid() $I->waitForPageLoad(); } + public function goToTheAdminUserRoleForIdPage($userRoleId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddUserRolePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddUserRolePage); + $I->waitForPageLoad(); + } + public function goToTheAdminNotificationsGrid() { $I = $this; @@ -668,6 +1179,20 @@ public function goToTheAdminCustomVariablesGrid() $I->waitForPageLoad(); } + public function goToTheAdminCustomVariableForId($customVariableId) + { + $I = $this; + $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); + $I->waitForPageLoad(); + } + + public function goToTheAdminAddCustomVariablePage() + { + $I = $this; + $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomVariablePage); + $I->waitForPageLoad(); + } + public function goToTheAdminEncryptionKeyPage() { $I = $this; @@ -710,6 +1235,27 @@ public function shouldBeOnTheAdminOrdersGrid() $I->see('Orders', self::$adminPageTitle); } + public function shouldBeOnTheAdminOrderForIdPage($orderId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); + $I->see($orderId, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddOrderPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderPage); + $I->see('Create New Order', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddOrderForCustomerIdPage($customerId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); + $I->see('Create New Order', self::$adminPageTitle); + } + public function shouldBeOnTheAdminInvoicesGrid() { $I = $this; @@ -717,6 +1263,13 @@ public function shouldBeOnTheAdminInvoicesGrid() $I->see('Invoices', self::$adminPageTitle); } + public function shouldBeOnTheAdminAddInvoiceForOrderIdPage($orderId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); + $I->see('New Invoice', self::$adminPageTitle); + } + public function shouldBeOnTheAdminShipmentsGrid() { $I = $this; @@ -724,40 +1277,124 @@ public function shouldBeOnTheAdminShipmentsGrid() $I->see('Shipments', self::$adminPageTitle); } + public function shouldBeOnTheAdminShipmentForIdPage($shipmentId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); + $I->see('New Shipment'); + } + public function shouldBeOnTheAdminCreditMemosGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemosGrid); - $I->see('Credit Memos', self::$adminPageTitle); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemosGrid); + $I->see('Credit Memos', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminCreditMemoForIdPage($creditMemoId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); + $I->see('View Memo', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminBillingAgreementsGrid() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBillingAgreementsGrid); + $I->see('Billing Agreements', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminTransactionsGrid() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTransactionsGrid); + $I->see('Transactions', self::$adminPageTitle); + } + + // Products + public function shouldBeOnTheAdminCatalogGrid() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogGrid); + $I->see('Catalog', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminProductForIdPage($productId, $productName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductForIdPage . $productId)); + $I->see($productName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddSimpleProductPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSimpleProductPage); + $I->see('New Product', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddConfigurableProductPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddConfigurableProductPage); + $I->see('New Product', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddGroupedProductPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddGroupedProductPage); + $I->see('New Product', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddVirtualProductPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddVirtualProductPage); + $I->see('New Product', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddBundledProductPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddBundleProductPage); + $I->see('New Product', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddDownloadableProductPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddDownloadableProductPage); + $I->see('New Product', self::$adminPageTitle); } - public function shouldBeOnTheAdminBillingAgreementsGrid() + public function shouldBeOnTheAdminCategoriesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBillingAgreementsGrid); - $I->see('Billing Agreements', self::$adminPageTitle); + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoriesPage); + $I->see('Default Category', self::$adminPageTitle); } - public function shouldBeOnTheAdminTransactionsGrid() + public function shouldBeOnTheAdminCategoryForIdPage($categoryId, $categoryName) { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTransactionsGrid); - $I->see('Transactions', self::$adminPageTitle); + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); + $I->see($categoryName, self::$adminPageTitle); } - // Products - public function shouldBeOnTheAdminCatalogGrid() + public function shouldBeOnTheAdminAddRootCategoryForStoreIdPage($storeId) { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogGrid); - $I->see('Catalog', self::$adminPageTitle); + $I->seeInCurrentUrl(('/admin/catalog/category/add/store/' . $storeId . '/parent/1')); + $I->see('New Category', self::$adminPageTitle); } - public function shouldBeOnTheAdminCategoryPage() + public function shouldBeOnTheAdminAddSubCategoryForStoreIdPage($storeId) { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoriesPage); - $I->see('Default Category', self::$adminPageTitle); + $I->seeInCurrentUrl(('/admin/catalog/category/add/store/' . $storeId . '/parent/2')); + $I->see('New Category', self::$adminPageTitle); } // Customers @@ -775,6 +1412,20 @@ public function shouldBeOnTheAdminCustomersNowOnlineGrid() $I->see('Customers Now Online', self::$adminPageTitle); } + public function shouldBeOnTheAdminCustomerForIdPage($customerId, $customerName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); + $I->see($customerName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddCustomerPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomerPage); + $I->see('New Customer', self::$adminPageTitle); + } + // Marketing public function shouldBeOnTheAdminCatalogPriceRuleGrid() { @@ -783,6 +1434,20 @@ public function shouldBeOnTheAdminCatalogPriceRuleGrid() $I->see('Catalog Price Rule', self::$adminPageTitle); } + public function shouldBeOnTheAdminCatalogPriceRuleForIdPage($catalogPriceRuleId, $catalogPriceRuleName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); + $I->see($catalogPriceRuleName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddCatalogPriceRulePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); + $I->see('New Catalog Price Rule', self::$adminPageTitle); + } + public function shouldBeOnTheAdminCartPriceRulesGrid() { $I = $this; @@ -790,6 +1455,20 @@ public function shouldBeOnTheAdminCartPriceRulesGrid() $I->see('Cart Price Rules', self::$adminPageTitle); } + public function shouldBeOnTheAdminCartPriceRuleForIdPage($cartPriceRuleId, $cartPriceRuleName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); + $I->see($cartPriceRuleName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddCartPriceRulePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCartPriceRulePage); + $I->see('New Cart Price Rule', self::$adminPageTitle); + } + public function shouldBeOnTheAdminEmailTemplatesGrid() { $I = $this; @@ -797,6 +1476,20 @@ public function shouldBeOnTheAdminEmailTemplatesGrid() $I->see('Email Templates', self::$adminPageTitle); } + public function shouldBeOnTheAdminEmailTemplateForIdPage($emailTemplateId, $templateName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); + $I->see($templateName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddEmailTemplatePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddEmailTemplatePage); + $I->see('New Template', self::$adminPageTitle); + } + public function shouldBeOnTheAdminNewsletterTemplateGrid() { $I = $this; @@ -804,6 +1497,20 @@ public function shouldBeOnTheAdminNewsletterTemplateGrid() $I->see('Newsletter Templates', self::$adminPageTitle); } + public function shouldBeOnTheAdminNewsletterTemplateByIdPage($newsletterTemplateId, $templateName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); + $I->see($templateName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddNewsletterTemplatePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); + $I->see('New Template', self::$adminPageTitle); + } + public function shouldBeOnTheAdminNewsletterQueueGrid() { $I = $this; @@ -825,6 +1532,20 @@ public function shouldBeOnTheAdminURLRewritesGrid() $I->see('URL Rewrites', self::$adminPageTitle); } + public function shouldBeOnTheAdminURLRewriteForId($urlRewriteId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); + $I->see('Edit URL Rewrite for a', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddURLRewritePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddURLRewritePage); + $I->see('Add New URL Rewrite', self::$adminPageTitle); + } + public function shouldBeOnTheAdminSearchTermsGrid() { $I = $this; @@ -832,6 +1553,20 @@ public function shouldBeOnTheAdminSearchTermsGrid() $I->see('Search Terms', self::$adminPageTitle); } + public function shouldBeOnTheAdminSearchTermForIdPage($searchTermId, $searchQuery) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); + $I->see($searchQuery, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddSearchTermPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSearchTermPage); + $I->see('New Search', self::$adminPageTitle); + } + public function shouldBeOnTheAdminSearchSynonymsGrid() { $I = $this; @@ -839,6 +1574,20 @@ public function shouldBeOnTheAdminSearchSynonymsGrid() $I->see('Search Synonyms', self::$adminPageTitle); } + public function shouldBeOnTheAdminSearchSynonymGroupByIdPage($searchSynonymId, $synonyms) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); + $I->see($synonyms, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddSearchSynonymGroupPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); + $I->see('New Synonym Group', self::$adminPageTitle); + } + public function shouldBeOnTheAdminSiteMapGrid() { $I = $this; @@ -846,6 +1595,20 @@ public function shouldBeOnTheAdminSiteMapGrid() $I->see('Site Map', self::$adminPageTitle); } + public function shouldBeOnTheAdminSiteMapForIdPage($siteMapId, $fileName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); + $I->see($fileName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddSiteMapPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSiteMapPage); + $I->see('New Site Map', self::$adminPageTitle); + } + public function shouldBeOnTheAdminReviewsGrid() { $I = $this; @@ -853,6 +1616,20 @@ public function shouldBeOnTheAdminReviewsGrid() $I->see('Reviews', self::$adminPageTitle); } + public function shouldBeOnTheAdminReviewForIdPage($reviewId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); + $I->see('Edit Review', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddReviewPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddReviewPage); + $I->see('New Review', self::$adminPageTitle); + } + // Content public function shouldBeOnTheAdminPagesGrid() { @@ -861,6 +1638,20 @@ public function shouldBeOnTheAdminPagesGrid() $I->see('Pages', self::$adminPageTitle); } + public function shouldBeOnTheAdminPageForIdPage($pageId, $pageTitle) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); + $I->see($pageTitle, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddPagePage() + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddPagePage)); + $I->see('New Page', self::$adminPageTitle); + } + public function shouldBeOnTheAdminBlocksGrid() { $I = $this; @@ -868,6 +1659,20 @@ public function shouldBeOnTheAdminBlocksGrid() $I->see('Blocks', self::$adminPageTitle); } + public function shouldBeOnTheAdminBlockForIdPage($blockId, $blockTitle) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); + $I->see($blockTitle, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddBlockPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddBlockPage); + $I->see('New Block', self::$adminPageTitle); + } + public function shouldBeOnTheAdminWidgetsGrid() { $I = $this; @@ -875,6 +1680,13 @@ public function shouldBeOnTheAdminWidgetsGrid() $I->see('Widgets', self::$adminPageTitle); } + public function shouldBeOnTheAdminAddWidgetPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddWidgetPage); + $I->see('Widgets', self::$adminPageTitle); + } + public function shouldBeOnTheAdminDesignConfigurationGrid() { $I = $this; @@ -889,6 +1701,13 @@ public function shouldBeOnTheAdminThemesGrid() $I->see('Themes', self::$adminPageTitle); } + public function shouldBeOnTheAdminThemeByIdPage($themeId, $themeTitle) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); + $I->see($themeTitle); + } + public function shouldBeOnTheAdminStoreContentScheduleGrid() { $I = $this; @@ -896,6 +1715,20 @@ public function shouldBeOnTheAdminStoreContentScheduleGrid() $I->see('Store Design Schedule', self::$adminPageTitle); } + public function shouldBeOnTheAdminStoreContentScheduleForIdPage($storeContentScheduleId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); + $I->see('Edit Store Design Change', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddStoreDesignChangePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddStoreDesignChangePage); + $I->see('New Store Design Change'); + } + // Reports public function shouldBeOnTheAdminProductsInCartGrid() { @@ -939,6 +1772,20 @@ public function shouldBeOnTheAdminProductReviewsReportGrid() $I->see('Product Reviews Report', self::$adminPageTitle); } + public function shouldBeOnTheAdminProductReviewsForProductIdPage($productId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); + $I->see('Reviews', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminProductReviewIdForProductIdPage($productReviewId, $productId) + { + $I = $this; + $I->seeInCurrentUrl(('/admin/review/product/edit/id/' . $productReviewId . '/productId/' . $productId)); + $I->see('Edit Review', self::$adminPageTitle); + } + public function shouldBeOnTheAdminOrdersReportGrid() { $I = $this; @@ -1066,6 +1913,45 @@ public function shouldBeOnTheAdminAllStoresGrid() $I->see('Stores', self::$adminPageTitle); } + public function shouldBeOnTheAdminCreateStoreViewPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateStoreViewPage); + $I->see('Stores', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminCreateStorePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateStorePage); + $I->see('Stores', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminCreateWebsitePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateWebsitePage); + $I->see('Stores'); + } + + public function shouldBeOnTheAdminWebsiteForIdPage($websiteId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); + } + + public function shouldBeOnTheAdminStoreViewForIdPage($storeViewId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); + } + + public function shouldBeOnTheAdminStoreForIdPage($storeId) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); + } + public function shouldBeOnTheAdminConfigurationGrid() { $I = $this; @@ -1080,6 +1966,20 @@ public function shouldBeOnTheAdminTermsAndConditionsGrid() $I->see('Terms and Conditions', self::$adminPageTitle); } + public function shouldBeOnTheAdminTermsAndConditionForIdPage($termsAndConditionsId, $conditionName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); + $I->see($conditionName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddNewTermsAndConditionsPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); + $I->see('New Condition', self::$adminPageTitle); + } + public function shouldBeOnTheAdminOrderStatusGrid() { $I = $this; @@ -1087,6 +1987,13 @@ public function shouldBeOnTheAdminOrderStatusGrid() $I->see('Order Status', self::$adminPageTitle); } + public function shouldBeOnTheAdminAddOrderStatusPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderStatusPage); + $I->see('Create New Order Status', self::$adminPageTitle); + } + public function shouldBeOnTheAdminTaxRulesGrid() { $I = $this; @@ -1094,6 +2001,20 @@ public function shouldBeOnTheAdminTaxRulesGrid() $I->see('Tax Rules', self::$adminPageTitle); } + public function shouldBeOnTheAdminTaxRuleForIdPage($taxRuleId, $taxRuleName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); + $I->see($taxRuleName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddTaxRulePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddTaxRulePage); + $I->see('New Tax Rule', self::$adminPageTitle); + } + public function shouldBeOnTheAdminTaxZonesAndRatesGrid() { $I = $this; @@ -1101,6 +2022,20 @@ public function shouldBeOnTheAdminTaxZonesAndRatesGrid() $I->see('Tax Zones and Rates', self::$adminPageTitle); } + public function shouldBeOnTheAdminTaxZoneAndRateForIdPage($taxZoneAndRateId, $taxIdentifier) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); + $I->see($taxIdentifier, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddTaxZoneAndRatePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); + $I->see('New Tax Rate', self::$adminPageTitle); + } + public function shouldBeOnTheAdminCurrencyRatesPage() { $I = $this; @@ -1122,6 +2057,20 @@ public function shouldBeOnTheAdminProductAttributesGrid() $I->see('Product Attributes', self::$adminPageTitle); } + public function shouldBeOnTheAdminProductAttributeForIdPage($productAttributeId, $productAttributeDefaultLabel) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); + $I->see($productAttributeDefaultLabel, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddProductAttributePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddProductAttributePage); + $I->see('New Product Attribute', self::$adminPageTitle); + } + public function shouldBeOnTheAdminAttributeSetsGrid() { $I = $this; @@ -1129,6 +2078,20 @@ public function shouldBeOnTheAdminAttributeSetsGrid() $I->see('Attribute Sets', self::$adminPageTitle); } + public function shouldBeOnTheAdminAttributeSetByIdPage($attributeSetId, $attributeSetName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); + $I->see($attributeSetName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddAttributeSetPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddAttributeSetPage); + $I->see('New Attribute Set', self::$adminPageTitle); + } + public function shouldBeOnTheAdminRatingsGrid() { $I = $this; @@ -1136,6 +2099,20 @@ public function shouldBeOnTheAdminRatingsGrid() $I->see('Ratings', self::$adminPageTitle); } + public function shouldBeOnTheAdminRatingForIdPage($ratingId, $ratingDefaultValue) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); + $I->see($ratingDefaultValue, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddRatingPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddRatingPage); + $I->see('New Rating', self::$adminPageTitle); + } + public function shouldBeOnTheAdminCustomerGroupsGrid() { $I = $this; @@ -1143,6 +2120,20 @@ public function shouldBeOnTheAdminCustomerGroupsGrid() $I->see('Customer Groups', self::$adminPageTitle); } + public function shouldBeOnTheAdminCustomerGroupForIdPage($customerGroupId, $customerGroupName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); + $I->see($customerGroupName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddCustomerGroupPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomerGroupPage); + $I->see('New Customer Group', self::$adminPageTitle); + } + // System public function shouldBeOnTheAdminImportPage() { @@ -1179,6 +2170,22 @@ public function shouldBeOnTheAdminIntegrationsGrid() $I->see('Integrations', self::$adminPageTitle); } + public function shouldBeOnTheAdminIntegrationForIdPage($integrationId, $integrationName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); + $I->see('Edit', self::$adminPageTitle); + $I->see($integrationName, self::$adminPageTitle); + $I->see('Integration', self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddIntegrationPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddIntegrationPage); + $I->see('New Integration', self::$adminPageTitle); + } + public function shouldBeOnTheAdminCacheManagementGrid() { $I = $this; @@ -1214,6 +2221,20 @@ public function shouldBeOnTheAdminAllUsersGrid() $I->see('Users', self::$adminPageTitle); } + public function shouldBeOnTheAdminUserForIdPage($userId, $userFirstAndLastName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserByIdPage . $userId)); + $I->see($userFirstAndLastName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddUserPage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewUserPage); + $I->see('New User', self::$adminPageTitle); + } + public function shouldBeOnTheAdminLockedUsersGrid() { $I = $this; @@ -1228,6 +2249,20 @@ public function shouldBeOnTheAdminUserRolesGrid() $I->see('Roles', self::$adminPageTitle); } + public function shouldBeOnTheAdminUserRoleForIdPage($userRoleId, $userRoleName) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); + $I->see($userRoleName, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddUserRolePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddUserRolePage); + $I->see('New Role', self::$adminPageTitle); + } + public function shouldBeOnTheAdminNotificationsGrid() { $I = $this; @@ -1242,6 +2277,20 @@ public function shouldBeOnTheAdminCustomVariablesGrid() $I->see('Custom Variables', self::$adminPageTitle); } + public function shouldBeOnTheAdminCustomVariableForId($customVariableId, $customVariableCode) + { + $I = $this; + $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); + $I->see($customVariableCode, self::$adminPageTitle); + } + + public function shouldBeOnTheAdminAddCustomVariablePage() + { + $I = $this; + $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomVariablePage); + $I->see('New Custom Variable', self::$adminPageTitle); + } + public function shouldBeOnTheAdminEncryptionKeyPage() { $I = $this; diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php index 6e195ccf2..1b3db39d4 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php @@ -67,7 +67,7 @@ public function shouldBeAbleToAccessEachAdminPageDirectly(AdminStep $I) $I->shouldBeOnTheAdminCatalogGrid(); $I->goToTheAdminCategoriesPage(); - $I->shouldBeOnTheAdminCategoryPage(); + $I->shouldBeOnTheAdminCategoriesPage(); $I->goToTheAdminAllCustomersGrid(); $I->shouldBeOnTheAdminAllCustomersGrid(); @@ -273,4 +273,116 @@ public function shouldBeAbleToAccessEachAdminPageDirectly(AdminStep $I) $I->goToTheAdminEncryptionKeyPage(); $I->shouldBeOnTheAdminEncryptionKeyPage(); } + + /** + * Allure annotations + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "AdminStep", value = "$I") + * @TestCaseId("") + * + * Codeception annotations + * @param AdminStep $I + * @return void + */ + public function shouldBeAbleToAccessEachAdminAddPageDirectly(AdminStep $I) + { + $I->goToTheAdminAddOrderPage(); + $I->shouldBeOnTheAdminAddOrderPage(); + + $I->goToTheAdminAddSimpleProductPage(); + $I->shouldBeOnTheAdminAddSimpleProductPage(); + + $I->goToTheAdminAddConfigurableProductPage(); + $I->shouldBeOnTheAdminAddConfigurableProductPage(); + + $I->goToTheAdminAddGroupedProductPage(); + $I->shouldBeOnTheAdminAddGroupedProductPage(); + + $I->goToTheAdminAddVirtualProductPage(); + $I->shouldBeOnTheAdminAddVirtualProductPage(); + + $I->goToTheAdminAddBundledProductPage(); + $I->shouldBeOnTheAdminAddBundledProductPage(); + + $I->goToTheAdminAddDownloadableProductPage(); + $I->shouldBeOnTheAdminAddDownloadableProductPage(); + + $I->goToTheAdminAddCustomerPage(); + $I->shouldBeOnTheAdminAddCustomerPage(); + + $I->goToTheAdminAddCatalogPriceRulePage(); + $I->shouldBeOnTheAdminAddCatalogPriceRulePage(); + + $I->goToTheAdminAddCartPriceRulePage(); + $I->shouldBeOnTheAdminAddCartPriceRulePage(); + + $I->goToTheAdminAddEmailTemplatePage(); + $I->shouldBeOnTheAdminAddEmailTemplatePage(); + + $I->goToTheAdminAddNewsletterTemplatePage(); + $I->shouldBeOnTheAdminAddNewsletterTemplatePage(); + + $I->goToTheAdminAddURLRewritePage(); + $I->shouldBeOnTheAdminAddURLRewritePage(); + + $I->goToTheAdminAddSearchTermPage(); + $I->shouldBeOnTheAdminAddSearchTermPage(); + + $I->goToTheAdminAddSearchSynonymGroupPage(); + $I->shouldBeOnTheAdminAddSearchSynonymGroupPage(); + + $I->goToTheAdminAddSiteMapPage(); + $I->shouldBeOnTheAdminAddSiteMapPage(); + + $I->goToTheAdminAddReviewPage(); + $I->shouldBeOnTheAdminAddReviewPage(); + + $I->goToTheAdminAddPagePage(); + $I->shouldBeOnTheAdminAddPagePage(); + + $I->goToTheAdminAddBlockPage(); + $I->shouldBeOnTheAdminAddBlockPage(); + + $I->goToTheAdminAddWidgetPage(); + $I->shouldBeOnTheAdminAddWidgetPage(); + + $I->goToTheAdminAddStoreDesignChangePage(); + $I->shouldBeOnTheAdminAddStoreDesignChangePage(); + + $I->goToTheAdminAddNewTermsAndConditionsPage(); + $I->shouldBeOnTheAdminAddNewTermsAndConditionsPage(); + + $I->goToTheAdminAddOrderStatusPage(); + $I->shouldBeOnTheAdminAddOrderStatusPage(); + + $I->goToTheAdminAddTaxRulePage(); + $I->shouldBeOnTheAdminAddTaxRulePage(); + + $I->goToTheAdminAddTaxZoneAndRatePage(); + $I->shouldBeOnTheAdminAddTaxZoneAndRatePage(); + + $I->goToTheAdminAddProductAttributePage(); + $I->shouldBeOnTheAdminAddProductAttributePage(); + + $I->goToTheAdminAddAttributeSetPage(); + $I->shouldBeOnTheAdminAddAttributeSetPage(); + + $I->goToTheAdminAddRatingPage(); + $I->shouldBeOnTheAdminAddRatingPage(); + + $I->goToTheAdminAddCustomerGroupPage(); + $I->shouldBeOnTheAdminAddCustomerGroupPage(); + + $I->goToTheAdminAddIntegrationPage(); + $I->shouldBeOnTheAdminAddIntegrationPage(); + + $I->goToTheAdminAddUserPage(); + $I->shouldBeOnTheAdminAddUserPage(); + + $I->goToTheAdminAddUserRolePage(); + $I->shouldBeOnTheAdminAddUserRolePage(); + + $I->goToTheAdminAddCustomVariablePage(); + $I->shouldBeOnTheAdminAddCustomVariablePage(); + } } diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php index e0f2f3dde..df8ff7466 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php @@ -120,7 +120,7 @@ public function shouldLandOnEachOfTheProductsPages(AdminStep $I, SideNav $sideNa $sideNavMenu->clickOnProductsInTheSideNavMenu(); $sideNavMenu->clickOnCategoriesInTheProductNavMenu(); - $I->shouldBeOnTheAdminCategoryPage(); + $I->shouldBeOnTheAdminCategoriesPage(); } /** From 335a9cd227f19906146a0eb81f79b369f74f2035 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 9 May 2017 13:46:22 -0500 Subject: [PATCH 067/149] MTA-4194: Abstract api step objects into MagentoRestDriver module; Added methods to create configurable products, product attributes through web api requests. --- .../Xxyyzz/Helper/MagentoFakerData.php | 115 ++++ .../Xxyyzz/Module/MagentoFakerData.php | 236 -------- .../Xxyyzz/Module/MagentoRestDriver.php | 509 ++++++++++++++++++ .../Xxyyzz/Page/Catalog/AdminProductPage.php | 9 +- .../Page/Catalog/StorefrontCategoryPage.php | 8 +- .../Page/Catalog/StorefrontProductPage.php | 4 +- .../Step/Catalog/Api/CategoryApiStep.php | 37 -- .../Step/Catalog/Api/ProductApiStep.php | 37 -- .../Step/Customer/Api/CustomerApiStep.php | 22 - tests/acceptance.suite.dist.yml | 3 +- 10 files changed, 634 insertions(+), 346 deletions(-) create mode 100644 tests/_support/Magento/Xxyyzz/Helper/MagentoFakerData.php delete mode 100644 tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php delete mode 100644 tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php delete mode 100644 tests/_support/Magento/Xxyyzz/Step/Catalog/Api/ProductApiStep.php delete mode 100644 tests/_support/Magento/Xxyyzz/Step/Customer/Api/CustomerApiStep.php diff --git a/tests/_support/Magento/Xxyyzz/Helper/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Helper/MagentoFakerData.php new file mode 100644 index 000000000..cfaeef872 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Helper/MagentoFakerData.php @@ -0,0 +1,115 @@ + $faker->title, + 'firstname' => $faker->firstName, + 'middlename' => $faker->firstName, + 'lastname' => $faker->lastName, + 'suffix' => \Faker\Provider\en_US\Person::suffix(), + 'email' => $faker->email, + 'dateOfBirth' => $faker->date($format = 'm/d/Y', $max = 'now'), + 'gender' => rand(0, 1), + 'group_id' => 1, + 'store_id' => 1, + 'website_id' => 1, + 'taxVatNumber' => \Faker\Provider\at_AT\Payment::vat(), + 'company' => $faker->company, + 'phoneNumber' => $faker->phoneNumber, + 'address' => [ + 'address1' => $faker->streetAddress, + 'address2' => $faker->streetAddress, + 'city' => $faker->city, + 'country' => 'United States', + 'state' => \Faker\Provider\en_US\Address::state(), + 'zipCode' => $faker->postcode + ] + ]; + return array_merge($customerData, $additional); + } + + /** + * Get category data. + * + * @return array + */ + public function getCategoryData() + { + $faker = \Faker\Factory::create(); + + return [ + 'enableCategory' => $faker->boolean(), + 'includeInMenu' => $faker->boolean(), + 'categoryName' => $faker->md5, + 'categoryImage' => '', + 'description' => $faker->sentence($nbWords = 10, $variableNbWords = true), + 'addCMSBlock' => '', + + 'urlKey' => $faker->uuid, + 'metaTitle' => $faker->word, + 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), + 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true), + ]; + } + + /** + * Get simple product data. + * + * @param integer $categoryId + * @param array $productData + * @return array + */ + public function getProductData($categoryId = 0, $productData = []) + { + $faker = \Faker\Factory::create(); + return [ + 'enableProduct' => $faker->boolean(), + 'attributeSet' => '', + 'productName' => $faker->text($maxNbChars = 20), + 'sku' => \Faker\Provider\DateTime::unixTime($max = 'now'), + 'price' => $faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 999), + 'quantity' => $faker->numberBetween($min = 1, $max = 999), + + 'urlKey' => $faker->uuid, + 'metaTitle' => $faker->word, + 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), + 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true) + ]; + } + + /** + * Get Content Page Data. + * + * @return array + */ + public function getContentPage() + { + $faker = \Faker\Factory::create(); + + $pageContent = [ + 'pageTitle' => $faker->sentence($nbWords = 3, $variableNbWords = true), + 'contentHeading' => $faker->sentence($nbWords = 3, $variableNbWords = true), + 'contentBody' => $faker->sentence($nbWords = 10, $variableNbWords = true), + 'urlKey' => $faker->uuid, + 'metaTitle' => $faker->word, + 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), + 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true), + 'layoutUpdateXml' => "ToveJaniReminderDon't forget me this weekend!", + 'from' => $faker->date($format = 'm/d/Y', $max = 'now'), + 'to' => $faker->date($format = 'm/d/Y') + ]; + + return $pageContent; + } +} diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php b/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php deleted file mode 100644 index 4293d5266..000000000 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoFakerData.php +++ /dev/null @@ -1,236 +0,0 @@ -getSqs(); - return [ - 'parent_id' => '2', - 'name' => isset($categoryData['name']) - ? $categoryData['name'] : 'category'.$sq, - 'is_active' => '1', - 'include_in_menu' => '1', - 'available_sort_by' => ['position', 'name'], - 'custom_attributes' => [ - ['attribute_code' => 'url_key', 'value' => isset($categoryData['name']) - ? $categoryData['name'] : 'category'.$sq], - ['attribute_code' => 'description', 'value' => $faker->text(20)], - ['attribute_code' => 'meta_title', 'value' => $faker->text(20)], - ['attribute_code' => 'meta_keywords', 'value' => $faker->text(20)], - ['attribute_code' => 'meta_description', 'value' => $faker->text(20)], - ['attribute_code' => 'display_mode', 'value' => 'PRODUCTS'], - ['attribute_code' => 'landing_page', 'value' => ''], - ['attribute_code' => 'is_anchor', 'value' => '0'], - ['attribute_code' => 'custom_use_parent_settings', 'value' => '0'], - ['attribute_code' => 'custom_apply_to_products', 'value' => '0'], - ['attribute_code' => 'custom_design', 'value' => ''], - ['attribute_code' => 'custom_design_from', 'value' => $faker->date($format = 'm/d/Y', $max = 'now')], - ['attribute_code' => 'custom_design_to', 'value' => $faker->date($format = 'm/d/Y')], - ['attribute_code' => 'page_layout', 'value' => ''], - ] - ]; - } - - /** - * Get simple product api data. - * - * @param integer $categoryId - * @param array $productData - * @return array - */ - public function getProductApiData($type = 'simple', $categoryId = 0, $productData = []) - { - $faker = \Faker\Factory::create(); - $sq = $this->getSqs(); - return [ - 'sku' => isset($productData['sku']) - ? $productData['sku'] : $type . '_product_sku'.$sq, - 'name' => isset($productData['name']) - ? $productData['name'] : $type . '_product'.$sq, - 'visibility' => 4, - 'type_id' => $type, - 'price' => $faker->randomFloat(2, 1), - 'status' => 1, - 'attribute_set_id' => 4, - 'extension_attributes' => [ - 'stock_item' => ['is_in_stock' => 1, 'qty' => $faker->numberBetween(100, 9000)] - ], - 'custom_attributes' => [ - ['attribute_code' => 'url_key', 'value' => isset($productData['name']) - ? $productData['name'] : $type . '_product'.$sq,], - ['attribute_code' => 'tax_class_id', 'value' => 2], - ['attribute_code' => 'category_ids', 'value' => $categoryId], - ], - ]; - } - - /** - * Get Customer Api data. - * - * @param array $additional - * @return array - */ - public function getCustomerApiData(array $additional = []) - { - $faker = \Faker\Factory::create(); - $customerData = [ - 'firstname' => $faker->firstName, - 'middlename' => $faker->firstName, - 'lastname' => $faker->lastName, - 'email' => $faker->email, - 'gender' => rand(0, 1), - 'group_id' => 1, - 'store_id' => 1, - 'website_id' => 1, - 'custom_attributes' => [ - [ - 'attribute_code' => 'disable_auto_group_change', - 'value' => '0', - ], - ], - ]; - return array_merge($customerData, $additional); - } - - /** - * Get customer data including password. - * - * @param string $password - * @return array - */ - public function getCustomerApiDataWithPassword($password = '') - { - return ['customer' => self::getCustomerApiData(), 'password' => ($password !== '') ? $password : '123123qW']; - } - - /** - * Get Customer Api data. - * - * @param array $additional - * @return array - */ - public function getCustomerData(array $additional = []) - { - $faker = \Faker\Factory::create(); - $customerData = [ - 'prefix' => $faker->title, - 'firstname' => $faker->firstName, - 'middlename' => $faker->firstName, - 'lastname' => $faker->lastName, - 'suffix' => \Faker\Provider\en_US\Person::suffix(), - 'email' => $faker->email, - 'dateOfBirth' => $faker->date($format = 'm/d/Y', $max = 'now'), - 'gender' => rand(0, 1), - 'group_id' => 1, - 'store_id' => 1, - 'website_id' => 1, - 'taxVatNumber' => \Faker\Provider\at_AT\Payment::vat(), - 'company' => $faker->company, - 'phoneNumber' => $faker->phoneNumber, - 'address' => [ - 'address1' => $faker->streetAddress, - 'address2' => $faker->streetAddress, - 'city' => $faker->city, - 'country' => 'United States', - 'state' => \Faker\Provider\en_US\Address::state(), - 'zipCode' => $faker->postcode - ] - ]; - return array_merge($customerData, $additional); - } - - /** - * Get category data. - * - * @return array - */ - public function getCategoryData() - { - $faker = \Faker\Factory::create(); - - return [ - 'enableCategory' => $faker->boolean(), - 'includeInMenu' => $faker->boolean(), - 'categoryName' => $faker->md5, - 'categoryImage' => '', - 'description' => $faker->sentence($nbWords = 10, $variableNbWords = true), - 'addCMSBlock' => '', - - 'urlKey' => $faker->uuid, - 'metaTitle' => $faker->word, - 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), - 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true), - ]; - } - - /** - * Get simple product api data. - * - * @param integer $categoryId - * @param array $productData - * @return array - */ - public function getProductData($categoryId = 0, $productData = []) - { - $faker = \Faker\Factory::create(); - return [ - 'enableProduct' => $faker->boolean(), - 'attributeSet' => '', - 'productName' => $faker->text($maxNbChars = 20), - 'sku' => \Faker\Provider\DateTime::unixTime($max = 'now'), - 'price' => $faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 999), - 'quantity' => $faker->numberBetween($min = 1, $max = 999), - - 'urlKey' => $faker->uuid, - 'metaTitle' => $faker->word, - 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), - 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true) - ]; - } - - /** - * Get Content Page Data. - * - * @return array - */ - public function getContentPage() - { - $faker = \Faker\Factory::create(); - - $pageContent = [ - 'pageTitle' => $faker->sentence($nbWords = 3, $variableNbWords = true), - 'contentHeading' => $faker->sentence($nbWords = 3, $variableNbWords = true), - 'contentBody' => $faker->sentence($nbWords = 10, $variableNbWords = true), - 'urlKey' => $faker->uuid, - 'metaTitle' => $faker->word, - 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), - 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true), - 'layoutUpdateXml' => "ToveJaniReminderDon't forget me this weekend!", - 'from' => $faker->date($format = 'm/d/Y', $max = 'now'), - 'to' => $faker->date($format = 'm/d/Y') - ]; - - return $pageContent; - } - - /** - * Get a unique sequence across suite. - * - * @return string - */ - public function getSqs() - { - return sqs(); - } -} diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoRestDriver.php b/tests/_support/Magento/Xxyyzz/Module/MagentoRestDriver.php index 74227f269..b4420adfc 100644 --- a/tests/_support/Magento/Xxyyzz/Module/MagentoRestDriver.php +++ b/tests/_support/Magento/Xxyyzz/Module/MagentoRestDriver.php @@ -2,6 +2,7 @@ namespace Magento\Xxyyzz\Module; use Codeception\Module\REST; +use Codeception\Module\Sequence; /** * MagentoRestDriver module provides Magento REST WebService. @@ -43,6 +44,22 @@ */ class MagentoRestDriver extends REST { + /** + * HTTP methods supported by REST. + */ + const HTTP_METHOD_GET = 'GET'; + const HTTP_METHOD_DELETE = 'DELETE'; + const HTTP_METHOD_PUT = 'PUT'; + const HTTP_METHOD_POST = 'POST'; + + protected static $categoryEndpoint = 'categories'; + protected static $productEndpoint = 'products'; + protected static $productAttributesEndpoint = 'products/attributes'; + protected static $productAttributesOptionsEndpoint = 'products/attributes/%s/options'; + protected static $productAttributeSetEndpoint = 'products/attribute-sets/attributes'; + protected static $configurableProductEndpoint = 'configurable-products/%s/options'; + protected static $customersEndpoint = 'customers'; + /** * Module required fields. * @@ -89,6 +106,7 @@ public function _beforeSuite($settings = []) $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); $this->haveHttpHeader('Authorization', 'Bearer ' . $token); self::$adminTokens[$this->config['username']] = $token; + $this->getModule('Sequence')->_initialize(); } /** @@ -151,4 +169,495 @@ public function amAdminTokenAuthenticated($username = null, $password = null, $n } $this->amBearerAuthenticated(self::$adminTokens[$username]); } + + /** + * Send REST API request. + * + * @param string $endpoint + * @param string $httpMethod + * @param array $params + * @param string $grabByJsonPath + * @param bool $decode + * @return mixed + * @throws \LogicException + * @part json + * @part xml + */ + public function sendRestRequest($endpoint, $httpMethod, $params = [], $grabByJsonPath = null, $decode = true) + { + $this->amAdminTokenAuthenticated(); + switch ($httpMethod) { + case self::HTTP_METHOD_GET: + $this->sendGET($endpoint, $params); + break; + case self::HTTP_METHOD_POST: + $this->sendPOST($endpoint, $params); + break; + case self::HTTP_METHOD_PUT: + $this->sendPUT($endpoint, $params); + break; + case self::HTTP_METHOD_DELETE: + $this->sendDELETE($endpoint, $params); + break; + default: + throw new \LogicException("HTTP method '{$httpMethod}' is not supported."); + } + $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); + + if (!$decode && is_null($grabByJsonPath)) { + return $this->grabResponse(); + } elseif (!$decode) { + return $this->grabDataFromResponseByJsonPath($grabByJsonPath); + } else { + return \GuzzleHttp\json_decode($this->grabResponse()); + } + } + + /** + * Create a category in Magento. + * + * @param array $categoryData + * @return array|mixed + * @part json + * @part xml + */ + public function requireCategory($categoryData = []) + { + if (!$categoryData) { + $categoryData = $this->getCategoryApiData(); + } + $categoryData = $this->sendRestRequest( + self::$categoryEndpoint, + self::HTTP_METHOD_POST, + ['category' => $categoryData] + ); + return $categoryData; + } + + /** + * Create a simple product in Magento. + * + * @param int $categoryId + * @param array $simpleProductData + * @return array|mixed + * @part json + * @part xml + */ + public function requireSimpleProduct($categoryId = 0, $simpleProductData = []) + { + if (!$simpleProductData) { + $simpleProductData = $this->getProductApiData('simple', $categoryId); + } + $simpleProductData = $this->sendRestRequest( + self::$productEndpoint, + self::HTTP_METHOD_POST, + ['product' => $simpleProductData] + ); + return $simpleProductData; + } + + /** + * Create a configurable product in Magento. + * + * @param int $categoryId + * @param array $configurableProductData + * @return array|mixed + * @part json + * @part xml + */ + public function requireConfigurableProduct($categoryId = 0, $configurableProductData = []) + { + $configurableProductData = $this->getProductApiData('configurable', $categoryId, $configurableProductData); + $this->sendRestRequest( + self::$productEndpoint, + self::HTTP_METHOD_POST, + ['product' => $configurableProductData] + ); + + $attributeData = $this->getProductAttributeApiData(); + $attribute = $this->sendRestRequest( + self::$productAttributesEndpoint, + self::HTTP_METHOD_POST, + $attributeData + ); + $options = $this->sendRestRequest( + sprintf(self::$productAttributesOptionsEndpoint, $attribute->attribute_code), + self::HTTP_METHOD_GET + ); + + $attributeSetData = $this->getAssignAttributeToAttributeSetApiData($attribute->attribute_code); + $this->sendRestRequest( + self::$productAttributeSetEndpoint, + self::HTTP_METHOD_POST, + $attributeSetData + ); + + $simpleProduct1Data = $this->getProductApiData('simple', $categoryId); + array_push( + $simpleProduct1Data['custom_attributes'], + [ + 'attribute_code' => $attribute->attribute_code, + 'value' => $options[1]->value + ] + ); + $simpleProduct1Id = $this->sendRestRequest( + self::$productEndpoint, + self::HTTP_METHOD_POST, + ['product' => $simpleProduct1Data] + )->id; + + $simpleProduct2Data = $this->getProductApiData('simple', $categoryId); + array_push( + $simpleProduct2Data['custom_attributes'], + [ + 'attribute_code' => $attribute->attribute_code, + 'value' => $options[2]->value + ] + ); + $simpleProduct2Id = $this->sendRestRequest( + self::$productEndpoint, + self::HTTP_METHOD_POST, + ['product' => $simpleProduct2Data] + )->id; + + $tAttributes[] = [ + 'id' => $attribute->attribute_id, + 'code' => $attribute->attribute_code + ]; + + $tOptions = [ + intval($options[1]->value), + intval($options[2]->value) + ]; + + $configOptions = $this->getConfigurableProductOptionsApiData($tAttributes, $tOptions); + + $configurableProductData = $this->getConfigurableProductApiData( + $configOptions, + [$simpleProduct1Id, $simpleProduct2Id], + $configurableProductData + ); + + $configurableProductData = $this->sendRestRequest( + self::$productEndpoint . '/' . $configurableProductData['sku'], + self::HTTP_METHOD_PUT, + ['product' => $configurableProductData] + ); + return $configurableProductData; + } + + /** + * Create a product attribute in Magento. + * + * @param string $code + * @return array|mixed + * @part json + * @part xml + */ + public function requireProductAttribute($code = 'attribute') + { + $attributeData = $this->getProductAttributeApiData($code); + $attributeData = $this->sendRestRequest( + self::$productAttributesEndpoint, + self::HTTP_METHOD_POST, + $attributeData + ); + return $attributeData; + } + + /** + * Create a customer in Magento. + * + * @param array $customerData + * @param string $password + * @return array|mixed + * @part json + * @part xml + */ + public function requireCustomer(array $customerData = [], $password = '123123qW') + { + if (!$customerData) { + $customerData = $this->getCustomerApiData(); + } + $customerData = $this->getCustomerApiDataWithPassword($customerData, $password); + $customerData = $this->sendRestRequest( + self::$customersEndpoint, + self::HTTP_METHOD_POST, + $customerData + ); + return $customerData; + } + + /** + * Get category api data. + * + * @param array $categoryData + * @return array + * @part json + * @part xml + */ + public function getCategoryApiData($categoryData = []) + { + $faker = \Faker\Factory::create(); + $sq = sqs(); + return array_replace_recursive( + [ + 'parent_id' => '2', + 'name' => 'category' . $sq, + 'is_active' => true, + 'include_in_menu' => true, + 'available_sort_by' => ['position', 'name'], + 'custom_attributes' => [ + ['attribute_code' => 'url_key', 'value' => 'category' . $sq], + ['attribute_code' => 'description', 'value' => $faker->text(20)], + ['attribute_code' => 'meta_title', 'value' => $faker->text(20)], + ['attribute_code' => 'meta_keywords', 'value' => $faker->text(20)], + ['attribute_code' => 'meta_description', 'value' => $faker->text(20)], + ['attribute_code' => 'display_mode', 'value' => 'PRODUCTS'], + ['attribute_code' => 'landing_page', 'value' => ''], + ['attribute_code' => 'is_anchor', 'value' => '0'], + ['attribute_code' => 'custom_use_parent_settings', 'value' => '0'], + ['attribute_code' => 'custom_apply_to_products', 'value' => '0'], + ['attribute_code' => 'custom_design', 'value' => ''], + ['attribute_code' => 'page_layout', 'value' => ''], + ['attribute_code' => 'custom_design_to', 'value' => $faker->date($format = 'm/d/Y')], + ['attribute_code' => 'custom_design_from', 'value' => $faker->date($format = 'm/d/Y', $max = 'now')] + ] + ], + $categoryData + ); + } + + /** + * Get simple product api data. + * + * @param string $type + * @param integer $categoryId + * @param array $productData + * @return array + * @part json + * @part xml + */ + public function getProductApiData($type = 'simple', $categoryId = 0, $productData = []) + { + $faker = \Faker\Factory::create(); + $sq = sqs(); + return array_replace_recursive( + [ + 'sku' => $type . '_product_sku' . $sq, + 'name' => $type . '_product' . $sq, + 'visibility' => 4, + 'type_id' => $type, + 'price' => $faker->randomFloat(2, 1), + 'status' => 1, + 'attribute_set_id' => 4, + 'extension_attributes' => [ + 'stock_item' => ['is_in_stock' => 1, 'qty' => $faker->numberBetween(100, 9000)] + ], + 'custom_attributes' => [ + ['attribute_code' => 'url_key', 'value' => $type . '_product' . $sq], + ['attribute_code' => 'tax_class_id', 'value' => 2], + ['attribute_code' => 'category_ids', 'value' => $categoryId], + ], + ], + $productData + ); + } + + /** + * Get Customer Api data. + * + * @param array $customerData + * @return array + * @part json + * @part xml + */ + public function getCustomerApiData($customerData = []) + { + $faker = \Faker\Factory::create(); + return array_replace_recursive( + [ + 'firstname' => $faker->firstName, + 'middlename' => $faker->firstName, + 'lastname' => $faker->lastName, + 'email' => $faker->email, + 'gender' => rand(0, 1), + 'group_id' => 1, + 'store_id' => 1, + 'website_id' => 1, + 'custom_attributes' => [ + [ + 'attribute_code' => 'disable_auto_group_change', + 'value' => '0', + ], + ], + ], + $customerData + ); + } + + /** + * Get customer data including password. + * + * @param array $customerData + * @param string $password + * @return array + * @part json + * @part xml + */ + public function getCustomerApiDataWithPassword($customerData = [], $password = '123123qW') + { + return ['customer' => self::getCustomerApiData($customerData), 'password' => $password]; + } + + /** + * @param string $code + * @param array $attributeData + * @return array + * @part json + * @part xml + */ + public function getProductAttributeApiData($code = 'attribute', $attributeData = []) + { + $sq = sqs(); + return array_replace_recursive( + [ + 'attribute' => [ + 'attribute_code' => $code . $sq, + 'frontend_labels' => [ + [ + 'store_id' => 0, + 'label' => $code . $sq + ], + ], + 'is_required' => false, + 'is_unique' => false, + 'is_visible' => true, + 'scope' => 'global', + 'default_value' => '', + 'frontend_input' => 'select', + 'is_visible_on_front' => true, + 'is_searchable' => true, + 'is_visible_in_advanced_search' => true, + 'is_filterable' => true, + 'is_filterable_in_search' => true, + //'is_used_in_grid' => true, + //'is_visible_in_grid' => true, + //'is_filterable_in_grid' => true, + 'used_in_product_listing' => true, + 'is_used_for_promo_rules' => true, + 'options' => [ + [ + 'label' => 'option1', + 'value' => '', + 'sort_order' => 0, + 'is_default' => true, + 'store_labels' => [ + [ + 'store_id' => 0, + 'label' => 'option1' + ], + [ + 'store_id' => 1, + 'label' => 'option1' + ] + ] + ], + [ + 'label' => 'option2', + 'value' => '', + 'sort_order' => 1, + 'is_default' => false, + 'store_labels' => [ + [ + 'store_id' => 0, + 'label' => 'option2' + ], + [ + 'store_id' => 1, + 'label' => 'option2' + ] + ] + ] + ] + ], + ], + $attributeData + ); + } + + /** + * @param array $attributes + * @param array $optionIds + * @return array + * @part json + * @part xml + */ + public function getConfigurableProductOptionsApiData($attributes, $optionIds) + { + $configurableProductOptions = []; + foreach ($attributes as $attribute) { + $attributeItem = [ + 'attribute_id' => (string)$attribute['id'], + 'label' => $attribute['code'], + 'values' => [] + ]; + foreach ($optionIds as $optionId) { + $attributeItem['values'][] = ['value_index' => $optionId]; + } + $configurableProductOptions [] = $attributeItem; + } + return $configurableProductOptions; + } + + /** + * @param array $configurableProductOptions + * @param array $childProductIds + * @param array $configurableProduct + * @param int $categoryId + * @return array + * @part json + * @part xml + */ + public function getConfigurableProductApiData( + array $configurableProductOptions, + array $childProductIds, + array $configurableProduct = [], + int $categoryId = 0 + ) { + if (!$configurableProduct) { + $configurableProduct = $this->getProductApiData('configurable', $categoryId); + } + $configurableProduct = array_merge_recursive( + $configurableProduct, + [ + 'extension_attributes' => [ + 'configurable_product_options' => $configurableProductOptions, + 'configurable_product_links' => $childProductIds, + ], + ] + ); + return $configurableProduct; + } + + /** + * @param $attributeCode + * @param int $attributeSetId + * @param int $attributeGroupId + * @return array + * @part json + * @part xml + */ + public function getAssignAttributeToAttributeSetApiData( + $attributeCode, + int $attributeSetId = 4, + int $attributeGroupId = 7 + ) { + return [ + 'attributeSetId' => $attributeSetId, + 'attributeGroupId' => $attributeGroupId, + 'attributeCode' => $attributeCode, + 'sortOrder' => 0 + ]; + } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php index f4405cdd9..69f6c386c 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php @@ -15,7 +15,6 @@ class AdminProductPage extends AbstractAdminPage */ public static $productAddProductButton = '#add_new_product-button'; public static $productSaveButton = '#save-button'; - public static $createConfigurationsButton = 'button[data-index=create_configurable_products_button]'; /** * Product data fields. @@ -33,6 +32,7 @@ class AdminProductPage extends AbstractAdminPage public static $producCategoriesMultiSelect = '.admin__field[data-index=category_ids]'; public static $producCategoriesMultiSelectText = '.admin__field[data-index=category_ids] .admin__action-multiselect-crumb:nth-child(%s)>span'; + public static $productCountryOfManufacture = '.admin__field[data-index=country_of_manufacture] select'; /** * Product form loading spinner. @@ -190,11 +190,4 @@ public function addBasicProductUnderCategory($productData, $categoryData) self::saveProduct(); } - - public function clickCreateConfigurationsButton() - { - $I = $this->acceptanceTester; - $I->performOn(self::$createConfigurationsButton, ['click' => self::$createConfigurationsButton]); - $I->waitForPageLoad(); - } } diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php index d7855571f..6e1c5c15e 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php @@ -5,6 +5,7 @@ use Facebook\WebDriver\Remote\RemoteWebDriver; use Facebook\WebDriver\WebDriverBy; use Facebook\WebDriver\Exception\WebDriverException; +use Codeception\Exception\ElementNotFound; class StorefrontCategoryPage extends AbstractFrontendPage { @@ -50,14 +51,14 @@ public function seeProductLinksInPage($name, $link) { $this->goToPageForProduct($name); $I = $this->acceptanceTester; - $I->seeElement(sprintf(self::$productLinks, $link)); + $I->canSeeElement(sprintf(self::$productLinks, $link)); } public function seeProductNameInPage($name) { $this->goToPageForProduct($name); $I = $this->acceptanceTester; - $I->seeElement(sprintf(self::$productName, $name)); + $I->canSeeElement(sprintf(self::$productName, $name)); } public function seeProductPriceInPage($name, $price) @@ -83,7 +84,8 @@ public function goToPageForProduct($name) try { $I->click(self::$pageNextButton); $I->waitForPageLoad(); - } catch (WebDriverException $e) { + } catch (ElementNotFound $e) { + break; } } } while (true); diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php index 66ea873ef..1f8073b08 100644 --- a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php @@ -20,10 +20,10 @@ class StorefrontProductPage extends AbstractFrontendPage */ public static $productOptionsDropDown = '#product-options-wrapper .super-attribute-select'; - public function amOnProductPage($categoryUrlKey) + public function amOnProductPage($productUrlKey) { $I = $this->acceptanceTester; - $I->amOnPage(self::route($categoryUrlKey . '.html')); + $I->amOnPage(self::route($productUrlKey . '.html')); $I->waitForPageLoad(); } diff --git a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php deleted file mode 100644 index 71e055a9b..000000000 --- a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/CategoryApiStep.php +++ /dev/null @@ -1,37 +0,0 @@ -amAdminTokenAuthenticated(); - $I->sendPOST($this->endpoint, $params); - $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - return $I->grabDataFromResponseByJsonPath('$.id')[0]; - } - - /** - * Get Magento Category Data by REST API. - * - * @param string $id - * @return string - */ - public function getCategory($id) - { - $I = $this; - $I->amAdminTokenAuthenticated(); - $I->sendGET($this->endpoint . "/$id"); - $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - return $I->grabResponse(); - } -} diff --git a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/ProductApiStep.php b/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/ProductApiStep.php deleted file mode 100644 index a1b97d54c..000000000 --- a/tests/_support/Magento/Xxyyzz/Step/Catalog/Api/ProductApiStep.php +++ /dev/null @@ -1,37 +0,0 @@ -amAdminTokenAuthenticated(); - $I->sendPOST($this->endpoint, $params); - $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - return $I->grabDataFromResponseByJsonPath('$.id')[0]; - } - - /** - * Get Magento Product Data by REST API. - * - * @param string $sku - * @return string - */ - public function getProduct($sku) - { - $I = $this; - $I->amAdminTokenAuthenticated(); - $I->sendGET($this->endpoint . "/$sku"); - $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - return $I->grabDataFromResponseByJsonPath('$..*'); - } -} diff --git a/tests/_support/Magento/Xxyyzz/Step/Customer/Api/CustomerApiStep.php b/tests/_support/Magento/Xxyyzz/Step/Customer/Api/CustomerApiStep.php deleted file mode 100644 index 46b2240ab..000000000 --- a/tests/_support/Magento/Xxyyzz/Step/Customer/Api/CustomerApiStep.php +++ /dev/null @@ -1,22 +0,0 @@ -amAdminTokenAuthenticated(); - $I->sendPOST($this->endpoint, $params); - $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - return $I->grabDataFromResponseByJsonPath('$.id')[0]; - } -} diff --git a/tests/acceptance.suite.dist.yml b/tests/acceptance.suite.dist.yml index fb04d8b95..2640da5cf 100644 --- a/tests/acceptance.suite.dist.yml +++ b/tests/acceptance.suite.dist.yml @@ -10,13 +10,14 @@ modules: enabled: - \Magento\Xxyyzz\Module\MagentoWebDriver - \Magento\Xxyyzz\Helper\Acceptance + - \Magento\Xxyyzz\Helper\MagentoFakerData - \Magento\Xxyyzz\Module\MagentoRESTDriver: url: "%MAGENTO_BASE_URL%/rest/default/V1/" username: "%MAGENTO_ADMIN_USERNAME%" password: "%MAGENTO_ADMIN_PASSWORD%" depends: PhpBrowser part: Json - - \Magento\Xxyyzz\Module\MagentoFakerData + - Sequence - Asserts config: \Magento\Xxyyzz\Module\MagentoWebDriver: From 3bfa1088360400b94fd82b4ed89bed2d7f7fc339 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 4 May 2017 10:15:04 -0500 Subject: [PATCH 068/149] Updating the README file: - Adding a reference to the new Robo command to clone all of the necessary .dist. files. - Moved the step for "composer install" to the top of the page so they can use the Robo command I added to clone the files. - Adding a list of the current Test Groups that we have listed in the Test Suite. These names are still a work in progress. (cherry picked from commit 268920d) --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 921e55f2e..1376fb539 100755 --- a/README.md +++ b/README.md @@ -1,14 +1,23 @@ # Welcome to the example of Codeception + Robo + Allure! + ### Prerequisites * **Codeception**, **Allure** and **Robo** are PHP based applications installed via **Composer**, so you will need to have **Composer** installed in order to run the following. Please visit the [Composer](https://getcomposer.org/) homepage for installation instructions. * Some settings need to be adjusted to meet the build environment settings in the appropriate `XXX.suite.yml` file in the `[PROJECT_ROOT]/tests/` directory: `[PROJECT_ROOT]/tests/XXXXXXX.suite.yml` -### Configuration -* Create .env file by copying existing .env.example file at project root directory. +### Installation +* Open a Terminal Window. CD to the Project Directory. Run the following command to install the project dependencies: + ``` + cd [LOCATION_OF_GITHUB_REPO] + composer install + ``` + +### Configuration +* In order to adjust the settings for the Framework you will need to copy the `.dist.` settings files and make your adjustments based on your unique Setup. These files are listed in the `.gitignore` file so they will only effect your Setup. You can run the following Robo command to copy the necassary files or follow the [Optional] instructions listed below. ``` - cp .env.example .env + robo clone:files ``` -* Configure the following environment variables according to Magento application being tested. + +* Configure the following `.env` variables according to the Magento application being tested. ``` MAGENTO_BASE_URL=http://magento.loc/index.php @@ -20,24 +29,29 @@ DB_USERNAME='' DB_PASSWORD='' ``` -* **[Optional]** If you wish to customize entire test suite locally, you can create codeception.yml by copying existing codeception.dist.yml, and make change in codeception.yml. - ``` - cp codeception.dist.yml codeception.yml - ``` -* **[Optional]** If you wish to customize acceptance test suite locally, you can create acceptance.suite.yml by copying existing acceptance.suite.dist.yml, and make change in acceptance.suite.yml. - ``` - cp acceptance.suite.dist.yml acceptance.suite.yml - ``` + + * **[Optional]** Create .env file by copying existing .env.example file at project root directory. + + ``` + cp .env.example .env + ``` + + * **[Optional]** If you wish to customize entire test suite locally, you can create codeception.yml by copying existing codeception.dist.yml, and make change in codeception.yml. + ``` + cp codeception.dist.yml codeception.yml + ``` + + * **[Optional]** If you wish to customize acceptance test suite locally, you can create acceptance.suite.yml by copying existing acceptance.suite.dist.yml, and make change in acceptance.suite.yml. + ``` + cp acceptance.suite.dist.yml acceptance.suite.yml + ``` + ### Running the Tests -* Open a Terminal Window. CD to the Project Directory. Run the following command to install the project dependencies: - ``` - cd [LOCATION_OF_GITHUB_REPO] - composer install - ``` * Build the project: ``` vendor/bin/codecept build ``` + * **You will need to install Allure's CLI tool to generate the reports, please visit this page for instructions**: http://wiki.qatools.ru/display/AL/Allure+Commandline. * Next you will need to start a Selenium server so we can run the tests (This will vary based on your local setup). @@ -49,11 +63,13 @@ ``` robo test ``` + * To kick off some example tests with 2 test cases run the following command: ``` robo example ``` + ### Testing using Robo * You can run the following test suites using robo: @@ -69,7 +85,6 @@ * Generate a report and open it: `robo allure:report` ### Testing Environments - * You can run a subset of Tests by editing a command in the file `RoboFile.php` or by running `codecept` directly: ```codecept run --env chrome``` @@ -79,6 +94,26 @@ ```codecept run --env phantomjs``` ```codecept run --env chrome --group slow``` + +### Testing Groups +* You can run or exclude subsets of Tests using the `--group` and `--skip-group` codeception flags in the Terminal (IF you add the `@env` tag to a Test you HAVE to include the `--env ZZZZ` flag in your `codecept` command): + * ```codecept run acceptance --env ZZZZ --group XXXX --skip-group YYYY``` + * *skip* + * *slow* + * *example* + * *sample* + * *admin-direct-access* + * *nav-menu-access* + * *sampleData* + * *nav-menu* + * *add* + * *fields* + * *catalog* + * *configurable* + * *customer* + * *sales* + * *orders* + ### RoboFile.php * Edit the following command to change the Tests that the command `robo test` executes: @@ -86,6 +121,7 @@ ``` $this->_exec('codecept run --env chrome'); ``` + ### TROUBLESHOOTING * TimeZone Error - http://stackoverflow.com/questions/18768276/codeception-datetime-error * TimeZone List - http://php.net/manual/en/timezones.america.php From 61d7271389e72a034c4d909fcd6a4d0cdbffa20e Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 9 May 2017 14:04:25 -0500 Subject: [PATCH 069/149] MTA-4154: Added update configurable product test; Updated existing tests to use the abstract MagentoRestDriver api methods. --- .../AdminConfigurableProductPage.php | 133 ++++++++++- .../Catalog/CreateSimpleProductCest.php | 11 +- .../Catalog/UpdateSimpleProductCest.php | 27 +-- .../CreateConfigurableProductCest.php | 17 +- .../UpdateConfigurableProductCest.php | 220 ++++++++++++++++++ .../Customer/SignInCustomerFrontendCest.php | 10 +- 6 files changed, 366 insertions(+), 52 deletions(-) create mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php diff --git a/tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php b/tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php index af0a7d1c1..bbed8a98e 100644 --- a/tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php +++ b/tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php @@ -8,6 +8,13 @@ class AdminConfigurableProductPage extends AdminProductPage { + /** + * Configurations collapsible sections + */ + public static $createConfigurationsButton = 'button[data-index=create_configurable_products_button]'; + public static $editConfigurationsButton = 'button[data-index=create_configurable_products_button]'; + public static $addProductsManuallyButton = 'button[data-index=add_products_manually_button]'; + /** * Configurable product step wizard form. */ @@ -24,14 +31,18 @@ class AdminConfigurableProductPage extends AdminProductPage /** * Page 2 */ - public static $attributeSelectAllButton = 'div[data-attribute-title=%s] .action-select-all.action-tertiary'; - public static $attributeDeSelectAllButton = 'div[data-attribute-title=%s] .action-deselect-all.action-tertiary'; - public static $attributeCreateNewValueButton = 'div[data-attribute-title=%s] button[data-action=addOption]'; - public static $newAttributeOptionText = 'div[data-attribute-title=%s] li[data-attribute-option-title=""] input[type=text]'; - public static $newAttributeOptionSave = 'div[data-attribute-title=%s] li[data-attribute-option-title=""] button[data-action=save]'; - public static $newAttributeOptionRemove = 'div[data-attribute-title=%s] li[data-attribute-option-title=""] button[data-action=remove]'; - public static $attributeOption = 'div[data-attribute-title=%s] li[data-attribute-option-title=%s]'; - public static $attributeOptionCheckbox = 'div[data-attribute-title=%s] li[data-attribute-option-title=%s] .admin__control-checkbox'; + public static $attributeSelectAllButton = 'div[data-attribute-title="%s"] .action-select-all.action-tertiary'; + public static $attributeDeSelectAllButton = 'div[data-attribute-title="%s"] .action-deselect-all.action-tertiary'; + public static $attributeCreateNewValueButton = 'div[data-attribute-title="%s"] button[data-action=addOption]'; + public static $newAttributeOptionText + = 'div[data-attribute-title="%s"] li[data-attribute-option-title=""] input[type=text]'; + public static $newAttributeOptionSave + = 'div[data-attribute-title="%s"] li[data-attribute-option-title=""] button[data-action=save]'; + public static $newAttributeOptionRemove + = 'div[data-attribute-title="%s"] li[data-attribute-option-title=""] button[data-action=remove]'; + public static $attributeOption = 'div[data-attribute-title="%s"] li[data-attribute-option-title="%s"]'; + public static $attributeOptionCheckbox + = 'div[data-attribute-title="%s"] li[data-attribute-option-title="%s"] .admin__control-checkbox'; /** * Page 3 @@ -54,9 +65,31 @@ class AdminConfigurableProductPage extends AdminProductPage public static $applyUniqueQuantityField = '#apply-qty-input-%s'; public static $skipQuantityRadioButton = '#skip-inventory-radio'; + /** + * Configurable Product Variations Grid + */ public static $configurableVariationsGrid = '.admin__dynamic-rows.data-grid'; private static $lastConfigurableVariation = '.admin__dynamic-rows.data-grid tbody>tr:last-child'; + /** + * Choose Affected Attribute Set Modal Popup + */ + public static $affectedAttributeSetModalPopup + = '.product_form_product_form_configurable_attribute_set_handler_modal._show'; + public static $affectedAttributeSetCurrentRadioButton + = '.product_form_product_form_configurable_attribute_set_handler_modal._show ' + . 'input[data-index=affectedAttributeSetCurrent]'; + public static $affectedAttributeSetNewRadioButton + = '.product_form_product_form_configurable_attribute_set_handler_modal._show ' + . 'input[data-index=affectedAttributeSetNew]'; + public static $affectedAttributeSetNewAttributeNameField + = '.product_form_product_form_configurable_attribute_set_handler_modal._show' + . ' div[data-index=configurableNewAttributeSetName] input'; + public static $affectedAttributeSetExistingRadioButton + = '.product_form_product_form_configurable_attribute_set_handler_modal._show ' + . 'input[data-index=affectedAttributeSetExisting]'; + public static $affectedAttributeSetConfirmButton = 'button[data-index=confirm_button]'; + /** * @var AdminGridPage */ @@ -87,6 +120,30 @@ public function checkCheckboxInCurrentNthRow(int $n) self::$configurableAttributesGrid->checkCheckboxInCurrentNthRow($n); } + public function clickCreateConfigurationsButton() + { + $I = $this->acceptanceTester; + $I->scrollTo(self::$productCountryOfManufacture); + $I->click(self::$createConfigurationsButton); + $I->waitForElementVisible(self::$createProductConfigurationsForm, $this->pageLoadTimeout); + } + + public function clickEditConfigurationsButton() + { + $I = $this->acceptanceTester; + $I->scrollTo(self::$productCountryOfManufacture); + $I->click(self::$editConfigurationsButton); + $I->waitForElementVisible(self::$createProductConfigurationsForm, $this->pageLoadTimeout); + } + + public function clickAddProductsManuallyButton() + { + $I = $this->acceptanceTester; + $I->scrollTo(self::$productCountryOfManufacture); + $I->click(self::$addProductsManuallyButton); + $I->waitForElementVisible(self::$createProductConfigurationsForm, $this->pageLoadTimeout); + } + public function clickNextButton() { $I = $this->acceptanceTester; @@ -298,6 +355,66 @@ public function assertNumberOfConfigurableVariations(int $number) $I->assertEquals($number, intval($this->getIndexForLastConfigurableVariation())+1); } + public function saveProduct($attributeSetOption = 'current', $newAttributeName = '') + { + parent::saveProduct(); + $I = $this->acceptanceTester; + try { + $I->seeElement(self::$affectedAttributeSetModalPopup); + switch ($attributeSetOption) { + case 'new': + $this->clickAffectedAttributeSetNewRadioButton(); + $this->fillFieldAffectedAttributeSetNewAttributeName($newAttributeName); + break; + case 'existing': + $this->clickAffectedAttributeSetExistingRadioButton(); + break; + case 'current': + default: + //TODO: handle this radiobutton + //$this->clickAffectedAttributeSetCurrentRadioButton(); //default + break; + } + $this->clickAffectedAttributeSetConfirmButton(); + } catch (\PHPUnit_Framework_AssertionFailedError $e) { + } + } + + public function clickAffectedAttributeSetCurrentRadioButton() + { + $I = $this->acceptanceTester; + $I->selectOption(self::$affectedAttributeSetCurrentRadioButton, 'current'); + $I->waitForPageLoad(); + } + + public function clickAffectedAttributeSetNewRadioButton() + { + $I = $this->acceptanceTester; + $I->selectOption(self::$affectedAttributeSetNewRadioButton, 'new'); + $I->waitForPageLoad(); + } + + public function fillFieldAffectedAttributeSetNewAttributeName($attributeName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$affectedAttributeSetNewAttributeNameField, $attributeName); + $I->waitForPageLoad(); + } + + public function clickAffectedAttributeSetExistingRadioButton() + { + $I = $this->acceptanceTester; + $I->selectOption(self::$affectedAttributeSetExistingRadioButton, 'new'); + $I->waitForPageLoad(); + } + + public function clickAffectedAttributeSetConfirmButton() + { + $I = $this->acceptanceTester; + $I->click(self::$affectedAttributeSetConfirmButton); + $I->waitForPageLoad(); + } + private function getIndexForLastConfigurableVariation() { $I = $this->acceptanceTester; diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php index 86bff86b6..1d67779e3 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php @@ -6,7 +6,6 @@ use Magento\Xxyyzz\Page\Catalog\AdminProductPage; use Magento\Xxyyzz\Page\Catalog\StorefrontCategoryPage; use Magento\Xxyyzz\Page\Catalog\StorefrontProductPage; -use Magento\Xxyyzz\Step\Catalog\Api\CategoryApiStep; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Title; @@ -42,23 +41,21 @@ class CreateSimpleProductCest */ protected $product; - public function _before(AdminStep $I, CategoryApiStep $api) + public function _before(AdminStep $I) { $I->loginAsAdmin(); $I->goToTheAdminCatalogPage(); - $this->category = $I->getCategoryApiData(); - $api->amAdminTokenAuthenticated(); - $this->category = array_merge($this->category, ['id' => $api->createCategory(['category' => $this->category])]); + $this->category['id'] = $I->requireCategory($this->category)->id; $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - $this->product = $I->getProductApiData(); + $this->product = $I->getProductApiData('simple', $this->category['id']); + $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { $this->product['stock_status'] = 'In Stock'; $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; } else { $this->product['stock_status'] = 'Out of Stock'; } - $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; } public function _after(AdminStep $I) diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index df423889d..243069a7d 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -2,8 +2,6 @@ namespace Magento\Xxyyzz\Acceptance\Catalog; use Magento\Xxyyzz\Step\Backend\AdminStep; -use Magento\Xxyyzz\Step\Catalog\Api\CategoryApiStep; -use Magento\Xxyyzz\Step\Catalog\Api\ProductApiStep; use Magento\Xxyyzz\Page\Catalog\AdminProductGridPage; use Magento\Xxyyzz\Page\Catalog\AdminProductPage; use Magento\Xxyyzz\Page\Catalog\StorefrontCategoryPage; @@ -44,34 +42,24 @@ class UpdateSimpleProductCest /** * @param AdminStep $I - * @param CategoryApiStep $categoryApi - * @param ProductApiStep $productApi */ - public function _before(AdminStep $I, CategoryApiStep $categoryApi, ProductApiStep $productApi) + public function _before(AdminStep $I) { $I->loginAsAdmin(); - $I->goToTheAdminCatalogPage(); - + $this->category = $I->getCategoryApiData(); - $categoryApi->amAdminTokenAuthenticated(); - $this->category = array_merge( - $this->category, - ['id' => $categoryApi->createCategory(['category' => $this->category])] - ); + $this->category['id'] = $I->requireCategory($this->category)->id; $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; + $this->product = $I->getProductApiData('simple', $this->category['id']); - $productApi->amAdminTokenAuthenticated(); - $this->product = array_merge( - $this->product, - ['id' => $productApi->createProduct(['product' => $this->product])] - ); + $this->product['id'] = $I->requireSimpleProduct($this->category['id'], $this->product)->id; + $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { $this->product['stock_status'] = 'In Stock'; $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; } else { $this->product['stock_status'] = 'Out of Stock'; } - $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; } public function _after(AdminStep $I) @@ -108,6 +96,7 @@ public function updateSimpleProductTest( StorefrontProductPage $storefrontProductPage ) { $I->wantTo('update simple product in admin.'); + $adminProductGridPage->amOnAdminProductGridPage(); $adminProductGridPage->searchBySku($this->product['sku']); $adminProductGridPage->seeInCurrentGridNthRow(1, [$this->product['sku']]); @@ -140,7 +129,7 @@ public function updateSimpleProductTest( $I->wantTo('verify simple product data in frontend category page.'); $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); $storefrontCategoryPage->seeProductNameInPage($this->product['name'] . '-updated'); - $storefrontCategoryPage->seeProductPriceInPage($this->product['name'] . '-updated', $this->product['price'] + 10); + $storefrontCategoryPage->seeProductPriceInPage($this->product['name'] . '-updated', $this->product['price']+10); $I->wantTo('verify simple product data in frontend product page.'); $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php index acdb482ad..74a2e871f 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php @@ -4,11 +4,8 @@ use Magento\Xxyyzz\Page\ConfigurableProduct\AdminConfigurableProductPage; use Magento\Xxyyzz\Step\Backend\AdminStep; use Magento\Xxyyzz\Page\Catalog\AdminProductGridPage; -use Magento\Xxyyzz\Page\Catalog\AdminProductPage; use Magento\Xxyyzz\Page\Catalog\StorefrontCategoryPage; use Magento\Xxyyzz\Page\Catalog\StorefrontProductPage; -use Magento\Xxyyzz\Step\Catalog\Api\CategoryApiStep; -use Magento\Xxyyzz\Step\Catalog\Api\ProductApiStep; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Title; @@ -64,24 +61,22 @@ class CreateConfigurableProductCest */ protected $variationQuantity = []; - public function _before(AdminStep $I, CategoryApiStep $categoryApi, ProductApiStep $productApi) + public function _before(AdminStep $I) { $I->loginAsAdmin(); + $this->category = $I->getCategoryApiData(); - $categoryApi->amAdminTokenAuthenticated(); - $this->category = array_merge( - $this->category, - ['id' => $categoryApi->createCategory(['category' => $this->category])] - ); + $this->category['id'] = $I->requireCategory($this->category)->id; $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; + $this->product = $I->getProductApiData('configurable', $this->category['id']); + $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { $this->product['stock_status'] = 'In Stock'; $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; } else { $this->product['stock_status'] = 'Out of Stock'; } - $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; $this->productVariations = [ [ @@ -116,7 +111,7 @@ public function _before(AdminStep $I, CategoryApiStep $categoryApi, ProductApiSt public function _after(AdminStep $I) { - //$I->goToTheAdminLogoutPage(); + $I->goToTheAdminLogoutPage(); } /** diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php new file mode 100644 index 000000000..98eb5ae3e --- /dev/null +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php @@ -0,0 +1,220 @@ +loginAsAdmin(); + + $this->category = $I->getCategoryApiData(); + $this->category['id'] = $I->requireCategory($this->category)->id; + $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; + + $this->product = $I->getProductApiData('configurable', $this->category['id']); + $this->product['id'] = ($I->requireConfigurableProduct($this->category['id'], $this->product))->id; + $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; + if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { + $this->product['stock_status'] = 'In Stock'; + $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; + } else { + $this->product['stock_status'] = 'Out of Stock'; + } + + $this->attribute = $I->requireProductAttribute(); + + $this->productVariations = [ + [ + 'attribute_code' => $this->attribute->attribute_code, + 'attribute_value' => $this->attribute->options[1]->label . '_updated', + 'sku' => $this->product['sku'] . '_updated-' . $this->attribute->options[1]->label . '_updated', + 'price' => '11.11', + 'qty' => $this->product['qty'], + ], + [ + 'attribute_code' => $this->attribute->attribute_code, + 'attribute_value' => $this->attribute->options[2]->label . '_updated', + 'sku' => $this->product['sku'] . '_updated-' . $this->attribute->options[2]->label . '_updated', + 'price' => '22.22', + 'qty' => $this->product['qty'], + ] + ]; + + for ($c = 0; $c < count($this->productVariations); $c++) { + $this->variationPrice[$c] = $this->productVariations[$c]['price']; + $this->variationQuantity[$c] = $this->productVariations[$c]['qty']; + $this->attributeValues[$c] = $this->productVariations[$c]['attribute_value']; + } + } + + public function _after(AdminStep $I) + { + $I->goToTheAdminLogoutPage(); + } + + /** + * Allure annotations + * @Title("Update a configurable product and verify on the storefront") + * @Description("Update a configurable product and verify on the storefront.") + * @TestCaseId("") + * @Severity(level = SeverityLevel::CRITICAL) + * @Parameter(name = "AdminStep", value = "$I") + * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") + * @Parameter(name = "AdminConfigurableProductPage", value = "$adminConfigurableProductPage") + * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") + * @Parameter(name = "StorefrontProductPage", value = "$storefrontProductPage") + * + * @param AdminStep $I + * @param AdminProductGridPage $adminProductGridPage + * @param AdminConfigurableProductPage $adminConfigurableProductPage + * @param StorefrontCategoryPage $storefrontCategoryPage + * @param StorefrontProductPage $storefrontProductPage + * @return void + */ + public function createConfigurableProductTest( + AdminStep $I, + AdminProductGridPage $adminProductGridPage, + AdminConfigurableProductPage $adminConfigurableProductPage, + StorefrontCategoryPage $storefrontCategoryPage, + StorefrontProductPage $storefrontProductPage + ) { + $I->wantTo('update configurable product in admin.'); + $adminProductGridPage->amOnAdminProductGridPage(); + $adminProductGridPage->searchBySku($this->product['sku']); + $adminProductGridPage->seeInCurrentGridNthRow(1, [$this->product['sku']]); + + $I->wantTo('open product created from precondition.'); + $adminConfigurableProductPage->amOnAdminEditProductPageById($this->product['id']); + + $I->wantTo('update configurable data.'); + $adminConfigurableProductPage->fillFieldProductName($this->product['name'] . '_updated'); + $adminConfigurableProductPage->fillFieldProductSku($this->product['sku'] . '_updated'); + $adminConfigurableProductPage->clickEditConfigurationsButton(); + + $I->wantTo('on Create Product Configurations Wizard - Select Attributes...'); + $adminConfigurableProductPage->filterAndSelectAttributeByCode( + strtolower($this->productVariations[0]['attribute_code']) + ); + $adminConfigurableProductPage->checkCheckboxInCurrentNthRow(1); + $adminConfigurableProductPage->clickNextButton(); + + $I->wantTo('on Create Product Configurations Wizard - Attributes Values...'); + for ($c = 0; $c < count($this->productVariations); $c++) { + $adminConfigurableProductPage->checkAndSelectAttributeOption( + $this->productVariations[$c]['attribute_code'], + $this->productVariations[$c]['attribute_value'] + ); + } + $adminConfigurableProductPage->clickNextButton(); + + $I->wantTo('on Create Product Configurations Wizard - Bulk Images, Price and Quantity...'); + $adminConfigurableProductPage->clickApplyUniquePriceRadioButton(); + $adminConfigurableProductPage->selectAttributeToApplyUniquePrice( + $this->productVariations[0]['attribute_code'] + ); + $adminConfigurableProductPage->fillFieldWithUniquePrice($this->variationPrice); + $adminConfigurableProductPage->clickApplySingleQuantityRadioButton(); + $adminConfigurableProductPage->fillFieldApplySingleQuantity($this->variationQuantity[0]); + $adminConfigurableProductPage->clickNextButton(); + + $I->wantTo('on Create Product Configurations Wizard - Summary...'); + $I->wantTo('generate configurable products.'); + $adminConfigurableProductPage->clickNextButton(); + + $I->wantTo('see configurable product successfully saved message.'); + $adminConfigurableProductPage->saveProduct(); + $I->seeElement($adminConfigurableProductPage::$successMessage); + + $I->wantTo('see updated product data.'); + $adminConfigurableProductPage->seeInPageTitle($this->product['name'] . '_updated'); + $adminConfigurableProductPage->seeProductName($this->product['name'] . '_updated'); + $adminConfigurableProductPage->seeProductSku($this->product['sku'] . '_updated'); + + $adminConfigurableProductPage->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); + $adminConfigurableProductPage->assertNumberOfConfigurableVariations(count($this->productVariations)); + foreach ($this->productVariations as $variation) { + $adminConfigurableProductPage->seeInConfigurableVariations($variation); + } + + $I->wantTo('verify configurable product data in frontend category page.'); + $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); + //TODO: need to confirm if the product name should change. + $storefrontCategoryPage->seeProductLinksInPage( + $this->product['name'], + str_replace('_', '-', $this->product['url_key']) + ); + $storefrontCategoryPage->seeProductNameInPage($this->product['name']); + $storefrontCategoryPage->seeProductPriceInPage($this->product['name'], $this->variationPrice[0]); + + $I->wantTo('verify configurable product data in frontend product page.'); + $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); + $storefrontProductPage->seeProductNameInPage($this->product['name']); + $storefrontProductPage->seeProductPriceInPage($this->variationPrice[0]); + $storefrontProductPage->seeProductStockStatusInPage($this->product['stock_status']); + $storefrontProductPage->seeProductSkuInPage($this->productVariations[0]['sku'] . '_updated'); + $storefrontProductPage->seeProductOptions($this->attributeValues); + } +} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php index cc72a4122..67595b9b5 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php @@ -4,7 +4,6 @@ use Magento\Xxyyzz\AcceptanceTester; use Magento\Xxyyzz\Page\Customer\StorefrontCustomerAccountLoginPage; use Magento\Xxyyzz\Page\Customer\StorefrontCustomerAccountDashboardPage; -use Magento\Xxyyzz\Step\Customer\Api\CustomerApiStep; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Features; use Yandex\Allure\Adapter\Annotation\Title; @@ -37,13 +36,10 @@ class SignInCustomerFrontendCest /** * @param AcceptanceTester $I */ - public function _before(AcceptanceTester $I, CustomerApiStep $api) + public function _before(AcceptanceTester $I) { - $this->customer = $I->getCustomerApiDataWithPassword(); - $api->amAdminTokenAuthenticated(); - $this->customer = array_merge($this->customer, ['id' => $api->createCustomer($this->customer)]); - $this->customer = array_merge($this->customer['customer'], $this->customer); - unset($this->customer['customer']); + $this->customer = $I->getCustomerApiData(); + $this->customer['id'] = $I->requireCustomer($this->customer); } /** From 29318a5f84755c3c9b38c9c06cef498d7729dbd1 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 9 May 2017 15:16:31 -0500 Subject: [PATCH 070/149] MTA-4154: Added update group and updated README.md. --- README.md | 3 +++ .../Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php | 1 + .../ConfigurableProduct/UpdateConfigurableProductCest.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1376fb539..846b01788 100755 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ ### Testing Groups * You can run or exclude subsets of Tests using the `--group` and `--skip-group` codeception flags in the Terminal (IF you add the `@env` tag to a Test you HAVE to include the `--env ZZZZ` flag in your `codecept` command): * ```codecept run acceptance --env ZZZZ --group XXXX --skip-group YYYY``` + ##### Base on operation, currently we have groups: * *skip* * *slow* * *example* @@ -107,7 +108,9 @@ * *sampleData* * *nav-menu* * *add* + * *update* * *fields* + ##### Base on Magento module, currently we have groups: * *catalog* * *configurable* * *customer* diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php index 243069a7d..3bef840ac 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php @@ -24,6 +24,7 @@ * * Codeception Annotations * @group catalog + * @group update * @env chrome * @env firefox * @env phantomjs diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php index 98eb5ae3e..e9e2c0f7f 100644 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php +++ b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php @@ -24,7 +24,7 @@ * * Codeception annotations * @group configurable - * @group add + * @group update * @env chrome * @env firefox * @env phantomjs From c6f1260ca47d2cee1602d7e707106d9bac333e97 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 22 May 2017 13:45:58 -0500 Subject: [PATCH 071/149] MTA-4213: prepared to split project into framework and test packages. --- codeception.dist.yml | 4 +- composer.json | 2 +- composer.lock | 308 +++++++++--------- {tests => etc}/_envs/chrome.yml | 0 {tests => etc}/_envs/firefox.yml | 0 {tests => etc}/_envs/phantomjs.yml | 0 .../Magento/Xxyyzz/Helper/Acceptance.php | 0 .../Magento/Xxyyzz/Helper/AdminUrlList.php | 0 .../Xxyyzz/Helper/MagentoFakerData.php | 0 .../Xxyyzz/Module/MagentoRestDriver.php | 0 .../Xxyyzz/Module/MagentoWebDriver.php | 0 .../Magento/Xxyyzz/Page/AbstractAdminPage.php | 0 .../Xxyyzz/Page/AbstractFrontendPage.php | 0 .../Magento/Xxyyzz/Page/AdminGridPage.php | 0 .../Xxyyzz/Page/Backend/AdminLogin.php | 0 .../Page/Backend/AdminSideNavigation.php | 0 .../Xxyyzz/Page/Catalog/AdminCategoryPage.php | 0 .../Page/Catalog/AdminProductGridPage.php | 0 .../Xxyyzz/Page/Catalog/AdminProductPage.php | 0 .../Page/Catalog/StorefrontCategoryPage.php | 0 .../Page/Catalog/StorefrontProductPage.php | 0 .../Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php | 0 .../Magento/Xxyyzz/Page/Cms/AdminCmsPage.php | 0 .../Xxyyzz/Page/Cms/StorefrontCmsPage.php | 0 .../AdminConfigurableProductPage.php | 0 .../Page/Customer/AdminCustomerGrid.php | 0 .../Page/Customer/AdminCustomerPage.php | 0 .../StorefrontCustomerAccountCreatePage.php | 0 ...StorefrontCustomerAccountDashboardPage.php | 0 .../StorefrontCustomerAccountLoginPage.php | 0 .../Xxyyzz/Page/Sales/AdminOrderAddPage.php | 0 .../Page/Sales/AdminOrderDetailsPage.php | 0 .../Xxyyzz/Page/Sales/AdminOrderGrid.php | 0 .../Magento/Xxyyzz/Step/Backend/AdminStep.php | 0 34 files changed, 158 insertions(+), 156 deletions(-) rename {tests => etc}/_envs/chrome.yml (100%) rename {tests => etc}/_envs/firefox.yml (100%) rename {tests => etc}/_envs/phantomjs.yml (100%) rename {tests/_support => src}/Magento/Xxyyzz/Helper/Acceptance.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Helper/AdminUrlList.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Helper/MagentoFakerData.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Module/MagentoRestDriver.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Module/MagentoWebDriver.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/AbstractAdminPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/AbstractFrontendPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/AdminGridPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Backend/AdminLogin.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Cms/StorefrontCmsPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Step/Backend/AdminStep.php (100%) diff --git a/codeception.dist.yml b/codeception.dist.yml index 434f1510f..d678ae324 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -3,8 +3,8 @@ paths: tests: tests log: tests/_output data: tests/_data - support: tests/_support/Magento/Xxyyzz - envs: tests/_envs + support: src/Magento/Xxyyzz + envs: etc/_envs settings: bootstrap: _bootstrap.php colors: true diff --git a/composer.json b/composer.json index e6c01a7b6..bb8010d9b 100755 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "Yandex": "vendor/allure-framework/allure-codeception/src/" }, "psr-4": { - "Magento\\Xxyyzz\\": "tests/_support/Magento/Xxyyzz", + "Magento\\Xxyyzz\\": "src/Magento/Xxyyzz", "Magento\\Xxyyzz\\Acceptance\\": "tests/acceptance/Magento/Xxyyzz/Acceptance" } } diff --git a/composer.lock b/composer.lock index de3f86864..79b1da65b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,6 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], + "hash": "e4c946a9a61310f5664b0cd48a521e0f", "content-hash": "cfaff575db89011a5e0d0f60979dcf01", "packages": [ { @@ -107,7 +108,7 @@ "php", "report" ], - "time": "2016-12-07T12:15:46+00:00" + "time": "2016-12-07 12:15:46" }, { "name": "behat/gherkin", @@ -166,20 +167,20 @@ "gherkin", "parser" ], - "time": "2016-10-30T11:50:56+00:00" + "time": "2016-10-30 11:50:56" }, { "name": "codeception/codeception", - "version": "2.2.10", + "version": "2.2.11", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "c32a3f92834db08ceedb4666ea2265c3aa43396e" + "reference": "a8681b416921ae282ccca2c485d75a3ed6756080" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/c32a3f92834db08ceedb4666ea2265c3aa43396e", - "reference": "c32a3f92834db08ceedb4666ea2265c3aa43396e", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/a8681b416921ae282ccca2c485d75a3ed6756080", + "reference": "a8681b416921ae282ccca2c485d75a3ed6756080", "shasum": "" }, "require": { @@ -190,9 +191,10 @@ "guzzlehttp/guzzle": ">=4.1.4 <7.0", "guzzlehttp/psr7": "~1.0", "php": ">=5.4.0 <8.0", - "phpunit/php-code-coverage": ">=2.2.4 <5.0", + "phpunit/php-code-coverage": ">=2.2.4 <6.0", "phpunit/phpunit": ">4.8.20 <6.0", - "sebastian/comparator": "~1.1", + "phpunit/phpunit-mock-objects": ">2.3 <5.0", + "sebastian/comparator": ">1.1 <3.0", "sebastian/diff": "^1.4", "stecman/symfony-console-completion": "^0.7.0", "symfony/browser-kit": ">=2.7 <4.0", @@ -259,7 +261,7 @@ "functional testing", "unit testing" ], - "time": "2017-03-25T03:19:52+00:00" + "time": "2017-05-11 21:07:05" }, { "name": "consolidation/annotated-command", @@ -311,7 +313,7 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-04-03T22:37:00+00:00" + "time": "2017-04-03 22:37:00" }, { "name": "consolidation/log", @@ -358,20 +360,20 @@ } ], "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", - "time": "2016-03-23T23:46:42+00:00" + "time": "2016-03-23 23:46:42" }, { "name": "consolidation/output-formatters", - "version": "3.1.8", + "version": "3.1.9", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "0b50ba1134d581fd55376f3e21508dab009ced47" + "reference": "2e09069866bae89d3fb545365f997a40745e34d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/0b50ba1134d581fd55376f3e21508dab009ced47", - "reference": "0b50ba1134d581fd55376f3e21508dab009ced47", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/2e09069866bae89d3fb545365f997a40745e34d2", + "reference": "2e09069866bae89d3fb545365f997a40745e34d2", "shasum": "" }, "require": { @@ -388,7 +390,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { @@ -407,7 +409,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-03-01T20:54:45+00:00" + "time": "2017-05-08 15:59:33" }, { "name": "consolidation/robo", @@ -486,7 +488,7 @@ } ], "description": "Modern task runner", - "time": "2017-03-31T18:23:36+00:00" + "time": "2017-03-31 18:23:36" }, { "name": "container-interop/container-interop", @@ -517,7 +519,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14T19:40:03+00:00" + "time": "2017-02-14 19:40:03" }, { "name": "dflydev/dot-access-data", @@ -576,7 +578,7 @@ "dot", "notation" ], - "time": "2017-01-20T21:14:22+00:00" + "time": "2017-01-20 21:14:22" }, { "name": "doctrine/annotations", @@ -644,7 +646,7 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2017-02-24 16:22:25" }, { "name": "doctrine/instantiator", @@ -698,7 +700,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "doctrine/lexer", @@ -752,20 +754,20 @@ "lexer", "parser" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2014-09-09 13:34:57" }, { "name": "facebook/webdriver", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/facebook/php-webdriver.git", - "reference": "3ea034c056189e11c0ce7985332a9f4b5b2b5db2" + "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/3ea034c056189e11c0ce7985332a9f4b5b2b5db2", - "reference": "3ea034c056189e11c0ce7985332a9f4b5b2b5db2", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/eadb0b7a7c3e6578185197fd40158b08c3164c83", + "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83", "shasum": "" }, "require": { @@ -804,7 +806,7 @@ "selenium", "webdriver" ], - "time": "2017-03-22T10:56:03+00:00" + "time": "2017-04-28 14:54:49" }, { "name": "flow/jsonpath", @@ -845,7 +847,7 @@ } ], "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2016-09-06T17:43:18+00:00" + "time": "2016-09-06 17:43:18" }, { "name": "fzaninotto/faker", @@ -893,7 +895,7 @@ "faker", "fixtures" ], - "time": "2016-04-29T12:21:54+00:00" + "time": "2016-04-29 12:21:54" }, { "name": "grasmash/yaml-expander", @@ -941,7 +943,7 @@ } ], "description": "Expands internal property references in a yaml file.", - "time": "2017-03-24T20:31:04+00:00" + "time": "2017-03-24 20:31:04" }, { "name": "guzzlehttp/guzzle", @@ -1003,7 +1005,7 @@ "rest", "web service" ], - "time": "2017-02-28T22:50:30+00:00" + "time": "2017-02-28 22:50:30" }, { "name": "guzzlehttp/promises", @@ -1054,7 +1056,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "time": "2016-12-20 10:07:11" }, { "name": "guzzlehttp/psr7", @@ -1119,7 +1121,7 @@ "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2017-03-20 17:10:46" }, { "name": "jms/metadata", @@ -1170,7 +1172,7 @@ "xml", "yaml" ], - "time": "2016-12-05T10:18:33+00:00" + "time": "2016-12-05 10:18:33" }, { "name": "jms/parser-lib", @@ -1205,20 +1207,20 @@ "Apache2" ], "description": "A library for easily creating recursive-descent parsers.", - "time": "2012-11-18T18:08:43+00:00" + "time": "2012-11-18 18:08:43" }, { "name": "jms/serializer", - "version": "1.6.2", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "b8683d206e7297f54034f67a877f966c14dc12ea" + "reference": "4fad8bbbe76e05de3b79ffa3db027058ed3813ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/b8683d206e7297f54034f67a877f966c14dc12ea", - "reference": "b8683d206e7297f54034f67a877f966c14dc12ea", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/4fad8bbbe76e05de3b79ffa3db027058ed3813ff", + "reference": "4fad8bbbe76e05de3b79ffa3db027058ed3813ff", "shasum": "" }, "require": { @@ -1257,7 +1259,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -1267,7 +1269,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache2" + "Apache-2.0" ], "authors": [ { @@ -1284,20 +1286,20 @@ "serialization", "xml" ], - "time": "2017-04-17T15:27:46+00:00" + "time": "2017-05-15 08:35:42" }, { "name": "league/container", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/thephpleague/container.git", - "reference": "5ec434f4760d83c2a479266b618fb3e3be24c974" + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/5ec434f4760d83c2a479266b618fb3e3be24c974", - "reference": "5ec434f4760d83c2a479266b618fb3e3be24c974", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", "shasum": "" }, "require": { @@ -1349,7 +1351,7 @@ "provider", "service" ], - "time": "2017-03-06T15:24:06+00:00" + "time": "2017-05-10 09:20:27" }, { "name": "moontoast/math", @@ -1398,7 +1400,7 @@ "bcmath", "math" ], - "time": "2017-02-16T16:54:46+00:00" + "time": "2017-02-16 16:54:46" }, { "name": "myclabs/deep-copy", @@ -1440,7 +1442,7 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2017-04-12 18:52:22" }, { "name": "paragonie/random_compat", @@ -1488,7 +1490,7 @@ "pseudorandom", "random" ], - "time": "2017-03-13T16:27:32+00:00" + "time": "2017-03-13 16:27:32" }, { "name": "phpcollection/phpcollection", @@ -1536,7 +1538,7 @@ "sequence", "set" ], - "time": "2015-05-17T12:39:23+00:00" + "time": "2015-05-17 12:39:23" }, { "name": "phpdocumentor/reflection-common", @@ -1590,7 +1592,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", @@ -1635,7 +1637,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2016-09-30 07:12:33" }, { "name": "phpdocumentor/type-resolver", @@ -1682,7 +1684,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2016-11-25 06:54:22" }, { "name": "phpoption/phpoption", @@ -1732,7 +1734,7 @@ "php", "type" ], - "time": "2015-07-25T16:39:46+00:00" + "time": "2015-07-25 16:39:46" }, { "name": "phpspec/prophecy", @@ -1795,7 +1797,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-03-02 20:05:34" }, { "name": "phpunit/php-code-coverage", @@ -1858,7 +1860,7 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2017-04-02 07:44:40" }, { "name": "phpunit/php-file-iterator", @@ -1905,7 +1907,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -1946,7 +1948,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -1995,7 +1997,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -2044,20 +2046,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-02-27 10:12:30" }, { "name": "phpunit/phpunit", - "version": "5.7.19", + "version": "5.7.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "69c4f49ff376af2692bad9cebd883d17ebaa98a1" + "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/69c4f49ff376af2692bad9cebd883d17ebaa98a1", - "reference": "69c4f49ff376af2692bad9cebd883d17ebaa98a1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3cb94a5f8c07a03c8b7527ed7468a2926203f58b", + "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b", "shasum": "" }, "require": { @@ -2075,7 +2077,7 @@ "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "^3.2", "sebastian/comparator": "^1.2.4", - "sebastian/diff": "~1.2", + "sebastian/diff": "^1.4.3", "sebastian/environment": "^1.3.4 || ^2.0", "sebastian/exporter": "~2.0", "sebastian/global-state": "^1.1", @@ -2126,7 +2128,7 @@ "testing", "xunit" ], - "time": "2017-04-03T02:22:27+00:00" + "time": "2017-05-22 07:42:55" }, { "name": "phpunit/phpunit-mock-objects", @@ -2185,7 +2187,7 @@ "mock", "xunit" ], - "time": "2016-12-08T20:27:08+00:00" + "time": "2016-12-08 20:27:08" }, { "name": "psr/container", @@ -2234,7 +2236,7 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2017-02-14 16:28:37" }, { "name": "psr/http-message", @@ -2284,7 +2286,7 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" + "time": "2016-08-06 14:39:51" }, { "name": "psr/log", @@ -2331,7 +2333,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "ramsey/uuid", @@ -2413,7 +2415,7 @@ "identifier", "uuid" ], - "time": "2017-03-26T20:37:53+00:00" + "time": "2017-03-26 20:37:53" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2458,7 +2460,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2017-03-04 06:30:41" }, { "name": "sebastian/comparator", @@ -2522,27 +2524,27 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { @@ -2574,7 +2576,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -2624,7 +2626,7 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2016-11-26 07:53:53" }, { "name": "sebastian/exporter", @@ -2691,7 +2693,7 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2016-11-19 08:54:04" }, { "name": "sebastian/global-state", @@ -2742,7 +2744,7 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/object-enumerator", @@ -2788,7 +2790,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "time": "2017-02-18 15:18:39" }, { "name": "sebastian/recursion-context", @@ -2841,7 +2843,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2016-11-19 07:33:16" }, { "name": "sebastian/resource-operations", @@ -2883,7 +2885,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", @@ -2926,20 +2928,20 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "squizlabs/php_codesniffer", - "version": "2.8.1", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", "shasum": "" }, "require": { @@ -3004,7 +3006,7 @@ "phpcs", "standards" ], - "time": "2017-03-01T22:17:45+00:00" + "time": "2017-05-22 02:43:20" }, { "name": "stecman/symfony-console-completion", @@ -3049,20 +3051,20 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24T05:08:54+00:00" + "time": "2016-02-24 05:08:54" }, { "name": "symfony/browser-kit", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "2fe0caa60c1a1dfeefd0425741182687a9b382b8" + "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/2fe0caa60c1a1dfeefd0425741182687a9b382b8", - "reference": "2fe0caa60c1a1dfeefd0425741182687a9b382b8", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/9fab1ab6f77b77f3df5fc5250fc6956811699b57", + "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57", "shasum": "" }, "require": { @@ -3106,20 +3108,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-02-21T09:12:04+00:00" + "time": "2017-04-12 14:13:17" }, { "name": "symfony/console", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c30243cc51f726812be3551316b109a2f5deaf8d" + "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c30243cc51f726812be3551316b109a2f5deaf8d", - "reference": "c30243cc51f726812be3551316b109a2f5deaf8d", + "url": "https://api.github.com/repos/symfony/console/zipball/a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", + "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", "shasum": "" }, "require": { @@ -3169,20 +3171,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-04-04T14:33:42+00:00" + "time": "2017-04-26 01:39:17" }, { "name": "symfony/css-selector", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c" + "reference": "02983c144038e697c959e6b06ef6666de759ccbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/a48f13dc83c168f1253a5d2a5a4fb46c36244c4c", - "reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/02983c144038e697c959e6b06ef6666de759ccbc", + "reference": "02983c144038e697c959e6b06ef6666de759ccbc", "shasum": "" }, "require": { @@ -3222,20 +3224,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-02-21T09:12:04+00:00" + "time": "2017-05-01 14:55:58" }, { "name": "symfony/debug", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "56f613406446a4a0a031475cfd0a01751de22659" + "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/56f613406446a4a0a031475cfd0a01751de22659", - "reference": "56f613406446a4a0a031475cfd0a01751de22659", + "url": "https://api.github.com/repos/symfony/debug/zipball/fd6eeee656a5a7b384d56f1072243fe1c0e81686", + "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686", "shasum": "" }, "require": { @@ -3279,20 +3281,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-03-28T21:38:24+00:00" + "time": "2017-04-19 20:17:50" }, { "name": "symfony/dom-crawler", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee" + "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/403944e294cf4ceb3b8447f54cbad88ea7b99cee", - "reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f1ad34e8af09ed17570e027cf0c58a12eddec286", + "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286", "shasum": "" }, "require": { @@ -3335,20 +3337,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-02-21T09:12:04+00:00" + "time": "2017-04-12 14:13:17" }, { "name": "symfony/event-dispatcher", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "154bb1ef7b0e42ccc792bd53edbce18ed73440ca" + "reference": "b8a401f733b43251e1d088c589368b2a94155e40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/154bb1ef7b0e42ccc792bd53edbce18ed73440ca", - "reference": "154bb1ef7b0e42ccc792bd53edbce18ed73440ca", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8a401f733b43251e1d088c589368b2a94155e40", + "reference": "b8a401f733b43251e1d088c589368b2a94155e40", "shasum": "" }, "require": { @@ -3395,20 +3397,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-04-04T07:26:27+00:00" + "time": "2017-05-01 14:58:48" }, { "name": "symfony/filesystem", - "version": "v2.8.19", + "version": "v2.8.20", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "31ab6827a696244094e6e20d77e7d404f8eb4252" + "reference": "dc40154e26a0116995e4f2f0c71cb9c2fe0775a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/31ab6827a696244094e6e20d77e7d404f8eb4252", - "reference": "31ab6827a696244094e6e20d77e7d404f8eb4252", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/dc40154e26a0116995e4f2f0c71cb9c2fe0775a3", + "reference": "dc40154e26a0116995e4f2f0c71cb9c2fe0775a3", "shasum": "" }, "require": { @@ -3444,20 +3446,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-03-26T15:40:40+00:00" + "time": "2017-04-12 14:07:15" }, { "name": "symfony/finder", - "version": "v2.8.19", + "version": "v2.8.20", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7131327eb95d86d72039fd1216226c28f36fd02a" + "reference": "16d55394b31547e4a8494551b85c9b9915545347" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7131327eb95d86d72039fd1216226c28f36fd02a", - "reference": "7131327eb95d86d72039fd1216226c28f36fd02a", + "url": "https://api.github.com/repos/symfony/finder/zipball/16d55394b31547e4a8494551b85c9b9915545347", + "reference": "16d55394b31547e4a8494551b85c9b9915545347", "shasum": "" }, "require": { @@ -3493,20 +3495,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-03-20T08:46:40+00:00" + "time": "2017-04-12 14:07:15" }, { "name": "symfony/http-foundation", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "cb0b6418f588952c9290b3df4ca650f1b7ab570a" + "reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cb0b6418f588952c9290b3df4ca650f1b7ab570a", - "reference": "cb0b6418f588952c9290b3df4ca650f1b7ab570a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9de6add7f731e5af7f5b2e9c0da365e43383ebef", + "reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef", "shasum": "" }, "require": { @@ -3546,7 +3548,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-04-04T15:30:56+00:00" + "time": "2017-05-01 14:55:58" }, { "name": "symfony/polyfill-mbstring", @@ -3605,20 +3607,20 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/process", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "57fdaa55827ae14d617550ebe71a820f0a5e2282" + "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/57fdaa55827ae14d617550ebe71a820f0a5e2282", - "reference": "57fdaa55827ae14d617550ebe71a820f0a5e2282", + "url": "https://api.github.com/repos/symfony/process/zipball/999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", + "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", "shasum": "" }, "require": { @@ -3654,20 +3656,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-03-27T18:07:02+00:00" + "time": "2017-04-12 14:13:17" }, { "name": "symfony/yaml", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621" + "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/62b4cdb99d52cb1ff253c465eb1532a80cebb621", - "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621", + "url": "https://api.github.com/repos/symfony/yaml/zipball/acec26fcf7f3031e094e910b94b002fa53d4e4d6", + "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6", "shasum": "" }, "require": { @@ -3709,7 +3711,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-03-20T09:45:15+00:00" + "time": "2017-05-01 14:55:58" }, { "name": "vlucas/phpdotenv", @@ -3759,7 +3761,7 @@ "env", "environment" ], - "time": "2016-09-01T10:05:43+00:00" + "time": "2016-09-01 10:05:43" }, { "name": "webmozart/assert", @@ -3809,7 +3811,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2016-11-23 20:04:58" } ], "packages-dev": [], diff --git a/tests/_envs/chrome.yml b/etc/_envs/chrome.yml similarity index 100% rename from tests/_envs/chrome.yml rename to etc/_envs/chrome.yml diff --git a/tests/_envs/firefox.yml b/etc/_envs/firefox.yml similarity index 100% rename from tests/_envs/firefox.yml rename to etc/_envs/firefox.yml diff --git a/tests/_envs/phantomjs.yml b/etc/_envs/phantomjs.yml similarity index 100% rename from tests/_envs/phantomjs.yml rename to etc/_envs/phantomjs.yml diff --git a/tests/_support/Magento/Xxyyzz/Helper/Acceptance.php b/src/Magento/Xxyyzz/Helper/Acceptance.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Helper/Acceptance.php rename to src/Magento/Xxyyzz/Helper/Acceptance.php diff --git a/tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php b/src/Magento/Xxyyzz/Helper/AdminUrlList.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Helper/AdminUrlList.php rename to src/Magento/Xxyyzz/Helper/AdminUrlList.php diff --git a/tests/_support/Magento/Xxyyzz/Helper/MagentoFakerData.php b/src/Magento/Xxyyzz/Helper/MagentoFakerData.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Helper/MagentoFakerData.php rename to src/Magento/Xxyyzz/Helper/MagentoFakerData.php diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoRestDriver.php b/src/Magento/Xxyyzz/Module/MagentoRestDriver.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Module/MagentoRestDriver.php rename to src/Magento/Xxyyzz/Module/MagentoRestDriver.php diff --git a/tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php b/src/Magento/Xxyyzz/Module/MagentoWebDriver.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Module/MagentoWebDriver.php rename to src/Magento/Xxyyzz/Module/MagentoWebDriver.php diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php b/src/Magento/Xxyyzz/Page/AbstractAdminPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/AbstractAdminPage.php rename to src/Magento/Xxyyzz/Page/AbstractAdminPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php b/src/Magento/Xxyyzz/Page/AbstractFrontendPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/AbstractFrontendPage.php rename to src/Magento/Xxyyzz/Page/AbstractFrontendPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php b/src/Magento/Xxyyzz/Page/AdminGridPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/AdminGridPage.php rename to src/Magento/Xxyyzz/Page/AdminGridPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Backend/AdminLogin.php b/src/Magento/Xxyyzz/Page/Backend/AdminLogin.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Backend/AdminLogin.php rename to src/Magento/Xxyyzz/Page/Backend/AdminLogin.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php b/src/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php rename to src/Magento/Xxyyzz/Page/Backend/AdminSideNavigation.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php b/src/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php rename to src/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php b/src/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php rename to src/Magento/Xxyyzz/Page/Catalog/AdminProductGridPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php b/src/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php rename to src/Magento/Xxyyzz/Page/Catalog/AdminProductPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php b/src/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php rename to src/Magento/Xxyyzz/Page/Catalog/StorefrontCategoryPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php b/src/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php rename to src/Magento/Xxyyzz/Page/Catalog/StorefrontProductPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php b/src/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php rename to src/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php b/src/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php rename to src/Magento/Xxyyzz/Page/Cms/AdminCmsPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Cms/StorefrontCmsPage.php b/src/Magento/Xxyyzz/Page/Cms/StorefrontCmsPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Cms/StorefrontCmsPage.php rename to src/Magento/Xxyyzz/Page/Cms/StorefrontCmsPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php b/src/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php rename to src/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php b/src/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php rename to src/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php b/src/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php rename to src/Magento/Xxyyzz/Page/Customer/AdminCustomerPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php b/src/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php rename to src/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountCreatePage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php b/src/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php rename to src/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountDashboardPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php b/src/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php rename to src/Magento/Xxyyzz/Page/Customer/StorefrontCustomerAccountLoginPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php b/src/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php rename to src/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php b/src/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php rename to src/Magento/Xxyyzz/Page/Sales/AdminOrderDetailsPage.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php b/src/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php rename to src/Magento/Xxyyzz/Page/Sales/AdminOrderGrid.php diff --git a/tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php b/src/Magento/Xxyyzz/Step/Backend/AdminStep.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Step/Backend/AdminStep.php rename to src/Magento/Xxyyzz/Step/Backend/AdminStep.php From b6dc9478139d1d1976efea25b4ede6e263b7f519 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 22 May 2017 14:18:59 -0500 Subject: [PATCH 072/149] MTA-4213: splitting tooling-demo project into framework and test packages; created new framework package. --- .env.example | 9 - RoboFile.php | 74 --- composer.json | 8 +- composer.lock | 4 +- tests/_bootstrap.php | 2 - tests/_data/dump.sql | 1 - tests/acceptance.suite.dist.yml | 30 - .../Backend/AccessAdminPagesDirectlyCest.php | 388 ------------ .../AccessAdminPagesViaNavMenuCest.php | 553 ------------------ .../Backend/OpenEachSideNavMenuCest.php | 74 --- .../Acceptance/Catalog/CreateCategoryCest.php | 79 --- .../Catalog/CreateSimpleProductCest.php | 137 ----- .../Catalog/UpdateSimpleProductCest.php | 141 ----- .../Acceptance/Cms/CreateContentPageCest.php | 177 ------ .../CreateConfigurableProductCest.php | 225 ------- .../UpdateConfigurableProductCest.php | 220 ------- .../Customer/CreateCustomerCest.php | 279 --------- .../CreateNewCustomerFrontendCest.php | 84 --- .../Customer/SignInCustomerFrontendCest.php | 79 --- .../Sales/CreateOrderViaAdminCest.php | 138 ----- .../Acceptance/SampleTests/ExampleCept.php | 6 - .../Acceptance/SampleTests/ExampleCest.php | 23 - .../Acceptance/SampleTests/TestCest.php | 38 -- .../SampleTests/TestStepObjectCept.php | 7 - .../SampleTests/TestStepObjectCest.php | 23 - .../User/AccessAdminLoginPageCest.php | 49 -- .../User/AccessForgotYourPasswordCest.php | 106 ---- .../CannotAccessAdminAfterLoggingOutCest.php | 57 -- .../User/CannotAccessAdminPagesCest.php | 55 -- .../User/LoginOnAdminLoginPageCest.php | 49 -- .../Acceptance/User/LogoutAfterLoginCest.php | 49 -- tests/acceptance/_bootstrap.php | 2 - 32 files changed, 7 insertions(+), 3159 deletions(-) delete mode 100644 .env.example delete mode 100644 RoboFile.php delete mode 100644 tests/_bootstrap.php delete mode 100644 tests/_data/dump.sql delete mode 100644 tests/acceptance.suite.dist.yml delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesDirectlyCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCept.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php delete mode 100644 tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php delete mode 100644 tests/acceptance/_bootstrap.php diff --git a/.env.example b/.env.example deleted file mode 100644 index 9cf46d76e..000000000 --- a/.env.example +++ /dev/null @@ -1,9 +0,0 @@ -MAGENTO_BASE_URL=http://magento3.loc/index.php - -MAGENTO_BACKEND_NAME=admin -MAGENTO_ADMIN_USERNAME=admin -MAGENTO_ADMIN_PASSWORD=123123q - -DB_DSN='' -DB_USERNAME='' -DB_PASSWORD='' \ No newline at end of file diff --git a/RoboFile.php b/RoboFile.php deleted file mode 100644 index 0bd47f512..000000000 --- a/RoboFile.php +++ /dev/null @@ -1,74 +0,0 @@ -_exec('cp -vn .env.example .env'); - $this->_exec('cp -vn codeception.dist.yml codeception.yml'); - $this->_exec('cp -vn tests/acceptance.suite.dist.yml tests/acceptance.suite.yml'); - } - - function allureGenerate() { - return $this->_exec('allure generate tests/_output/allure-results/ -o tests/_output/allure-report/'); - } - - function allureOpen() { - $this->_exec('allure report open --report-dir tests/_output/allure-report/'); - } - - function allureReport() { - $result1 = $this->allureGenerate(); - - if ($result1->wasSuccessful()) { - $this->allureOpen(); - } - } - - function code(array $args) { - $this->_exec('codecept run ' . implode(' ', $args)); - $this->allureReport(); - } - - function test() { - $this->chrome(); - $this->allureReport(); - } - - function example() { - $this->_exec('codecept run --env chrome --group example --skip-group skip'); - $this->allureReport(); - } - - function group($args = '') { - $this->taskExec('codecept run acceptance --verbose --steps --env chrome --skip-group skip --group')->args($args)->run(); - } - - function chrome() { - $this->_exec('codecept run acceptance --env chrome --skip-group skip'); - $this->allureReport(); - } - - function firefox() { - $this->_exec('codecept run acceptance --env firefox --skip-group skip'); - $this->allureReport(); - } - - function phantomjs() { - $this->_exec('codecept run acceptance --env phantomjs'); - $this->allureReport(); - } - - function catalog() - { - $this->_exec('codecept run --env chrome --group catalog'); - $this->allureReport(); - } -} diff --git a/composer.json b/composer.json index bb8010d9b..8438001a6 100755 --- a/composer.json +++ b/composer.json @@ -1,5 +1,8 @@ { - "name": "tooling-demo", + "name": "magento/acceptance-test-framework", + "type": "library", + "description": "Magento Acceptance Testing Framework", + "keywords": ["magento", "automation", "acceptance", "testing"], "require": { "php": ">=5.4.0", "codeception/codeception": "~2.2", @@ -16,8 +19,7 @@ "Yandex": "vendor/allure-framework/allure-codeception/src/" }, "psr-4": { - "Magento\\Xxyyzz\\": "src/Magento/Xxyyzz", - "Magento\\Xxyyzz\\Acceptance\\": "tests/acceptance/Magento/Xxyyzz/Acceptance" + "Magento\\Xxyyzz\\": "src/Magento/Xxyyzz" } } } diff --git a/composer.lock b/composer.lock index 79b1da65b..3fec03694 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e4c946a9a61310f5664b0cd48a521e0f", - "content-hash": "cfaff575db89011a5e0d0f60979dcf01", + "hash": "c898396a0e199f4ee06aa583d460dd13", + "content-hash": "b3996f320720df346a5957013e38c433", "packages": [ { "name": "allure-framework/allure-codeception", diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php deleted file mode 100644 index 243f9c85b..000000000 --- a/tests/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ -loginAsAdmin(); - } - - /** - * Allure annotations - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @TestCaseId("") - * - * Codeception annotations - * @param AdminStep $I - * @return void - */ - public function shouldBeAbleToAccessEachAdminPageDirectly(AdminStep $I) - { - $I->goToTheAdminOrdersGrid(); - $I->shouldBeOnTheAdminOrdersGrid(); - - $I->goToTheAdminInvoicesGrid(); - $I->shouldBeOnTheAdminInvoicesGrid(); - - $I->goToTheAdminShipmentsGrid(); - $I->shouldBeOnTheAdminShipmentsGrid(); - - $I->goToTheAdminCreditMemosGrid(); - $I->shouldBeOnTheAdminCreditMemosGrid(); - - $I->goToTheAdminBillingAgreementsGrid(); - $I->shouldBeOnTheAdminBillingAgreementsGrid(); - - $I->goToTheAdminTransactionsGrid(); - $I->shouldBeOnTheAdminTransactionsGrid(); - - $I->goToTheAdminCatalogPage(); - $I->shouldBeOnTheAdminCatalogGrid(); - - $I->goToTheAdminCategoriesPage(); - $I->shouldBeOnTheAdminCategoriesPage(); - - $I->goToTheAdminAllCustomersGrid(); - $I->shouldBeOnTheAdminAllCustomersGrid(); - - $I->goToTheAdminCustomersNowOnlineGrid(); - $I->shouldBeOnTheAdminCustomersNowOnlineGrid(); - - $I->goToTheAdminCatalogPriceRuleGrid(); - $I->shouldBeOnTheAdminCatalogPriceRuleGrid(); - - $I->goToTheAdminCartPriceRulesGrid(); - $I->shouldBeOnTheAdminCartPriceRulesGrid(); - - $I->goToTheAdminEmailTemplatesGrid(); - $I->shouldBeOnTheAdminEmailTemplatesGrid(); - - $I->goToTheAdminNewsletterTemplateGrid(); - $I->shouldBeOnTheAdminNewsletterTemplateGrid(); - - $I->goToTheAdminNewsletterQueueGrid(); - $I->shouldBeOnTheAdminNewsletterQueueGrid(); - - $I->goToTheAdminNewsletterSubscribersGrid(); - $I->shouldBeOnTheAdminNewsletterSubscribersGrid(); - - $I->goToTheAdminURLRewritesGrid(); - $I->shouldBeOnTheAdminURLRewritesGrid(); - - $I->goToTheAdminSearchTermsGrid(); - $I->shouldBeOnTheAdminSearchTermsGrid(); - - $I->goToTheAdminSearchSynonymsGrid(); - $I->shouldBeOnTheAdminSearchSynonymsGrid(); - - $I->goToTheAdminSiteMapGrid(); - $I->shouldBeOnTheAdminSiteMapGrid(); - - $I->goToTheAdminReviewsGrid(); - $I->shouldBeOnTheAdminReviewsGrid(); - - $I->goToTheAdminPagesGrid(); - $I->shouldBeOnTheAdminPagesGrid(); - - $I->goToTheAdminBlocksGrid(); - $I->shouldBeOnTheAdminBlocksGrid(); - - $I->goToTheAdminWidgetsGrid(); - $I->shouldBeOnTheAdminWidgetsGrid(); - - $I->goToTheAdminDesignConfigurationGrid(); - $I->shouldBeOnTheAdminDesignConfigurationGrid(); - - $I->goToTheAdminThemesGrid(); - $I->shouldBeOnTheAdminThemesGrid(); - - $I->goToTheAdminStoreContentScheduleGrid(); - $I->shouldBeOnTheAdminStoreContentScheduleGrid(); - - $I->goToTheAdminProductsInCartGrid(); - $I->shouldBeOnTheAdminProductsInCartGrid(); - - $I->goToTheAdminSearchTermsReportGrid(); - $I->shouldBeOnTheAdminSearchTermsReportGrid(); - - $I->goToTheAdminAbandonedCartsGrid(); - $I->shouldBeOnTheAdminAbandonedCartsGrid(); - - $I->goToTheAdminNewsletterProblemsReportGrid(); - $I->shouldBeOnTheAdminNewsletterProblemsReportGrid(); - - $I->goToTheAdminCustomerReviewsReportGrid(); - $I->shouldBeOnTheAdminCustomerReviewsReportGrid(); - - $I->goToTheAdminProductReviewsReportGrid(); - $I->shouldBeOnTheAdminProductReviewsReportGrid(); - - $I->goToTheAdminOrdersReportGrid(); - $I->shouldBeOnTheAdminOrdersReportGrid(); - - $I->goToTheAdminTaxReportGrid(); - $I->shouldBeOnTheAdminTaxReportGrid(); - - $I->goToTheAdminInvoiceReportGrid(); - $I->shouldBeOnTheAdminInvoiceReportGrid(); - - $I->goToTheAdminShippingReportGrid(); - $I->shouldBeOnTheAdminShippingReportGrid(); - - $I->goToTheAdminRefundsReportGrid(); - $I->shouldBeOnTheAdminRefundsReportGrid(); - - $I->goToTheAdminCouponsReportGrid(); - $I->shouldBeOnTheAdminCouponsReportGrid(); - - $I->goToTheAdminPayPalSettlementReportsGrid(); - $I->shouldBeOnTheAdminPayPalSettlementReportsGrid(); - - $I->goToTheAdminBraintreeSettlementReportGrid(); - $I->shouldBeOnTheAdminBraintreeSettlementReportGrid(); - - $I->goToTheAdminOrderTotalReportGrid(); - $I->shouldBeOnTheAdminOrderTotalReportGrid(); - - $I->goToTheAdminOrderCountReportGrid(); - $I->shouldBeOnTheAdminOrderCountReportGrid(); - - $I->goToTheAdminNewAccountsReportGrid(); - $I->shouldBeOnTheAdminNewAccountsReportGrid(); - - $I->goToTheAdminProductViewsReportGrid(); - $I->shouldBeOnTheAdminProductViewsReportGrid(); - - $I->goToTheAdminBestsellersReportGrid(); - $I->shouldBeOnTheAdminBestsellersReportGrid(); - - $I->goToTheAdminLowStockReportGrid(); - $I->shouldBeOnTheAdminLowStockReportGrid(); - - $I->goToTheAdminOrderedProductsReportGrid(); - $I->shouldBeOnTheAdminOrderedProductsGrid(); - - $I->goToTheAdminDownloadsReportGrid(); - $I->shouldBeOnTheAdminDownloadsReportGrid(); - - $I->goToTheAdminRefreshStatisticsGrid(); - $I->shouldBeOnTheAdminRefreshStatisticsGrid(); - - $I->goToTheAdminAllStoresGrid(); - $I->shouldBeOnTheAdminAllStoresGrid(); - - $I->goToTheAdminConfigurationGrid(); - $I->shouldBeOnTheAdminConfigurationGrid(); - - $I->goToTheAdminTermsAndConditionsGrid(); - $I->shouldBeOnTheAdminTermsAndConditionsGrid(); - - $I->goToTheAdminOrderStatusGrid(); - $I->shouldBeOnTheAdminOrderStatusGrid(); - - $I->goToTheAdminTaxRulesGrid(); - $I->shouldBeOnTheAdminTaxRulesGrid(); - - $I->goToTheAdminTaxZonesAndRatesGrid(); - $I->shouldBeOnTheAdminTaxZonesAndRatesGrid(); - - $I->goToTheAdminCurrencyRatesPage(); - $I->shouldBeOnTheAdminCurrencyRatesPage(); - - $I->goToTheAdminCurrencySymbolsPage(); - $I->shouldBeOnTheAdminCurrencySymbolsPage(); - - $I->goToTheAdminProductAttributesGrid(); - $I->shouldBeOnTheAdminProductAttributesGrid(); - - $I->goToTheAdminAttributeSetGrid(); - $I->shouldBeOnTheAdminAttributeSetsGrid(); - - $I->goToTheAdminRatingGrid(); - $I->shouldBeOnTheAdminRatingsGrid(); - - $I->goToTheAdminCustomerGroupsGrid(); - $I->shouldBeOnTheAdminCustomerGroupsGrid(); - - $I->goToTheAdminImportPage(); - $I->shouldBeOnTheAdminImportPage(); - - $I->goToTheAdminExportPage(); - $I->shouldBeOnTheAdminExportPage(); - - $I->goToTheAdminImportAndExportTaxRatesPage(); - $I->shouldBeOnTheAdminImportAndExportTaxRatesPage(); - - $I->goToTheAdminImportHistoryGrid(); - $I->shouldBeOnTheAdminImportHistoryGrid(); - - $I->goToTheAdminIntegrationsGrid(); - $I->shouldBeOnTheAdminIntegrationsGrid(); - - $I->goToTheAdminCacheManagementGrid(); - $I->shouldBeOnTheAdminCacheManagementGrid(); - - $I->goToTheAdminBackupsGrid(); - $I->shouldBeOnTheAdminBackupsGrid(); - - $I->goToTheAdminIndexManagementGrid(); - $I->shouldBeOnTheAdminIndexManagementGrid(); - - $I->goToTheAdminAllUsersGrid(); - $I->shouldBeOnTheAdminAllUsersGrid(); - - $I->goToTheAdminLockedUsersGrid(); - $I->shouldBeOnTheAdminLockedUsersGrid(); - - $I->goToTheAdminUserRolesGrid(); - $I->shouldBeOnTheAdminUserRolesGrid(); - - $I->goToTheAdminNotificationsGrid(); - $I->shouldBeOnTheAdminNotificationsGrid(); - - $I->goToTheAdminCustomVariablesGrid(); - $I->shouldBeOnTheAdminCustomVariablesGrid(); - - $I->goToTheAdminEncryptionKeyPage(); - $I->shouldBeOnTheAdminEncryptionKeyPage(); - } - - /** - * Allure annotations - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @TestCaseId("") - * - * Codeception annotations - * @param AdminStep $I - * @return void - */ - public function shouldBeAbleToAccessEachAdminAddPageDirectly(AdminStep $I) - { - $I->goToTheAdminAddOrderPage(); - $I->shouldBeOnTheAdminAddOrderPage(); - - $I->goToTheAdminAddSimpleProductPage(); - $I->shouldBeOnTheAdminAddSimpleProductPage(); - - $I->goToTheAdminAddConfigurableProductPage(); - $I->shouldBeOnTheAdminAddConfigurableProductPage(); - - $I->goToTheAdminAddGroupedProductPage(); - $I->shouldBeOnTheAdminAddGroupedProductPage(); - - $I->goToTheAdminAddVirtualProductPage(); - $I->shouldBeOnTheAdminAddVirtualProductPage(); - - $I->goToTheAdminAddBundledProductPage(); - $I->shouldBeOnTheAdminAddBundledProductPage(); - - $I->goToTheAdminAddDownloadableProductPage(); - $I->shouldBeOnTheAdminAddDownloadableProductPage(); - - $I->goToTheAdminAddCustomerPage(); - $I->shouldBeOnTheAdminAddCustomerPage(); - - $I->goToTheAdminAddCatalogPriceRulePage(); - $I->shouldBeOnTheAdminAddCatalogPriceRulePage(); - - $I->goToTheAdminAddCartPriceRulePage(); - $I->shouldBeOnTheAdminAddCartPriceRulePage(); - - $I->goToTheAdminAddEmailTemplatePage(); - $I->shouldBeOnTheAdminAddEmailTemplatePage(); - - $I->goToTheAdminAddNewsletterTemplatePage(); - $I->shouldBeOnTheAdminAddNewsletterTemplatePage(); - - $I->goToTheAdminAddURLRewritePage(); - $I->shouldBeOnTheAdminAddURLRewritePage(); - - $I->goToTheAdminAddSearchTermPage(); - $I->shouldBeOnTheAdminAddSearchTermPage(); - - $I->goToTheAdminAddSearchSynonymGroupPage(); - $I->shouldBeOnTheAdminAddSearchSynonymGroupPage(); - - $I->goToTheAdminAddSiteMapPage(); - $I->shouldBeOnTheAdminAddSiteMapPage(); - - $I->goToTheAdminAddReviewPage(); - $I->shouldBeOnTheAdminAddReviewPage(); - - $I->goToTheAdminAddPagePage(); - $I->shouldBeOnTheAdminAddPagePage(); - - $I->goToTheAdminAddBlockPage(); - $I->shouldBeOnTheAdminAddBlockPage(); - - $I->goToTheAdminAddWidgetPage(); - $I->shouldBeOnTheAdminAddWidgetPage(); - - $I->goToTheAdminAddStoreDesignChangePage(); - $I->shouldBeOnTheAdminAddStoreDesignChangePage(); - - $I->goToTheAdminAddNewTermsAndConditionsPage(); - $I->shouldBeOnTheAdminAddNewTermsAndConditionsPage(); - - $I->goToTheAdminAddOrderStatusPage(); - $I->shouldBeOnTheAdminAddOrderStatusPage(); - - $I->goToTheAdminAddTaxRulePage(); - $I->shouldBeOnTheAdminAddTaxRulePage(); - - $I->goToTheAdminAddTaxZoneAndRatePage(); - $I->shouldBeOnTheAdminAddTaxZoneAndRatePage(); - - $I->goToTheAdminAddProductAttributePage(); - $I->shouldBeOnTheAdminAddProductAttributePage(); - - $I->goToTheAdminAddAttributeSetPage(); - $I->shouldBeOnTheAdminAddAttributeSetPage(); - - $I->goToTheAdminAddRatingPage(); - $I->shouldBeOnTheAdminAddRatingPage(); - - $I->goToTheAdminAddCustomerGroupPage(); - $I->shouldBeOnTheAdminAddCustomerGroupPage(); - - $I->goToTheAdminAddIntegrationPage(); - $I->shouldBeOnTheAdminAddIntegrationPage(); - - $I->goToTheAdminAddUserPage(); - $I->shouldBeOnTheAdminAddUserPage(); - - $I->goToTheAdminAddUserRolePage(); - $I->shouldBeOnTheAdminAddUserRolePage(); - - $I->goToTheAdminAddCustomVariablePage(); - $I->shouldBeOnTheAdminAddCustomVariablePage(); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php deleted file mode 100644 index df8ff7466..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/AccessAdminPagesViaNavMenuCest.php +++ /dev/null @@ -1,553 +0,0 @@ -loginAsAdmin(); - } - - /** - * Allure annotations - * @Title("DASHBOARD Menu Test") - * @Description("Attempt to access the DASHBOARD via the Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnTheDashboardPage(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access the DASHBOARD Page using the Side Nav Menu.'); - $I->goToRandomAdminPage(); - $sideNavMenu->clickOnDashboardInTheSideNavMenu(); - $I->shouldBeOnTheAdminDashboardPage(); - } - - /** - * Allure annotations - * @Title("SALES Menu Tests") - * @Description("Attempt to access all of the SALES pages using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnEachOfTheSalesPages(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access each of the SALES Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnSalesInTheSideNavMenu(); - $sideNavMenu->clickOnOrdersInTheSalesNavMenu(); - $I->shouldBeOnTheAdminOrdersGrid(); - - $sideNavMenu->clickOnSalesInTheSideNavMenu(); - $sideNavMenu->clickOnInvoicesInTheSalesNavMenu(); - $I->shouldBeOnTheAdminInvoicesGrid(); - - $sideNavMenu->clickOnSalesInTheSideNavMenu(); - $sideNavMenu->clickOnShipmentsInTheSalesNavMenu(); - $I->shouldBeOnTheAdminShipmentsGrid(); - - $sideNavMenu->clickOnSalesInTheSideNavMenu(); - $sideNavMenu->clickOnCreditMemosInTheSalesNavMenu(); - $I->shouldBeOnTheAdminCreditMemosGrid(); - - $sideNavMenu->clickOnSalesInTheSideNavMenu(); - $sideNavMenu->clickOnBillingAgreementsInTheSalesNavMenu(); - $I->shouldBeOnTheAdminBillingAgreementsGrid(); - - $sideNavMenu->clickOnSalesInTheSideNavMenu(); - $sideNavMenu->clickOnTransactionsInTheSalesNavMenu(); - $I->shouldBeOnTheAdminTransactionsGrid(); - } - - /** - * Allure annotations - * @Title("PRODUCT Menu Tests") - * @Description("Attempt to access all of the PRODUCT pages using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnEachOfTheProductsPages(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access each of the PRODUCT Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnProductsInTheSideNavMenu(); - $sideNavMenu->clickOnCatalogInTheProductNavMenu(); - $I->shouldBeOnTheAdminCatalogGrid(); - - $sideNavMenu->clickOnProductsInTheSideNavMenu(); - $sideNavMenu->clickOnCategoriesInTheProductNavMenu(); - $I->shouldBeOnTheAdminCategoriesPage(); - } - - /** - * Allure annotations - * @Title("CUSTOMER Menu Tests") - * @Description("Attempt to access all of the CUSTOMER pages using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLanOnEachOfTheCustomersPages(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access each of the CUSTOMER Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnCustomersInTheSideNavMenu(); - $sideNavMenu->clickOnAllCustomersInTheCustomersNavMenu(); - $I->shouldBeOnTheAdminAllCustomersGrid(); - - $sideNavMenu->clickOnCustomersInTheSideNavMenu(); - $sideNavMenu->clickOnNowOnlineInTheCustomersNavMenu(); - $I->shouldBeOnTheAdminCustomersNowOnlineGrid(); - } - - // Marketing Menu Tests - /** - * Allure annotations - * @Title("MARKETING Menu Tests") - * @Description("Attempt to access all of the MARKETING pages using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnEachOfTheMarketingPages(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access each of the MARKETING Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnCatalogPriceRulesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminCatalogPriceRuleGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnCartPriceRulesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminCartPriceRulesGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnEmailTemplatesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminEmailTemplatesGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnNewsletterTemplatesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminNewsletterTemplateGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnNewsletterQueueInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminNewsletterQueueGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnNewsletterSubscribersInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminNewsletterSubscribersGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnURLRewritesInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminURLRewritesGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnSearchTermsInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminSearchTermsGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnSearchSynonymsInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminSearchSynonymsGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnSiteMapInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminSiteMapGrid(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->clickOnContentReviewsInTheMarketingNavMenu(); - $I->shouldBeOnTheAdminReviewsGrid(); - } - - // Content Menu Tests - /** - * Allure annotations - * @Title("CONTENT Menu Tests") - * @Description("Attempt to access all of the CONTENT pages using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnEachOfTheContentPages(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access each of the CONTENT Admin Pages using the Side Nav Menus'); - $sideNavMenu->clickOnContentInTheSideNavMenu(); - $sideNavMenu->clickOnPagesInTheContentNavMenu(); - $I->shouldBeOnTheAdminPagesGrid(); - - $sideNavMenu->clickOnContentInTheSideNavMenu(); - $sideNavMenu->clickOnBlocksInTheContentNavMenu(); - $I->shouldBeOnTheAdminBlocksGrid(); - - $sideNavMenu->clickOnContentInTheSideNavMenu(); - $sideNavMenu->clickOnWidgetsInTheContentNavMenu(); - $I->shouldBeOnTheAdminWidgetsGrid(); - - $sideNavMenu->clickOnContentInTheSideNavMenu(); - $sideNavMenu->clickOnConfigurationInTheContentNavMenu(); - $I->shouldBeOnTheAdminDesignConfigurationGrid(); - - $sideNavMenu->clickOnContentInTheSideNavMenu(); - $sideNavMenu->clickOnThemesInTheContentNavMenu(); - $I->shouldBeOnTheAdminThemesGrid(); - - $sideNavMenu->clickOnContentInTheSideNavMenu(); - $sideNavMenu->clickOnScheduleInTheContentNavMenu(); - $I->shouldBeOnTheAdminStoreContentScheduleGrid(); - } - - /** - * Allure annotations - * @Title("REPORT Menu Tests") - * @Description("Attempt to access all of the REPORT pages using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnEachOfTheReportsPages(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access each of the REPORT Admin Pages using the Side Nav Menu'); - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnProductsInCartInTheReportsNavMenu(); - $I->shouldBeOnTheAdminProductsInCartGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnSearchTermsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminSearchTermsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnAbandonedCartsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminAbandonedCartsGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnNewsletterProblemReportsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminNewsletterProblemsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnByCustomersInTheReportsNavMenu(); - $I->shouldBeOnTheAdminCustomerReviewsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnByProductsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminProductReviewsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnOrdersInTheReportsNavMenu(); - $I->shouldBeOnTheAdminOrdersReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOTaxInTheReportsNavMenu(); - $I->shouldBeOnTheAdminTaxReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnInvoicedInTheReportsNavMenu(); - $I->shouldBeOnTheAdminInvoiceReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnShippingInTheReportsNavMenu(); - $I->shouldBeOnTheAdminShippingReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnRefundsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminRefundsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnCouponsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminCouponsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnPayPalSettlementInTheReportsNavMenu(); - $I->shouldBeOnTheAdminPayPalSettlementReportsGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnBraintreeSettlementInTheReportsNavMenu(); - $I->shouldBeOnTheAdminBraintreeSettlementReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnOrderTotalInTheReportsNavMenu(); - $I->shouldBeOnTheAdminOrderTotalReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnOrderCountInTheReportsNavMenu(); - $I->shouldBeOnTheAdminOrderCountReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnNewInTheReportsNavMenu(); - $I->shouldBeOnTheAdminNewAccountsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnViewsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminProductViewsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnBestSellersInTheReportsNavMenu(); - $I->shouldBeOnTheAdminBestsellersReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnLowStockInTheReportsNavMenu(); - $I->shouldBeOnTheAdminLowStockReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnOrderedInTheReportsNavMenu(); - $I->shouldBeOnTheAdminOrderedProductsGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnDownloadsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminDownloadsReportGrid(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->clickOnRefreshStatisticsInTheReportsNavMenu(); - $I->shouldBeOnTheAdminRefreshStatisticsGrid(); - } - - /** - * Allure annotations - * @Title("STORE Menu Tests") - * @Description("Attempt to access all of the STORE pages using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnEachOfTheStoresPages(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access each of the STORE Admin Pages using the Side Nav Menu'); - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnAllStoresInTheStoresNavMenu(); - $I->shouldBeOnTheAdminAllStoresGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnConfigurationInTheStoresNavMenu(); - $I->shouldBeOnTheAdminConfigurationGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnTermsAndConditionsInTheStoresNavMenu(); - $I->shouldBeOnTheAdminTermsAndConditionsGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnOrderStatusInTheStoresNavMenu(); - $I->shouldBeOnTheAdminOrderStatusGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnTaxRuleInTheStoresNavMenu(); - $I->shouldBeOnTheAdminTaxRulesGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnTaxZonesAndRatesInTheStoresNavMenu(); - $I->shouldBeOnTheAdminTaxZonesAndRatesGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnCurrencyRatesInTheStoresNavMenu(); - $I->shouldBeOnTheAdminCurrencyRatesPage(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnCurrencySymbolsInTheStoresNavMenu(); - $I->shouldBeOnTheAdminCurrencySymbolsPage(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnProductInTheStoresNavMenu(); - $I->shouldBeOnTheAdminProductAttributesGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnAttributesSetInTheStoresNavMenu(); - $I->shouldBeOnTheAdminAttributeSetsGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnRatingsInTheStoresNavMenu(); - $I->shouldBeOnTheAdminRatingsGrid(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->clickOnCustomerGroupInTheStoresNavMenu(); - $I->shouldBeOnTheAdminCustomerGroupsGrid(); - } - - // System Menu Tests - /** - * Allure annotations - * @Title("SYSTEM Menu Tests") - * @Description("Attempt to access all of the SYSTEM pages using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnEachOfTheSystemPages(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access each of the SYSTEM Admin Pages using the Side Nav Menu'); - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnImportInTheSystemNavMenu(); - $I->shouldBeOnTheAdminImportPage(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnExportInTheSystemNavMenu(); - $I->shouldBeOnTheAdminExportPage(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnImportExportTaxRatesInTheSystemNavMenu(); - $I->shouldBeOnTheAdminImportAndExportTaxRatesPage(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnImportHistoryInTheSystemNavMenu(); - $I->shouldBeOnTheAdminImportHistoryGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnIntegrationsInTheSystemNavMenu(); - $I->shouldBeOnTheAdminIntegrationsGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnCacheManagementInTheSystemNavMenu(); - $I->shouldBeOnTheAdminCacheManagementGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnBackupsInTheSystemNavMenu(); - $I->shouldBeOnTheAdminBackupsGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnIndexManagementInTheSystemNavMenu(); - $I->shouldBeOnTheAdminIndexManagementGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnAllUsersInTheSystemNavMenu(); - $I->shouldBeOnTheAdminAllUsersGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnLockedUsersInTheSystemNavMenu(); - $I->shouldBeOnTheAdminLockedUsersGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnUserRolesInTheSystemNavMenu(); - $I->shouldBeOnTheAdminUserRolesGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnNotificationsInTheSystemNavMenu(); - $I->shouldBeOnTheAdminNotificationsGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnCustomVariablesInTheSystemNavMenu(); - $I->shouldBeOnTheAdminCustomVariablesGrid(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnManageEncryptionKeyInTheSystemNavMenu(); - $I->shouldBeOnTheAdminEncryptionKeyPage(); - } - - /** - * Allure annotations - * @Title("WEB SETUP WIZARD Menu Test") - * @Description("Attempt to access all of the WEB SETUP WIZARD page using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnTheWebSetupWizardPage(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access the WEB SETUP WIZARD Admin Page using the Side Nav Menu'); - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->clickOnWebSetupWizardInTheSystemNavMenu(); - $I->shouldBeOnTheAdminWebSetupWizardPage(); - $I->goToTheAdminLogoutPage(); - } - - /** - * Allure annotations - * @Title("PARTNERS & EXTENSIONS Menu Test") - * @Description("Attempt to access all of the PARTNERS & EXTENSIONS page using the Side Nav Menu.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param AdminStep $I - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldLandOnThePartnersAndExtensionsPage(AdminStep $I, SideNav $sideNavMenu) - { - $I->wantTo('see if I can access the Partners and Extensions Admin Page using the Side Nav Menu'); - $sideNavMenu->clickOnFindPartnersAndExtensionsInTheSideNavMenu(); - $I->shouldBeOnTheAdminFindPartnersAndExtensionsPage(); - $I->goToTheAdminLogoutPage(); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php deleted file mode 100644 index 442db1988..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Backend/OpenEachSideNavMenuCest.php +++ /dev/null @@ -1,74 +0,0 @@ -loginAsAdmin(); - } - - /** - * Allure annotations - * @Title("Open each Admin Nav Menu") - * @Description("Attempt to open each of the Admin Nav Menus and verify all of the proper menus are displayed.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "SideNav", value = "$sideNavMenu") - * - * Codeception annotations - * @param SideNav $sideNavMenu - * @return void - */ - public function shouldBeAbleToOpenEachSideNavMenu(SideNav $sideNavMenu) - { - $sideNavMenu->clickOnSalesInTheSideNavMenu(); - $sideNavMenu->shouldSeeTheSalesNavMenu(); - - $sideNavMenu->clickOnProductsInTheSideNavMenu(); - $sideNavMenu->shouldSeeTheProductNavMenu(); - - $sideNavMenu->clickOnCustomersInTheSideNavMenu(); - $sideNavMenu->shouldSeeTheCustomersNavMenu(); - - $sideNavMenu->clickOnMarketingInTheSideNavMenu(); - $sideNavMenu->shouldSeeTheMarketingNavMenu(); - - $sideNavMenu->clickOnContentInTheSideNavMenu(); - $sideNavMenu->shouldSeeTheContentNavMenu(); - - $sideNavMenu->clickOnReportsInTheSideNavMenu(); - $sideNavMenu->shouldSeeTheReportsNavMenu(); - - $sideNavMenu->clickOnStoresInTheSideNavMenu(); - $sideNavMenu->shouldSeeTheStoresNavMenu(); - - $sideNavMenu->clickOnSystemInTheSideNavMenu(); - $sideNavMenu->shouldSeeTheSystemNavMenu(); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php deleted file mode 100644 index 398b8b3a3..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateCategoryCest.php +++ /dev/null @@ -1,79 +0,0 @@ -loginAsAdmin(); - } - - public function _after(AdminStep $I) - { - $I->goToTheAdminLogoutPage(); - } - - /** - * Allure annotations - * @Title("Create sub category with required fields") - * @Description("Create sub category with required fields") - * @TestCaseId("") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCategoryPage", value = "$adminCategoryPage") - * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") - * - * Codeception annotations - * @param AdminStep $I - * @param AdminCategoryPage $adminCategoryPage - * @param StorefrontCategoryPage $storefrontCategoryPage - * @return void - */ - public function createCategoryTest( - AdminStep $I, - AdminCategoryPage $adminCategoryPage, - StorefrontCategoryPage $storefrontCategoryPage - ) { - $I->wantTo('create sub category with required fields in admin Category page.'); - $category = $I->getCategoryApiData(); - - $I->goToTheAdminCategoriesPage(); - $adminCategoryPage->addSubCategory(); - $adminCategoryPage->fillFieldCategoryName($category['name']); - - $adminCategoryPage->clickOnSearchEngineOptimization(); - $adminCategoryPage->fillFieldCategoryUrlKey($category['custom_attributes'][0]['value']); - $adminCategoryPage->saveCategory(); - $adminCategoryPage->seeSuccessMessage(); - - $I->wantTo('verify created category in frontend category page.'); - $storefrontCategoryPage->amOnCategoryPage(str_replace('_', '-', $category['custom_attributes'][0]['value'])); - $storefrontCategoryPage->seeCategoryNameInTitleHeading($category['name']); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php deleted file mode 100644 index 1d67779e3..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/CreateSimpleProductCest.php +++ /dev/null @@ -1,137 +0,0 @@ -loginAsAdmin(); - $I->goToTheAdminCatalogPage(); - $this->category = $I->getCategoryApiData(); - $this->category['id'] = $I->requireCategory($this->category)->id; - $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - $this->product = $I->getProductApiData('simple', $this->category['id']); - $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; - if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { - $this->product['stock_status'] = 'In Stock'; - $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; - } else { - $this->product['stock_status'] = 'Out of Stock'; - } - } - - public function _after(AdminStep $I) - { - $I->goToTheAdminLogoutPage(); - } - - /** - * Allure annotations - * @Title("Create a simple product and verify on the Storefront") - * @Description("Create a simple product in the Admin and verify the content on the Storefront.") - * @TestCaseId("") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") - * @Parameter(name = "AdminProductPage", value = "$adminProductPage") - * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") - * @Parameter(name = "StorefrontProductPage", value = "$storefrontProductPage") - * - * @param AdminStep $I - * @param AdminProductGridPage $adminProductGridPage - * @param AdminProductPage $adminProductPage - * @param StorefrontCategoryPage $storefrontCategoryPage - * @param StorefrontProductPage $storefrontProductPage - * @return void - */ - public function createSimpleProductTest( - AdminStep $I, - AdminProductGridPage $adminProductGridPage, - AdminProductPage $adminProductPage, - StorefrontCategoryPage $storefrontCategoryPage, - StorefrontProductPage $storefrontProductPage - ) { - $I->wantTo('create simple product with required fields in admin product page.'); - $adminProductGridPage->clickAddNewProductButton(); - $adminProductPage->amOnAdminNewProductPage(); - $adminProductPage->fillFieldProductName($this->product['name']); - $adminProductPage->fillFieldProductSku($this->product['sku']); - $adminProductPage->fillFieldProductPrice($this->product['price']); - if (isset($this->product['qty'])) { - $adminProductPage->fillFieldProductQuantity($this->product['qty']); - } - $adminProductPage->selectProductStockStatus($this->product['stock_status']); - $adminProductPage->selectProductCategories([$this->category['name']]); - $adminProductPage->fillFieldProductUrlKey($this->product['url_key']); - - $I->wantTo('see simple product successfully saved message.'); - $adminProductPage->saveProduct(); - $adminProductPage->seeSuccessMessage(); - - $I->wantTo('verify simple product data in admin product page.'); - $adminProductPage->seeProductAttributeSet('Default'); - $adminProductPage->seeProductName($this->product['name']); - $adminProductPage->seeProductSku($this->product['sku']); - $adminProductPage->seeProductPrice($this->product['price']); - if (isset($this->product['qty'])) { - $adminProductPage->seeProductQuantity($this->product['qty']); - } - $adminProductPage->seeProductStockStatus($this->product['stock_status']); - $adminProductPage->seeProductCategories([$this->category['name']]); - $adminProductPage->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); - - $I->wantTo('verify simple product data in frontend category page.'); - $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); - $storefrontCategoryPage->seeProductLinksInPage( - $this->product['name'], - str_replace('_', '-', $this->product['url_key']) - ); - $storefrontCategoryPage->seeProductNameInPage($this->product['name']); - $storefrontCategoryPage->seeProductPriceInPage($this->product['name'], $this->product['price']); - - $I->wantTo('verify simple product data in frontend product page.'); - $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); - $storefrontProductPage->seeProductNameInPage($this->product['name']); - $storefrontProductPage->seeProductPriceInPage($this->product['price']); - $storefrontProductPage->seeProductStockStatusInPage($this->product['stock_status']); - $storefrontProductPage->seeProductSkuInPage($this->product['sku']); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php deleted file mode 100644 index 3bef840ac..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Catalog/UpdateSimpleProductCest.php +++ /dev/null @@ -1,141 +0,0 @@ -loginAsAdmin(); - - $this->category = $I->getCategoryApiData(); - $this->category['id'] = $I->requireCategory($this->category)->id; - $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - - $this->product = $I->getProductApiData('simple', $this->category['id']); - $this->product['id'] = $I->requireSimpleProduct($this->category['id'], $this->product)->id; - $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; - if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { - $this->product['stock_status'] = 'In Stock'; - $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; - } else { - $this->product['stock_status'] = 'Out of Stock'; - } - } - - public function _after(AdminStep $I) - { - $I->goToTheAdminLogoutPage(); - } - - /** - * Update simple product in admin. - * - * Allure annotations - * @Title("Update simple product with required fields") - * @Description("Update simple product with required fields") - * @TestCaseId("") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") - * @Parameter(name = "AdminProductPage", value = "$adminProductPage") - * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") - * @Parameter(name = "StorefrontProductPage", value = "$storefrontProductPage") - * - * @param AdminStep $I - * @param AdminProductGridPage $adminProductGridPage - * @param AdminProductPage $adminProductPage - * @param StorefrontCategoryPage $storefrontCategoryPage - * @param StorefrontProductPage $storefrontProductPage - * @return void - */ - public function updateSimpleProductTest( - AdminStep $I, - AdminProductGridPage $adminProductGridPage, - AdminProductPage $adminProductPage, - StorefrontCategoryPage $storefrontCategoryPage, - StorefrontProductPage $storefrontProductPage - ) { - $I->wantTo('update simple product in admin.'); - $adminProductGridPage->amOnAdminProductGridPage(); - $adminProductGridPage->searchBySku($this->product['sku']); - $adminProductGridPage->seeInCurrentGridNthRow(1, [$this->product['sku']]); - - $I->wantTo('open product created from precondition.'); - $adminProductPage->amOnAdminEditProductPageById($this->product['id']); - - $I->wantTo('update product data fields.'); - $adminProductPage->fillFieldProductName($this->product['name'] . '-updated'); - $adminProductPage->fillFieldProductSku($this->product['sku'] . '-updated'); - $adminProductPage->fillFieldProductPrice($this->product['price']+10); - $adminProductPage->fillFieldProductQuantity( - $this->product['extension_attributes']['stock_item']['qty']+100 - ); - $I->wantTo('save product data change.'); - $adminProductPage->saveProduct(); - $adminProductPage->seeSuccessMessage(); - - $I->wantTo('see updated product data.'); - $adminProductPage->amOnAdminEditProductPageById($this->product['id']); - $adminProductPage->seeInPageTitle($this->product['name'] . '-updated'); - $adminProductPage->seeProductAttributeSet('Default'); - $adminProductPage->seeProductName($this->product['name'] . '-updated'); - $adminProductPage->seeProductSku($this->product['sku'] . '-updated'); - $adminProductPage->seeProductPrice($this->product['price']+10); - $adminProductPage->seeProductQuantity($this->product['extension_attributes']['stock_item']['qty']+100); - $adminProductPage->seeProductStockStatus( - $this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0 ? 'In Stock' : 'Out of Stock' - ); - - $I->wantTo('verify simple product data in frontend category page.'); - $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); - $storefrontCategoryPage->seeProductNameInPage($this->product['name'] . '-updated'); - $storefrontCategoryPage->seeProductPriceInPage($this->product['name'] . '-updated', $this->product['price']+10); - - $I->wantTo('verify simple product data in frontend product page.'); - $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); - $storefrontProductPage->seeProductNameInPage($this->product['name'] . '-updated'); - $storefrontProductPage->seeProductPriceInPage($this->product['price'] + 10); - $storefrontProductPage->seeProductSkuInPage($this->product['sku'] . '-updated'); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php deleted file mode 100644 index eb4e7900b..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Cms/CreateContentPageCest.php +++ /dev/null @@ -1,177 +0,0 @@ -am('an Admin'); - $I->loginAsAdmin(); - $I->goToTheAdminPagesGrid(); - - $adminCmsGrid->clickOnAddPageButton(); - } - - public function _after(AdminStep $I) - { - $I->goToTheAdminLogoutPage(); - } - - /** - * Allure annotations - * @Title("Enter text into every field on the ADD Content Page.") - * @Description("Enter text into ALL fields on the ADD Content Page and verify the content of the fields.") - * @Severity(level = SeverityLevel::NORMAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCmsPage", value = "$adminCmsPage") - * - * Codeception annotations - * @group fields - * @param AdminStep $I - * @param AdminCmsPage $adminCmsPage - * @return void - */ - public function verifyThatEachFieldOnTheContentPageWorks( - AdminStep $I, - AdminCmsPage $adminCmsPage - ) - { - $I->wantTo('verify that I can use all of the fields on the page.'); - $pageData = $I->getContentPage(); - - $adminCmsPage->clickOnEnablePageToggle(); - - $adminCmsPage->enterPageTitle($pageData['pageTitle']); - - $adminCmsPage->clickOnPageContent(); - $adminCmsPage->enterPageContentHeading($pageData['contentHeading']); - $adminCmsPage->enterPageContentBody($pageData['contentBody']); - - $adminCmsPage->clickOnPageSearchEngineOptimisation(); - $adminCmsPage->enterUrlKey($pageData['urlKey']); - $adminCmsPage->enterMetaTitle($pageData['metaTitle']); - $adminCmsPage->enterMetaKeywords($pageData['metaKeywords']); - $adminCmsPage->enterMetaDescription($pageData['metaDescription']); - - $adminCmsPage->clickOnPagePageInWebsites(); - $adminCmsPage->selectDefaultStoreView(); - - $adminCmsPage->clickOnPageDesign(); - $adminCmsPage->selectLayout1Column(); - $adminCmsPage->enterLayoutUpdateXml($pageData['layoutUpdateXml']); - - $adminCmsPage->clickOnPageCustomDesignUpdate(); - $adminCmsPage->enterFrom($pageData['from']); - $adminCmsPage->enterTo($pageData['to']); - $adminCmsPage->selectNewThemeMagentoLuma(); - $adminCmsPage->selectNewLayout3Columns(); - - $adminCmsPage->verifyPageTitle($pageData['pageTitle']); - - $adminCmsPage->verifyPageContentHeading($pageData['contentHeading']); - $adminCmsPage->verifyPageContentBody($pageData['contentBody']); - - $adminCmsPage->verifyUrlKey($pageData['urlKey']); - $adminCmsPage->verifyMetaTitle($pageData['metaTitle']); - $adminCmsPage->verifyMetaKeywords($pageData['metaKeywords']); - $adminCmsPage->verifyMetaDescription($pageData['metaDescription']); - - $adminCmsPage->verifyDefaultStoreView(); - - $adminCmsPage->verifyLayout1Column(); - $adminCmsPage->verifyLayoutUpdateXml($pageData['layoutUpdateXml']); - - $adminCmsPage->verifyFrom($pageData['from']); - $adminCmsPage->verifyTo($pageData['to']); - $adminCmsPage->verifyNewThemeMagentoLuma(); - $adminCmsPage->verifyNewLayout3Columns(); - } - - /** - * Allure annotations - * @Title("Create a basic Content Page") - * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Storefront.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCmsPage", value = "$adminCmsPage") - * @Parameter(name = "StorefrontCmsPage", value = "$storefrontCmsPage") - * - * Codeception annotations - * @group add - * @param AdminStep $I - * @param AdminCmsGrid $adminCmsGrid - * @param AdminCmsPage $adminCmsPage - * @param StorefrontCmsPage $storefrontCmsPage - * @return void - */ - public function createContentPageTest( - AdminStep $I, - AdminCmsGrid $adminCmsGrid, - AdminCmsPage $adminCmsPage, - StorefrontCmsPage $storefrontCmsPage - ) - { - $I->wantTo('verify content page in admin'); - $pageData = $I->getContentPage(); - - $adminCmsPage->clickOnPageContent(); - $adminCmsPage->enterPageTitle($pageData['pageTitle']); - $adminCmsPage->enterPageContentHeading($pageData['contentHeading']); - $adminCmsPage->enterPageContentBody($pageData['contentBody']); - - $adminCmsPage->clickOnPageSearchEngineOptimisation(); - $adminCmsPage->enterUrlKey($pageData['urlKey']); - - $adminCmsPage->clickOnSavePageButton(); - $adminCmsPage->seeSaveSuccessMessage(); - - $I->openNewTabGoToVerify($pageData['urlKey']); - $storefrontCmsPage->verifyPageContentTitle($pageData['contentHeading']); - $storefrontCmsPage->verifyPageContentBody($pageData['contentBody']); - $I->closeNewTab(); - - $adminCmsGrid->performSearchByKeyword($pageData['urlKey']); - $adminCmsGrid->clickOnActionEditFor($pageData['urlKey']); - - $adminCmsPage->clickOnPageContent(); - $adminCmsPage->clickOnPageSearchEngineOptimisation(); - - $adminCmsPage->verifyPageTitle($pageData['pageTitle']); - - $adminCmsPage->verifyPageContentHeading($pageData['contentHeading']); - $adminCmsPage->verifyPageContentBody($pageData['contentBody']); - $adminCmsPage->verifyUrlKey($pageData['urlKey']); - } -} \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php deleted file mode 100644 index 74a2e871f..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/CreateConfigurableProductCest.php +++ /dev/null @@ -1,225 +0,0 @@ -loginAsAdmin(); - - $this->category = $I->getCategoryApiData(); - $this->category['id'] = $I->requireCategory($this->category)->id; - $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - - $this->product = $I->getProductApiData('configurable', $this->category['id']); - $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; - if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { - $this->product['stock_status'] = 'In Stock'; - $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; - } else { - $this->product['stock_status'] = 'Out of Stock'; - } - - $this->productVariations = [ - [ - 'attribute_code' => 'Color', - 'attribute_value' => 'red', - 'sku' => $this->product['sku'].'-red', - 'price' => '11.11', - 'qty' => $this->product['qty'], - ], - [ - 'attribute_code' => 'Color', - 'attribute_value' => 'blue', - 'sku' => $this->product['sku'].'-blue', - 'price' => '22.22', - 'qty' => $this->product['qty'], - ], - [ - 'attribute_code' => 'Color', - 'attribute_value' => 'white', - 'sku' => $this->product['sku'].'-white', - 'price' => '33.33', - 'qty' => $this->product['qty'], - ] - ]; - - for ($c = 0; $c < count($this->productVariations); $c++) { - $this->variationPrice[$c] = $this->productVariations[$c]['price']; - $this->variationQuantity[$c] = $this->productVariations[$c]['qty']; - $this->attributeValues[$c] = $this->productVariations[$c]['attribute_value']; - } - } - - public function _after(AdminStep $I) - { - $I->goToTheAdminLogoutPage(); - } - - /** - * Allure annotations - * @Title("Create a configurable product and verify on the storefront") - * @Description("Create a configurable product and verify on the storefront.") - * @TestCaseId("") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") - * @Parameter(name = "AdminConfigurableProductPage", value = "$adminConfigurableProductPage") - * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") - * @Parameter(name = "StorefrontProductPage", value = "$storefrontProductPage") - * - * @param AdminStep $I - * @param AdminProductGridPage $adminProductGridPage - * @param AdminConfigurableProductPage $adminConfigurableProductPage - * @param StorefrontCategoryPage $storefrontCategoryPage - * @param StorefrontProductPage $storefrontProductPage - * @return void - */ - public function createConfigurableProductTest( - AdminStep $I, - AdminProductGridPage $adminProductGridPage, - AdminConfigurableProductPage $adminConfigurableProductPage, - StorefrontCategoryPage $storefrontCategoryPage, - StorefrontProductPage $storefrontProductPage - ) { - $I->wantTo('create configurable product with required fields in admin product page.'); - $adminProductGridPage->amOnAdminProductGridPage(); - $adminProductGridPage->clickOnAddConfigurableProductOption(); - $adminConfigurableProductPage->amOnAdminNewProductPage(); - $adminConfigurableProductPage->fillFieldProductName($this->product['name']); - $adminConfigurableProductPage->fillFieldProductSku($this->product['sku']); - $adminConfigurableProductPage->fillFieldProductPrice($this->product['price']); - if (isset($this->product['qty'])) { - $adminConfigurableProductPage->fillFieldProductQuantity($this->product['qty']); - } - $adminConfigurableProductPage->selectProductStockStatus($this->product['stock_status']); - $adminConfigurableProductPage->selectProductCategories([$this->category['name']]); - $adminConfigurableProductPage->fillFieldProductUrlKey($this->product['url_key']); - - $I->wantTo('create configurations for product.'); - $adminConfigurableProductPage->clickCreateConfigurationsButton(); - - $I->wantTo('on Create Product Configurations Wizard - Select Attributes...'); - $adminConfigurableProductPage->filterAndSelectAttributeByCode( - strtolower($this->productVariations[0]['attribute_code']) - ); - $adminConfigurableProductPage->checkCheckboxInCurrentNthRow(1); - $adminConfigurableProductPage->clickNextButton(); - - $I->wantTo('on Create Product Configurations Wizard - Attributes Values...'); - for ($c = 0; $c < count($this->productVariations); $c++) { - $adminConfigurableProductPage->checkAndSelectAttributeOption( - $this->productVariations[$c]['attribute_code'], - $this->productVariations[$c]['attribute_value'] - ); - } - $adminConfigurableProductPage->clickNextButton(); - - $I->wantTo('on Create Product Configurations Wizard - Bulk Images, Price and Quantity...'); - $adminConfigurableProductPage->clickApplyUniquePriceRadioButton(); - $adminConfigurableProductPage->selectAttributeToApplyUniquePrice( - $this->productVariations[0]['attribute_code'] - ); - $adminConfigurableProductPage->fillFieldWithUniquePrice($this->variationPrice); - $adminConfigurableProductPage->clickApplySingleQuantityRadioButton(); - $adminConfigurableProductPage->fillFieldApplySingleQuantity($this->variationQuantity[0]); - $adminConfigurableProductPage->clickNextButton(); - - $I->wantTo('on Create Product Configurations Wizard - Summary...'); - $I->wantTo('generate configurable products.'); - $adminConfigurableProductPage->clickNextButton(); - - $I->wantTo('see configurable product successfully saved message.'); - $adminConfigurableProductPage->saveProduct(); - $I->seeElement($adminConfigurableProductPage::$successMessage); - - $I->wantTo('verify configurable product data in admin product page.'); - $adminConfigurableProductPage->seeProductAttributeSet('Default'); - $adminConfigurableProductPage->seeProductName($this->product['name']); - $adminConfigurableProductPage->seeProductSku($this->product['sku']); - $adminConfigurableProductPage->seeProductPriceDisabled(); - $adminConfigurableProductPage->seeProductQuantityDisabled(); - $adminConfigurableProductPage->seeProductStockStatus($this->product['stock_status']); - $adminConfigurableProductPage->seeProductCategories([$this->category['name']]); - $adminConfigurableProductPage->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); - $adminConfigurableProductPage->assertNumberOfConfigurableVariations(count($this->productVariations)); - foreach ($this->productVariations as $variation) { - $adminConfigurableProductPage->seeInConfigurableVariations($variation); - } - - $I->wantTo('verify configurable product data in frontend category page.'); - $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); - $storefrontCategoryPage->seeProductLinksInPage( - $this->product['name'], - str_replace('_', '-', $this->product['url_key']) - ); - $storefrontCategoryPage->seeProductNameInPage($this->product['name']); - $storefrontCategoryPage->seeProductPriceInPage($this->product['name'], $this->variationPrice[0]); - - $I->wantTo('verify configurable product data in frontend product page.'); - $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); - $storefrontProductPage->seeProductNameInPage($this->product['name']); - $storefrontProductPage->seeProductPriceInPage($this->variationPrice[0]); - $storefrontProductPage->seeProductStockStatusInPage($this->product['stock_status']); - $storefrontProductPage->seeProductSkuInPage($this->productVariations[0]['sku']); - $storefrontProductPage->seeProductOptions($this->attributeValues); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php deleted file mode 100644 index e9e2c0f7f..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/ConfigurableProduct/UpdateConfigurableProductCest.php +++ /dev/null @@ -1,220 +0,0 @@ -loginAsAdmin(); - - $this->category = $I->getCategoryApiData(); - $this->category['id'] = $I->requireCategory($this->category)->id; - $this->category['url_key'] = $this->category['custom_attributes'][0]['value']; - - $this->product = $I->getProductApiData('configurable', $this->category['id']); - $this->product['id'] = ($I->requireConfigurableProduct($this->category['id'], $this->product))->id; - $this->product['url_key'] = $this->product['custom_attributes'][0]['value']; - if ($this->product['extension_attributes']['stock_item']['is_in_stock'] !== 0) { - $this->product['stock_status'] = 'In Stock'; - $this->product['qty'] = $this->product['extension_attributes']['stock_item']['qty']; - } else { - $this->product['stock_status'] = 'Out of Stock'; - } - - $this->attribute = $I->requireProductAttribute(); - - $this->productVariations = [ - [ - 'attribute_code' => $this->attribute->attribute_code, - 'attribute_value' => $this->attribute->options[1]->label . '_updated', - 'sku' => $this->product['sku'] . '_updated-' . $this->attribute->options[1]->label . '_updated', - 'price' => '11.11', - 'qty' => $this->product['qty'], - ], - [ - 'attribute_code' => $this->attribute->attribute_code, - 'attribute_value' => $this->attribute->options[2]->label . '_updated', - 'sku' => $this->product['sku'] . '_updated-' . $this->attribute->options[2]->label . '_updated', - 'price' => '22.22', - 'qty' => $this->product['qty'], - ] - ]; - - for ($c = 0; $c < count($this->productVariations); $c++) { - $this->variationPrice[$c] = $this->productVariations[$c]['price']; - $this->variationQuantity[$c] = $this->productVariations[$c]['qty']; - $this->attributeValues[$c] = $this->productVariations[$c]['attribute_value']; - } - } - - public function _after(AdminStep $I) - { - $I->goToTheAdminLogoutPage(); - } - - /** - * Allure annotations - * @Title("Update a configurable product and verify on the storefront") - * @Description("Update a configurable product and verify on the storefront.") - * @TestCaseId("") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminProductGridPage", value = "$adminProductGridPage") - * @Parameter(name = "AdminConfigurableProductPage", value = "$adminConfigurableProductPage") - * @Parameter(name = "StorefrontCategoryPage", value = "$storefrontCategoryPage") - * @Parameter(name = "StorefrontProductPage", value = "$storefrontProductPage") - * - * @param AdminStep $I - * @param AdminProductGridPage $adminProductGridPage - * @param AdminConfigurableProductPage $adminConfigurableProductPage - * @param StorefrontCategoryPage $storefrontCategoryPage - * @param StorefrontProductPage $storefrontProductPage - * @return void - */ - public function createConfigurableProductTest( - AdminStep $I, - AdminProductGridPage $adminProductGridPage, - AdminConfigurableProductPage $adminConfigurableProductPage, - StorefrontCategoryPage $storefrontCategoryPage, - StorefrontProductPage $storefrontProductPage - ) { - $I->wantTo('update configurable product in admin.'); - $adminProductGridPage->amOnAdminProductGridPage(); - $adminProductGridPage->searchBySku($this->product['sku']); - $adminProductGridPage->seeInCurrentGridNthRow(1, [$this->product['sku']]); - - $I->wantTo('open product created from precondition.'); - $adminConfigurableProductPage->amOnAdminEditProductPageById($this->product['id']); - - $I->wantTo('update configurable data.'); - $adminConfigurableProductPage->fillFieldProductName($this->product['name'] . '_updated'); - $adminConfigurableProductPage->fillFieldProductSku($this->product['sku'] . '_updated'); - $adminConfigurableProductPage->clickEditConfigurationsButton(); - - $I->wantTo('on Create Product Configurations Wizard - Select Attributes...'); - $adminConfigurableProductPage->filterAndSelectAttributeByCode( - strtolower($this->productVariations[0]['attribute_code']) - ); - $adminConfigurableProductPage->checkCheckboxInCurrentNthRow(1); - $adminConfigurableProductPage->clickNextButton(); - - $I->wantTo('on Create Product Configurations Wizard - Attributes Values...'); - for ($c = 0; $c < count($this->productVariations); $c++) { - $adminConfigurableProductPage->checkAndSelectAttributeOption( - $this->productVariations[$c]['attribute_code'], - $this->productVariations[$c]['attribute_value'] - ); - } - $adminConfigurableProductPage->clickNextButton(); - - $I->wantTo('on Create Product Configurations Wizard - Bulk Images, Price and Quantity...'); - $adminConfigurableProductPage->clickApplyUniquePriceRadioButton(); - $adminConfigurableProductPage->selectAttributeToApplyUniquePrice( - $this->productVariations[0]['attribute_code'] - ); - $adminConfigurableProductPage->fillFieldWithUniquePrice($this->variationPrice); - $adminConfigurableProductPage->clickApplySingleQuantityRadioButton(); - $adminConfigurableProductPage->fillFieldApplySingleQuantity($this->variationQuantity[0]); - $adminConfigurableProductPage->clickNextButton(); - - $I->wantTo('on Create Product Configurations Wizard - Summary...'); - $I->wantTo('generate configurable products.'); - $adminConfigurableProductPage->clickNextButton(); - - $I->wantTo('see configurable product successfully saved message.'); - $adminConfigurableProductPage->saveProduct(); - $I->seeElement($adminConfigurableProductPage::$successMessage); - - $I->wantTo('see updated product data.'); - $adminConfigurableProductPage->seeInPageTitle($this->product['name'] . '_updated'); - $adminConfigurableProductPage->seeProductName($this->product['name'] . '_updated'); - $adminConfigurableProductPage->seeProductSku($this->product['sku'] . '_updated'); - - $adminConfigurableProductPage->seeProductUrlKey(str_replace('_', '-', $this->product['url_key'])); - $adminConfigurableProductPage->assertNumberOfConfigurableVariations(count($this->productVariations)); - foreach ($this->productVariations as $variation) { - $adminConfigurableProductPage->seeInConfigurableVariations($variation); - } - - $I->wantTo('verify configurable product data in frontend category page.'); - $storefrontCategoryPage->amOnCategoryPage($this->category['url_key']); - //TODO: need to confirm if the product name should change. - $storefrontCategoryPage->seeProductLinksInPage( - $this->product['name'], - str_replace('_', '-', $this->product['url_key']) - ); - $storefrontCategoryPage->seeProductNameInPage($this->product['name']); - $storefrontCategoryPage->seeProductPriceInPage($this->product['name'], $this->variationPrice[0]); - - $I->wantTo('verify configurable product data in frontend product page.'); - $storefrontProductPage->amOnProductPage(str_replace('_', '-', $this->product['url_key'])); - $storefrontProductPage->seeProductNameInPage($this->product['name']); - $storefrontProductPage->seeProductPriceInPage($this->variationPrice[0]); - $storefrontProductPage->seeProductStockStatusInPage($this->product['stock_status']); - $storefrontProductPage->seeProductSkuInPage($this->productVariations[0]['sku'] . '_updated'); - $storefrontProductPage->seeProductOptions($this->attributeValues); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php deleted file mode 100644 index 84efbd029..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateCustomerCest.php +++ /dev/null @@ -1,279 +0,0 @@ -am('an Admin'); - $I->loginAsAdmin(); - $I->goToTheAdminAllCustomersGrid(); - $customerPageGrid->clickOnAddNewCustomerButton(); - } - - /** - * Allure annotations - * @Title("Enter text into every field on the ADD Customer page.") - * @Description("Enter text into ALL fields on the ADD Customer page and verify the content of the fields.") - * @Severity(level = SeverityLevel::NORMAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCustomerPage", value = "$adminCustomerPage") - * - * Codeception annotations - * @group fields - * @param AdminStep $I - * @param AdminCustomerPage $adminCustomerPage - * @return void - */ - public function verifyThatEachFieldOnTheCustomerAddPageWorks( - AdminStep $I, - AdminCustomerPage $adminCustomerPage - ) - { - $I->wantTo('verify that I can use all of the fields on the page.'); - $customerData = $I->getCustomerData(); - - $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); - $adminCustomerPage->selectGroupWholesale(); - $adminCustomerPage->enterPrefix($customerData['prefix']); - $adminCustomerPage->enterFirstName($customerData['firstname']); - $adminCustomerPage->enterMiddleName($customerData['middlename']); - $adminCustomerPage->enterLastName($customerData['lastname']); - $adminCustomerPage->enterSuffix($customerData['suffix']); - $adminCustomerPage->enterEmailAddress($customerData['email']); - $adminCustomerPage->enterDateOfBirth($customerData['dateOfBirth']); - $adminCustomerPage->enterTaxVatNumber($customerData['taxVatNumber']); - $adminCustomerPage->selectGenderFemale(); - $adminCustomerPage->selectSendWelcomeEmailFromDefaultStoreView(); - - $adminCustomerPage->verifyAssociateToWebsiteMainWebsite(); - $adminCustomerPage->verifyGroupWholesale(); - $adminCustomerPage->verifyPrefix($customerData['prefix']); - $adminCustomerPage->verifyFirstName($customerData['firstname']); - $adminCustomerPage->verifyMiddleName($customerData['middlename']); - $adminCustomerPage->verifyLastName($customerData['lastname']); - $adminCustomerPage->verifySuffix($customerData['suffix']); - $adminCustomerPage->verifyEmailAddress($customerData['email']); - $adminCustomerPage->verifyDateOfBirth($customerData['dateOfBirth']); - $adminCustomerPage->verifyTaxVatNumber($customerData['taxVatNumber']); - $adminCustomerPage->verifyGenderFemale(); - $adminCustomerPage->verifySendWelcomeEmailFromDefaultStoreView(); - } - - /** - * Allure annotations - * @Title("Enter text into every field on the ADD ADDRESS area of the Customer page.") - * @Description("Enter text into ALL fields on the ADD ADDRESS area on the Customer page and verify the content of the fields.") - * @Severity(level = SeverityLevel::NORMAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCustomerPage", value = "$adminCustomerPage") - * - * Codeception annotations - * @group fields - * @param AdminStep $I - * @param AdminCustomerPage $adminCustomerPage - * @return void - */ - public function verifyThatEachFieldOnTheCustomerAddAddressAreaWorks( - AdminStep $I, - AdminCustomerPage $adminCustomerPage - ) - { - $I->wantTo('verify that I can use all of the fields in the Add Address area.'); - $customerData = $I->getCustomerData(); - - $adminCustomerPage->clickOnAddressesLink(); - $adminCustomerPage->clickOnAddNewAddressButton(); - - $adminCustomerPage->clickOnAddNewAddressDefaultBillingAddress(); - $adminCustomerPage->clickOnAddNewAddressDefaultShippingAddress(); - - $adminCustomerPage->enterAddAddressPrefix($customerData['prefix']); - $adminCustomerPage->enterAddAddressFirstName($customerData['firstname']); - $adminCustomerPage->enterAddAddressMiddleName($customerData['middlename']); - $adminCustomerPage->enterAddAddressLastName($customerData['lastname']); - $adminCustomerPage->enterAddAddressSuffix($customerData['suffix']); - $adminCustomerPage->enterAddAddressCompany($customerData['company']); - $adminCustomerPage->enterAddAddressAddress1($customerData['address']['address1']); - $adminCustomerPage->enterAddAddressAddress2($customerData['address']['address2']); - $adminCustomerPage->enterAddAddressCity($customerData['address']['city']); - $adminCustomerPage->enterAddAddressCountry($customerData['address']['country']); - $adminCustomerPage->enterAddAddressState($customerData['address']['state']); - $adminCustomerPage->enterAddAddressZipPostalCode($customerData['address']['zipCode']); - $adminCustomerPage->enterAddAddressPhoneNumber($customerData['phoneNumber']); - $adminCustomerPage->enterAddAddressVatNumber($customerData['taxVatNumber']); - - $adminCustomerPage->verifyAddAddressDefaultBillingAddress(true); - $adminCustomerPage->verifyAddAddressDefaultShippingAddress(true); - - $adminCustomerPage->verifyAddAddressPrefix($customerData['prefix']); - $adminCustomerPage->verifyAddAddressFirstName($customerData['firstname']); - $adminCustomerPage->verifyAddAddressMiddleName($customerData['middlename']); - $adminCustomerPage->verifyAddAddressLastName($customerData['lastname']); - $adminCustomerPage->verifyAddAddressSuffix($customerData['suffix']); - $adminCustomerPage->verifyAddAddressCompany($customerData['company']); - $adminCustomerPage->verifyAddAddressAddress1($customerData['address']['address1']); - $adminCustomerPage->verifyAddAddressAddress2($customerData['address']['address2']); - $adminCustomerPage->verifyAddAddressCity($customerData['address']['city']); - $adminCustomerPage->verifyAddAddressCountry($customerData['address']['country']); - $adminCustomerPage->verifyAddAddressState($customerData['address']['state']); - $adminCustomerPage->verifyAddAddressZipPostalCode($customerData['address']['zipCode']); - $adminCustomerPage->verifyAddAddressPhoneNumber($customerData['phoneNumber']); - $adminCustomerPage->verifyAddAddressVatNumber($customerData['taxVatNumber']); - } - - /** - * Allure annotations - * @Title("Create a new Customer account using the REQUIRED fields only.") - * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Admin page.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCustomerPage", value = "$adminCustomerPage") - * @Parameter(name = "AdminCustomerGrid", value = "$adminCustomerGrid") - * - * Codeception annotations - * @group add - * @param AdminStep $I - * @param AdminCustomerPage $adminCustomerPage - * @param AdminCustomerGrid $adminCustomerGrid - * @return void - */ - public function createBasicCustomerAccountTest( - AdminStep $I, - AdminCustomerPage $adminCustomerPage, - AdminCustomerGrid $adminCustomerGrid - ) - { - $I->wantTo('verify basic Customer creation in admin'); - $customerData = $I->getCustomerData(); - - $adminCustomerPage->enterFirstName($customerData['firstname']); - $adminCustomerPage->enterLastName($customerData['lastname']); - $adminCustomerPage->enterEmailAddress($customerData['email']); - $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); - $adminCustomerPage->selectGroupGeneral(); - - $adminCustomerPage->clickOnSaveCustomerButton(); - - $adminCustomerGrid->performSearchByKeyword($customerData['email']); - $adminCustomerGrid->clickOnActionLinkFor($customerData['email']); - - $adminCustomerPage->clickOnAccountInformationLink(); - $adminCustomerPage->verifyFirstName($customerData['firstname']); - $adminCustomerPage->verifyLastName($customerData['lastname']); - $adminCustomerPage->verifyEmailAddress($customerData['email']); - $adminCustomerPage->verifyAssociateToWebsiteMainWebsite(); - $adminCustomerPage->verifyGroupGeneral(); - } - - /** - * Allure annotations - * @Title("Create a new Customer account using the REQUIRED fields with an Address.") - * @Description("Enter text into the REQUIRED fields, SAVE the content and VERIFY it on the Admin page.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminCustomerPage", value = "$adminCustomerPage") - * @Parameter(name = "AdminCustomerGrid", value = "$adminCustomerGrid") - * - * Codeception annotations - * @group add - * @param AdminStep $I - * @param AdminCustomerPage $adminCustomerPage - * @param AdminCustomerGrid $adminCustomerGrid - * @return void - */ - public function createBasicCustomerAccountWithAddressTest( - AdminStep $I, - AdminCustomerPage $adminCustomerPage, - AdminCustomerGrid $adminCustomerGrid - ) - { - $I->wantTo('verify basic Customer creation in admin'); - $customerData = $I->getCustomerData(); - - $adminCustomerPage->clickOnAddressesLink(); - $adminCustomerPage->clickOnAddNewAddressButton(); - - $adminCustomerPage->clickOnAddNewAddressDefaultBillingAddress(); - $adminCustomerPage->clickOnAddNewAddressDefaultShippingAddress(); - - $adminCustomerPage->enterAddAddressPrefix($customerData['prefix']); - $adminCustomerPage->enterAddAddressFirstName($customerData['firstname']); - $adminCustomerPage->enterAddAddressMiddleName($customerData['middlename']); - $adminCustomerPage->enterAddAddressLastName($customerData['lastname']); - $adminCustomerPage->enterAddAddressSuffix($customerData['suffix']); - $adminCustomerPage->enterAddAddressCompany($customerData['company']); - $adminCustomerPage->enterAddAddressAddress1($customerData['address']['address1']); - $adminCustomerPage->enterAddAddressAddress2($customerData['address']['address2']); - $adminCustomerPage->enterAddAddressCity($customerData['address']['city']); - $adminCustomerPage->enterAddAddressCountry($customerData['address']['country']); - $adminCustomerPage->enterAddAddressState($customerData['address']['state']); - $adminCustomerPage->enterAddAddressZipPostalCode($customerData['address']['zipCode']); - $adminCustomerPage->enterAddAddressPhoneNumber($customerData['phoneNumber']); - $adminCustomerPage->enterAddAddressVatNumber($customerData['taxVatNumber']); - - $adminCustomerPage->clickOnAccountInformationLink(); - - $adminCustomerPage->enterFirstName($customerData['firstname']); - $adminCustomerPage->enterLastName($customerData['lastname']); - $adminCustomerPage->enterEmailAddress($customerData['email']); - $adminCustomerPage->selectAssociateToWebsiteMainWebsite(); - $adminCustomerPage->selectGroupGeneral(); - - $adminCustomerPage->clickOnSaveCustomerButton(); - - $adminCustomerGrid->performSearchByKeyword($customerData['email']); - $adminCustomerGrid->clickOnActionLinkFor($customerData['email']); - - $adminCustomerPage->clickOnAddressesLink(); - $adminCustomerPage->verifyAddAddressDefaultBillingAddress(true); - $adminCustomerPage->verifyAddAddressDefaultShippingAddress(true); - - $adminCustomerPage->verifyAddAddressPrefix($customerData['prefix']); - $adminCustomerPage->verifyAddAddressFirstName($customerData['firstname']); - $adminCustomerPage->verifyAddAddressMiddleName($customerData['middlename']); - $adminCustomerPage->verifyAddAddressLastName($customerData['lastname']); - $adminCustomerPage->verifyAddAddressSuffix($customerData['suffix']); - $adminCustomerPage->verifyAddAddressCompany($customerData['company']); - $adminCustomerPage->verifyAddAddressAddress1($customerData['address']['address1']); - $adminCustomerPage->verifyAddAddressAddress2($customerData['address']['address2']); - $adminCustomerPage->verifyAddAddressCity($customerData['address']['city']); - $adminCustomerPage->verifyAddAddressCountry($customerData['address']['country']); - $adminCustomerPage->verifyAddAddressState($customerData['address']['state']); - $adminCustomerPage->verifyAddAddressZipPostalCode($customerData['address']['zipCode']); - $adminCustomerPage->verifyAddAddressPhoneNumber($customerData['phoneNumber']); - $adminCustomerPage->verifyAddAddressVatNumber($customerData['taxVatNumber']); - } -} \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php deleted file mode 100644 index 077c37c6b..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/CreateNewCustomerFrontendCest.php +++ /dev/null @@ -1,84 +0,0 @@ -customer = $I->getCustomerApiDataWithPassword(); - $this->customer = array_merge($this->customer['customer'], $this->customer); - unset($this->customer['customer']); - } - - /** - * Create customer. - * - * Allure annotations - * @Title("Create new customer storefront") - * @Description("Create new customer storefront") - * @TestCaseId("") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AcceptanceTester", value = "$I") - * @Parameter(name = "StorefrontCustomerAccountCreatePage", value = "$customerAccountCreatePage") - * @Parameter(name = "StorefrontCustomerAccountDashboardPage", value = "$customerAccountDashboardPage") - * - * @param AcceptanceTester $I - * @param StorefrontCustomerAccountCreatePage $customerAccountCreatePage - * @param StorefrontCustomerAccountDashboardPage $customerAccountDashboardPage - * @return void - */ - public function createCustomerTest( - AcceptanceTester $I, - StorefrontCustomerAccountCreatePage $customerAccountCreatePage, - StorefrontCustomerAccountDashboardPage $customerAccountDashboardPage - ) { - $I->wantTo('create customer in frontend page.'); - $customerAccountCreatePage->amOnCustomerAccountCreatePage(); - $customerAccountCreatePage->fillFieldFirstName($this->customer['firstname']); - $customerAccountCreatePage->fillFieldLastName($this->customer['lastname']); - $customerAccountCreatePage->setNewsletterSubscribe(true); - $customerAccountCreatePage->fillFieldEmail($this->customer['email']); - $customerAccountCreatePage->fillFieldPassword($this->customer['password']); - $customerAccountCreatePage->fillFieldConfirmPassword($this->customer['password']); - $customerAccountCreatePage->clickCreateAccountButton(); - $customerAccountDashboardPage->seeContactInformationName( - $this->customer['firstname'] . ' ' . $this->customer['lastname'] - ); - $customerAccountDashboardPage->seeContactInformationEmail($this->customer['email']); - $customerAccountDashboardPage->seeNewsletterText('subscribed'); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php deleted file mode 100644 index 67595b9b5..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Customer/SignInCustomerFrontendCest.php +++ /dev/null @@ -1,79 +0,0 @@ -customer = $I->getCustomerApiData(); - $this->customer['id'] = $I->requireCustomer($this->customer); - } - - /** - * Sign in existing customer. - * - * Allure annotations - * @Title("Sign in existing customer storefront") - * @Description("Sign in existing customer storefront") - * @TestCaseId("") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AcceptanceTester", value = "$I") - * @Parameter(name = "StorefrontCustomerAccountLoginPage", value = "$customerAccountLoginPage") - * @Parameter(name = "StorefrontCustomerAccountDashboardPage", value = "$customerAccountDashboardPage") - * - * @param AcceptanceTester $I - * @param StorefrontCustomerAccountLoginPage $customerAccountLoginPage - * @param StorefrontCustomerAccountDashboardPage $customerAccountDashboardPage - * @return void - */ - public function createCustomerTest( - AcceptanceTester $I, - StorefrontCustomerAccountLoginPage $customerAccountLoginPage, - StorefrontCustomerAccountDashboardPage $customerAccountDashboardPage - ) { - $I->wantTo('create customer in frontend page.'); - $customerAccountLoginPage->amOnCustomerAccountLoginPage(); - $customerAccountLoginPage->fillFieldCustomerEmail($this->customer['email']); - $customerAccountLoginPage->fillFieldCustomerPassword($this->customer['password']); - $customerAccountLoginPage->clickSignInButton(); - - $customerAccountDashboardPage->seeContactInformationName( - $this->customer['firstname'] . ' ' . $this->customer['lastname'] - ); - $customerAccountDashboardPage->seeContactInformationEmail($this->customer['email']); - $customerAccountDashboardPage->seeNewsletterText('subscribed to'); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php deleted file mode 100644 index a23642037..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/Sales/CreateOrderViaAdminCest.php +++ /dev/null @@ -1,138 +0,0 @@ -loginAsAdmin(); - } - - /** - * Allure annotations - * @Title("Create an Order via the Admin") - * @Description("Setup a Category, Product, Customer and place an Order using them via the Admin.") - * @Severity(level = SeverityLevel::CRITICAL) - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminOrderGrid", value = "$adminOrderGrid") - * @Parameter(name = "AdminOrderPage", value = "$adminOrderAddPage") - * @Parameter(name = "AdminOrderDetailsPage", value = "$adminOrderDetailsPage") - * - * Codeception annotations - * @param AdminStep $I - * @param AdminCustomerPage $adminCustomerPage - * @param AdminCategoryPage $adminCategoryPage - * @param AdminProductPage $adminProductPage - * @param AdminOrderGrid $adminOrderGrid - * @param AdminOrderAddPage $adminOrderAddPage - * @param AdminOrderDetailsPage $adminOrderDetailsPage - * @return void - */ - public function createOrderViaAdmin( - AdminStep $I, - AdminCustomerPage $adminCustomerPage, - AdminCategoryPage $adminCategoryPage, - AdminProductPage $adminProductPage, - AdminOrderGrid $adminOrderGrid, - AdminOrderAddPage $adminOrderAddPage, - AdminOrderDetailsPage $adminOrderDetailsPage - ) - { - $customerDetails = $I->getCustomerData(); - $categoryDetails = $I->getCategoryData(); - $productDetails = $I->getProductData(); - - $customerName = $customerDetails['firstname'] . " " . $customerDetails['lastname']; - - $I->goToTheAdminAllCustomersGrid(); - $adminCustomerPage->addBasicCustomerWithAddress($customerDetails); - - $I->goToTheAdminCategoriesPage(); - $adminCategoryPage->addBasicCategory($categoryDetails); - - $I->goToTheAdminCatalogPage(); - $adminProductPage->addBasicProductUnderCategory($productDetails, $categoryDetails); - - $I->goToTheAdminOrdersGrid(); - $adminOrderGrid->clickOnCreateNewOrderButton(); - - $adminOrderAddPage->enterCustomerEmailSearchTerm($customerDetails['email']); - $adminOrderAddPage->clickOnCustomerSearchButton(); - $adminOrderAddPage->clickOnCustomerFor($customerDetails['email']); - - $adminOrderAddPage->clickOnDefaultStoreView(); - - $adminOrderAddPage->clickOnAddProductsButton(); - $adminOrderAddPage->enterProductSkuSearchField($productDetails['sku']); - $adminOrderAddPage->clickOnProductsSearchButton(); - $adminOrderAddPage->clickOnProductSkuFor($productDetails['sku']); - $adminOrderAddPage->clickOnAddSelectedProductsToOrderButton(); - - $adminOrderAddPage->clickOnGetShippingMethodsAndRatesLink(); - $adminOrderAddPage->clickOnFixedShippingMethod(); - - $adminOrderAddPage->clickOnBottomSubmitButton(); - - $adminOrderDetailsPage->verifyThatYouCreatedAnOrderMessageIsPresent(); - $adminOrderDetailsPage->verifyThereIsAnOrderNumber(); - $adminOrderDetailsPage->verifyThatTheOrderWasPlacedToday(); - $adminOrderDetailsPage->verifyOrderStatusPending(); - $adminOrderDetailsPage->verifyPurchasedFromDefaultStoreView(); - - $adminOrderDetailsPage->verifyThatYouCreatedAnOrderMessageIsPresent(); - $adminOrderDetailsPage->verifyThatTheOrderWasPlacedToday(); - $adminOrderDetailsPage->verifyOrderStatusPending(); - $adminOrderDetailsPage->verifyPurchasedFromDefaultStoreView(); - $adminOrderDetailsPage->verifyCustomerName($customerName); - $adminOrderDetailsPage->verifyCustomerEmail($customerDetails['email']); - $adminOrderDetailsPage->verifyCustomerGroup('General'); - - $adminOrderDetailsPage->verifyBillingAddressInformation($customerDetails); - $adminOrderDetailsPage->verifyShippingAddressInformation($customerDetails); - - $adminOrderDetailsPage->verifyPaymentTypeCheckMoneyOrder(); - $adminOrderDetailsPage->verifyPaymentCurrencyUSD(); - - $adminOrderDetailsPage->verifyShippingMethodFixedRate(); - $adminOrderDetailsPage->verifyShippingHandlingPrice('$0.00'); - - // TODO: Add verification for Product Details in the Order - $adminOrderDetailsPage->verifyItemsOrderedFor($productDetails); - - $adminOrderDetailsPage->verifyOrderStatusDropDownPending(); - $adminOrderDetailsPage->verifyOrderComments(''); - - $adminOrderDetailsPage->verifySubTotalPrice($productDetails['price']); - $adminOrderDetailsPage->verifyShippingHandlingPrice('$0.00'); - } -} \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCept.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCept.php deleted file mode 100644 index 781a07371..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('perform actions and see result'); diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php deleted file mode 100644 index 2c24da331..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/ExampleCest.php +++ /dev/null @@ -1,23 +0,0 @@ -goToTheAdminLoginPage(); - $I->loginAsAdmin(); - } - - /** - * @env phantomjs - * @env chrome - * @group example - */ - public function accessTheSalesOrdersPage(AdminStep $I) - { - $I->goToTheAdminOrdersGrid(); - $I->shouldBeOnTheAdminOrdersGrid(); - } - - /** - * @env phantomjs - * @env chrome - * @group example - */ - public function accessTheProductsCatalogPage(AdminStep $I) - { - $I->goToTheAdminCatalogPage(); - $I->shouldBeOnTheAdminCatalogGrid(); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php deleted file mode 100644 index 11e1d4d3c..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('demo the usage of StepObject in Cept'); -$I->loginAsAdmin(); \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php deleted file mode 100644 index 0904ed3e0..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/SampleTests/TestStepObjectCest.php +++ /dev/null @@ -1,23 +0,0 @@ -wantTo('demo the usage of StepObject in Cest'); - $I->loginAsAdmin(); - } -} \ No newline at end of file diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php deleted file mode 100644 index eb6f0e77e..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessAdminLoginPageCest.php +++ /dev/null @@ -1,49 +0,0 @@ -am('an Admin'); - $I->wantTo('verify that I can access the Admin Login page'); - - $I->goToTheAdminLoginPage(); - $I->shouldBeOnTheAdminLoginPage(); - $I->lookForwardTo('being on the Admin Login page'); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php deleted file mode 100644 index 06a84595e..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/AccessForgotYourPasswordCest.php +++ /dev/null @@ -1,106 +0,0 @@ -goToTheAdminLoginPage(); - } - - /** - * Allure annotations - * @Title("You should land on the Forgot Your Password page.") - * @Description("You should be able to access the Forgot Your Password page.") - * @Severity(level = SeverityLevel::CRITICAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminLogin", value = "$adminLogin") - * - * Codeception annotations - * @param AdminStep $I - * @param AdminLogin $adminLogin - * @return void - */ - public function shouldLandOnTheForgotYourPasswordPage(AdminStep $I, AdminLogin $adminLogin) - { - $I->am('an Admin'); - $I->wantTo('see if I can access the Forgot Your Password page'); - $adminLogin->clickOnForgotYourPassword(); - $I->shouldBeOnTheAdminForgotYourPasswordPage(); - $adminLogin->shouldSeeTheForgotYourPasswordFields(); - $I->see('Password Help'); - } - - /** - * Allure annotations - * @Title("You should be able to access the Login page from the Forgot Your Password page") - * @Description("You should land on the Login page after clicking on 'Back to Sign In'.") - * @Severity(level = SeverityLevel::TRIVIAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminLogin", value = "$adminLogin") - * - * Codeception annotations - * @param AdminStep $I - * @param AdminLogin $adminLogin - * @return void - */ - public function shouldLandOnTheLoginPageWhenBackToSignInIsClicked(AdminStep $I, AdminLogin $adminLogin) - { - $I->am('an Admin'); - $I->wantTo('see if I can access the Login page from the Forgot Your Password page'); - $adminLogin->clickOnForgotYourPassword(); - $adminLogin->clickOnBackToSignIn(); - $I->shouldBeOnTheAdminLoginPage(); - } - - /** - * Allure annotations - * @Title("You should be able to access the Login page from the Forgot Your Password page") - * @Description("You should land on the Login page after clicking on the Logo.") - * @Severity(level = SeverityLevel::TRIVIAL) - * @TestCaseId("") - * @Parameter(name = "AdminStep", value = "$I") - * @Parameter(name = "AdminLogin", value = "$adminLogin") - * - * Codeception annotations - * @param AdminStep $I - * @param AdminLogin $adminLogin - * @return void - */ - public function shouldLandOnTheLoginPageWhenTheLogoIsClicked(AdminStep $I, AdminLogin $adminLogin) - { - $I->am('an Admin'); - $I->wantTo('see if I can access the Login page by clicking on the Logo'); - $adminLogin->clickOnMagentoLogo(); - $I->shouldBeOnTheAdminLoginPage(); - - $adminLogin->clickOnForgotYourPassword(); - $adminLogin->clickOnMagentoLogo(); - $I->shouldBeOnTheAdminLoginPage(); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php deleted file mode 100644 index 81d3f86f7..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminAfterLoggingOutCest.php +++ /dev/null @@ -1,57 +0,0 @@ -am('an Admin'); - $I->wantTo('make sure you cannot access Admin pages after logging out'); - - $I->loginAsAdmin(); - $I->goToTheAdminLogoutPage(); - - $I->goToRandomAdminPage(); - $I->shouldBeOnTheAdminLoginPage(); - - $I->goToRandomAdminPage(); - $I->shouldBeOnTheAdminLoginPage(); - - $I->goToRandomAdminPage(); - $I->shouldBeOnTheAdminLoginPage(); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php deleted file mode 100644 index bec537445..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/CannotAccessAdminPagesCest.php +++ /dev/null @@ -1,55 +0,0 @@ -am('an Admin'); - $I->wantTo('make sure you cannot access Admin pages when NOT logged in'); - $I->goToTheAdminLoginPage(); - - $I->goToRandomAdminPage(); - $I->shouldBeOnTheAdminLoginPage(); - - $I->goToRandomAdminPage(); - $I->shouldBeOnTheAdminLoginPage(); - - $I->goToRandomAdminPage(); - $I->shouldBeOnTheAdminLoginPage(); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php deleted file mode 100644 index 7a9173166..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LoginOnAdminLoginPageCest.php +++ /dev/null @@ -1,49 +0,0 @@ -am('an Admin'); - $I->wantTo('verify that I can login via the Admin Login page'); - - $I->loginAsAdmin(); - $I->shouldBeOnTheAdminDashboardPage(); - } -} diff --git a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php b/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php deleted file mode 100644 index 795f5d108..000000000 --- a/tests/acceptance/Magento/Xxyyzz/Acceptance/User/LogoutAfterLoginCest.php +++ /dev/null @@ -1,49 +0,0 @@ -am('an Admin'); - $I->wantTo('logout of the Admin area and land on the Login page'); - - $I->loginAsAdmin(); - $I->goToTheAdminLogoutPage(); - $I->shouldBeOnTheAdminLoginPage(); - } -} diff --git a/tests/acceptance/_bootstrap.php b/tests/acceptance/_bootstrap.php deleted file mode 100644 index 8a8855580..000000000 --- a/tests/acceptance/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ - Date: Mon, 22 May 2017 15:48:02 -0500 Subject: [PATCH 073/149] MTA-4213: updated .gitignore and removed yml config file. --- .gitignore | 6 ------ codeception.dist.yml | 31 ------------------------------- 2 files changed, 37 deletions(-) delete mode 100644 codeception.dist.yml diff --git a/.gitignore b/.gitignore index 1977bd5c3..8091249d3 100755 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,3 @@ .idea composer.phar vendor/* -tests/_output/* -tests/_support/Magento/Xxyyzz/AcceptanceTester.php -tests/acceptance.suite.yml -codeception.yml -.env -_generated \ No newline at end of file diff --git a/codeception.dist.yml b/codeception.dist.yml deleted file mode 100644 index d678ae324..000000000 --- a/codeception.dist.yml +++ /dev/null @@ -1,31 +0,0 @@ -actor: Tester -paths: - tests: tests - log: tests/_output - data: tests/_data - support: src/Magento/Xxyyzz - envs: etc/_envs -settings: - bootstrap: _bootstrap.php - colors: true - memory_limit: 1024M -extensions: - enabled: - - Codeception\Extension\RunFailed - - Yandex\Allure\Adapter\AllureAdapter - config: - Yandex\Allure\Adapter\AllureAdapter: - deletePreviousResults: true - outputDirectory: allure-results - ignoredAnnotations: - - env - - zephyrId -params: - - .env -modules: - config: - Db: - dsn: "%DB_DSN%" - user: "%DB_USERNAME%" - password: "%DB_PASSWORD%" - dump: tests/_data/dump.sql \ No newline at end of file From 38d957d47f23df7b60897173b4d0d665ff7078a5 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Fri, 5 May 2017 05:23:52 -0500 Subject: [PATCH 074/149] MTA-4179: PO - Shipments - Grid. --- .../Page/Sales/Shipment/AdminShipmentGrid.php | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 tests/_support/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php b/tests/_support/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php new file mode 100644 index 000000000..73c557e8d --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php @@ -0,0 +1,81 @@ +acceptanceTester; + $I->fillField(self::$filterShipDateFromField, $shipDateFrom); + } + + public function enterFilterShipDateTo($shipDateTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterShipDateToField, $shipDateTo); + } + + public function enterFilterOrderDateFrom($orderDateFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterOrderDateFromField, $orderDateFrom); + } + + public function enterFilterOrderDateTo($orderDateTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterOrderDateToField, $orderDateTo); + } + + public function enterTotalQtyFrom($totalQtyFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterTotalQtyFromField, $totalQtyFrom); + } + + public function enterTotalQtyTo($totalQtyTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterTotalQtyToField, $totalQtyTo); + } + + public function selectPurchasedFrom($purchasedFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterPurchasedFromDropDown, $purchasedFrom); + } + + public function enterShipment($shipment) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterShipmentField, $shipment); + } + + public function enterOrder($order) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterOrderField, $order); + } + + public function enterShipToName($shipToName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterShipToNameField, $shipToName); + } +} From 7b1c1a35cd6741defd05316d5f3732a2d1490df2 Mon Sep 17 00:00:00 2001 From: Vasyl Kozyrenko Date: Thu, 11 May 2017 03:50:02 -0500 Subject: [PATCH 075/149] MTA-4164: PO - Invoices - Grid. --- .../Page/Sales/Invoice/AdminInvoiceGrid.php | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 tests/_support/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php b/tests/_support/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php new file mode 100644 index 000000000..ed1b2dc99 --- /dev/null +++ b/tests/_support/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php @@ -0,0 +1,102 @@ +acceptanceTester; + $I->fillField(self::$filterInvoiceDateFromField, $invoiceDateFrom); + } + + public function enterFilterInvoiceDateTo($invoiceDateTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterInvoiceDateToField, $invoiceDateTo); + } + + public function enterFilterOrderDateFrom($orderDateFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterOrderDateFromField, $orderDateFrom); + } + + public function enterFilterOrderDateTo($orderDateTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterOrderDateToField, $orderDateTo); + } + + public function enterFilterBaseGrandTotalFrom($baseGrandTotalFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterBaseGrandTotalFromField, $baseGrandTotalFrom); + } + + public function enterFilterBaseGrandTotalTo($baseGrandTotalTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterBaseGrandTotalToField, $baseGrandTotalTo); + } + + public function enterFilterGrandTotalFrom($grandTotalFrom) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterGrandTotalFromField, $grandTotalFrom); + } + + public function enterFilterGrandTotalTo($grandTotalTo) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterGrandTotalToField, $grandTotalTo); + } + + public function selectPurchasedFrom($purchasedFrom) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$filterPurchasedFromDropDown, $purchasedFrom); + } + + public function selectStatus($status) + { + $I = $this->acceptanceTester; + $I->selectOption(self::$filterStatusDropDown, $status); + } + + public function enterInvoice($invoice) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterInvoiceField, $invoice); + } + + public function enterOrder($order) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterOrderField, $order); + } + + public function enterBillToName($billToName) + { + $I = $this->acceptanceTester; + $I->fillField(self::$filterBillToNameField, $billToName); + } +} From 8f67c9a6f0fdb57b5342b0efffbfbe7c3109f74d Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 23 May 2017 09:56:53 -0500 Subject: [PATCH 076/149] MTA-4213: merged AdminInvoiceGrid and AdminShipmentGrid page objects in new framework. --- .../Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php | 0 .../Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {tests/_support => src}/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php (100%) rename {tests/_support => src}/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php (100%) diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php b/src/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php rename to src/Magento/Xxyyzz/Page/Sales/Invoice/AdminInvoiceGrid.php diff --git a/tests/_support/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php b/src/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php similarity index 100% rename from tests/_support/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php rename to src/Magento/Xxyyzz/Page/Sales/Shipment/AdminShipmentGrid.php From 4848c29cb11fa03d1015eccc25f38262cbfc9f18 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 23 May 2017 14:46:14 -0500 Subject: [PATCH 077/149] MTA-4213: cleaned up framework package composer dependencies. --- composer.json | 11 +- composer.lock | 1820 ++--------------- .../Xxyyzz/Module/MagentoRestDriver.php | 1 + 3 files changed, 222 insertions(+), 1610 deletions(-) diff --git a/composer.json b/composer.json index 8438001a6..b7d75f55e 100755 --- a/composer.json +++ b/composer.json @@ -4,20 +4,11 @@ "description": "Magento Acceptance Testing Framework", "keywords": ["magento", "automation", "acceptance", "testing"], "require": { - "php": ">=5.4.0", - "codeception/codeception": "~2.2", - "symfony/filesystem": "~2.6", - "symfony/finder": "~2.6", - "consolidation/robo": "^1.0.0", - "allure-framework/allure-codeception": "dev-master", + "codeception/codeception": "~2.2|2.3", "flow/jsonpath": ">0.2", - "vlucas/phpdotenv": "~2.4", "fzaninotto/faker": "^1.6" }, "autoload": { - "psr-0": { - "Yandex": "vendor/allure-framework/allure-codeception/src/" - }, "psr-4": { "Magento\\Xxyyzz\\": "src/Magento/Xxyyzz" } diff --git a/composer.lock b/composer.lock index 3fec03694..f885d5953 100644 --- a/composer.lock +++ b/composer.lock @@ -4,112 +4,9 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "c898396a0e199f4ee06aa583d460dd13", - "content-hash": "b3996f320720df346a5957013e38c433", + "hash": "6bd1d4309326e68d95d58525a7ad1008", + "content-hash": "7e79b94dc6f0047a64653467582fb486", "packages": [ - { - "name": "allure-framework/allure-codeception", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/allure-framework/allure-codeception.git", - "reference": "af40af5ae2b717618a42fe3e137d75878508c75d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/allure-framework/allure-codeception/zipball/af40af5ae2b717618a42fe3e137d75878508c75d", - "reference": "af40af5ae2b717618a42fe3e137d75878508c75d", - "shasum": "" - }, - "require": { - "allure-framework/allure-php-api": "~1.1.0", - "codeception/codeception": "~2.1", - "php": ">=5.4.0", - "symfony/filesystem": ">=2.6", - "symfony/finder": ">=2.6" - }, - "type": "library", - "autoload": { - "psr-0": { - "Yandex": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Ivan Krutov", - "email": "vania-pooh@yandex-team.ru", - "role": "Developer" - } - ], - "description": "A Codeception adapter for Allure report.", - "homepage": "http://allure.qatools.ru/", - "keywords": [ - "allure", - "attachments", - "cases", - "codeception", - "report", - "steps", - "testing" - ], - "time": "2017-03-30 09:01:00" - }, - { - "name": "allure-framework/allure-php-api", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/allure-framework/allure-php-adapter-api.git", - "reference": "a462a0da121681577033e13c123b6cc4e89cdc64" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/allure-framework/allure-php-adapter-api/zipball/a462a0da121681577033e13c123b6cc4e89cdc64", - "reference": "a462a0da121681577033e13c123b6cc4e89cdc64", - "shasum": "" - }, - "require": { - "jms/serializer": ">=0.16.0", - "moontoast/math": ">=1.1.0", - "php": ">=5.4.0", - "phpunit/phpunit": ">=4.0.0", - "ramsey/uuid": ">=3.0.0", - "symfony/http-foundation": ">=2.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Yandex": [ - "src/", - "test/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Ivan Krutov", - "email": "vania-pooh@yandex-team.ru", - "role": "Developer" - } - ], - "description": "PHP API for Allure adapter", - "homepage": "http://allure.qatools.ru/", - "keywords": [ - "allure", - "api", - "php", - "report" - ], - "time": "2016-12-07 12:15:46" - }, { "name": "behat/gherkin", "version": "v4.4.5", @@ -171,16 +68,16 @@ }, { "name": "codeception/codeception", - "version": "2.2.11", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "a8681b416921ae282ccca2c485d75a3ed6756080" + "reference": "b54eaf4007484f36145c1dc8c64da1874adbc340" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/a8681b416921ae282ccca2c485d75a3ed6756080", - "reference": "a8681b416921ae282ccca2c485d75a3ed6756080", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b54eaf4007484f36145c1dc8c64da1874adbc340", + "reference": "b54eaf4007484f36145c1dc8c64da1874adbc340", "shasum": "" }, "require": { @@ -261,45 +158,41 @@ "functional testing", "unit testing" ], - "time": "2017-05-11 21:07:05" + "time": "2017-05-22 23:47:35" }, { - "name": "consolidation/annotated-command", - "version": "2.4.8", + "name": "doctrine/instantiator", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/consolidation/annotated-command.git", - "reference": "6672ea38212f8bffb71fec7eadc8b3372154b17e" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/6672ea38212f8bffb71fec7eadc8b3372154b17e", - "reference": "6672ea38212f8bffb71fec7eadc8b3372154b17e", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "consolidation/output-formatters": "^3.1.5", - "php": ">=5.4.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "psr/log": "^1", - "symfony/console": "^2.8|~3", - "symfony/event-dispatcher": "^2.5|^3", - "symfony/finder": "^2.5|^3" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "^2.7" + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Consolidation\\AnnotatedCommand\\": "src" + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -308,94 +201,97 @@ ], "authors": [ { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" } ], - "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-04-03 22:37:00" + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" }, { - "name": "consolidation/log", - "version": "1.0.3", + "name": "facebook/webdriver", + "version": "1.4.1", "source": { "type": "git", - "url": "https://github.com/consolidation/log.git", - "reference": "74ba81b4edc585616747cc5c5309ce56fec41254" + "url": "https://github.com/facebook/php-webdriver.git", + "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/log/zipball/74ba81b4edc585616747cc5c5309ce56fec41254", - "reference": "74ba81b4edc585616747cc5c5309ce56fec41254", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/eadb0b7a7c3e6578185197fd40158b08c3164c83", + "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83", "shasum": "" }, "require": { - "php": ">=5.5.0", - "psr/log": "~1.0", - "symfony/console": "~2.5|~3.0" + "ext-curl": "*", + "ext-zip": "*", + "php": "^5.5 || ~7.0", + "symfony/process": "^2.8 || ^3.1" }, "require-dev": { - "phpunit/phpunit": "4.*", - "squizlabs/php_codesniffer": "2.*" + "friendsofphp/php-cs-fixer": "^2.0", + "php-mock/php-mock-phpunit": "^1.1", + "phpunit/phpunit": "4.6.* || ~5.0", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "^2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-community": "1.5-dev" } }, "autoload": { "psr-4": { - "Consolidation\\Log\\": "src" + "Facebook\\WebDriver\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache-2.0" ], - "authors": [ - { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" - } + "description": "A PHP client for Selenium WebDriver", + "homepage": "https://github.com/facebook/php-webdriver", + "keywords": [ + "facebook", + "php", + "selenium", + "webdriver" ], - "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", - "time": "2016-03-23 23:46:42" + "time": "2017-04-28 14:54:49" }, { - "name": "consolidation/output-formatters", - "version": "3.1.9", + "name": "flow/jsonpath", + "version": "0.3.4", "source": { "type": "git", - "url": "https://github.com/consolidation/output-formatters.git", - "reference": "2e09069866bae89d3fb545365f997a40745e34d2" + "url": "https://github.com/FlowCommunications/JSONPath.git", + "reference": "00aa9c361e4d0a210dd95f3c917a1e0dde3a957f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/2e09069866bae89d3fb545365f997a40745e34d2", - "reference": "2e09069866bae89d3fb545365f997a40745e34d2", + "url": "https://api.github.com/repos/FlowCommunications/JSONPath/zipball/00aa9c361e4d0a210dd95f3c917a1e0dde3a957f", + "reference": "00aa9c361e4d0a210dd95f3c917a1e0dde3a957f", "shasum": "" }, "require": { - "php": ">=5.4.0", - "symfony/console": "^2.8|~3", - "symfony/finder": "~2.5|~3.0" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "^2.7", - "victorjonsson/markdowndocs": "^1.3" + "peekmo/jsonpath": "dev-master", + "phpunit/phpunit": "^4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "autoload": { - "psr-4": { - "Consolidation\\OutputFormatters\\": "src" + "psr-0": { + "Flow\\JSONPath": "src/", + "Flow\\JSONPath\\Test": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -404,77 +300,42 @@ ], "authors": [ { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" + "name": "Stephen Frank", + "email": "stephen@flowsa.com" } ], - "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-05-08 15:59:33" + "description": "JSONPath implementation for parsing, searching and flattening arrays", + "time": "2016-09-06 17:43:18" }, { - "name": "consolidation/robo", - "version": "1.0.6", + "name": "fzaninotto/faker", + "version": "v1.6.0", "source": { "type": "git", - "url": "https://github.com/consolidation/Robo.git", - "reference": "de6225256b2ed88822af1cd8cc3a01bf933add8c" + "url": "https://github.com/fzaninotto/Faker.git", + "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/de6225256b2ed88822af1cd8cc3a01bf933add8c", - "reference": "de6225256b2ed88822af1cd8cc3a01bf933add8c", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123", + "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123", "shasum": "" }, "require": { - "consolidation/annotated-command": "^2.2", - "consolidation/log": "~1", - "consolidation/output-formatters": "^3.1.5", - "dflydev/dot-access-data": "^1.1.0", - "grasmash/yaml-expander": "^1.1", - "league/container": "^2.2", - "php": ">=5.5.0", - "squizlabs/php_codesniffer": "^2.8", - "symfony/console": "~2.8|~3.0", - "symfony/event-dispatcher": "~2.5|~3.0", - "symfony/filesystem": "~2.5|~3.0", - "symfony/finder": "~2.5|~3.0", - "symfony/process": "~2.5|~3.0" - }, - "replace": { - "codegyre/robo": "< 1.0" + "php": "^5.3.3|^7.0" }, "require-dev": { - "codeception/aspect-mock": "~1", - "codeception/base": "^2.2.6", - "codeception/verify": "^0.3.2", - "henrikbjorn/lurker": "~1", - "natxet/cssmin": "~3", - "patchwork/jsqueeze": "~2", - "pear/archive_tar": "^1.4.2", - "phpunit/php-code-coverage": "~2|~4", - "satooshi/php-coveralls": "~1" - }, - "suggest": { - "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", - "natxet/CssMin": "For minifying JS files in taskMinify", - "patchwork/jsqueeze": "For minifying JS files in taskMinify", - "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + "ext-intl": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" }, - "bin": [ - "robo" - ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } + "branch-alias": [] }, "autoload": { - "classmap": [ - "scripts/composer/ScriptHandler.php" - ], "psr-4": { - "Robo\\": "src" + "Faker\\": "src/Faker/" } }, "notification-url": "https://packagist.org/downloads/", @@ -483,71 +344,112 @@ ], "authors": [ { - "name": "Davert", - "email": "davert.php@resend.cc" + "name": "François Zaninotto" } ], - "description": "Modern task runner", - "time": "2017-03-31 18:23:36" + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "time": "2016-04-29 12:21:54" }, { - "name": "container-interop/container-interop", - "version": "1.2.0", + "name": "guzzlehttp/guzzle", + "version": "6.2.3", "source": { "type": "git", - "url": "https://github.com/container-interop/container-interop.git", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", "shasum": "" }, "require": { - "psr/container": "^1.0" + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0", + "psr/log": "^1.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" + "GuzzleHttp\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14 19:40:03" + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-02-28 22:50:30" }, { - "name": "dflydev/dot-access-data", - "version": "v1.1.0", + "name": "guzzlehttp/promises", + "version": "v1.3.1", "source": { "type": "git", - "url": "https://github.com/dflydev/dflydev-dot-access-data.git", - "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", - "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { - "psr-0": { - "Dflydev\\DotAccessData": "src" - } + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -555,778 +457,54 @@ ], "authors": [ { - "name": "Dragonfly Development Inc.", - "email": "info@dflydev.com", - "homepage": "http://dflydev.com" - }, - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" - }, - { - "name": "Carlos Frutos", - "email": "carlos@kiwing.it", - "homepage": "https://github.com/cfrutos" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" } ], - "description": "Given a deep data structure, access data by dot notation.", - "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "description": "Guzzle promises library", "keywords": [ - "access", - "data", - "dot", - "notation" + "promise" ], - "time": "2017-01-20 21:14:22" + "time": "2016-12-20 10:07:11" }, { - "name": "doctrine/annotations", - "version": "v1.4.0", + "name": "guzzlehttp/psr7", + "version": "1.4.2", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" }, "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.4-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "time": "2017-02-24 16:22:25" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14 21:17:01" - }, - { - "name": "doctrine/lexer", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "lexer", - "parser" - ], - "time": "2014-09-09 13:34:57" - }, - { - "name": "facebook/webdriver", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/facebook/php-webdriver.git", - "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/eadb0b7a7c3e6578185197fd40158b08c3164c83", - "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-zip": "*", - "php": "^5.5 || ~7.0", - "symfony/process": "^2.8 || ^3.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "php-mock/php-mock-phpunit": "^1.1", - "phpunit/phpunit": "4.6.* || ~5.0", - "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "^2.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-community": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "A PHP client for Selenium WebDriver", - "homepage": "https://github.com/facebook/php-webdriver", - "keywords": [ - "facebook", - "php", - "selenium", - "webdriver" - ], - "time": "2017-04-28 14:54:49" - }, - { - "name": "flow/jsonpath", - "version": "0.3.4", - "source": { - "type": "git", - "url": "https://github.com/FlowCommunications/JSONPath.git", - "reference": "00aa9c361e4d0a210dd95f3c917a1e0dde3a957f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FlowCommunications/JSONPath/zipball/00aa9c361e4d0a210dd95f3c917a1e0dde3a957f", - "reference": "00aa9c361e4d0a210dd95f3c917a1e0dde3a957f", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "peekmo/jsonpath": "dev-master", - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Flow\\JSONPath": "src/", - "Flow\\JSONPath\\Test": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Stephen Frank", - "email": "stephen@flowsa.com" - } - ], - "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2016-09-06 17:43:18" - }, - { - "name": "fzaninotto/faker", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123", - "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123", - "shasum": "" - }, - "require": { - "php": "^5.3.3|^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5" - }, - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "time": "2016-04-29 12:21:54" - }, - { - "name": "grasmash/yaml-expander", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/grasmash/yaml-expander.git", - "reference": "95f9c876ca31f31bf5bfd9c8e89cc1f065c45528" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/95f9c876ca31f31bf5bfd9c8e89cc1f065c45528", - "reference": "95f9c876ca31f31bf5bfd9c8e89cc1f065c45528", - "shasum": "" - }, - "require": { - "dflydev/dot-access-data": "^1.1.0", - "php": ">=5.4", - "symfony/console": "^2.8.11|^3", - "symfony/yaml": "^2.8.11|^3" - }, - "require-dev": { - "phpunit/phpunit": "^4.8|^5.5.4", - "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "^2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Grasmash\\YamlExpander\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthew Grasmick" - } - ], - "description": "Expands internal property references in a yaml file.", - "time": "2017-03-24 20:31:04" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.2.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", - "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0", - "psr/log": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2017-02-28 22:50:30" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20 10:07:11" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20 17:10:46" - }, - { - "name": "jms/metadata", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/metadata.git", - "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab", - "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "doctrine/cache": "~1.0", - "symfony/cache": "~3.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, - "autoload": { - "psr-0": { - "Metadata\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Class/method/property metadata management in PHP", - "keywords": [ - "annotations", - "metadata", - "xml", - "yaml" - ], - "time": "2016-12-05 10:18:33" - }, - { - "name": "jms/parser-lib", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/parser-lib.git", - "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", - "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", - "shasum": "" - }, - "require": { - "phpoption/phpoption": ">=0.9,<2.0-dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "JMS\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache2" - ], - "description": "A library for easily creating recursive-descent parsers.", - "time": "2012-11-18 18:08:43" - }, - { - "name": "jms/serializer", - "version": "1.7.1", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/serializer.git", - "reference": "4fad8bbbe76e05de3b79ffa3db027058ed3813ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/4fad8bbbe76e05de3b79ffa3db027058ed3813ff", - "reference": "4fad8bbbe76e05de3b79ffa3db027058ed3813ff", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.0", - "doctrine/instantiator": "^1.0.3", - "jms/metadata": "~1.1", - "jms/parser-lib": "1.*", - "php": ">=5.5.0", - "phpcollection/phpcollection": "~0.1", - "phpoption/phpoption": "^1.1" - }, - "conflict": { - "jms/serializer-bundle": "<1.2.1", - "twig/twig": "<1.12" - }, - "require-dev": { - "doctrine/orm": "~2.1", - "doctrine/phpcr-odm": "^1.3|^2.0", - "ext-pdo_sqlite": "*", - "jackalope/jackalope-doctrine-dbal": "^1.1.5", - "phpunit/phpunit": "^4.8|^5.0", - "propel/propel1": "~1.7", - "symfony/expression-language": "^2.6|^3.0", - "symfony/filesystem": "^2.1", - "symfony/form": "~2.1|^3.0", - "symfony/translation": "^2.1|^3.0", - "symfony/validator": "^2.2|^3.0", - "symfony/yaml": "^2.1|^3.0", - "twig/twig": "~1.12|~2.0" - }, - "suggest": { - "doctrine/cache": "Required if you like to use cache functionality.", - "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.", - "symfony/yaml": "Required if you'd like to serialize data to YAML format." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "autoload": { - "psr-0": { - "JMS\\Serializer": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", - "homepage": "http://jmsyst.com/libs/serializer", - "keywords": [ - "deserialization", - "jaxb", - "json", - "serialization", - "xml" - ], - "time": "2017-05-15 08:35:42" - }, - { - "name": "league/container", - "version": "2.4.1", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/container.git", - "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", - "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", - "shasum": "" - }, - "require": { - "container-interop/container-interop": "^1.2", - "php": "^5.4.0 || ^7.0" - }, - "provide": { - "container-interop/container-interop-implementation": "^1.2", - "psr/container-implementation": "^1.0" - }, - "replace": { - "orno/di": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Container\\": "src" - } + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1334,73 +512,26 @@ ], "authors": [ { - "name": "Phil Bennett", - "email": "philipobenito@gmail.com", - "homepage": "http://www.philipobenito.com", - "role": "Developer" - } - ], - "description": "A fast and intuitive dependency injection container.", - "homepage": "https://github.com/thephpleague/container", - "keywords": [ - "container", - "dependency", - "di", - "injection", - "league", - "provider", - "service" - ], - "time": "2017-05-10 09:20:27" - }, - { - "name": "moontoast/math", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/ramsey/moontoast-math.git", - "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/c2792a25df5cad4ff3d760dd37078fc5b6fccc79", - "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79", - "shasum": "" - }, - "require": { - "ext-bcmath": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "jakub-onderka/php-parallel-lint": "^0.9.0", - "phpunit/phpunit": "^4.7|>=5.0 <5.4", - "satooshi/php-coveralls": "^0.6.1", - "squizlabs/php_codesniffer": "^2.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Moontoast\\Math\\": "src/Moontoast/Math/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "A mathematics library, providing functionality for large numbers", - "homepage": "https://github.com/ramsey/moontoast-math", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "bcmath", - "math" + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" ], - "time": "2017-02-16 16:54:46" + "time": "2017-03-20 17:10:46" }, { "name": "myclabs/deep-copy", @@ -1444,102 +575,6 @@ ], "time": "2017-04-12 18:52:22" }, - { - "name": "paragonie/random_compat", - "version": "v2.0.10", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d", - "reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "pseudorandom", - "random" - ], - "time": "2017-03-13 16:27:32" - }, - { - "name": "phpcollection/phpcollection", - "version": "0.5.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-collection.git", - "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", - "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", - "shasum": "" - }, - "require": { - "phpoption/phpoption": "1.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-0": { - "PhpCollection": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache2" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "General-Purpose Collection Library for PHP", - "keywords": [ - "collection", - "list", - "map", - "sequence", - "set" - ], - "time": "2015-05-17 12:39:23" - }, { "name": "phpdocumentor/reflection-common", "version": "1.0", @@ -1637,104 +672,54 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30 07:12:33" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.2.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2016-11-25 06:54:22" + "time": "2016-09-30 07:12:33" }, { - "name": "phpoption/phpoption", - "version": "1.5.0", + "name": "phpdocumentor/type-resolver", + "version": "0.2.1", "source": { "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", - "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { - "phpunit/phpunit": "4.7.*" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "PhpOption\\": "src/" + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache2" + "MIT" ], "authors": [ { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" } ], - "description": "Option Type for PHP", - "keywords": [ - "language", - "option", - "php", - "type" - ], - "time": "2015-07-25 16:39:46" + "time": "2016-11-25 06:54:22" }, { "name": "phpspec/prophecy", @@ -2189,55 +1174,6 @@ ], "time": "2016-12-08 20:27:08" }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14 16:28:37" - }, { "name": "psr/http-message", "version": "1.0.1", @@ -2335,88 +1271,6 @@ ], "time": "2016-10-10 12:19:37" }, - { - "name": "ramsey/uuid", - "version": "3.6.1", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "4ae32dd9ab8860a4bbd750ad269cba7f06f7934e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/4ae32dd9ab8860a4bbd750ad269cba7f06f7934e", - "reference": "4ae32dd9ab8860a4bbd750ad269cba7f06f7934e", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "^1.0|^2.0", - "php": "^5.4 || ^7.0" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "apigen/apigen": "^4.1", - "codeception/aspect-mock": "^1.0 | ^2.0", - "doctrine/annotations": "~1.2.0", - "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1", - "ircmaxell/random-lib": "^1.1", - "jakub-onderka/php-parallel-lint": "^0.9.0", - "mockery/mockery": "^0.9.4", - "moontoast/math": "^1.1", - "php-mock/php-mock-phpunit": "^0.3|^1.1", - "phpunit/phpunit": "^4.7|>=5.0 <5.4", - "satooshi/php-coveralls": "^0.6.1", - "squizlabs/php_codesniffer": "^2.3" - }, - "suggest": { - "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", - "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", - "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", - "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Ramsey\\Uuid\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marijn Huizendveld", - "email": "marijn.huizendveld@gmail.com" - }, - { - "name": "Thibaud Fabre", - "email": "thibaud@aztech.io" - }, - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", - "homepage": "https://github.com/ramsey/uuid", - "keywords": [ - "guid", - "identifier", - "uuid" - ], - "time": "2017-03-26 20:37:53" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -2930,84 +1784,6 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03 07:35:21" }, - { - "name": "squizlabs/php_codesniffer", - "version": "2.9.1", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "bin": [ - "scripts/phpcs", - "scripts/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2017-05-22 02:43:20" - }, { "name": "stecman/symfony-console-completion", "version": "0.7.0", @@ -3399,76 +2175,27 @@ "homepage": "https://symfony.com", "time": "2017-05-01 14:58:48" }, - { - "name": "symfony/filesystem", - "version": "v2.8.20", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "dc40154e26a0116995e4f2f0c71cb9c2fe0775a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/dc40154e26a0116995e4f2f0c71cb9c2fe0775a3", - "reference": "dc40154e26a0116995e4f2f0c71cb9c2fe0775a3", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2017-04-12 14:07:15" - }, { "name": "symfony/finder", - "version": "v2.8.20", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "16d55394b31547e4a8494551b85c9b9915545347" + "reference": "9cf076f8f492f4b1ffac40aae9c2d287b4ca6930" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/16d55394b31547e4a8494551b85c9b9915545347", - "reference": "16d55394b31547e4a8494551b85c9b9915545347", + "url": "https://api.github.com/repos/symfony/finder/zipball/9cf076f8f492f4b1ffac40aae9c2d287b4ca6930", + "reference": "9cf076f8f492f4b1ffac40aae9c2d287b4ca6930", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -3495,60 +2222,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:07:15" - }, - { - "name": "symfony/http-foundation", - "version": "v3.2.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9de6add7f731e5af7f5b2e9c0da365e43383ebef", - "reference": "9de6add7f731e5af7f5b2e9c0da365e43383ebef", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.1" - }, - "require-dev": { - "symfony/expression-language": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com", - "time": "2017-05-01 14:55:58" + "time": "2017-04-12 14:13:17" }, { "name": "symfony/polyfill-mbstring", @@ -3713,56 +2387,6 @@ "homepage": "https://symfony.com", "time": "2017-05-01 14:55:58" }, - { - "name": "vlucas/phpdotenv", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause-Attribution" - ], - "authors": [ - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "time": "2016-09-01 10:05:43" - }, { "name": "webmozart/assert", "version": "1.2.0", @@ -3817,13 +2441,9 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "allure-framework/allure-codeception": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": { - "php": ">=5.4.0" - }, + "platform": [], "platform-dev": [] } diff --git a/src/Magento/Xxyyzz/Module/MagentoRestDriver.php b/src/Magento/Xxyyzz/Module/MagentoRestDriver.php index b4420adfc..07f8cf625 100644 --- a/src/Magento/Xxyyzz/Module/MagentoRestDriver.php +++ b/src/Magento/Xxyyzz/Module/MagentoRestDriver.php @@ -3,6 +3,7 @@ use Codeception\Module\REST; use Codeception\Module\Sequence; +use Flow\JSONPath; /** * MagentoRestDriver module provides Magento REST WebService. From 08e4f55186a3a9a07edcaecc059d06306c4daecb Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 23 May 2017 17:08:50 -0500 Subject: [PATCH 078/149] MTA-4213: updated README.md. --- README.md | 150 +++++++----------------------------------------------- 1 file changed, 17 insertions(+), 133 deletions(-) diff --git a/README.md b/README.md index 846b01788..98287e5b3 100755 --- a/README.md +++ b/README.md @@ -1,133 +1,17 @@ -# Welcome to the example of Codeception + Robo + Allure! - -### Prerequisites -* **Codeception**, **Allure** and **Robo** are PHP based applications installed via **Composer**, so you will need to have **Composer** installed in order to run the following. Please visit the [Composer](https://getcomposer.org/) homepage for installation instructions. -* Some settings need to be adjusted to meet the build environment settings in the appropriate `XXX.suite.yml` file in the `[PROJECT_ROOT]/tests/` directory: `[PROJECT_ROOT]/tests/XXXXXXX.suite.yml` - -### Installation -* Open a Terminal Window. CD to the Project Directory. Run the following command to install the project dependencies: - ``` - cd [LOCATION_OF_GITHUB_REPO] - composer install - ``` - -### Configuration -* In order to adjust the settings for the Framework you will need to copy the `.dist.` settings files and make your adjustments based on your unique Setup. These files are listed in the `.gitignore` file so they will only effect your Setup. You can run the following Robo command to copy the necassary files or follow the [Optional] instructions listed below. - ``` - robo clone:files - ``` - -* Configure the following `.env` variables according to the Magento application being tested. - ``` - MAGENTO_BASE_URL=http://magento.loc/index.php - - MAGENTO_BACKEND_NAME=admin - MAGENTO_ADMIN_USERNAME=admin - MAGENTO_ADMIN_PASSWORD=123123q - - DB_DSN='' - DB_USERNAME='' - DB_PASSWORD='' - ``` - - * **[Optional]** Create .env file by copying existing .env.example file at project root directory. - - ``` - cp .env.example .env - ``` - - * **[Optional]** If you wish to customize entire test suite locally, you can create codeception.yml by copying existing codeception.dist.yml, and make change in codeception.yml. - ``` - cp codeception.dist.yml codeception.yml - ``` - - * **[Optional]** If you wish to customize acceptance test suite locally, you can create acceptance.suite.yml by copying existing acceptance.suite.dist.yml, and make change in acceptance.suite.yml. - ``` - cp acceptance.suite.dist.yml acceptance.suite.yml - ``` - -### Running the Tests -* Build the project: - ``` - vendor/bin/codecept build - ``` - -* **You will need to install Allure's CLI tool to generate the reports, please visit this page for instructions**: http://wiki.qatools.ru/display/AL/Allure+Commandline. - -* Next you will need to start a Selenium server so we can run the tests (This will vary based on your local setup). - -* Then open a New Terminal Window. - -* Kick off the entire E2E Test Suite run the following command: - - ``` - robo test - ``` - -* To kick off some example tests with 2 test cases run the following command: - - ``` - robo example - ``` - -### Testing using Robo - -* You can run the following test suites using robo: - - * Run the tests marked with **@group chrome**: `robo chrome` - * Run the tests marked with **@group firefox**: `robo chrome` - * Run the tests marked with **@group phantomjs**: `robo phantomjs` - -### Allure + Robo -* You can generate an Allure report, open an Allure report or both using robo: - * Generate a report from **[PROJECT_ROOT]/tests/_output/allure-results/**: `robo allure:generate` - * Open a generate report from **[PROJECT_ROOT]/tests/_output/allure-report**: `robo allure:open` - * Generate a report and open it: `robo allure:report` - -### Testing Environments -* You can run a subset of Tests by editing a command in the file `RoboFile.php` or by running `codecept` directly: - - ```codecept run --env chrome``` - - ```codecept run --env firefox``` - - ```codecept run --env phantomjs``` - - ```codecept run --env chrome --group slow``` - -### Testing Groups -* You can run or exclude subsets of Tests using the `--group` and `--skip-group` codeception flags in the Terminal (IF you add the `@env` tag to a Test you HAVE to include the `--env ZZZZ` flag in your `codecept` command): - * ```codecept run acceptance --env ZZZZ --group XXXX --skip-group YYYY``` - ##### Base on operation, currently we have groups: - * *skip* - * *slow* - * *example* - * *sample* - * *admin-direct-access* - * *nav-menu-access* - * *sampleData* - * *nav-menu* - * *add* - * *update* - * *fields* - ##### Base on Magento module, currently we have groups: - * *catalog* - * *configurable* - * *customer* - * *sales* - * *orders* - -### RoboFile.php - -* Edit the following command to change the Tests that the command `robo test` executes: - - ``` - $this->_exec('codecept run --env chrome'); - ``` - -### TROUBLESHOOTING -* TimeZone Error - http://stackoverflow.com/questions/18768276/codeception-datetime-error -* TimeZone List - http://php.net/manual/en/timezones.america.php -* System PATH - Make sure you have `vendor/bin/` and `vendor/` listed in your system path so you can run the `codecept` and `robo` commands directly: - - `sudo nano /etc/private/paths` \ No newline at end of file +# Magento Acceptance Test Framework + +Customized codeception modules, helpers, page objects and step objects for Magento 2.2.x. This library package can be used as dependency for Magento Acceptance Test projects for Magento 2 Community Edition ([magento/acceptance-test-ce](https://github.com/magento-pangolin/acceptance-test-ce/)) or Magento 2 Enterprise Edition in ([magento/acceptance-test-ee](https://github.com/magento-pangolin/acceptance-test-ee/)) or acceptance test projects for Magento 2 extensions. + +## Installation +Add the package into your acceptance test project composer.json: +``` + { + "require": { + "magento/acceptance-test-framework": "dev-master" + } + } +``` +Then run: +``` + php composer.phar update +``` From 18dd1022963ba3e89eb981e3cdb7a9b939886d44 Mon Sep 17 00:00:00 2001 From: Oleksii Kolesnyk Date: Wed, 24 May 2017 16:42:01 +0300 Subject: [PATCH 079/149] MTA-4228: [Customizability] XML parser --- bootstrap.php | 11 + composer.json | 4 +- composer.lock | 478 ++++++++++++------ entryPoint.php | 7 + etc/di.xml | 97 ++++ lib/Magento/TestFramework/Code/Generator.php | 103 ++++ .../Code/Generator/Autoloader.php | 41 ++ .../TestFramework/Code/Reader/ClassReader.php | 85 ++++ .../TestFramework/Config/CacheInterface.php | 71 +++ .../TestFramework/Config/Converter.php | 200 ++++++++ .../Config/Converter/Dom/Flat.php | 131 +++++ .../Config/ConverterInterface.php | 20 + lib/Magento/TestFramework/Config/Data.php | 99 ++++ .../TestFramework/Config/DataInterface.php | 45 ++ lib/Magento/TestFramework/Config/Dom.php | 387 ++++++++++++++ .../Config/Dom/ArrayNodeConfig.php | 78 +++ .../Config/Dom/NodeMergingConfig.php | 50 ++ .../Config/Dom/NodePathMatcher.php | 40 ++ .../Config/Dom/ValidationException.php | 16 + .../Config/FileResolver/Module.php | 52 ++ .../Config/FileResolver/Primary.php | 77 +++ .../Config/FileResolverInterface.php | 21 + lib/Magento/TestFramework/Config/Reader.php | 57 +++ .../Config/Reader/Filesystem.php | 202 ++++++++ .../TestFramework/Config/ReaderInterface.php | 29 ++ .../Config/ReplacerInterface.php | 21 + .../TestFramework/Config/SchemaLocator.php | 57 +++ .../Config/SchemaLocatorInterface.php | 27 + .../TestFramework/Config/ValidationState.php | 40 ++ .../Config/ValidationStateInterface.php | 19 + .../Data/Argument/Interpreter/Argument.php | 38 ++ .../Data/Argument/Interpreter/ArrayType.php | 47 ++ .../Data/Argument/Interpreter/Boolean.php | 42 ++ .../Data/Argument/Interpreter/Composite.php | 94 ++++ .../Data/Argument/Interpreter/Constant.php | 28 + .../Data/Argument/Interpreter/NullType.php | 24 + .../Data/Argument/Interpreter/Number.php | 28 + .../Data/Argument/Interpreter/ObjectType.php | 47 ++ .../Data/Argument/Interpreter/StringType.php | 46 ++ .../Data/Argument/InterpreterInterface.php | 23 + .../Argument/InterpreterInterface/Proxy.php | 104 ++++ .../MissingOptionalValueException.php | 14 + lib/Magento/TestFramework/Data/etc/types.xsd | 72 +++ lib/Magento/TestFramework/ObjectManager.php | 118 +++++ .../TestFramework/ObjectManager/Config.php | 52 ++ .../ObjectManager/Config/Config.php | 243 +++++++++ .../Config/Mapper/ArgumentParser.php | 64 +++ .../ObjectManager/Config/Mapper/Dom.php | 147 ++++++ .../ObjectManager/Config/Reader/Dom.php | 70 +++ .../ObjectManager/Config/SchemaLocator.php | 37 ++ .../ObjectManager/ConfigInterface.php | 53 ++ .../ObjectManager/ConfigLoader/Primary.php | 70 +++ .../ObjectManager/Definition/Runtime.php | 60 +++ .../ObjectManager/DefinitionInterface.php | 38 ++ .../TestFramework/ObjectManager/Factory.php | 247 +++++++++ .../Factory/Dynamic/Developer.php | 204 ++++++++ .../ObjectManager/FactoryInterface.php | 23 + .../ObjectManager/ObjectManager.php | 91 ++++ .../ObjectManager/Relations/Runtime.php | 57 +++ .../ObjectManager/RelationsInterface.php | 28 + .../ObjectManager/etc/config.xsd | 144 ++++++ .../TestFramework/ObjectManagerFactory.php | 119 +++++ .../TestFramework/ObjectManagerInterface.php | 38 ++ .../PageObject/etc/pageObject.xsd | 150 ++++++ .../TestFramework/Stdlib/BooleanUtils.php | 63 +++ .../TestFramework/System/Code/ClassReader.php | 51 ++ .../Util/Iterator/AbstractIterator.php | 131 +++++ .../TestFramework/Util/Iterator/File.php | 56 ++ .../TestFramework/Util/ModuleResolver.php | 56 ++ src/Magento/Xxyyzz/Dummy.php | 25 + src/Magento/Xxyyzz/Page/Backend/etc/Page.xml | 7 + src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml | 7 + src/Magento/Xxyyzz/Page/Cms/etc/Page.xml | 7 + .../Page/ConfigurableProduct/etc/Page.xml | 7 + src/Magento/Xxyyzz/Page/Customer/etc/Page.xml | 7 + src/Magento/Xxyyzz/Page/Sales/etc/Page.xml | 10 + 76 files changed, 5508 insertions(+), 144 deletions(-) create mode 100755 bootstrap.php create mode 100644 entryPoint.php create mode 100644 etc/di.xml create mode 100644 lib/Magento/TestFramework/Code/Generator.php create mode 100644 lib/Magento/TestFramework/Code/Generator/Autoloader.php create mode 100644 lib/Magento/TestFramework/Code/Reader/ClassReader.php create mode 100644 lib/Magento/TestFramework/Config/CacheInterface.php create mode 100644 lib/Magento/TestFramework/Config/Converter.php create mode 100644 lib/Magento/TestFramework/Config/Converter/Dom/Flat.php create mode 100644 lib/Magento/TestFramework/Config/ConverterInterface.php create mode 100644 lib/Magento/TestFramework/Config/Data.php create mode 100644 lib/Magento/TestFramework/Config/DataInterface.php create mode 100644 lib/Magento/TestFramework/Config/Dom.php create mode 100644 lib/Magento/TestFramework/Config/Dom/ArrayNodeConfig.php create mode 100644 lib/Magento/TestFramework/Config/Dom/NodeMergingConfig.php create mode 100644 lib/Magento/TestFramework/Config/Dom/NodePathMatcher.php create mode 100644 lib/Magento/TestFramework/Config/Dom/ValidationException.php create mode 100644 lib/Magento/TestFramework/Config/FileResolver/Module.php create mode 100644 lib/Magento/TestFramework/Config/FileResolver/Primary.php create mode 100644 lib/Magento/TestFramework/Config/FileResolverInterface.php create mode 100644 lib/Magento/TestFramework/Config/Reader.php create mode 100644 lib/Magento/TestFramework/Config/Reader/Filesystem.php create mode 100644 lib/Magento/TestFramework/Config/ReaderInterface.php create mode 100644 lib/Magento/TestFramework/Config/ReplacerInterface.php create mode 100644 lib/Magento/TestFramework/Config/SchemaLocator.php create mode 100644 lib/Magento/TestFramework/Config/SchemaLocatorInterface.php create mode 100644 lib/Magento/TestFramework/Config/ValidationState.php create mode 100644 lib/Magento/TestFramework/Config/ValidationStateInterface.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/Argument.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/ArrayType.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/Composite.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/Constant.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/NullType.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/Number.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/ObjectType.php create mode 100644 lib/Magento/TestFramework/Data/Argument/Interpreter/StringType.php create mode 100644 lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php create mode 100644 lib/Magento/TestFramework/Data/Argument/InterpreterInterface/Proxy.php create mode 100644 lib/Magento/TestFramework/Data/Argument/MissingOptionalValueException.php create mode 100644 lib/Magento/TestFramework/Data/etc/types.xsd create mode 100644 lib/Magento/TestFramework/ObjectManager.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Config.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Config/Config.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Config/Mapper/ArgumentParser.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php create mode 100644 lib/Magento/TestFramework/ObjectManager/ConfigInterface.php create mode 100644 lib/Magento/TestFramework/ObjectManager/ConfigLoader/Primary.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php create mode 100644 lib/Magento/TestFramework/ObjectManager/DefinitionInterface.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Factory.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Factory/Dynamic/Developer.php create mode 100644 lib/Magento/TestFramework/ObjectManager/FactoryInterface.php create mode 100644 lib/Magento/TestFramework/ObjectManager/ObjectManager.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Relations/Runtime.php create mode 100644 lib/Magento/TestFramework/ObjectManager/RelationsInterface.php create mode 100644 lib/Magento/TestFramework/ObjectManager/etc/config.xsd create mode 100644 lib/Magento/TestFramework/ObjectManagerFactory.php create mode 100644 lib/Magento/TestFramework/ObjectManagerInterface.php create mode 100644 lib/Magento/TestFramework/PageObject/etc/pageObject.xsd create mode 100644 lib/Magento/TestFramework/Stdlib/BooleanUtils.php create mode 100644 lib/Magento/TestFramework/System/Code/ClassReader.php create mode 100644 lib/Magento/TestFramework/Util/Iterator/AbstractIterator.php create mode 100644 lib/Magento/TestFramework/Util/Iterator/File.php create mode 100644 lib/Magento/TestFramework/Util/ModuleResolver.php create mode 100644 src/Magento/Xxyyzz/Dummy.php create mode 100644 src/Magento/Xxyyzz/Page/Backend/etc/Page.xml create mode 100644 src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml create mode 100644 src/Magento/Xxyyzz/Page/Cms/etc/Page.xml create mode 100644 src/Magento/Xxyyzz/Page/ConfigurableProduct/etc/Page.xml create mode 100644 src/Magento/Xxyyzz/Page/Customer/etc/Page.xml create mode 100644 src/Magento/Xxyyzz/Page/Sales/etc/Page.xml diff --git a/bootstrap.php b/bootstrap.php new file mode 100755 index 000000000..cdfe414f9 --- /dev/null +++ b/bootstrap.php @@ -0,0 +1,11 @@ +=7.0", "codeception/codeception": "~2.2|2.3", "flow/jsonpath": ">0.2", "fzaninotto/faker": "^1.6" }, "autoload": { "psr-4": { - "Magento\\Xxyyzz\\": "src/Magento/Xxyyzz" + "Magento\\Xxyyzz\\": "src/Magento/Xxyyzz", + "Magento\\TestFramework\\": "lib/Magento/TestFramework" } } } diff --git a/composer.lock b/composer.lock index f885d5953..da84851c4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "6bd1d4309326e68d95d58525a7ad1008", - "content-hash": "7e79b94dc6f0047a64653467582fb486", + "content-hash": "ace050b01aa009d3ee82eb5bc4a02cf1", "packages": [ { "name": "behat/gherkin", @@ -64,20 +63,20 @@ "gherkin", "parser" ], - "time": "2016-10-30 11:50:56" + "time": "2016-10-30T11:50:56+00:00" }, { "name": "codeception/codeception", - "version": "2.3.0", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "b54eaf4007484f36145c1dc8c64da1874adbc340" + "reference": "d4d76d18ea0ec8d504995995ae68fccac24523db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b54eaf4007484f36145c1dc8c64da1874adbc340", - "reference": "b54eaf4007484f36145c1dc8c64da1874adbc340", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/d4d76d18ea0ec8d504995995ae68fccac24523db", + "reference": "d4d76d18ea0ec8d504995995ae68fccac24523db", "shasum": "" }, "require": { @@ -89,7 +88,7 @@ "guzzlehttp/psr7": "~1.0", "php": ">=5.4.0 <8.0", "phpunit/php-code-coverage": ">=2.2.4 <6.0", - "phpunit/phpunit": ">4.8.20 <6.0", + "phpunit/phpunit": ">4.8.20 <7.0", "phpunit/phpunit-mock-objects": ">2.3 <5.0", "sebastian/comparator": ">1.1 <3.0", "sebastian/diff": "^1.4", @@ -158,7 +157,7 @@ "functional testing", "unit testing" ], - "time": "2017-05-22 23:47:35" + "time": "2017-05-24T00:54:13+00:00" }, { "name": "doctrine/instantiator", @@ -212,7 +211,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "facebook/webdriver", @@ -264,7 +263,7 @@ "selenium", "webdriver" ], - "time": "2017-04-28 14:54:49" + "time": "2017-04-28T14:54:49+00:00" }, { "name": "flow/jsonpath", @@ -305,7 +304,7 @@ } ], "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2016-09-06 17:43:18" + "time": "2016-09-06T17:43:18+00:00" }, { "name": "fzaninotto/faker", @@ -353,7 +352,7 @@ "faker", "fixtures" ], - "time": "2016-04-29 12:21:54" + "time": "2016-04-29T12:21:54+00:00" }, { "name": "guzzlehttp/guzzle", @@ -415,7 +414,7 @@ "rest", "web service" ], - "time": "2017-02-28 22:50:30" + "time": "2017-02-28T22:50:30+00:00" }, { "name": "guzzlehttp/promises", @@ -466,7 +465,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20 10:07:11" + "time": "2016-12-20T10:07:11+00:00" }, { "name": "guzzlehttp/psr7", @@ -531,7 +530,7 @@ "uri", "url" ], - "time": "2017-03-20 17:10:46" + "time": "2017-03-20T17:10:46+00:00" }, { "name": "myclabs/deep-copy", @@ -573,7 +572,109 @@ "object", "object graph" ], - "time": "2017-04-12 18:52:22" + "time": "2017-04-12T18:52:22+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -627,7 +728,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -672,7 +773,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30 07:12:33" + "time": "2016-09-30T07:12:33+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -719,7 +820,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25 06:54:22" + "time": "2016-11-25T06:54:22+00:00" }, { "name": "phpspec/prophecy", @@ -782,44 +883,45 @@ "spy", "stub" ], - "time": "2017-03-02 20:05:34" + "time": "2017-03-02T20:05:34+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "5.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "dc421f9ca5082a0c0cb04afb171c765f79add85b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/dc421f9ca5082a0c0cb04afb171c765f79add85b", + "reference": "dc421f9ca5082a0c0cb04afb171c765f79add85b", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", + "php": "^7.0", "phpunit/php-file-iterator": "^1.3", "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "phpunit/php-token-stream": "^1.4.11 || ^2.0", "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "ext-xdebug": "^2.5", + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-xdebug": "^2.5.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.2.x-dev" } }, "autoload": { @@ -845,7 +947,7 @@ "testing", "xunit" ], - "time": "2017-04-02 07:44:40" + "time": "2017-04-21T08:03:57+00:00" }, { "name": "phpunit/php-file-iterator", @@ -892,7 +994,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -933,7 +1035,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -982,7 +1084,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26 11:10:40" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", @@ -1031,20 +1133,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27 10:12:30" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.20", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b" + "reference": "42b7f394a8e009516582331b1e03a1aba40175d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3cb94a5f8c07a03c8b7527ed7468a2926203f58b", - "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/42b7f394a8e009516582331b1e03a1aba40175d1", + "reference": "42b7f394a8e009516582331b1e03a1aba40175d1", "shasum": "" }, "require": { @@ -1053,33 +1155,35 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", + "myclabs/deep-copy": "^1.3", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.2", + "phpunit/php-file-iterator": "^1.4", + "phpunit/php-text-template": "^1.2", "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" + "phpunit/phpunit-mock-objects": "^4.0", + "sebastian/comparator": "^2.0", + "sebastian/diff": "^1.4.3 || ^2.0", + "sebastian/environment": "^3.0.2", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^1.1 || ^2.0", + "sebastian/object-enumerator": "^3.0.2", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -1087,7 +1191,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "6.1.x-dev" } }, "autoload": { @@ -1113,33 +1217,33 @@ "testing", "xunit" ], - "time": "2017-05-22 07:42:55" + "time": "2017-05-22T07:45:30+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.3", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" + "reference": "eabce450df194817a7d7e27e19013569a903a2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/eabce450df194817a7d7e27e19013569a903a2bf", + "reference": "eabce450df194817a7d7e27e19013569a903a2bf", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", + "php": "^7.0", "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" + "sebastian/exporter": "^3.0" }, "conflict": { - "phpunit/phpunit": "<5.4.0" + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-soap": "*" @@ -1147,7 +1251,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -1172,7 +1276,7 @@ "mock", "xunit" ], - "time": "2016-12-08 20:27:08" + "time": "2017-03-03T06:30:20+00:00" }, { "name": "psr/http-message", @@ -1222,7 +1326,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", @@ -1269,7 +1373,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1314,34 +1418,34 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04 06:30:41" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "20f84f468cb67efee293246e6a09619b891f55f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/20f84f468cb67efee293246e6a09619b891f55f0", + "reference": "20f84f468cb67efee293246e6a09619b891f55f0", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0", + "sebastian/diff": "^1.2", + "sebastian/exporter": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1378,7 +1482,7 @@ "compare", "equality" ], - "time": "2017-01-29 09:50:25" + "time": "2017-03-03T06:26:08+00:00" }, { "name": "sebastian/diff", @@ -1430,32 +1534,32 @@ "keywords": [ "diff" ], - "time": "2017-05-22 07:24:03" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3", + "reference": "02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1480,34 +1584,34 @@ "environment", "hhvm" ], - "time": "2016-11-26 07:53:53" + "time": "2017-05-18T10:10:00+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1547,27 +1651,27 @@ "export", "exporter" ], - "time": "2016-11-19 08:54:04" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -1575,7 +1679,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1598,33 +1702,34 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/31dd3379d16446c5d86dec32ab1ad1f378581ad8", + "reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1644,32 +1749,77 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18 15:18:39" + "time": "2017-03-12T15:17:29+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1697,7 +1847,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19 07:33:16" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -1739,7 +1889,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", @@ -1782,7 +1932,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "stecman/symfony-console-completion", @@ -1827,7 +1977,7 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24 05:08:54" + "time": "2016-02-24T05:08:54+00:00" }, { "name": "symfony/browser-kit", @@ -1884,7 +2034,7 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:13:17" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/console", @@ -1947,7 +2097,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-04-26 01:39:17" + "time": "2017-04-26T01:39:17+00:00" }, { "name": "symfony/css-selector", @@ -2000,7 +2150,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01 14:55:58" + "time": "2017-05-01T14:55:58+00:00" }, { "name": "symfony/debug", @@ -2057,7 +2207,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-04-19 20:17:50" + "time": "2017-04-19T20:17:50+00:00" }, { "name": "symfony/dom-crawler", @@ -2113,7 +2263,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:13:17" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/event-dispatcher", @@ -2173,7 +2323,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-05-01 14:58:48" + "time": "2017-05-01T14:58:48+00:00" }, { "name": "symfony/finder", @@ -2222,7 +2372,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:13:17" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2281,7 +2431,7 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/process", @@ -2330,7 +2480,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:13:17" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/yaml", @@ -2385,7 +2535,47 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-01 14:55:58" + "time": "2017-05-01T14:55:58+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", @@ -2435,7 +2625,7 @@ "check", "validate" ], - "time": "2016-11-23 20:04:58" + "time": "2016-11-23T20:04:58+00:00" } ], "packages-dev": [], @@ -2444,6 +2634,8 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "php": ">=7.0" + }, "platform-dev": [] } diff --git a/entryPoint.php b/entryPoint.php new file mode 100644 index 000000000..965097a7a --- /dev/null +++ b/entryPoint.php @@ -0,0 +1,7 @@ +create(\Magento\Xxyyzz\Dummy::class); +$dummy->readPageObjects(); diff --git a/etc/di.xml b/etc/di.xml new file mode 100644 index 000000000..5e7a09efb --- /dev/null +++ b/etc/di.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + developer + + + + + + data + + + + + converterArgumentParser + Magento\TestFramework\Data\Argument\Interpreter\Composite + data + + + + + + Magento\TestFramework\Data\Argument\Interpreter\ObjectType + arrayArgumentInterpreterProxy + Magento\TestFramework\Data\Argument\Interpreter\Boolean + Magento\TestFramework\Data\Argument\Interpreter\Number + Magento\TestFramework\Data\Argument\Interpreter\StringType + Magento\TestFramework\Data\Argument\Interpreter\NullType + Magento\TestFramework\Data\Argument\Interpreter\Constant + + xsi:type + + + + + Magento\TestFramework\Data\Argument\Interpreter\Composite + + + + + + Magento\TestFramework\Data\Argument\Interpreter\ArrayType + + + + + + + Magento\TestFramework\Config\Reader\Page + + + + + + Magento/TestFramework/PageObject/etc/pageObject.xsd + + + + + Magento\TestFramework\Config\FileResolver\Module + Magento\TestFramework\Config\Converter + Magento\TestFramework\Config\SchemaLocator\Page + + name + name + name + + Page.xml + etc + + + + + + Magento\TestFramework\PageObject\Config\Data + + + diff --git a/lib/Magento/TestFramework/Code/Generator.php b/lib/Magento/TestFramework/Code/Generator.php new file mode 100644 index 000000000..5622047d1 --- /dev/null +++ b/lib/Magento/TestFramework/Code/Generator.php @@ -0,0 +1,103 @@ +generatedEntities = $generatedEntities; + } + + /** + * Get generated entities. + * + * @return string[] + */ + public function getGeneratedEntities() + { + return $this->generatedEntities; + } + + /** + * Generate class. + * + * @param string $className + * @return string + * @throws \Exception + * @throws \InvalidArgumentException + */ + public function generateClass($className) + { + $classNameRegexp = '/\\\Test\\\([^\\\]+)(?:\\\[^\\\]+)+$/'; + + if (preg_match($classNameRegexp, $className, $matches)) { + $classType = lcfirst($matches[1]); + + if (!isset($this->generatedEntities[$classType])) { + throw new \InvalidArgumentException( + sprintf('Cannot generate class "%s". Unknown type %s', $className, $classType) + ); + } + + /** @var \Magento\TestFramework\Util\Generate\AbstractGenerate $generator */ + $generator = $this->createGeneratorInstance($this->generatedEntities[$classType]); + + $classFilePath = $generator->generate($className); + + if (!$classFilePath) { + throw new \Exception(implode(' ', $generator->getErrors())); + } + + $this->includeFile($classFilePath); + + return self::GENERATION_SUCCESS; + } + + return self::GENERATION_SKIP; + } + + /** + * @param string $fileName + * @return void + */ + public function includeFile($fileName) + { + include $fileName; + } + + /** + * Create entity generator. + * + * @param string $generatorClass + * @return \Magento\TestFramework\Util\Generate\AbstractGenerate + */ + protected function createGeneratorInstance($generatorClass) + { + return \Magento\TestFramework\ObjectManager::getInstance()->get($generatorClass); + } +} diff --git a/lib/Magento/TestFramework/Code/Generator/Autoloader.php b/lib/Magento/TestFramework/Code/Generator/Autoloader.php new file mode 100644 index 000000000..8b445e41d --- /dev/null +++ b/lib/Magento/TestFramework/Code/Generator/Autoloader.php @@ -0,0 +1,41 @@ +generator = $generator; + } + + /** + * Load specified class name and generate it if necessary + * + * @param string $className + * @return bool True if class was loaded + */ + public function load($className) + { + if (!class_exists($className)) { + return Generator::GENERATION_SUCCESS == $this->generator->generateClass($className); + } + return true; + } +} diff --git a/lib/Magento/TestFramework/Code/Reader/ClassReader.php b/lib/Magento/TestFramework/Code/Reader/ClassReader.php new file mode 100644 index 000000000..157357cd0 --- /dev/null +++ b/lib/Magento/TestFramework/Code/Reader/ClassReader.php @@ -0,0 +1,85 @@ +getConstructor(); + if ($constructor) { + $result = []; + /** @var $parameter \ReflectionParameter */ + foreach ($constructor->getParameters() as $parameter) { + try { + $result[] = [ + $parameter->getName(), + $parameter->getClass() !== null ? $parameter->getClass()->getName() : null, + !$parameter->isOptional(), + $parameter->isOptional() ? $parameter + ->isDefaultValueAvailable() ? $parameter + ->getDefaultValue() : null : null + ]; + } catch (\ReflectionException $e) { + $message = $e->getMessage(); + throw new \ReflectionException($message, 0, $e); + } + } + } + + return $result; + } + + /** + * Retrieve parent relation information for type in a following format + * array( + * 'Parent_Class_Name', + * 'Interface_1', + * 'Interface_2', + * ... + * ) + * + * @param string $className + * @return string[] + */ + public function getParents($className) + { + $parentClass = get_parent_class($className); + if ($parentClass) { + $result = []; + $interfaces = class_implements($className); + if ($interfaces) { + $parentInterfaces = class_implements($parentClass); + if ($parentInterfaces) { + $result = array_values(array_diff($interfaces, $parentInterfaces)); + } else { + $result = array_values($interfaces); + } + } + array_unshift($result, $parentClass); + } else { + $result = array_values(class_implements($className)); + if ($result) { + array_unshift($result, null); + } else { + $result = []; + } + } + return $result; + } +} diff --git a/lib/Magento/TestFramework/Config/CacheInterface.php b/lib/Magento/TestFramework/Config/CacheInterface.php new file mode 100644 index 000000000..2c4819b09 --- /dev/null +++ b/lib/Magento/TestFramework/Config/CacheInterface.php @@ -0,0 +1,71 @@ +argumentParser = $argumentParser; + $this->argumentInterpreter = $argumentInterpreter; + $this->argumentNodeName = $argumentNodeName; + $this->idAttributes = $idAttributes; + } + + /** + * Convert XML to array. + * + * @param \DOMDocument $source + * @return array + */ + public function convert(\DOMDocument $source) + { + return $this->convertXml($source->documentElement->childNodes); + } + + /** + * Convert XML node to array or string recursive. + * + * @param \DOMNodeList|array $elements + * @return array + */ + protected function convertXml($elements) + { + $result = []; + + foreach ($elements as $element) { + if ($element instanceof \DOMElement) { + if ($element->hasAttribute('xsi:type')) { + if ($element->hasAttribute('path')) { + $elementData = $this->getAttributes($element); + $elementData['value'] = $this->argumentInterpreter->evaluate( + $this->argumentParser->parse($element) + ); + unset($elementData['xsi:type'], $elementData['item']); + } else { + $elementData = $this->argumentInterpreter->evaluate( + $this->argumentParser->parse($element) + ); + } + } else { + $elementData = array_merge( + $this->getAttributes($element), + $this->getChildNodes($element) + ); + } + $key = $this->getElementKey($element); + if ($key) { + $result[$element->nodeName][$key] = $elementData; + } elseif (!empty($elementData)) { + $result[$element->nodeName][] = $elementData; + } + } elseif ($element->nodeType == XML_TEXT_NODE && trim($element->nodeValue) != '') { + return ['value' => $element->nodeValue]; + } + } + + return $result; + } + + /** + * Get key for DOM element + * + * @param \DOMElement $element + * @return bool|string + */ + protected function getElementKey(\DOMElement $element) + { + if (isset($this->idAttributes[$element->nodeName])) { + if ($element->hasAttribute($this->idAttributes[$element->nodeName])) { + return $element->getAttribute($this->idAttributes[$element->nodeName]); + } + } + if ($element->hasAttribute(self::NAME_ATTRIBUTE)) { + return $element->getAttribute(self::NAME_ATTRIBUTE); + } + return false; + } + + /** + * @param \DOMElement $element + * @param \DOMAttr $attribute + * @return bool + */ + protected function isKeyAttribute(\DOMElement $element, \DOMAttr $attribute) + { + if (isset($this->idAttributes[$element->nodeName])) { + return $attribute->name == $this->idAttributes[$element->nodeName]; + } else { + return $attribute->name == self::NAME_ATTRIBUTE; + } + } + + /** + * Get node attributes. + * + * @param \DOMElement $element + * @return array + */ + protected function getAttributes(\DOMElement $element) + { + $attributes = []; + if ($element->hasAttributes()) { + /** @var \DomAttr $attribute */ + foreach ($element->attributes as $attribute) { + if (trim($attribute->nodeValue) != '' && !$this->isKeyAttribute($element, $attribute)) { + $attributes[$attribute->nodeName] = $this->castNumeric($attribute->nodeValue); + } + } + } + return $attributes; + } + + /** + * Get child nodes data. + * + * @param \DOMElement $element + * @return array + */ + protected function getChildNodes(\DOMElement $element) + { + $children = []; + if ($element->hasChildNodes()) { + $children = $this->convertXml($element->childNodes); + } + return $children; + } + + /** + * Cast nodeValue to int or double. + * + * @param string $nodeValue + * @return float|int + */ + protected function castNumeric($nodeValue) + { + if (is_numeric($nodeValue)) { + if (preg_match('/^\d+$/', $nodeValue)) { + $nodeValue = (int) $nodeValue; + } else { + $nodeValue = (double) $nodeValue; + } + } + + return $nodeValue; + } +} diff --git a/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php b/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php new file mode 100644 index 000000000..e95a987fb --- /dev/null +++ b/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php @@ -0,0 +1,131 @@ +arrayNodeConfig = $arrayNodeConfig; + } + + /** + * Convert dom node tree to array in general case or to string in a case of a text node + * + * Example: + * + * val2 + * + * + * is converted to + * + * array( + * 'node' => array( + * 'attr' => 'wal', + * 'subnode' => 'val2' + * ) + * ) + * + * @param \DOMNode $source + * @param string $basePath + * @return string|array + * @throws \UnexpectedValueException + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + public function convert(\DOMNode $source, $basePath = '') + { + $value = []; + /** @var \DOMNode $node */ + foreach ($source->childNodes as $node) { + if ($node->nodeType == XML_ELEMENT_NODE) { + $nodeName = $node->nodeName; + $nodePath = $basePath . '/' . $nodeName; + + $arrayKeyAttribute = $this->arrayNodeConfig->getAssocArrayKeyAttribute($nodePath); + $isNumericArrayNode = $this->arrayNodeConfig->isNumericArray($nodePath); + $isArrayNode = $isNumericArrayNode || $arrayKeyAttribute; + + if (isset($value[$nodeName]) && !$isArrayNode) { + throw new \UnexpectedValueException( + "Node path '{$nodePath}' is not unique, but it has not been marked as array." + ); + } + + $nodeData = $this->convert($node, $nodePath); + + if ($isArrayNode) { + if ($isNumericArrayNode) { + $value[$nodeName][] = $nodeData; + } else { + if (isset($nodeData[$arrayKeyAttribute])) { + $arrayKeyValue = $nodeData[$arrayKeyAttribute]; + $value[$nodeName][$arrayKeyValue] = $nodeData; + } else { + throw new \UnexpectedValueException( + "Array is expected to contain value for key '{$arrayKeyAttribute}'." + ); + } + } + } else { + $value[$nodeName] = $nodeData; + } + } elseif ($node->nodeType == XML_CDATA_SECTION_NODE + || ($node->nodeType == XML_TEXT_NODE && trim($node->nodeValue) != '') + ) { + $value = $node->nodeValue; + break; + } + } + $result = $this->getNodeAttributes($source); + if (is_array($value)) { + $result = array_merge($result, $value); + if (!$result) { + $result = ''; + } + } else { + if ($result) { + $result['value'] = $value; + } else { + $result = $value; + } + } + return $result; + } + + /** + * Retrieve key-value pairs of node attributes + * + * @param \DOMNode $node + * @return array + */ + protected function getNodeAttributes(\DOMNode $node) + { + $result = []; + $attributes = $node->attributes ? : []; + /** @var \DOMNode $attribute */ + foreach ($attributes as $attribute) { + if ($attribute->nodeType == XML_ATTRIBUTE_NODE) { + $result[$attribute->nodeName] = $attribute->nodeValue; + } + } + return $result; + } +} diff --git a/lib/Magento/TestFramework/Config/ConverterInterface.php b/lib/Magento/TestFramework/Config/ConverterInterface.php new file mode 100644 index 000000000..e598046ba --- /dev/null +++ b/lib/Magento/TestFramework/Config/ConverterInterface.php @@ -0,0 +1,20 @@ +reader = $reader; + $this->load(); + } + + /** + * Merge config data to the object + * + * @param array $config + * @return void + */ + public function merge(array $config) + { + $this->data = array_replace_recursive($this->data, $config); + } + + /** + * Get config value by key + * + * @param string $path + * @param mixed $default + * @return array|mixed|null + */ + public function get($path = null, $default = null) + { + if ($path === null) { + return $this->data; + } + $keys = explode('/', $path); + $data = $this->data; + foreach ($keys as $key) { + if (is_array($data) && array_key_exists($key, $data)) { + $data = $data[$key]; + } else { + return $default; + } + } + return $data; + } + + /** + * Set name of the config file + * + * @param string $fileName + * @return self + */ + public function setFileName($fileName) + { + if (!is_null($fileName)) { + $this->reader->setFileName($fileName); + } + return $this; + } + + /** + * Load config data + * + * @param string|null $scope + */ + public function load($scope = null) + { + $this->merge( + $this->reader->read($scope) + ); + } +} \ No newline at end of file diff --git a/lib/Magento/TestFramework/Config/DataInterface.php b/lib/Magento/TestFramework/Config/DataInterface.php new file mode 100644 index 000000000..ec33fc6ce --- /dev/null +++ b/lib/Magento/TestFramework/Config/DataInterface.php @@ -0,0 +1,45 @@ + 'id_attribute_name') + * The path to ID attribute name should not include any attribute notations or modifiers -- only node names + * + * @param string $xml + * @param array $idAttributes + * @param string $typeAttributeName + * @param string $schemaFile + * @param string $errorFormat + */ + public function __construct( + $xml, + array $idAttributes = [], + $typeAttributeName = null, + $schemaFile = null, + $errorFormat = self::ERROR_FORMAT_DEFAULT + ) { + $this->_schemaFile = $schemaFile; + $this->_nodeMergingConfig = new Dom\NodeMergingConfig(new Dom\NodePathMatcher(), $idAttributes); + $this->_typeAttributeName = $typeAttributeName; + $this->_errorFormat = $errorFormat; + $this->_dom = $this->_initDom($xml); + $this->_rootNamespace = $this->_dom->lookupNamespaceUri($this->_dom->namespaceURI); + } + + /** + * Merge $xml into DOM document + * + * @param string $xml + * @return void + */ + public function merge($xml) + { + $dom = $this->_initDom($xml); + $this->_mergeNode($dom->documentElement, ''); + } + + /** + * Recursive merging of the \DOMElement into the original document + * + * Algorithm: + * 1. Find the same node in original document + * 2. Extend and override original document node attributes and scalar value if found + * 3. Append new node if original document doesn't have the same node + * + * @param \DOMElement $node + * @param string $parentPath path to parent node + * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + protected function _mergeNode(\DOMElement $node, $parentPath) + { + $path = $this->_getNodePathByParent($node, $parentPath); + + $matchedNode = $this->_getMatchedNode($path); + + /* Update matched node attributes and value */ + if ($matchedNode) { + + //different node type + if ($this->_typeAttributeName + && $node->hasAttribute($this->_typeAttributeName) + && $matchedNode->hasAttribute($this->_typeAttributeName) + && $node->getAttribute($this->_typeAttributeName) + !== $matchedNode->getAttribute($this->_typeAttributeName) + ) { + $this->replaceNodeValue($parentPath, $node, $matchedNode); + return; + } + + $this->_mergeAttributes($matchedNode, $node); + if ($node->nodeValue === '' && $matchedNode->nodeValue !== '' && $matchedNode->childNodes->length === 1) { + $this->replaceNodeValue($parentPath, $node, $matchedNode); + } + if (!$node->hasChildNodes()) { + return; + } + /* override node value */ + if ($this->_isTextNode($node)) { + /* skip the case when the matched node has children, otherwise they get overridden */ + if (!$matchedNode->hasChildNodes() || $this->_isTextNode($matchedNode)) { + $matchedNode->nodeValue = $node->childNodes->item(0)->nodeValue; + } + } else { + /* recursive merge for all child nodes */ + foreach ($node->childNodes as $childNode) { + if ($childNode instanceof \DOMElement) { + $this->_mergeNode($childNode, $path); + } + } + } + } else { + /* Add node as is to the document under the same parent element */ + $parentMatchedNode = $this->_getMatchedNode($parentPath); + $newNode = $this->_dom->importNode($node, true); + $parentMatchedNode->appendChild($newNode); + } + } + + /** + * Replace node value. + * + * @param string $parentPath + * @param \DOMElement $node + * @param \DOMElement $matchedNode + * + * @return void + */ + private function replaceNodeValue($parentPath, \DOMElement $node, \DOMElement $matchedNode) + { + $parentMatchedNode = $this->_getMatchedNode($parentPath); + $newNode = $this->_dom->importNode($node, true); + $parentMatchedNode->replaceChild($newNode, $matchedNode); + } + + /** + * Check if the node content is text + * + * @param \DOMElement $node + * @return bool + */ + protected function _isTextNode($node) + { + return $node->childNodes->length == 1 && $node->childNodes->item(0) instanceof \DOMText; + } + + /** + * Merges attributes of the merge node to the base node + * + * @param \DOMElement $baseNode + * @param \DOMNode $mergeNode + * @return void + */ + protected function _mergeAttributes($baseNode, $mergeNode) + { + foreach ($mergeNode->attributes as $attribute) { + $baseNode->setAttribute($this->_getAttributeName($attribute), $attribute->value); + } + } + + /** + * Identify node path based on parent path and node attributes + * + * @param \DOMElement $node + * @param string $parentPath + * @return string + */ + protected function _getNodePathByParent(\DOMElement $node, $parentPath) + { + $prefix = is_null($this->_rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; + $path = $parentPath . '/' . $prefix . $node->tagName; + $idAttribute = $this->_nodeMergingConfig->getIdAttribute($path); + if ($idAttribute) { + foreach (explode('|', $idAttribute) as $idAttributeValue) { + if ($value = $node->getAttribute($idAttributeValue)) { + $path .= "[@{$idAttributeValue}='{$value}']"; + break; + } + } + } + return $path; + } + + /** + * Getter for node by path + * An exception is possible if original document contains multiple nodes for identifier + * + * @param string $nodePath + * @throws \Exception + * @return \DOMElement|null + */ + protected function _getMatchedNode($nodePath) + { + $xPath = new \DOMXPath($this->_dom); + if ($this->_rootNamespace) { + $xPath->registerNamespace(self::ROOT_NAMESPACE_PREFIX, $this->_rootNamespace); + } + $matchedNodes = $xPath->query($nodePath); + $node = null; + if ($matchedNodes->length > 1) { + throw new \Exception("More than one node matching the query: {$nodePath}"); + } elseif ($matchedNodes->length == 1) { + $node = $matchedNodes->item(0); + } + return $node; + } + + /** + * Validate dom document + * + * @param \DOMDocument $dom + * @param string $schemaFileName + * @param string $errorFormat + * @return array of errors + * @throws \Exception + */ + public static function validateDomDocument( + \DOMDocument $dom, + $schemaFileName, + $errorFormat = self::ERROR_FORMAT_DEFAULT + ) { + libxml_use_internal_errors(true); + try { + $result = $dom->schemaValidate($schemaFileName); + $errors = []; + if (!$result) { + $validationErrors = libxml_get_errors(); + if (count($validationErrors)) { + foreach ($validationErrors as $error) { + $errors[] = self::_renderErrorMessage($error, $errorFormat); + } + } else { + $errors[] = 'Unknown validation error'; + } + } + } catch (\Exception $exception) { + libxml_use_internal_errors(false); + throw new \Exception( + sprintf( + 'Failed to validate xml using schema: %s. Exception: %s', + $schemaFileName, + $exception->getMessage() + ) + ); + } + libxml_use_internal_errors(false); + return $errors; + } + + /** + * Render error message string by replacing placeholders '%field%' with properties of \LibXMLError + * + * @param \LibXMLError $errorInfo + * @param string $format + * @return string + * @throws \InvalidArgumentException + */ + private static function _renderErrorMessage(\LibXMLError $errorInfo, $format) + { + $result = $format; + foreach ($errorInfo as $field => $value) { + $placeholder = '%' . $field . '%'; + $value = trim((string)$value); + $result = str_replace($placeholder, $value, $result); + } + if (strpos($result, '%') !== false) { + throw new \InvalidArgumentException("Error format '{$format}' contains unsupported placeholders."); + } + return $result; + } + + /** + * DOM document getter + * + * @return \DOMDocument + */ + public function getDom() + { + return $this->_dom; + } + + /** + * Create DOM document based on $xml parameter + * + * @param string $xml + * @return \DOMDocument + * @throws \Magento\TestFramework\Config\Dom\ValidationException + */ + protected function _initDom($xml) + { + $dom = new \DOMDocument(); + $dom->loadXML($xml); + if ($this->_schemaFile) { + $errors = self::validateDomDocument($dom, $this->_schemaFile, $this->_errorFormat); + if (count($errors)) { + throw new \Magento\TestFramework\Config\Dom\ValidationException(implode("\n", $errors)); + } + } + return $dom; + } + + /** + * Validate self contents towards to specified schema + * + * @param string $schemaFileName absolute path to schema file + * @param array &$errors + * @return bool + */ + public function validate($schemaFileName, &$errors = []) + { + $errors = self::validateDomDocument($this->_dom, $schemaFileName, $this->_errorFormat); + return !count($errors); + } + + /** + * Set schema file + * + * @param string $schemaFile + * @return $this + */ + public function setSchemaFile($schemaFile) + { + $this->_schemaFile = $schemaFile; + return $this; + } + + /** + * Returns the attribute name with prefix, if there is one + * + * @param \DOMAttr $attribute + * @return string + */ + private function _getAttributeName($attribute) + { + if (!is_null($attribute->prefix) && !empty($attribute->prefix)) { + $attributeName = $attribute->prefix . ':' . $attribute->name; + } else { + $attributeName = $attribute->name; + } + return $attributeName; + } +} diff --git a/lib/Magento/TestFramework/Config/Dom/ArrayNodeConfig.php b/lib/Magento/TestFramework/Config/Dom/ArrayNodeConfig.php new file mode 100644 index 000000000..5fd7b2bcb --- /dev/null +++ b/lib/Magento/TestFramework/Config/Dom/ArrayNodeConfig.php @@ -0,0 +1,78 @@ + '', ...) + * + * @var array + */ + private $assocArrays = []; + + /** + * Format: array('/numeric/array/path', ...) + * + * @var array + */ + private $numericArrays = []; + + /** + * @param NodePathMatcher $nodePathMatcher + * @param array $assocArrayAttributes + * @param array $numericArrays + */ + public function __construct( + NodePathMatcher $nodePathMatcher, + array $assocArrayAttributes, + array $numericArrays = [] + ) { + $this->nodePathMatcher = $nodePathMatcher; + $this->assocArrays = $assocArrayAttributes; + $this->numericArrays = $numericArrays; + } + + /** + * Whether a node is a numeric array or not + * + * @param string $nodeXpath + * @return bool + */ + public function isNumericArray($nodeXpath) + { + foreach ($this->numericArrays as $pathPattern) { + if ($this->nodePathMatcher->match($pathPattern, $nodeXpath)) { + return true; + } + } + return false; + } + + /** + * Retrieve name of array key attribute, if a node is an associative array + * + * @param string $nodeXpath + * @return string|null + */ + public function getAssocArrayKeyAttribute($nodeXpath) + { + foreach ($this->assocArrays as $pathPattern => $keyAttribute) { + if ($this->nodePathMatcher->match($pathPattern, $nodeXpath)) { + return $keyAttribute; + } + } + return null; + } +} diff --git a/lib/Magento/TestFramework/Config/Dom/NodeMergingConfig.php b/lib/Magento/TestFramework/Config/Dom/NodeMergingConfig.php new file mode 100644 index 000000000..9530d30c3 --- /dev/null +++ b/lib/Magento/TestFramework/Config/Dom/NodeMergingConfig.php @@ -0,0 +1,50 @@ + '', ...) + * + * @var array + */ + private $idAttributes = []; + + /** + * @param NodePathMatcher $nodePathMatcher + * @param array $idAttributes + */ + public function __construct(NodePathMatcher $nodePathMatcher, array $idAttributes) + { + $this->nodePathMatcher = $nodePathMatcher; + $this->idAttributes = $idAttributes; + } + + /** + * Retrieve name of an identifier attribute for a node + * + * @param string $nodeXpath + * @return string|null + */ + public function getIdAttribute($nodeXpath) + { + foreach ($this->idAttributes as $pathPattern => $idAttribute) { + if ($this->nodePathMatcher->match($pathPattern, $nodeXpath)) { + return $idAttribute; + } + } + return null; + } +} diff --git a/lib/Magento/TestFramework/Config/Dom/NodePathMatcher.php b/lib/Magento/TestFramework/Config/Dom/NodePathMatcher.php new file mode 100644 index 000000000..b14ed5bc3 --- /dev/null +++ b/lib/Magento/TestFramework/Config/Dom/NodePathMatcher.php @@ -0,0 +1,40 @@ +simplifyXpath($xpathSubject); + $pathPattern = '#^' . $pathPattern . '$#'; + return (bool)preg_match($pathPattern, $pathSubject); + } + + /** + * Strip off predicates and namespaces from the XPath + * + * @param string $xpath + * @return string + */ + protected function simplifyXpath($xpath) + { + $result = $xpath; + $result = preg_replace('/\[@[^\]]+?\]/', '', $result); + $result = preg_replace('/\/[^:]+?\:/', '/', $result); + return $result; + } +} diff --git a/lib/Magento/TestFramework/Config/Dom/ValidationException.php b/lib/Magento/TestFramework/Config/Dom/ValidationException.php new file mode 100644 index 000000000..a853887e5 --- /dev/null +++ b/lib/Magento/TestFramework/Config/Dom/ValidationException.php @@ -0,0 +1,16 @@ +moduleResolver = ModuleResolver::getInstance(); + } + + /** + * Retrieve the list of configuration files with given name that relate to specified scope + * + * @param string $filename + * @param string $scope + * @return array|\Iterator,\Countable + */ + public function get($filename, $scope) + { + $modulesPath = $this->moduleResolver->getModulesPath(); + $paths = []; + foreach ($modulesPath as $modulePath) { + $path = $modulePath . DIRECTORY_SEPARATOR . $scope . DIRECTORY_SEPARATOR . $filename; + if (is_readable($path)) { + $paths[] = $path; + } + } + + $iterator = new File($paths); + return $iterator; + } +} diff --git a/lib/Magento/TestFramework/Config/FileResolver/Primary.php b/lib/Magento/TestFramework/Config/FileResolver/Primary.php new file mode 100644 index 000000000..6a6cfeafc --- /dev/null +++ b/lib/Magento/TestFramework/Config/FileResolver/Primary.php @@ -0,0 +1,77 @@ +getFilePaths($filename, $scope)); + } + + /** + * Get list of configuration files + * + * @param string $filename + * @param string $scope + * @return array + */ + private function getFilePaths($filename, $scope) + { + $paths = []; + foreach ($this->getPathPatterns($filename, $scope) as $pattern) { + $paths = array_merge($paths, glob($pattern)); + } + return array_combine($paths, $paths); + } + + /** + * Retrieve patterns for glob function + * + * @param string $filename + * @param string $scope + * @return array + */ + private function getPathPatterns($filename, $scope) + { + if (substr($scope, 0, strlen(BP)) === BP) { + $patterns = [ + $scope . '/' . $filename, + $scope . '/*/' . $filename + ]; + } else { + $defaultPath = dirname(dirname(dirname(dirname(__DIR__)))); + $defaultPath = str_replace('\\', '/', $defaultPath); + $patterns = [ + $defaultPath . '/' . $scope . '/' . $filename, + $defaultPath . '/' . $scope . '/*/' . $filename, + BP . '/' . $scope . '/' . $filename, + BP . '/' . $scope . '/*/' . $filename + ]; + } + return str_replace('/', DIRECTORY_SEPARATOR, $patterns); + } +} diff --git a/lib/Magento/TestFramework/Config/FileResolverInterface.php b/lib/Magento/TestFramework/Config/FileResolverInterface.php new file mode 100644 index 000000000..8ba0a027b --- /dev/null +++ b/lib/Magento/TestFramework/Config/FileResolverInterface.php @@ -0,0 +1,21 @@ + 'name', + '/scenarios/scenario/methods/method' => 'name', + '/scenarios/scenario/methods/method/steps/step' => 'name', + ]; + + /** + * @constructor + * @param FileResolverInterface $fileResolver + * @param ConverterInterface $converter + * @param SchemaLocatorInterface $schemaLocator + * @param ValidationStateInterface $validationState + * @param string $fileName [optional] + * @param array $idAttributes [optional] + * @param string $domDocumentClass [optional] + * @param string $defaultScope [optional] + */ + public function __construct( + FileResolverInterface $fileResolver, + ConverterInterface $converter, + SchemaLocatorInterface $schemaLocator, + ValidationStateInterface $validationState, + $fileName = 'scenario.xml', + $idAttributes = [], + $domDocumentClass = 'Magento\TestFramework\Config\Dom', + $defaultScope = 'etc' + ) { + $this->_fileResolver = $fileResolver; + $this->_converter = $converter; + $this->_fileName = $fileName; + $this->_idAttributes = array_replace($this->_idAttributes, $idAttributes); + $this->_schemaFile = $schemaLocator->getSchema(); + $this->_isValidated = $validationState->isValidated(); + $this->_perFileSchema = $schemaLocator->getPerFileSchema() && + $this->_isValidated ? $schemaLocator->getPerFileSchema() : null; + $this->_domDocumentClass = $domDocumentClass; + $this->_defaultScope = $defaultScope; + } +} diff --git a/lib/Magento/TestFramework/Config/Reader/Filesystem.php b/lib/Magento/TestFramework/Config/Reader/Filesystem.php new file mode 100644 index 000000000..e5fd47185 --- /dev/null +++ b/lib/Magento/TestFramework/Config/Reader/Filesystem.php @@ -0,0 +1,202 @@ +_fileResolver = $fileResolver; + $this->_converter = $converter; + $this->_fileName = $fileName; + $this->_idAttributes = $idAttributes; + $this->_schemaFile = $schemaLocator->getSchema(); + $this->_isValidated = $validationState->isValidated(); + $this->_perFileSchema = $schemaLocator->getPerFileSchema() && + $this->_isValidated ? $schemaLocator->getPerFileSchema() : null; + $this->_domDocumentClass = $domDocumentClass; + $this->_defaultScope = $defaultScope; + $this->replacer = $replacer; + } + + /** + * Load configuration scope. + * + * @param string|null $scope + * @return array + * @throws \Exception + * @SuppressWarnings(PHPMD.NPathComplexity) + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + public function read($scope = null) + { + $scope = $scope ? : $this->_defaultScope; + $fileList = $this->_fileResolver->get($this->_fileName, $scope); + if (!count($fileList)) { + return []; + } + $output = $this->_readFiles($fileList); + + return $output; + } + + /** + * Set name of the config file. + * + * @param string $fileName + */ + public function setFileName($fileName) + { + $this->_fileName = $fileName; + } + + /** + * Read configuration files. + * + * @param array $fileList + * @return array + * @throws \Exception + */ + protected function _readFiles($fileList) + { + /** @var \Magento\TestFramework\Config\Dom $configMerger */ + $configMerger = null; + foreach ($fileList as $key => $content) { + try { + if (!$configMerger) { + $configMerger = $this->_createConfigMerger($this->_domDocumentClass, $content); + } else { + $configMerger->merge($content); + } + } catch (\Magento\TestFramework\Config\Dom\ValidationException $e) { + throw new \Exception("Invalid XML in file " . $key . ":\n" . $e->getMessage()); + } + } + if ($this->_isValidated) { + $errors = []; + if ($configMerger && !$configMerger->validate($this->_schemaFile, $errors)) { + $message = "Invalid Document \n"; + throw new \Exception($message . implode("\n", $errors)); + } + } + + $output = []; + if ($configMerger) { + $output = $this->_converter->convert($configMerger->getDom()); + if ($this->replacer !== null) { + $this->replacer->apply($output); + } + } + return $output; + } + + /** + * Return newly created instance of a config merger. + * + * @param string $mergerClass + * @param string $initialContents + * @return \Magento\TestFramework\Config\Dom + * @throws \UnexpectedValueException + */ + protected function _createConfigMerger($mergerClass, $initialContents) + { + $result = new $mergerClass($initialContents, $this->_idAttributes, null, $this->_perFileSchema); + if (!$result instanceof \Magento\TestFramework\Config\Dom) { + throw new \UnexpectedValueException( + "Instance of the DOM config merger is expected, got {$mergerClass} instead." + ); + } + return $result; + } +} diff --git a/lib/Magento/TestFramework/Config/ReaderInterface.php b/lib/Magento/TestFramework/Config/ReaderInterface.php new file mode 100644 index 000000000..b274e22fc --- /dev/null +++ b/lib/Magento/TestFramework/Config/ReaderInterface.php @@ -0,0 +1,29 @@ +schemaPath = BP . '/' . $schemaPath; + } else { + $path = dirname(dirname(dirname(__DIR__))); + $path = str_replace('\\', '/', $path); + $this->schemaPath = $path . '/' . $schemaPath; + } + } + + /** + * Get path to merged config schema + * + * @return string + */ + public function getSchema() + { + return $this->schemaPath; + } + + /** + * Get path to pre file validation schema + * + * @return null + */ + public function getPerFileSchema() + { + return null; + } +} diff --git a/lib/Magento/TestFramework/Config/SchemaLocatorInterface.php b/lib/Magento/TestFramework/Config/SchemaLocatorInterface.php new file mode 100644 index 000000000..4fefa91e7 --- /dev/null +++ b/lib/Magento/TestFramework/Config/SchemaLocatorInterface.php @@ -0,0 +1,27 @@ +_appMode = $appMode; + } + + /** + * Retrieve current validation state + * + * @return boolean + */ + public function isValidated() + { + return $this->_appMode == 'developer'; // @todo + } +} diff --git a/lib/Magento/TestFramework/Config/ValidationStateInterface.php b/lib/Magento/TestFramework/Config/ValidationStateInterface.php new file mode 100644 index 000000000..18d080edd --- /dev/null +++ b/lib/Magento/TestFramework/Config/ValidationStateInterface.php @@ -0,0 +1,19 @@ +constInterpreter = $constInterpreter; + } + + /** + * {@inheritdoc} + * @return mixed + * @throws MissingOptionalValueException + */ + public function evaluate(array $data) + { + return ['argument' => $this->constInterpreter->evaluate($data)]; + } +} diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/ArrayType.php b/lib/Magento/TestFramework/Data/Argument/Interpreter/ArrayType.php new file mode 100644 index 000000000..a605d3d05 --- /dev/null +++ b/lib/Magento/TestFramework/Data/Argument/Interpreter/ArrayType.php @@ -0,0 +1,47 @@ +itemInterpreter = $itemInterpreter; + } + + /** + * {@inheritdoc} + * @return array + * @throws \InvalidArgumentException + */ + public function evaluate(array $data) + { + if (!isset($data['item']) || !is_array($data['item'])) { + throw new \InvalidArgumentException('Array items are expected.'); + } + $result = []; + $items = $data['item']; + foreach ($items as $itemKey => $itemData) { + $result[$itemKey] = $this->itemInterpreter->evaluate($itemData); + } + return $result; + } +} diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php b/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php new file mode 100644 index 000000000..c2a063708 --- /dev/null +++ b/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php @@ -0,0 +1,42 @@ +booleanUtils = $booleanUtils; + } + + /** + * {@inheritdoc} + * @return bool + * @throws \InvalidArgumentException + */ + public function evaluate(array $data) + { + if (!isset($data['value'])) { + throw new \InvalidArgumentException('Boolean value is missing.'); + } + $value = $data['value']; + return $this->booleanUtils->toBoolean($value); + } +} diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Composite.php b/lib/Magento/TestFramework/Data/Argument/Interpreter/Composite.php new file mode 100644 index 000000000..6689315cb --- /dev/null +++ b/lib/Magento/TestFramework/Data/Argument/Interpreter/Composite.php @@ -0,0 +1,94 @@ +' => , ...) + * + * @var InterpreterInterface[] + */ + private $interpreters; + + /** + * Data key that holds name of an interpreter to be used for that data + * + * @var string + */ + private $discriminator; + + /** + * @param InterpreterInterface[] $interpreters + * @param string $discriminator + * @throws \InvalidArgumentException + */ + public function __construct(array $interpreters, $discriminator) + { + foreach ($interpreters as $interpreterName => $interpreterInstance) { + if (!$interpreterInstance instanceof InterpreterInterface) { + throw new \InvalidArgumentException( + "Interpreter named '{$interpreterName}' is expected to be an argument interpreter instance." + ); + } + } + $this->interpreters = $interpreters; + $this->discriminator = $discriminator; + } + + /** + * {@inheritdoc} + * @throws \InvalidArgumentException + */ + public function evaluate(array $data) + { + if (!isset($data[$this->discriminator])) { + throw new \InvalidArgumentException( + sprintf('Value for key "%s" is missing in the argument data.', $this->discriminator) + ); + } + $interpreterName = $data[$this->discriminator]; + unset($data[$this->discriminator]); + $interpreter = $this->getInterpreter($interpreterName); + return $interpreter->evaluate($data); + } + + /** + * Register interpreter instance under a given unique name + * + * @param string $name + * @param InterpreterInterface $instance + * @return void + * @throws \InvalidArgumentException + */ + public function addInterpreter($name, InterpreterInterface $instance) + { + if (isset($this->interpreters[$name])) { + throw new \InvalidArgumentException("Argument interpreter named '{$name}' has already been defined."); + } + $this->interpreters[$name] = $instance; + } + + /** + * Retrieve interpreter instance by its unique name + * + * @param string $name + * @return InterpreterInterface + * @throws \InvalidArgumentException + */ + protected function getInterpreter($name) + { + if (!isset($this->interpreters[$name])) { + throw new \InvalidArgumentException("Argument interpreter named '{$name}' has not been defined."); + } + return $this->interpreters[$name]; + } +} diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Constant.php b/lib/Magento/TestFramework/Data/Argument/Interpreter/Constant.php new file mode 100644 index 000000000..f7d4f5b32 --- /dev/null +++ b/lib/Magento/TestFramework/Data/Argument/Interpreter/Constant.php @@ -0,0 +1,28 @@ +booleanUtils = $booleanUtils; + } + + /** + * Compute and return effective value of an argument + * + * @param array $data + * @return mixed + * @throws \InvalidArgumentException + * @throws \UnexpectedValueException + */ + public function evaluate(array $data) + { + $result = ['instance' => $data['value']]; + if (isset($data['shared'])) { + $result['shared'] = $this->booleanUtils->toBoolean($data['shared']); + } + return $result; + } +} diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/StringType.php b/lib/Magento/TestFramework/Data/Argument/Interpreter/StringType.php new file mode 100644 index 000000000..fc64e28a1 --- /dev/null +++ b/lib/Magento/TestFramework/Data/Argument/Interpreter/StringType.php @@ -0,0 +1,46 @@ +booleanUtils = $booleanUtils; + } + + /** + * {@inheritdoc} + * @return string + * @throws \InvalidArgumentException + */ + public function evaluate(array $data) + { + if (isset($data['value'])) { + $result = $data['value']; + if (!is_string($result)) { + throw new \InvalidArgumentException('String value is expected.'); + } + } else { + $result = ''; + } + return $result; + } +} diff --git a/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php b/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php new file mode 100644 index 000000000..75b53c747 --- /dev/null +++ b/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php @@ -0,0 +1,23 @@ +objectManager = $objectManager; + $this->instanceName = $instanceName; + $this->isShared = $shared; + } + + /** + * @return array + */ + public function __sleep() + { + return ['subject', 'isShared']; + } + + /** + * Retrieve ObjectManager from global scope + */ + public function __wakeup() + { + $this->objectManager = \Magento\TestFramework\ObjectManager::getInstance(); + } + + /** + * Clone proxied instance + */ + public function __clone() + { + $this->subject = clone $this->_getSubject(); + } + + /** + * Get proxied instance + * + * @return \Magento\TestFramework\Data\Argument\InterpreterInterface + */ + protected function _getSubject() + { + if (!$this->subject) { + $this->subject = true === $this->isShared + ? $this->objectManager->get($this->instanceName) + : $this->objectManager->create($this->instanceName); + } + return $this->subject; + } + + /** + * {@inheritdoc} + */ + public function evaluate(array $data) + { + return $this->_getSubject()->evaluate($data); + } +} diff --git a/lib/Magento/TestFramework/Data/Argument/MissingOptionalValueException.php b/lib/Magento/TestFramework/Data/Argument/MissingOptionalValueException.php new file mode 100644 index 000000000..01ea7f7bc --- /dev/null +++ b/lib/Magento/TestFramework/Data/Argument/MissingOptionalValueException.php @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/Magento/TestFramework/ObjectManager.php b/lib/Magento/TestFramework/ObjectManager.php new file mode 100644 index 000000000..61b2c30b0 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager.php @@ -0,0 +1,118 @@ +_sharedInstances['Magento\TestFramework\ObjectManager'] = $this; + } + + /** + * Get list of parameters for class method + * + * @param string $type + * @param string $method + * @return array|null + */ + public function getParameters($type, $method) + { + return $this->_factory->getParameters($type, $method); + } + + /** + * Resolve and prepare arguments for class method + * + * @param object $object + * @param string $method + * @param array $arguments + * @return array + */ + public function prepareArguments($object, $method, array $arguments = []) + { + return $this->_factory->prepareArguments($object, $method, $arguments); + } + + /** + * Invoke class method with prepared arguments + * + * @param object $object + * @param string $method + * @param array $arguments + * @return mixed + */ + public function invoke($object, $method, array $arguments = []) + { + return $this->_factory->invoke($object, $method, $arguments); + } + + /** + * Set object manager instance + * + * @param ObjectManager $objectManager + * @return void + */ + public static function setInstance(ObjectManager $objectManager) + { + self::$_instance = $objectManager; + } + + /** + * Retrieve object manager + * + * @return ObjectManager + * @throws \RuntimeException + */ + public static function getInstance() + { + if (!self::$_instance instanceof ObjectManager) { + return false; + } + return self::$_instance; + } + + /** + * Avoid to serialize Closure properties + * + * @return array + */ + public function __sleep() + { + return []; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Config.php b/lib/Magento/TestFramework/ObjectManager/Config.php new file mode 100644 index 000000000..966619cab --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Config.php @@ -0,0 +1,52 @@ +_nonShared[$type])) { + return false; + } + + if (isset($this->_virtualTypes[$type])) { + return true; + } + + if (!isset($this->_nonSharedRefClasses[$type])) { + $this->_nonSharedRefClasses[$type] = new \ReflectionClass($type); + } + foreach ($this->_nonShared as $noneShared => $flag) { + if ($this->_nonSharedRefClasses[$type]->isSubclassOf($noneShared)) { + return false; + } + } + + return true; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Config.php b/lib/Magento/TestFramework/ObjectManager/Config/Config.php new file mode 100644 index 000000000..af5841df6 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Config/Config.php @@ -0,0 +1,243 @@ +_relations = $relations ? : new \Magento\TestFramework\ObjectManager\Relations\Runtime(); + $this->_definitions = $definitions ? : new \Magento\TestFramework\ObjectManager\Definition\Runtime(); + } + + /** + * Retrieve list of arguments per type + * + * @param string $type + * @return array + */ + public function getArguments($type) + { + return isset($this->_mergedArguments[$type]) + ? $this->_mergedArguments[$type] + : $this->_collectConfiguration($type); + } + + /** + * Check whether type is shared + * + * @param string $type + * @return bool + */ + public function isShared($type) + { + return !isset($this->_nonShared[$type]); + } + + /** + * Retrieve instance type + * + * @param string $instanceName + * @return mixed + */ + public function getInstanceType($instanceName) + { + while (isset($this->_virtualTypes[$instanceName])) { + $instanceName = $this->_virtualTypes[$instanceName]; + } + return $instanceName; + } + + /** + * Retrieve preference for type + * + * @param string $type + * @return string + * @throws \LogicException + */ + public function getPreference($type) + { + $type = ltrim($type, '\\'); + $preferencePath = []; + while (isset($this->_preferences[$type])) { + if (isset($preferencePath[$this->_preferences[$type]])) { + throw new \LogicException( + 'Circular type preference: ' . + $type . + ' relates to ' . + $this->_preferences[$type] . + ' and viceversa.' + ); + } + $type = $this->_preferences[$type]; + $preferencePath[$type] = 1; + } + return $type; + } + + /** + * Collect parent types configuration for requested type + * + * @param string $type + * @return array + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + protected function _collectConfiguration($type) + { + if (!isset($this->_mergedArguments[$type])) { + if (isset($this->_virtualTypes[$type])) { + $arguments = $this->_collectConfiguration($this->_virtualTypes[$type]); + } else { + if ($this->_relations->has($type)) { + $relations = $this->_relations->getParents($type); + $arguments = []; + foreach ($relations as $relation) { + if ($relation) { + $relationArguments = $this->_collectConfiguration($relation); + if ($relationArguments) { + $arguments = array_replace($arguments, $relationArguments); + } + } + } + } else { + $arguments = []; + } + } + + if (isset($this->_arguments[$type])) { + if ($arguments && count($arguments)) { + $arguments = array_replace_recursive($arguments, $this->_arguments[$type]); + } else { + $arguments = $this->_arguments[$type]; + } + } + $this->_mergedArguments[$type] = $arguments; + return $arguments; + } + return $this->_mergedArguments[$type]; + } + + /** + * Merge configuration + * + * @param array $configuration + * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + protected function _mergeConfiguration(array $configuration) + { + foreach ($configuration as $key => $curConfig) { + switch ($key) { + case 'preferences': + foreach ($curConfig as $for => $to) { + $this->_preferences[ltrim($for, '\\')] = ltrim($to, '\\'); + } + break; + + default: + $key = ltrim($key, '\\'); + if (isset($curConfig['type'])) { + $this->_virtualTypes[$key] = ltrim($curConfig['type'], '\\'); + } + if (isset($curConfig['arguments'])) { + if (!empty($this->_mergedArguments)) { + $this->_mergedArguments = []; + } + if (isset($this->_arguments[$key])) { + $this->_arguments[$key] = array_replace($this->_arguments[$key], $curConfig['arguments']); + } else { + $this->_arguments[$key] = $curConfig['arguments']; + } + } + if (isset($curConfig['shared'])) { + if (!$curConfig['shared']) { + $this->_nonShared[$key] = 1; + } else { + unset($this->_nonShared[$key]); + } + } + break; + } + } + } + + /** + * Extend configuration + * + * @param array $configuration + * @return void + */ + public function extend(array $configuration) + { + $this->_mergeConfiguration($configuration); + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Mapper/ArgumentParser.php b/lib/Magento/TestFramework/ObjectManager/Config/Mapper/ArgumentParser.php new file mode 100644 index 000000000..6b8d244d3 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Config/Mapper/ArgumentParser.php @@ -0,0 +1,64 @@ +argumentNodeName = $argumentNodeName; + } + + + /** + * Build and return array representation of DI argument node + * + * @param \DOMNode $argumentNode + * @return array|string + */ + public function parse(\DOMNode $argumentNode) + { + // Base path is specified to use more meaningful XPaths in config + return $this->getConverter()->convert($argumentNode, $this->argumentNodeName); + } + + /** + * Retrieve instance of XML converter, suitable for DI argument nodes + * + * @return FlatConverter + */ + protected function getConverter() + { + if (!$this->converter) { + $arrayNodeConfig = new ArrayNodeConfig( + new NodePathMatcher(), + [$this->argumentNodeName . '(/item)+' => 'name'] + ); + $this->converter = new FlatConverter($arrayNodeConfig); + } + return $this->converter; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php b/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php new file mode 100644 index 000000000..01d32ece5 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php @@ -0,0 +1,147 @@ +argumentInterpreter = $argumentInterpreter; + $this->booleanUtils = $booleanUtils ? : new BooleanUtils(); + $this->argumentParser = $argumentParser ? : new ArgumentParser(); + } + + /** + * Convert configuration in DOM format to assoc array that can be used by object manager + * + * @param \DOMDocument $config + * @return array + * @throws \Exception + * @todo this method has high cyclomatic complexity in order to avoid performance issues + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function convert(\DOMDocument $config) + { + $output = []; + /** @var \DOMNode $node */ + foreach ($config->documentElement->childNodes as $node) { + if ($node->nodeType != XML_ELEMENT_NODE) { + continue; + } + switch ($node->nodeName) { + case 'preference': + $output['preferences'][$node->attributes->getNamedItem( + 'for' + )->nodeValue] = $node->attributes->getNamedItem( + 'type' + )->nodeValue; + break; + case 'type': + case 'virtualType': + $typeData = []; + $typeNodeAttributes = $node->attributes; + $typeNodeShared = $typeNodeAttributes->getNamedItem('shared'); + if ($typeNodeShared) { + $typeData['shared'] = $this->booleanUtils->toBoolean($typeNodeShared->nodeValue); + } + if ($node->nodeName == 'virtualType') { + $attributeType = $typeNodeAttributes->getNamedItem('type'); + // attribute type is required for virtual type only in merged configuration + if ($attributeType) { + $typeData['type'] = $attributeType->nodeValue; + } + } + $typeArguments = []; + $typePlugins = []; + /** @var \DOMNode $typeChildNode */ + foreach ($node->childNodes as $typeChildNode) { + if ($typeChildNode->nodeType != XML_ELEMENT_NODE) { + continue; + } + switch ($typeChildNode->nodeName) { + case 'arguments': + /** @var \DOMNode $argumentNode */ + foreach ($typeChildNode->childNodes as $argumentNode) { + if ($argumentNode->nodeType != XML_ELEMENT_NODE) { + continue; + } + $argumentName = $argumentNode->attributes->getNamedItem('name')->nodeValue; + $argumentData = $this->argumentParser->parse($argumentNode); + $typeArguments[$argumentName] = $this->argumentInterpreter->evaluate( + $argumentData + ); + } + break; + case 'plugin': + $pluginAttributes = $typeChildNode->attributes; + $pluginDisabledNode = $pluginAttributes->getNamedItem('disabled'); + $pluginSortOrderNode = $pluginAttributes->getNamedItem('sortOrder'); + $pluginTypeNode = $pluginAttributes->getNamedItem('type'); + $pluginData = [ + 'sortOrder' => $pluginSortOrderNode ? (int)$pluginSortOrderNode->nodeValue : 0 + ]; + if ($pluginDisabledNode) { + $pluginData['disabled'] = $this->booleanUtils->toBoolean( + $pluginDisabledNode->nodeValue + ); + } + if ($pluginTypeNode) { + $pluginData['instance'] = $pluginTypeNode->nodeValue; + } + $typePlugins[$pluginAttributes->getNamedItem('name')->nodeValue] = $pluginData; + break; + default: + throw new \Exception( + "Invalid application config. Unknown node: {$typeChildNode->nodeName}." + ); + } + } + + $typeData['arguments'] = $typeArguments; + if (!empty($typePlugins)) { + $typeData['plugins'] = $typePlugins; + } + $output[$typeNodeAttributes->getNamedItem('name')->nodeValue] = $typeData; + break; + default: + throw new \Exception("Invalid application config. Unknown node: {$node->nodeName}."); + } + } + + return $output; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php b/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php new file mode 100644 index 000000000..d885c2c77 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php @@ -0,0 +1,70 @@ + 'for', + '/config/(type|virtualType)' => 'name', + '/config/(type|virtualType)/plugin' => 'name', + '/config/(type|virtualType)/arguments/argument' => 'name', + '/config/(type|virtualType)/arguments/argument(/item)+' => 'name' + ], + $domDocumentClass = 'Magento\TestFramework\Config\Dom', + $defaultScope = 'etc' + ) { + parent::__construct( + $fileResolver, + $converter, + $schemaLocator, + $validationState, + $fileName, + $idAttributes, + $domDocumentClass, + $defaultScope + ); + } + + /** + * Create and return a config merger instance that takes into account types of arguments + * + * @param string $mergerClass + * @param string $initialContents + * @return \Magento\TestFramework\Config\Dom + */ + protected function _createConfigMerger($mergerClass, $initialContents) + { + return new $mergerClass($initialContents, $this->_idAttributes, self::TYPE_ATTRIBUTE, $this->_perFileSchema); + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php b/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php new file mode 100644 index 000000000..0819c70c9 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php @@ -0,0 +1,37 @@ +createArgumentInterpreter() + ), + new \Magento\TestFramework\ObjectManager\Config\SchemaLocator(), + new \Magento\TestFramework\Config\ValidationState($this->_appMode) + ); + + return $reader->read(); + } + + + /** + * Return newly created instance on an argument interpreter, suitable for processing DI arguments + * + * @return \Magento\TestFramework\Data\Argument\InterpreterInterface + */ + protected function createArgumentInterpreter() + { + $booleanUtils = new \Magento\TestFramework\Stdlib\BooleanUtils(); + $constInterpreter = new \Magento\TestFramework\Data\Argument\Interpreter\Constant(); + $result = new \Magento\TestFramework\Data\Argument\Interpreter\Composite( + [ + 'boolean' => new \Magento\TestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), + 'string' => new \Magento\TestFramework\Data\Argument\Interpreter\StringType($booleanUtils), + 'number' => new \Magento\TestFramework\Data\Argument\Interpreter\Number(), + 'null' => new \Magento\TestFramework\Data\Argument\Interpreter\NullType(), + 'object' => new \Magento\TestFramework\Data\Argument\Interpreter\ObjectType($booleanUtils), + 'const' => $constInterpreter, + 'init_parameter' => new \Magento\TestFramework\Data\Argument\Interpreter\Argument($constInterpreter) + ], + \Magento\TestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE + ); + // Add interpreters that reference the composite + $result->addInterpreter('array', new \Magento\TestFramework\Data\Argument\Interpreter\ArrayType($result)); + return $result; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php b/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php new file mode 100644 index 000000000..4659e9f6c --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php @@ -0,0 +1,60 @@ +_reader = $reader ? : new \Magento\TestFramework\Code\Reader\ClassReader(); + } + + /** + * Get list of method parameters + * + * Retrieve an ordered list of constructor parameters. + * Each value is an array with following entries: + * + * array( + * 0, // string: Parameter name + * 1, // string|null: Parameter type + * 2, // bool: whether this param is required + * 3, // mixed: default value + * ); + * + * @param string $className + * @return array|null + */ + public function getParameters($className) + { + if (!array_key_exists($className, $this->_definitions)) { + $this->_definitions[$className] = $this->_reader->getConstructor($className); + } + return $this->_definitions[$className]; + } + + /** + * Retrieve list of all classes covered with definitions + * + * @return array + */ + public function getClasses() + { + return []; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/DefinitionInterface.php b/lib/Magento/TestFramework/ObjectManager/DefinitionInterface.php new file mode 100644 index 000000000..7c9a16012 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/DefinitionInterface.php @@ -0,0 +1,38 @@ +classReader = new ClassReader(); + } + + /** + * Invoke class method and prepared arguments + * + * @param mixed $object + * @param string $method + * @param array $args + * @return mixed + */ + public function invoke($object, $method, array $args = []) + { + $args = $this->prepareArguments($object, $method, $args); + + $type = get_class($object); + $class = new \ReflectionClass($type); + $method = $class->getMethod($method); + + return $method->invokeArgs($object, $args); + } + + /** + * Get list of parameters for class method + * + * @param string $type + * @param string $method + * @return array|null + */ + public function getParameters($type, $method) + { + return $this->classReader->getParameters($type, $method); + } + + /** + * Resolve and prepare arguments for class method + * + * @param object $object + * @param string $method + * @param array $arguments + * @return array + */ + public function prepareArguments($object, $method, array $arguments = []) + { + $type = get_class($object); + $parameters = $this->classReader->getParameters($type, $method); + if ($parameters == null) { + return []; + } + + return $this->_resolveArguments($type, $parameters, $arguments); + } + + /** + * Resolve constructor arguments + * + * @param string $requestedType + * @param array $parameters + * @param array $arguments + * @return array + * @throws \UnexpectedValueException + * @throws \BadMethodCallException + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + protected function _resolveArguments($requestedType, array $parameters, array $arguments = []) + { + $resolvedArguments = []; + $arguments = count($arguments) + ? array_replace($this->config->getArguments($requestedType), $arguments) + : $this->config->getArguments($requestedType); + foreach ($parameters as $parameter) { + list($paramName, $paramType, $paramRequired, $paramDefault) = $parameter; + $argument = null; + if (array_key_exists($paramName, $arguments)) { + $argument = $arguments[$paramName]; + } elseif (array_key_exists('options', $arguments) && array_key_exists($paramName, $arguments['options'])) { + // The parameter name doesn't exist in the arguments, but it is contained in the 'options' argument. + $argument = $arguments['options'][$paramName]; + } else { + if ($paramRequired) { + if ($paramType) { + $argument = ['instance' => $paramType]; + } else { + $this->creationStack = []; + throw new \BadMethodCallException( + 'Missing required argument $' . $paramName . ' of ' . $requestedType . '.' + ); + } + } else { + $argument = $paramDefault; + } + } + if ($paramType && !is_object($argument) && $argument !== $paramDefault) { + if (!is_array($argument)) { + throw new \UnexpectedValueException( + 'Invalid parameter configuration provided for $' . $paramName . ' argument of ' . $requestedType + ); + } + if (isset($argument['instance']) && !empty($argument['instance'])) { + $argumentType = $argument['instance']; + unset($argument['instance']); + if (array_key_exists('shared', $argument)) { + $isShared = $argument['shared']; + unset($argument['shared']); + } else { + $isShared = $this->config->isShared($argumentType); + } + } else { + $argumentType = $paramType; + $isShared = $this->config->isShared($argumentType); + } + + $_arguments = !empty($argument) ? $argument : []; + + $argument = $isShared + ? $this->objectManager->get($argumentType) + : $this->objectManager->create($argumentType, $_arguments); + } else { + if (is_array($argument)) { + if (isset($argument['argument'])) { + $argKey = $argument['argument']; + $argument = isset($this->globalArguments[$argKey]) + ? $this->globalArguments[$argKey] + : $paramDefault; + } else { + $this->parseArray($argument); + } + } + } + $resolvedArguments[$paramName] = $argument; + } + return $resolvedArguments; + } + + /** + * Parse array argument + * + * @param array $array + * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + protected function parseArray(&$array) + { + foreach ($array as $key => $item) { + if (!is_array($item)) { + continue; + } + if (isset($item['instance'])) { + $itemType = $item['instance']; + $isShared = isset($item['shared']) ? $item['shared'] : $this->config->isShared($itemType); + + unset($item['instance']); + if (array_key_exists('shared', $item)) { + unset($item['shared']); + } + + $_arguments = !empty($item) ? $item : []; + + $array[$key] = $isShared + ? $this->objectManager->get($itemType) + : $this->objectManager->create($itemType, $_arguments); + } elseif (isset($item['argument'])) { + $array[$key] = isset($this->globalArguments[$item['argument']]) + ? $this->globalArguments[$item['argument']] + : null; + } else { + $this->parseArray($item); + } + } + } + + /** + * Create instance with call time arguments + * + * @param string $requestedType + * @param array $arguments + * @return object + * @throws \Exception + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + public function create($requestedType, array $arguments = []) + { + $type = $this->config->getInstanceType($requestedType); + $parameters = $this->definitions->getParameters($type); + if ($parameters == null) { + return new $type(); + } + if (isset($this->creationStack[$requestedType])) { + $lastFound = end($this->creationStack); + $this->creationStack = []; + throw new \LogicException("Circular dependency: {$requestedType} depends on {$lastFound} and vice versa."); + } + $this->creationStack[$requestedType] = $requestedType; + try { + $args = $this->_resolveArguments($requestedType, $parameters, $arguments); + unset($this->creationStack[$requestedType]); + } catch (\Exception $e) { + unset($this->creationStack[$requestedType]); + throw $e; + } + + $reflection = new \ReflectionClass($type); + + return $reflection->newInstanceArgs($args); + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Factory/Dynamic/Developer.php b/lib/Magento/TestFramework/ObjectManager/Factory/Dynamic/Developer.php new file mode 100644 index 000000000..30bfda70a --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Factory/Dynamic/Developer.php @@ -0,0 +1,204 @@ +config = $config; + $this->objectManager = $objectManager; + $this->definitions = $definitions ?: new \Magento\TestFramework\ObjectManager\Definition\Runtime(); + $this->globalArguments = $globalArguments; + } + + /** + * Set object manager + * + * @param \Magento\TestFramework\ObjectManagerInterface $objectManager + * @return void + */ + public function setObjectManager(\Magento\TestFramework\ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Resolve constructor arguments + * + * @param string $requestedType + * @param array $parameters + * @param array $arguments + * @return array + * @throws \UnexpectedValueException + * @throws \BadMethodCallException + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + protected function _resolveArguments($requestedType, array $parameters, array $arguments = []) + { + $resolvedArguments = []; + $arguments = count($arguments) + ? array_replace($this->config->getArguments($requestedType), $arguments) + : $this->config->getArguments($requestedType); + foreach ($parameters as $parameter) { + list($paramName, $paramType, $paramRequired, $paramDefault) = $parameter; + $argument = null; + if (!empty($arguments) && (isset($arguments[$paramName]) || array_key_exists($paramName, $arguments))) { + $argument = $arguments[$paramName]; + } else if ($paramRequired) { + if ($paramType) { + $argument = ['instance' => $paramType]; + } else { + $this->creationStack = []; + throw new \BadMethodCallException( + 'Missing required argument $' . $paramName . ' of ' . $requestedType . '.' + ); + } + } else { + $argument = $paramDefault; + } + if ($paramType && $argument !== $paramDefault && !is_object($argument)) { + if (!isset($argument['instance']) || !is_array($argument)) { + throw new \UnexpectedValueException( + 'Invalid parameter configuration provided for $' . $paramName . ' argument of ' . $requestedType + ); + } + $argumentType = $argument['instance']; + $isShared = (isset($argument['shared']) ? $argument['shared'] : $this->config->isShared($argumentType)); + $argument = $isShared + ? $this->objectManager->get($argumentType) + : $this->objectManager->create($argumentType); + } else if (is_array($argument)) { + if (isset($argument['argument'])) { + $argument = isset($this->globalArguments[$argument['argument']]) + ? $this->globalArguments[$argument['argument']] + : $paramDefault; + } else if (!empty($argument)) { + $this->parseArray($argument); + } + } + $resolvedArguments[] = $argument; + } + return $resolvedArguments; + } + + /** + * Parse array argument + * + * @param array $array + * @return void + */ + protected function parseArray(&$array) + { + foreach ($array as $key => $item) { + if (is_array($item)) { + if (isset($item['instance'])) { + $itemType = $item['instance']; + $isShared = (isset($item['shared'])) ? $item['shared'] : $this->config->isShared($itemType); + $array[$key] = $isShared + ? $this->objectManager->get($itemType) + : $this->objectManager->create($itemType); + } elseif (isset($item['argument'])) { + $array[$key] = isset($this->globalArguments[$item['argument']]) + ? $this->globalArguments[$item['argument']] + : null; + } else { + $this->parseArray($array[$key]); + } + } + } + } + + /** + * Create instance with call time arguments + * + * @param string $requestedType + * @param array $arguments + * @return object + * @throws \Exception + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + public function create($requestedType, array $arguments = []) + { + $type = $this->config->getInstanceType($requestedType); + $parameters = $this->definitions->getParameters($type); + if ($parameters == null) { + return new $type(); + } + if (isset($this->creationStack[$requestedType])) { + $lastFound = end($this->creationStack); + $this->creationStack = []; + throw new \LogicException("Circular dependency: {$requestedType} depends on {$lastFound} and vice versa."); + } + $this->creationStack[$requestedType] = $requestedType; + try { + $args = $this->_resolveArguments($requestedType, $parameters, $arguments); + unset($this->creationStack[$requestedType]); + } catch (\Exception $e) { + unset($this->creationStack[$requestedType]); + throw $e; + } + + $reflection = new \ReflectionClass($type); + + return $reflection->newInstanceArgs($args); + } + + /** + * Set global arguments + * + * @param array $arguments + * @return void + */ + public function setArguments($arguments) + { + $this->globalArguments = $arguments; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/FactoryInterface.php b/lib/Magento/TestFramework/ObjectManager/FactoryInterface.php new file mode 100644 index 000000000..24ec3a2ee --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/FactoryInterface.php @@ -0,0 +1,23 @@ +_config = $config; + $this->_factory = $factory; + $this->_sharedInstances = $sharedInstances; + $this->_sharedInstances['Magento\TestFramework\ObjectManagerInterface'] = $this; + } + + /** + * Create new object instance + * + * @param string $type + * @param array $arguments + * @return mixed + */ + public function create($type, array $arguments = []) + { + return $this->_factory->create($this->_config->getPreference($type), $arguments); + } + + /** + * Retrieve cached object instance + * + * @param string $type + * @return mixed + */ + public function get($type) + { + $type = $this->_config->getPreference($type); + if (!isset($this->_sharedInstances[$type])) { + $this->_sharedInstances[$type] = $this->_factory->create($type); + } + return $this->_sharedInstances[$type]; + } + + /** + * Configure di instance + * + * @param array $configuration + * @return void + */ + public function configure(array $configuration) + { + $this->_config->extend($configuration); + } + + /** + * Avoid to serialize Closure properties + * + * @return array + */ + public function __sleep() + { + return []; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Relations/Runtime.php b/lib/Magento/TestFramework/ObjectManager/Relations/Runtime.php new file mode 100644 index 000000000..fa3e60863 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Relations/Runtime.php @@ -0,0 +1,57 @@ +_classReader = $classReader ? : new \Magento\TestFramework\Code\Reader\ClassReader(); + } + + /** + * Check whether requested type is available for read + * + * @param string $type + * @return bool + */ + public function has($type) + { + return class_exists($type) || interface_exists($type); + } + + /** + * Retrieve list of parents + * + * @param string $type + * @return array + */ + public function getParents($type) + { + if (!class_exists($type)) { + return $this->_default; + } + return $this->_classReader->getParents($type) ? : $this->_default; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/RelationsInterface.php b/lib/Magento/TestFramework/ObjectManager/RelationsInterface.php new file mode 100644 index 000000000..946ab075d --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/RelationsInterface.php @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Param name should be unique in scope of type + + + + + + + + + + + Param name should be unique in scope of virtual type + + + + + + + + + + + + + Preference for each class should be unique in scope of file + + + + + + + + + Type name should be unique in scope of file + + + + + + + + + Virtual type name should be unique in scope of file + + + + + + + + + + + Preference help Object Manager to choose class for corresponding interface + + + + + + + + + + With 'type' tag you can point parameters and plugins for certain class + + + + + + + + + + + + + + + + + + + + + With 'virtualType' tag you can point parameters and plugins for autogenerated class + + + + + + + + + + + + + + diff --git a/lib/Magento/TestFramework/ObjectManagerFactory.php b/lib/Magento/TestFramework/ObjectManagerFactory.php new file mode 100644 index 000000000..4486769b5 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManagerFactory.php @@ -0,0 +1,119 @@ +configClassName(); + + $factory = new Factory($diConfig); + $argInterpreter = $this->createArgumentInterpreter(new BooleanUtils()); + $argumentMapper = new \Magento\TestFramework\ObjectManager\Config\Mapper\Dom($argInterpreter); + + + $sharedInstances['Magento\TestFramework\Data\Argument\InterpreterInterface'] = $argInterpreter; + $sharedInstances['Magento\TestFramework\ObjectManager\Config\Mapper\Dom'] = $argumentMapper; + + /** @var \Magento\TestFramework\ObjectManager $objectManager */ + $objectManager = new $this->locatorClassName($factory, $diConfig, $sharedInstances); + + $factory->setObjectManager($objectManager); + ObjectManager::setInstance($objectManager); + + self::configure($objectManager); + + return $objectManager; + } + + /** + * Return newly created instance on an argument interpreter, suitable for processing DI arguments. + * + * @param \Magento\TestFramework\Stdlib\BooleanUtils $booleanUtils + * @return \Magento\TestFramework\Data\Argument\InterpreterInterface + */ + protected function createArgumentInterpreter( + \Magento\TestFramework\Stdlib\BooleanUtils $booleanUtils + ) { + $constInterpreter = new \Magento\TestFramework\Data\Argument\Interpreter\Constant(); + $result = new \Magento\TestFramework\Data\Argument\Interpreter\Composite( + [ + 'boolean' => new \Magento\TestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), + 'string' => new \Magento\TestFramework\Data\Argument\Interpreter\StringType($booleanUtils), + 'number' => new \Magento\TestFramework\Data\Argument\Interpreter\Number(), + 'null' => new \Magento\TestFramework\Data\Argument\Interpreter\NullType(), + 'const' => $constInterpreter, + 'object' => new \Magento\TestFramework\Data\Argument\Interpreter\ObjectType($booleanUtils), + 'init_parameter' => new \Magento\TestFramework\Data\Argument\Interpreter\Argument($constInterpreter), + ], + \Magento\TestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE + ); + // Add interpreters that reference the composite + $result->addInterpreter('array', new \Magento\TestFramework\Data\Argument\Interpreter\ArrayType($result)); + return $result; + } + + /** + * Get Object Manager instance. + * + * @return ObjectManager + */ + public static function getObjectManager() + { + if (!$objectManager = ObjectManager::getInstance()) { + $objectManagerFactory = new self(); + $objectManager = $objectManagerFactory->create(); + } + + return $objectManager; + } + + /** + * Configure Object Manager. + * This method is static to have the ability to configure multiple instances of Object manager when needed. + * + * @param \Magento\TestFramework\ObjectManagerInterface $objectManager + * @return void + */ + public static function configure(\Magento\TestFramework\ObjectManagerInterface $objectManager) + { + $objectManager->configure( + $objectManager->get('Magento\TestFramework\ObjectManager\ConfigLoader\Primary')->load() + ); + } +} diff --git a/lib/Magento/TestFramework/ObjectManagerInterface.php b/lib/Magento/TestFramework/ObjectManagerInterface.php new file mode 100644 index 000000000..d5f2a10a1 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManagerInterface.php @@ -0,0 +1,38 @@ + + + + + + + The root element for configuration data. + + + + + + + + An element that contains configuration data of a page. + + + + + + + + + + + + + + An element that contains configuration data of a page block. + + + + + + + + The name of the page. + + + + + + + MCA path for the page. For example: "catalog/product/view". + + + + + + + The name of the module to which the page belongs. For example: "Magento_Catalog". + + + + + + + The name of the area to which the page belongs. For example: "Adminhtml". + + + + + + + + + + + + + An element that contains configuration data of a block render. + + + + + + + + The name of the block. + + + + + + + The path to the block PHP class file. + + + + + + + Locator of the block. For example, CSS selector "#maincontent". + + + + + + + Strategy according to value of "locator" attribute. + + + + + + + + + + + + The name of the render. + + + + + + + The path to the render PHP class file. + + + + + + + Locator of the render. For example, CSS selector "#maincontent". + + + + + + + Strategy according to value of "locator" attribute. + + + + + + + + + + + + + + + + + diff --git a/lib/Magento/TestFramework/Stdlib/BooleanUtils.php b/lib/Magento/TestFramework/Stdlib/BooleanUtils.php new file mode 100644 index 000000000..07f5a1339 --- /dev/null +++ b/lib/Magento/TestFramework/Stdlib/BooleanUtils.php @@ -0,0 +1,63 @@ +trueValues = $trueValues; + $this->falseValues = $falseValues; + } + + /** + * Retrieve boolean value for an expression + * + * @param mixed $value Boolean expression + * @return bool + * @throws \InvalidArgumentException + */ + public function toBoolean($value) + { + /** + * Built-in function filter_var() is not used, because such values as on/off are irrelevant in some contexts + * @link http://www.php.net/manual/en/filter.filters.validate.php + */ + if (in_array($value, $this->trueValues, true)) { + return true; + } + if (in_array($value, $this->falseValues, true)) { + return false; + } + $allowedValues = array_merge($this->trueValues, $this->falseValues); + throw new \InvalidArgumentException( + 'Boolean value is expected, supported values: ' . var_export($allowedValues, true) + ); + } +} diff --git a/lib/Magento/TestFramework/System/Code/ClassReader.php b/lib/Magento/TestFramework/System/Code/ClassReader.php new file mode 100644 index 000000000..4217c10ec --- /dev/null +++ b/lib/Magento/TestFramework/System/Code/ClassReader.php @@ -0,0 +1,51 @@ +getMethod($method); + if ($method) { + $result = []; + /** @var $parameter \ReflectionParameter */ + foreach ($method->getParameters() as $parameter) { + try { + $result[$parameter->getName()] = [ + $parameter->getName(), + ($parameter->getClass() !== null) ? $parameter->getClass()->getName() : null, + !$parameter->isOptional(), + $parameter->isOptional() ? + $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null : + null + ]; + } catch (\ReflectionException $e) { + $message = $e->getMessage(); + throw new \ReflectionException($message, 0, $e); + } + } + } + + return $result; + } +} diff --git a/lib/Magento/TestFramework/Util/Iterator/AbstractIterator.php b/lib/Magento/TestFramework/Util/Iterator/AbstractIterator.php new file mode 100644 index 000000000..12bc5998c --- /dev/null +++ b/lib/Magento/TestFramework/Util/Iterator/AbstractIterator.php @@ -0,0 +1,131 @@ +data); + if (!$this->isValid()) { + $this->next(); + } + } + + /** + * Seek to next valid row + * + * @return void + */ + public function next() + { + $this->current = next($this->data); + + if ($this->current !== false) { + if (!$this->isValid()) { + $this->next(); + } + } else { + $this->key = null; + } + } + + /** + * Check if current position is valid + * + * @return boolean + */ + public function valid() + { + $current = current($this->data); + if ($current === false || $current === null) { + return false; + } else { + return true; + } + } + + /** + * Get data key of the current data element + * + * @return int|string + */ + public function key() + { + return key($this->data); + } + + /** + * To make iterator countable + * + * @return int + */ + public function count() + { + return count($this->data); + } + + /** + * Initialize first element + * + * @return void + */ + protected function initFirstElement() + { + if ($this->data) { + $this->current = reset($this->data); + if (!$this->isValid()) { + $this->next(); + } + } + } +} diff --git a/lib/Magento/TestFramework/Util/Iterator/File.php b/lib/Magento/TestFramework/Util/Iterator/File.php new file mode 100644 index 000000000..e3655ebfd --- /dev/null +++ b/lib/Magento/TestFramework/Util/Iterator/File.php @@ -0,0 +1,56 @@ +data = $paths; + $this->initFirstElement(); + } + + /** + * Get file content + * + * @return string + */ + public function current() + { + if (!isset($this->cached[$this->current])) { + $this->cached[$this->current] = file_get_contents($this->current); + } + return $this->cached[$this->current]; + + } + + /** + * Check if current element is valid + * + * @return boolean + */ + protected function isValid() + { + return true; + } +} diff --git a/lib/Magento/TestFramework/Util/ModuleResolver.php b/lib/Magento/TestFramework/Util/ModuleResolver.php new file mode 100644 index 000000000..f724434c9 --- /dev/null +++ b/lib/Magento/TestFramework/Util/ModuleResolver.php @@ -0,0 +1,56 @@ +pageObjects = $pageObjects; + } + + public function readPageObjects() + { + var_dump($this->pageObjects->get('page/CatalogProductIndex')); + } +} diff --git a/src/Magento/Xxyyzz/Page/Backend/etc/Page.xml b/src/Magento/Xxyyzz/Page/Backend/etc/Page.xml new file mode 100644 index 000000000..5741afd4e --- /dev/null +++ b/src/Magento/Xxyyzz/Page/Backend/etc/Page.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml b/src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml new file mode 100644 index 000000000..1a070b223 --- /dev/null +++ b/src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Magento/Xxyyzz/Page/Cms/etc/Page.xml b/src/Magento/Xxyyzz/Page/Cms/etc/Page.xml new file mode 100644 index 000000000..8b9b1dc29 --- /dev/null +++ b/src/Magento/Xxyyzz/Page/Cms/etc/Page.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Magento/Xxyyzz/Page/ConfigurableProduct/etc/Page.xml b/src/Magento/Xxyyzz/Page/ConfigurableProduct/etc/Page.xml new file mode 100644 index 000000000..68a84e297 --- /dev/null +++ b/src/Magento/Xxyyzz/Page/ConfigurableProduct/etc/Page.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Magento/Xxyyzz/Page/Customer/etc/Page.xml b/src/Magento/Xxyyzz/Page/Customer/etc/Page.xml new file mode 100644 index 000000000..734611216 --- /dev/null +++ b/src/Magento/Xxyyzz/Page/Customer/etc/Page.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Magento/Xxyyzz/Page/Sales/etc/Page.xml b/src/Magento/Xxyyzz/Page/Sales/etc/Page.xml new file mode 100644 index 000000000..e33114016 --- /dev/null +++ b/src/Magento/Xxyyzz/Page/Sales/etc/Page.xml @@ -0,0 +1,10 @@ + + + + + + + + + + From 797c76d27ceff4358cdd9794e834e5ab8ef4d797 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 24 May 2017 12:00:55 -0500 Subject: [PATCH 080/149] MTA-4213: adjusted repo name change. --- composer.json | 2 +- src/Magento/Xxyyzz/Module/MagentoWebDriver.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b7d75f55e..fc22304a9 100755 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "magento/acceptance-test-framework", + "name": "magento/magento2-acceptance-test-framework", "type": "library", "description": "Magento Acceptance Testing Framework", "keywords": ["magento", "automation", "acceptance", "testing"], diff --git a/src/Magento/Xxyyzz/Module/MagentoWebDriver.php b/src/Magento/Xxyyzz/Module/MagentoWebDriver.php index c0da3f17a..95c841db4 100644 --- a/src/Magento/Xxyyzz/Module/MagentoWebDriver.php +++ b/src/Magento/Xxyyzz/Module/MagentoWebDriver.php @@ -229,7 +229,7 @@ public function scrollToTopOfPage() * @param $floatString * @return float */ - function parseFloat($floatString){ + public function parseFloat($floatString){ $floatString = str_replace(',', '', $floatString); return floatval($floatString); } From 6b84cbcd0142c2ce1010e49afcfec5a399b353fa Mon Sep 17 00:00:00 2001 From: Oleksii Kolesnyk Date: Thu, 25 May 2017 16:45:32 +0300 Subject: [PATCH 081/149] MTA-4228: [Customizability] XML parser --- bootstrap.php | 2 +- etc/di.xml | 6 +- lib/Magento/TestFramework/Code/Generator.php | 103 ------------------ .../Code/Generator/Autoloader.php | 41 ------- .../TestFramework/Code/Reader/ClassReader.php | 13 +-- .../Code/Reader/ClassReaderInterface.php | 34 ++++++ .../TestFramework/Config/CacheInterface.php | 71 ------------ .../TestFramework/Config/Converter.php | 4 +- .../Config/Converter/Dom/Flat.php | 18 ++- .../Config/ConverterInterface.php | 4 +- lib/Magento/TestFramework/Config/Data.php | 2 +- .../TestFramework/Config/DataInterface.php | 2 +- lib/Magento/TestFramework/Config/Dom.php | 2 +- .../Config/Dom/ArrayNodeConfig.php | 2 +- .../Config/Dom/NodeMergingConfig.php | 2 +- .../Config/Dom/NodePathMatcher.php | 2 +- .../Config/Dom/ValidationException.php | 4 +- .../Config/FileResolver/Module.php | 2 +- .../Config/FileResolver/Primary.php | 2 +- .../Config/FileResolverInterface.php | 2 +- lib/Magento/TestFramework/Config/Reader.php | 2 +- .../Config/Reader/Filesystem.php | 90 +++++++-------- .../TestFramework/Config/ReaderInterface.php | 14 +-- .../Config/ReplacerInterface.php | 2 +- .../TestFramework/Config/SchemaLocator.php | 2 +- .../Config/SchemaLocatorInterface.php | 2 +- .../TestFramework/Config/ValidationState.php | 4 +- .../Config/ValidationStateInterface.php | 6 +- .../Data/Argument/Interpreter/Argument.php | 2 +- .../Data/Argument/Interpreter/ArrayType.php | 82 +++++++++++++- .../Data/Argument/Interpreter/Boolean.php | 2 +- .../Data/Argument/Interpreter/Composite.php | 2 +- .../Data/Argument/Interpreter/Constant.php | 5 +- .../{ObjectType.php => DataObject.php} | 10 +- .../Data/Argument/Interpreter/NullType.php | 2 +- .../Data/Argument/Interpreter/Number.php | 2 +- .../{StringType.php => StringUtils.php} | 18 +-- .../Data/Argument/InterpreterInterface.php | 3 +- .../Argument/InterpreterInterface/Proxy.php | 4 +- .../MissingOptionalValueException.php | 14 --- lib/Magento/TestFramework/Data/etc/types.xsd | 43 ++++++-- lib/Magento/TestFramework/ObjectManager.php | 2 +- .../TestFramework/ObjectManager/Config.php | 2 +- .../ObjectManager/Config/Config.php | 2 +- .../Config/Mapper/ArgumentParser.php | 25 +---- .../ObjectManager/Config/Mapper/Dom.php | 33 +----- .../ObjectManager/Config/Reader/Dom.php | 3 +- .../Config/Reader/DomFactory.php | 53 +++++++++ .../ObjectManager/Config/SchemaLocator.php | 2 +- .../ObjectManager/ConfigInterface.php | 2 +- .../ObjectManager/ConfigLoader/Primary.php | 6 +- .../ObjectManager/Definition/Runtime.php | 2 +- .../ObjectManager/DefinitionInterface.php | 2 +- .../TestFramework/ObjectManager/Factory.php | 2 +- .../Factory/Dynamic/Developer.php | 2 +- .../ObjectManager/FactoryInterface.php | 2 +- .../ObjectManager/ObjectManager.php | 2 +- .../ObjectManager/Relations/Runtime.php | 2 +- .../ObjectManager/RelationsInterface.php | 2 +- .../ObjectManager/etc/config.xsd | 14 +-- .../TestFramework/ObjectManagerFactory.php | 8 +- .../TestFramework/ObjectManagerInterface.php | 2 +- .../TestFramework/Stdlib/BooleanUtils.php | 2 +- .../TestFramework/System/Code/ClassReader.php | 2 +- .../Util/Iterator/AbstractIterator.php | 2 +- .../TestFramework/Util/Iterator/File.php | 2 +- .../TestFramework/Util/ModuleResolver.php | 2 +- src/Magento/Xxyyzz/Dummy.php | 2 +- src/Magento/Xxyyzz/Page/Cms/etc/Page.xml | 1 + src/Magento/Xxyyzz/Page/Sales/etc/Page.xml | 4 +- 70 files changed, 339 insertions(+), 477 deletions(-) delete mode 100644 lib/Magento/TestFramework/Code/Generator.php delete mode 100644 lib/Magento/TestFramework/Code/Generator/Autoloader.php create mode 100644 lib/Magento/TestFramework/Code/Reader/ClassReaderInterface.php delete mode 100644 lib/Magento/TestFramework/Config/CacheInterface.php rename lib/Magento/TestFramework/Data/Argument/Interpreter/{ObjectType.php => DataObject.php} (83%) rename lib/Magento/TestFramework/Data/Argument/Interpreter/{StringType.php => StringUtils.php} (64%) delete mode 100644 lib/Magento/TestFramework/Data/Argument/MissingOptionalValueException.php create mode 100644 lib/Magento/TestFramework/ObjectManager/Config/Reader/DomFactory.php diff --git a/bootstrap.php b/bootstrap.php index cdfe414f9..7ce4779ba 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,6 +1,6 @@ @@ -36,11 +36,11 @@ - Magento\TestFramework\Data\Argument\Interpreter\ObjectType + Magento\TestFramework\Data\Argument\Interpreter\DataObject arrayArgumentInterpreterProxy Magento\TestFramework\Data\Argument\Interpreter\Boolean Magento\TestFramework\Data\Argument\Interpreter\Number - Magento\TestFramework\Data\Argument\Interpreter\StringType + Magento\TestFramework\Data\Argument\Interpreter\StringUtils Magento\TestFramework\Data\Argument\Interpreter\NullType Magento\TestFramework\Data\Argument\Interpreter\Constant diff --git a/lib/Magento/TestFramework/Code/Generator.php b/lib/Magento/TestFramework/Code/Generator.php deleted file mode 100644 index 5622047d1..000000000 --- a/lib/Magento/TestFramework/Code/Generator.php +++ /dev/null @@ -1,103 +0,0 @@ -generatedEntities = $generatedEntities; - } - - /** - * Get generated entities. - * - * @return string[] - */ - public function getGeneratedEntities() - { - return $this->generatedEntities; - } - - /** - * Generate class. - * - * @param string $className - * @return string - * @throws \Exception - * @throws \InvalidArgumentException - */ - public function generateClass($className) - { - $classNameRegexp = '/\\\Test\\\([^\\\]+)(?:\\\[^\\\]+)+$/'; - - if (preg_match($classNameRegexp, $className, $matches)) { - $classType = lcfirst($matches[1]); - - if (!isset($this->generatedEntities[$classType])) { - throw new \InvalidArgumentException( - sprintf('Cannot generate class "%s". Unknown type %s', $className, $classType) - ); - } - - /** @var \Magento\TestFramework\Util\Generate\AbstractGenerate $generator */ - $generator = $this->createGeneratorInstance($this->generatedEntities[$classType]); - - $classFilePath = $generator->generate($className); - - if (!$classFilePath) { - throw new \Exception(implode(' ', $generator->getErrors())); - } - - $this->includeFile($classFilePath); - - return self::GENERATION_SUCCESS; - } - - return self::GENERATION_SKIP; - } - - /** - * @param string $fileName - * @return void - */ - public function includeFile($fileName) - { - include $fileName; - } - - /** - * Create entity generator. - * - * @param string $generatorClass - * @return \Magento\TestFramework\Util\Generate\AbstractGenerate - */ - protected function createGeneratorInstance($generatorClass) - { - return \Magento\TestFramework\ObjectManager::getInstance()->get($generatorClass); - } -} diff --git a/lib/Magento/TestFramework/Code/Generator/Autoloader.php b/lib/Magento/TestFramework/Code/Generator/Autoloader.php deleted file mode 100644 index 8b445e41d..000000000 --- a/lib/Magento/TestFramework/Code/Generator/Autoloader.php +++ /dev/null @@ -1,41 +0,0 @@ -generator = $generator; - } - - /** - * Load specified class name and generate it if necessary - * - * @param string $className - * @return bool True if class was loaded - */ - public function load($className) - { - if (!class_exists($className)) { - return Generator::GENERATION_SUCCESS == $this->generator->generateClass($className); - } - return true; - } -} diff --git a/lib/Magento/TestFramework/Code/Reader/ClassReader.php b/lib/Magento/TestFramework/Code/Reader/ClassReader.php index 157357cd0..48bc28d91 100644 --- a/lib/Magento/TestFramework/Code/Reader/ClassReader.php +++ b/lib/Magento/TestFramework/Code/Reader/ClassReader.php @@ -1,14 +1,11 @@ getName(), $parameter->getClass() !== null ? $parameter->getClass()->getName() : null, !$parameter->isOptional(), - $parameter->isOptional() ? $parameter - ->isDefaultValueAvailable() ? $parameter - ->getDefaultValue() : null : null + $parameter->isOptional() + ? ($parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null) + : null, ]; } catch (\ReflectionException $e) { $message = $e->getMessage(); diff --git a/lib/Magento/TestFramework/Code/Reader/ClassReaderInterface.php b/lib/Magento/TestFramework/Code/Reader/ClassReaderInterface.php new file mode 100644 index 000000000..2ce7a1996 --- /dev/null +++ b/lib/Magento/TestFramework/Code/Reader/ClassReaderInterface.php @@ -0,0 +1,34 @@ +convertXml($source->documentElement->childNodes); } diff --git a/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php b/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php index e95a987fb..b47d2650e 100644 --- a/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php +++ b/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php @@ -1,6 +1,6 @@ attributes ? : []; + $attributes = $node->attributes ?: []; /** @var \DOMNode $attribute */ foreach ($attributes as $attribute) { if ($attribute->nodeType == XML_ATTRIBUTE_NODE) { diff --git a/lib/Magento/TestFramework/Config/ConverterInterface.php b/lib/Magento/TestFramework/Config/ConverterInterface.php index e598046ba..17ebde571 100644 --- a/lib/Magento/TestFramework/Config/ConverterInterface.php +++ b/lib/Magento/TestFramework/Config/ConverterInterface.php @@ -1,6 +1,6 @@ _fileResolver = $fileResolver; $this->_converter = $converter; $this->_fileName = $fileName; - $this->_idAttributes = $idAttributes; + $this->_idAttributes = array_replace($this->_idAttributes, $idAttributes); + $this->validationState = $validationState; $this->_schemaFile = $schemaLocator->getSchema(); - $this->_isValidated = $validationState->isValidated(); - $this->_perFileSchema = $schemaLocator->getPerFileSchema() && - $this->_isValidated ? $schemaLocator->getPerFileSchema() : null; + $this->_perFileSchema = $schemaLocator->getPerFileSchema() && $validationState->isValidationRequired() + ? $schemaLocator->getPerFileSchema() : null; $this->_domDocumentClass = $domDocumentClass; $this->_defaultScope = $defaultScope; - $this->replacer = $replacer; } /** - * Load configuration scope. + * Load configuration scope * * @param string|null $scope * @return array - * @throws \Exception - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function read($scope = null) { - $scope = $scope ? : $this->_defaultScope; + $scope = $scope ?: $this->_defaultScope; $fileList = $this->_fileResolver->get($this->_fileName, $scope); if (!count($fileList)) { return []; @@ -132,17 +130,7 @@ public function read($scope = null) } /** - * Set name of the config file. - * - * @param string $fileName - */ - public function setFileName($fileName) - { - $this->_fileName = $fileName; - } - - /** - * Read configuration files. + * Read configuration files * * @param array $fileList * @return array @@ -163,7 +151,7 @@ protected function _readFiles($fileList) throw new \Exception("Invalid XML in file " . $key . ":\n" . $e->getMessage()); } } - if ($this->_isValidated) { + if ($this->validationState->isValidationRequired()) { $errors = []; if ($configMerger && !$configMerger->validate($this->_schemaFile, $errors)) { $message = "Invalid Document \n"; @@ -174,15 +162,12 @@ protected function _readFiles($fileList) $output = []; if ($configMerger) { $output = $this->_converter->convert($configMerger->getDom()); - if ($this->replacer !== null) { - $this->replacer->apply($output); - } } return $output; } /** - * Return newly created instance of a config merger. + * Return newly created instance of a config merger * * @param string $mergerClass * @param string $initialContents @@ -191,7 +176,12 @@ protected function _readFiles($fileList) */ protected function _createConfigMerger($mergerClass, $initialContents) { - $result = new $mergerClass($initialContents, $this->_idAttributes, null, $this->_perFileSchema); + $result = new $mergerClass( + $initialContents, + $this->_idAttributes, + null, + $this->_perFileSchema + ); if (!$result instanceof \Magento\TestFramework\Config\Dom) { throw new \UnexpectedValueException( "Instance of the DOM config merger is expected, got {$mergerClass} instead." diff --git a/lib/Magento/TestFramework/Config/ReaderInterface.php b/lib/Magento/TestFramework/Config/ReaderInterface.php index b274e22fc..af5b98c9b 100644 --- a/lib/Magento/TestFramework/Config/ReaderInterface.php +++ b/lib/Magento/TestFramework/Config/ReaderInterface.php @@ -1,13 +1,15 @@ _appMode == 'developer'; // @todo } diff --git a/lib/Magento/TestFramework/Config/ValidationStateInterface.php b/lib/Magento/TestFramework/Config/ValidationStateInterface.php index 18d080edd..cea5cb286 100644 --- a/lib/Magento/TestFramework/Config/ValidationStateInterface.php +++ b/lib/Magento/TestFramework/Config/ValidationStateInterface.php @@ -1,12 +1,12 @@ sortItems($items); foreach ($items as $itemKey => $itemData) { $result[$itemKey] = $this->itemInterpreter->evaluate($itemData); } return $result; } + + /** + * Sort items by sort order attribute. + * + * @param array $items + * @return array + */ + private function sortItems($items) + { + $sortOrderDefined = $this->isSortOrderDefined($items); + if ($sortOrderDefined) { + $indexedItems = []; + foreach ($items as $key => $item) { + $indexedItems[] = ['key' => $key, 'item' => $item]; + } + uksort( + $indexedItems, + function ($firstItemKey, $secondItemKey) use ($indexedItems) { + return $this->compareItems($firstItemKey, $secondItemKey, $indexedItems); + } + ); + // Convert array of sorted items back to initial format + $items = []; + foreach ($indexedItems as $indexedItem) { + $items[$indexedItem['key']] = $indexedItem['item']; + } + } + return $items; + } + + /** + * Compare sortOrder of item + * + * @param mixed $firstItemKey + * @param mixed $secondItemKey + * @param array $indexedItems + * @return int + */ + private function compareItems($firstItemKey, $secondItemKey, $indexedItems) + { + $firstItem = $indexedItems[$firstItemKey]['item']; + $secondItem = $indexedItems[$secondItemKey]['item']; + $firstValue = 0; + $secondValue = 0; + if (isset($firstItem['sortOrder'])) { + $firstValue = intval($firstItem['sortOrder']); + } + + if (isset($secondItem['sortOrder'])) { + $secondValue = intval($secondItem['sortOrder']); + } + + if ($firstValue == $secondValue) { + // These keys reflect initial relative position of items. + // Allows stable sort for items with equal 'sortOrder' + return $firstItemKey < $secondItemKey ? -1 : 1; + } + return $firstValue < $secondValue ? -1 : 1; + } + + /** + * Determine if a sort order exists for any of the items. + * + * @param array $items + * @return bool + */ + private function isSortOrderDefined($items) + { + foreach ($items as $itemData) { + if (isset($itemData['sortOrder'])) { + return true; + } + } + return false; + } } diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php b/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php index c2a063708..4572171da 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php +++ b/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php @@ -1,6 +1,6 @@ booleanUtils = $booleanUtils; - } - /** * {@inheritdoc} * @return string diff --git a/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php b/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php index 75b53c747..3aa23e4f8 100644 --- a/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php +++ b/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php @@ -1,6 +1,6 @@ objectManager = $objectManager; diff --git a/lib/Magento/TestFramework/Data/Argument/MissingOptionalValueException.php b/lib/Magento/TestFramework/Data/Argument/MissingOptionalValueException.php deleted file mode 100644 index 01ea7f7bc..000000000 --- a/lib/Magento/TestFramework/Data/Argument/MissingOptionalValueException.php +++ /dev/null @@ -1,14 +0,0 @@ - - + @@ -17,8 +17,8 @@ - - + + @@ -26,35 +26,56 @@ + + + + + + - + - + - + + + + + + + + + + + + + + + + - + - + @@ -62,8 +83,8 @@ - - + + diff --git a/lib/Magento/TestFramework/ObjectManager.php b/lib/Magento/TestFramework/ObjectManager.php index 61b2c30b0..4a07545a7 100644 --- a/lib/Magento/TestFramework/ObjectManager.php +++ b/lib/Magento/TestFramework/ObjectManager.php @@ -1,6 +1,6 @@ argumentNodeName = $argumentNodeName; - } - - /** * Build and return array representation of DI argument node * @@ -42,7 +28,7 @@ public function __construct($argumentNodeName = 'argument') public function parse(\DOMNode $argumentNode) { // Base path is specified to use more meaningful XPaths in config - return $this->getConverter()->convert($argumentNode, $this->argumentNodeName); + return $this->getConverter()->convert($argumentNode, 'argument'); } /** @@ -53,10 +39,7 @@ public function parse(\DOMNode $argumentNode) protected function getConverter() { if (!$this->converter) { - $arrayNodeConfig = new ArrayNodeConfig( - new NodePathMatcher(), - [$this->argumentNodeName . '(/item)+' => 'name'] - ); + $arrayNodeConfig = new ArrayNodeConfig(new NodePathMatcher(), ['argument(/item)+' => 'name']); $this->converter = new FlatConverter($arrayNodeConfig); } return $this->converter; diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php b/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php index 01d32ece5..df999dc68 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php +++ b/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php @@ -1,6 +1,6 @@ argumentInterpreter = $argumentInterpreter; - $this->booleanUtils = $booleanUtils ? : new BooleanUtils(); - $this->argumentParser = $argumentParser ? : new ArgumentParser(); + $this->booleanUtils = $booleanUtils ?: new BooleanUtils(); + $this->argumentParser = $argumentParser ?: new ArgumentParser(); } /** @@ -54,7 +51,7 @@ public function __construct( * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function convert(\DOMDocument $config) + public function convert($config) { $output = []; /** @var \DOMNode $node */ @@ -86,7 +83,6 @@ public function convert(\DOMDocument $config) } } $typeArguments = []; - $typePlugins = []; /** @var \DOMNode $typeChildNode */ foreach ($node->childNodes as $typeChildNode) { if ($typeChildNode->nodeType != XML_ELEMENT_NODE) { @@ -106,24 +102,6 @@ public function convert(\DOMDocument $config) ); } break; - case 'plugin': - $pluginAttributes = $typeChildNode->attributes; - $pluginDisabledNode = $pluginAttributes->getNamedItem('disabled'); - $pluginSortOrderNode = $pluginAttributes->getNamedItem('sortOrder'); - $pluginTypeNode = $pluginAttributes->getNamedItem('type'); - $pluginData = [ - 'sortOrder' => $pluginSortOrderNode ? (int)$pluginSortOrderNode->nodeValue : 0 - ]; - if ($pluginDisabledNode) { - $pluginData['disabled'] = $this->booleanUtils->toBoolean( - $pluginDisabledNode->nodeValue - ); - } - if ($pluginTypeNode) { - $pluginData['instance'] = $pluginTypeNode->nodeValue; - } - $typePlugins[$pluginAttributes->getNamedItem('name')->nodeValue] = $pluginData; - break; default: throw new \Exception( "Invalid application config. Unknown node: {$typeChildNode->nodeName}." @@ -132,9 +110,6 @@ public function convert(\DOMDocument $config) } $typeData['arguments'] = $typeArguments; - if (!empty($typePlugins)) { - $typeData['plugins'] = $typePlugins; - } $output[$typeNodeAttributes->getNamedItem('name')->nodeValue] = $typeData; break; default: diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php b/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php index d885c2c77..f88fc2218 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php +++ b/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php @@ -1,6 +1,6 @@ 'for', '/config/(type|virtualType)' => 'name', - '/config/(type|virtualType)/plugin' => 'name', '/config/(type|virtualType)/arguments/argument' => 'name', '/config/(type|virtualType)/arguments/argument(/item)+' => 'name' ], diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Reader/DomFactory.php b/lib/Magento/TestFramework/ObjectManager/Config/Reader/DomFactory.php new file mode 100644 index 000000000..036bd5487 --- /dev/null +++ b/lib/Magento/TestFramework/ObjectManager/Config/Reader/DomFactory.php @@ -0,0 +1,53 @@ +_objectManager = $objectManager; + $this->_instanceName = $instanceName; + } + + /** + * Create class instance with specified parameters + * + * @param array $data + * @return \Magento\TestFramework\ObjectManager\Config\Reader\Dom + */ + public function create(array $data = []) + { + return $this->_objectManager->create($this->_instanceName, $data); + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php b/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php index 0819c70c9..901f4eb2b 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php +++ b/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php @@ -1,6 +1,6 @@ new \Magento\TestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), - 'string' => new \Magento\TestFramework\Data\Argument\Interpreter\StringType($booleanUtils), + 'string' => new \Magento\TestFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), 'number' => new \Magento\TestFramework\Data\Argument\Interpreter\Number(), 'null' => new \Magento\TestFramework\Data\Argument\Interpreter\NullType(), - 'object' => new \Magento\TestFramework\Data\Argument\Interpreter\ObjectType($booleanUtils), + 'object' => new \Magento\TestFramework\Data\Argument\Interpreter\DataObject($booleanUtils), 'const' => $constInterpreter, 'init_parameter' => new \Magento\TestFramework\Data\Argument\Interpreter\Argument($constInterpreter) ], diff --git a/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php b/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php index 4659e9f6c..930b97d7d 100644 --- a/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php +++ b/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php @@ -1,6 +1,6 @@ @@ -106,7 +106,7 @@ - With 'type' tag you can point parameters and plugins for certain class + With 'type' tag you can point parameters for certain class @@ -116,7 +116,6 @@ - @@ -127,18 +126,11 @@ - With 'virtualType' tag you can point parameters and plugins for autogenerated class + With 'virtualType' tag you can point parameters for autogenerated class - - - - - - - diff --git a/lib/Magento/TestFramework/ObjectManagerFactory.php b/lib/Magento/TestFramework/ObjectManagerFactory.php index 4486769b5..09a6b6cf8 100644 --- a/lib/Magento/TestFramework/ObjectManagerFactory.php +++ b/lib/Magento/TestFramework/ObjectManagerFactory.php @@ -1,6 +1,6 @@ new \Magento\TestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), - 'string' => new \Magento\TestFramework\Data\Argument\Interpreter\StringType($booleanUtils), + 'string' => new \Magento\TestFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), 'number' => new \Magento\TestFramework\Data\Argument\Interpreter\Number(), 'null' => new \Magento\TestFramework\Data\Argument\Interpreter\NullType(), 'const' => $constInterpreter, - 'object' => new \Magento\TestFramework\Data\Argument\Interpreter\ObjectType($booleanUtils), + 'object' => new \Magento\TestFramework\Data\Argument\Interpreter\DataObject($booleanUtils), 'init_parameter' => new \Magento\TestFramework\Data\Argument\Interpreter\Argument($constInterpreter), ], \Magento\TestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE @@ -113,7 +113,7 @@ public static function getObjectManager() public static function configure(\Magento\TestFramework\ObjectManagerInterface $objectManager) { $objectManager->configure( - $objectManager->get('Magento\TestFramework\ObjectManager\ConfigLoader\Primary')->load() + $objectManager->get(\Magento\TestFramework\ObjectManager\ConfigLoader\Primary::class)->load() ); } } diff --git a/lib/Magento/TestFramework/ObjectManagerInterface.php b/lib/Magento/TestFramework/ObjectManagerInterface.php index d5f2a10a1..a321f1026 100644 --- a/lib/Magento/TestFramework/ObjectManagerInterface.php +++ b/lib/Magento/TestFramework/ObjectManagerInterface.php @@ -1,6 +1,6 @@ + diff --git a/src/Magento/Xxyyzz/Page/Sales/etc/Page.xml b/src/Magento/Xxyyzz/Page/Sales/etc/Page.xml index e33114016..490e48661 100644 --- a/src/Magento/Xxyyzz/Page/Sales/etc/Page.xml +++ b/src/Magento/Xxyyzz/Page/Sales/etc/Page.xml @@ -4,7 +4,7 @@ - - + + From 70c737ae69d55d55aa6631b1ad4f8b70cfb031fc Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 2 Jun 2017 09:52:03 -0500 Subject: [PATCH 082/149] MQE-90: 1. Added schema for block object in page. 2. Refactored xml parser codes to fit better in codeception. 3. Changed to use a unified namespace. --- bootstrap.php | 2 +- composer.json | 3 +- composer.lock | 214 +++--- entryPoint.php | 4 +- etc/_envs/chrome.yml | 6 +- etc/_envs/firefox.yml | 6 +- etc/_envs/phantomjs.yml | 6 +- etc/di.xml | 72 +- .../ObjectManager/ConfigLoader/Primary.php | 70 -- .../TestFramework/ObjectManagerFactory.php | 119 ---- .../Code/Reader/ClassReader.php | 2 +- .../Code/Reader/ClassReaderInterface.php | 2 +- .../Config/Converter.php | 8 +- .../Config/Converter/Dom/Flat.php | 4 +- .../Config/ConverterInterface.php | 2 +- .../AcceptanceTestFramework}/Config/Data.php | 10 +- .../Config/DataInterface.php | 2 +- .../AcceptanceTestFramework}/Config/Dom.php | 6 +- .../Config/Dom/ArrayNodeConfig.php | 2 +- .../Config/Dom/NodeMergingConfig.php | 2 +- .../Config/Dom/NodePathMatcher.php | 2 +- .../Config/Dom/ValidationException.php | 2 +- .../Config/FileResolver/Module.php | 8 +- .../Config/FileResolver/Primary.php | 6 +- .../Config/FileResolverInterface.php | 2 +- .../Config/Reader.php | 6 +- .../Config/Reader/Filesystem.php | 36 +- .../Config/ReaderInterface.php | 2 +- .../Config/ReplacerInterface.php | 2 +- .../Config/SchemaLocator.php | 4 +- .../Config/SchemaLocatorInterface.php | 2 +- .../Config/ValidationState.php | 2 +- .../Config/ValidationStateInterface.php | 2 +- .../Data/Argument/Interpreter/Argument.php | 6 +- .../Data/Argument/Interpreter/ArrayType.php | 4 +- .../Data/Argument/Interpreter/Boolean.php | 6 +- .../Data/Argument/Interpreter/Composite.php | 4 +- .../Data/Argument/Interpreter/Constant.php | 4 +- .../Data/Argument/Interpreter/DataObject.php | 8 +- .../Data/Argument/Interpreter/NullType.php | 4 +- .../Data/Argument/Interpreter/Number.php | 4 +- .../Data/Argument/Interpreter/StringUtils.php | 4 +- .../Data/Argument/InterpreterInterface.php | 2 +- .../Argument/InterpreterInterface/Proxy.php | 20 +- .../Data/etc/types.xsd | 0 .../Dummy.php | 6 +- .../Helper/Acceptance.php | 6 +- .../Helper/AdminUrlList.php | 2 +- .../Helper/MagentoFakerData.php | 2 +- .../Module/MagentoRestDriver.php | 2 +- .../Module/MagentoWebDriver.php | 6 +- .../ObjectManager.php | 16 +- .../ObjectManager/Config.php | 4 +- .../ObjectManager/Config/Config.php | 14 +- .../Config/Mapper/ArgumentParser.php | 8 +- .../ObjectManager/Config/Mapper/Dom.php | 8 +- .../ObjectManager/Config/Reader/Dom.php | 25 +- .../Config/Reader/DomFactory.php | 14 +- .../ObjectManager/Config/SchemaLocator.php | 4 +- .../ObjectManager/ConfigInterface.php | 2 +- .../ObjectManager/ConfigLoader/Primary.php | 70 ++ .../ObjectManager/Definition/Runtime.php | 10 +- .../ObjectManager/DefinitionInterface.php | 2 +- .../ObjectManager/Factory.php | 20 +- .../Factory/Dynamic/Developer.php | 28 +- .../ObjectManager/FactoryInterface.php | 2 +- .../ObjectManager/ObjectManager.php | 8 +- .../ObjectManager/Relations/Runtime.php | 12 +- .../ObjectManager/RelationsInterface.php | 2 +- .../ObjectManager/etc/config.xsd | 0 .../ObjectManagerFactory.php | 119 ++++ .../ObjectManagerInterface.php | 2 +- .../Page/AbstractAdminPage.php | 4 +- .../Page/AbstractFrontendPage.php | 4 +- .../Page/AdminGridPage.php | 4 +- .../Page/Backend/AdminLogin.php | 4 +- .../Page/Backend/AdminSideNavigation.php | 4 +- .../Page/Backend/etc/Page.xml | 8 + .../Page/Catalog/AdminCategoryPage.php | 4 +- .../Page/Catalog/AdminProductGridPage.php | 4 +- .../Page/Catalog/AdminProductPage.php | 4 +- .../Page/Catalog/StorefrontCategoryPage.php | 4 +- .../Page/Catalog/StorefrontProductPage.php | 4 +- .../Page/Catalog/etc/Page.xml | 11 + .../Page/Cms/AdminCmsGrid.php | 4 +- .../Page/Cms/AdminCmsPage.php | 4 +- .../Page/Cms/StorefrontCmsPage.php | 4 +- .../Page/Cms/etc/Page.xml | 11 + .../AdminConfigurableProductPage.php | 8 +- .../Page/ConfigurableProduct/etc/Page.xml | 4 +- .../Page/Customer/AdminCustomerGrid.php | 4 +- .../Page/Customer/AdminCustomerPage.php | 4 +- .../StorefrontCustomerAccountCreatePage.php | 4 +- ...StorefrontCustomerAccountDashboardPage.php | 4 +- .../StorefrontCustomerAccountLoginPage.php | 4 +- .../Page/Customer/etc/Page.xml | 4 +- .../Page/Sales/AdminOrderAddPage.php | 4 +- .../Page/Sales/AdminOrderDetailsPage.php | 4 +- .../Page/Sales/AdminOrderGrid.php | 4 +- .../Page/Sales/Invoice/AdminInvoiceGrid.php | 4 +- .../Page/Sales/Shipment/AdminShipmentGrid.php | 4 +- .../Page/Sales/etc/Page.xml | 4 +- .../Page}/etc/pageObject.xsd | 58 +- .../Stdlib/BooleanUtils.php | 2 +- .../Step/Backend/AdminStep.php | 614 +++++++++--------- .../System/Code/ClassReader.php | 2 +- .../Util/Iterator/AbstractIterator.php | 2 +- .../Util/Iterator/File.php | 2 +- .../Util/ModuleResolver.php | 4 +- src/Magento/Xxyyzz/Page/Backend/etc/Page.xml | 7 - src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml | 7 - src/Magento/Xxyyzz/Page/Cms/etc/Page.xml | 8 - 112 files changed, 982 insertions(+), 944 deletions(-) delete mode 100644 lib/Magento/TestFramework/ObjectManager/ConfigLoader/Primary.php delete mode 100644 lib/Magento/TestFramework/ObjectManagerFactory.php rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Code/Reader/ClassReader.php (97%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Code/Reader/ClassReaderInterface.php (92%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Converter.php (95%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Converter/Dom/Flat.php (96%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/ConverterInterface.php (86%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Data.php (82%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/DataInterface.php (94%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Dom.php (97%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Dom/ArrayNodeConfig.php (97%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Dom/NodeMergingConfig.php (95%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Dom/NodePathMatcher.php (95%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Dom/ValidationException.php (82%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/FileResolver/Module.php (83%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/FileResolver/Primary.php (91%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/FileResolverInterface.php (89%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Reader.php (90%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/Reader/Filesystem.php (75%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/ReaderInterface.php (89%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/ReplacerInterface.php (87%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/SchemaLocator.php (88%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/SchemaLocatorInterface.php (89%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/ValidationState.php (92%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Config/ValidationStateInterface.php (86%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/Argument.php (77%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/ArrayType.php (96%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/Boolean.php (81%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/Composite.php (95%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/Constant.php (80%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/DataObject.php (76%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/NullType.php (73%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/Number.php (81%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/Interpreter/StringUtils.php (83%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/InterpreterInterface.php (89%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/Argument/InterpreterInterface/Proxy.php (66%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Data/etc/types.xsd (100%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Dummy.php (65%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Helper/Acceptance.php (65%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Helper/AdminUrlList.php (99%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Helper/MagentoFakerData.php (98%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Module/MagentoRestDriver.php (99%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Module/MagentoWebDriver.php (97%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager.php (79%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Config.php (88%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Config/Config.php (91%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Config/Mapper/ArgumentParser.php (79%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Config/Mapper/Dom.php (94%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Config/Reader/Dom.php (59%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Config/Reader/DomFactory.php (59%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Config/SchemaLocator.php (81%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/ConfigInterface.php (94%) create mode 100644 src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Definition/Runtime.php (71%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/DefinitionInterface.php (93%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Factory.php (90%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Factory/Dynamic/Developer.php (83%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/FactoryInterface.php (89%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/ObjectManager.php (84%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/Relations/Runtime.php (61%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/RelationsInterface.php (89%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManager/etc/config.xsd (100%) create mode 100644 src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/ObjectManagerInterface.php (94%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/AbstractAdminPage.php (98%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/AbstractFrontendPage.php (94%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/AdminGridPage.php (99%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Backend/AdminLogin.php (97%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Backend/AdminSideNavigation.php (99%) create mode 100644 src/Magento/AcceptanceTestFramework/Page/Backend/etc/Page.xml rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Catalog/AdminCategoryPage.php (96%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Catalog/AdminProductGridPage.php (97%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Catalog/AdminProductPage.php (98%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Catalog/StorefrontCategoryPage.php (96%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Catalog/StorefrontProductPage.php (95%) create mode 100644 src/Magento/AcceptanceTestFramework/Page/Catalog/etc/Page.xml rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Cms/AdminCmsGrid.php (94%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Cms/AdminCmsPage.php (99%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Cms/StorefrontCmsPage.php (83%) create mode 100644 src/Magento/AcceptanceTestFramework/Page/Cms/etc/Page.xml rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/ConfigurableProduct/AdminConfigurableProductPage.php (98%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/ConfigurableProduct/etc/Page.xml (69%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Customer/AdminCustomerGrid.php (97%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Customer/AdminCustomerPage.php (99%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Customer/StorefrontCustomerAccountCreatePage.php (95%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Customer/StorefrontCustomerAccountDashboardPage.php (95%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Customer/StorefrontCustomerAccountLoginPage.php (93%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Customer/etc/Page.xml (68%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Sales/AdminOrderAddPage.php (99%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Sales/AdminOrderDetailsPage.php (99%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Sales/AdminOrderGrid.php (97%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Sales/Invoice/AdminInvoiceGrid.php (96%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Sales/Shipment/AdminShipmentGrid.php (95%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Page/Sales/etc/Page.xml (56%) rename {lib/Magento/TestFramework/PageObject => src/Magento/AcceptanceTestFramework/Page}/etc/pageObject.xsd (73%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Stdlib/BooleanUtils.php (96%) rename src/Magento/{Xxyyzz => AcceptanceTestFramework}/Step/Backend/AdminStep.php (58%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/System/Code/ClassReader.php (96%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Util/Iterator/AbstractIterator.php (97%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Util/Iterator/File.php (94%) rename {lib/Magento/TestFramework => src/Magento/AcceptanceTestFramework}/Util/ModuleResolver.php (89%) delete mode 100644 src/Magento/Xxyyzz/Page/Backend/etc/Page.xml delete mode 100644 src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml delete mode 100644 src/Magento/Xxyyzz/Page/Cms/etc/Page.xml diff --git a/bootstrap.php b/bootstrap.php index 7ce4779ba..63dd7060e 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -8,4 +8,4 @@ require_once __DIR__ . '/vendor/autoload.php'; -$objectManager = \Magento\TestFramework\ObjectManagerFactory::getObjectManager(); \ No newline at end of file +$objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); \ No newline at end of file diff --git a/composer.json b/composer.json index 0bfbb5ffd..20a371ea7 100755 --- a/composer.json +++ b/composer.json @@ -11,8 +11,7 @@ }, "autoload": { "psr-4": { - "Magento\\Xxyyzz\\": "src/Magento/Xxyyzz", - "Magento\\TestFramework\\": "lib/Magento/TestFramework" + "Magento\\AcceptanceTestFramework\\": "src/Magento/AcceptanceTestFramework" } } } diff --git a/composer.lock b/composer.lock index da84851c4..b2e0113c3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,6 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], + "hash": "cf76c055cde25733e922c75ad3d479a5", "content-hash": "ace050b01aa009d3ee82eb5bc4a02cf1", "packages": [ { @@ -63,20 +64,20 @@ "gherkin", "parser" ], - "time": "2016-10-30T11:50:56+00:00" + "time": "2016-10-30 11:50:56" }, { "name": "codeception/codeception", - "version": "2.3.1", + "version": "2.3.2", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "d4d76d18ea0ec8d504995995ae68fccac24523db" + "reference": "1ebec015a322d66952f69954551d513984f02d14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/d4d76d18ea0ec8d504995995ae68fccac24523db", - "reference": "d4d76d18ea0ec8d504995995ae68fccac24523db", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/1ebec015a322d66952f69954551d513984f02d14", + "reference": "1ebec015a322d66952f69954551d513984f02d14", "shasum": "" }, "require": { @@ -135,7 +136,11 @@ "psr-4": { "Codeception\\": "src\\Codeception", "Codeception\\Extension\\": "ext" - } + }, + "files": [ + "shim.php", + "phpunit5-loggers.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -157,7 +162,7 @@ "functional testing", "unit testing" ], - "time": "2017-05-24T00:54:13+00:00" + "time": "2017-05-27 00:46:03" }, { "name": "doctrine/instantiator", @@ -211,7 +216,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "facebook/webdriver", @@ -263,7 +268,7 @@ "selenium", "webdriver" ], - "time": "2017-04-28T14:54:49+00:00" + "time": "2017-04-28 14:54:49" }, { "name": "flow/jsonpath", @@ -304,7 +309,7 @@ } ], "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2016-09-06T17:43:18+00:00" + "time": "2016-09-06 17:43:18" }, { "name": "fzaninotto/faker", @@ -352,7 +357,7 @@ "faker", "fixtures" ], - "time": "2016-04-29T12:21:54+00:00" + "time": "2016-04-29 12:21:54" }, { "name": "guzzlehttp/guzzle", @@ -414,7 +419,7 @@ "rest", "web service" ], - "time": "2017-02-28T22:50:30+00:00" + "time": "2017-02-28 22:50:30" }, { "name": "guzzlehttp/promises", @@ -465,7 +470,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "time": "2016-12-20 10:07:11" }, { "name": "guzzlehttp/psr7", @@ -530,7 +535,7 @@ "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2017-03-20 17:10:46" }, { "name": "myclabs/deep-copy", @@ -572,7 +577,7 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2017-04-12 18:52:22" }, { "name": "phar-io/manifest", @@ -627,7 +632,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2017-03-05 18:14:27" }, { "name": "phar-io/version", @@ -674,7 +679,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2017-03-05 17:38:23" }, { "name": "phpdocumentor/reflection-common", @@ -728,7 +733,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", @@ -773,7 +778,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2016-09-30 07:12:33" }, { "name": "phpdocumentor/type-resolver", @@ -820,7 +825,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2016-11-25 06:54:22" }, { "name": "phpspec/prophecy", @@ -883,7 +888,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-03-02 20:05:34" }, { "name": "phpunit/php-code-coverage", @@ -947,7 +952,7 @@ "testing", "xunit" ], - "time": "2017-04-21T08:03:57+00:00" + "time": "2017-04-21 08:03:57" }, { "name": "phpunit/php-file-iterator", @@ -994,7 +999,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -1035,7 +1040,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -1084,7 +1089,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -1133,7 +1138,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-02-27 10:12:30" }, { "name": "phpunit/phpunit", @@ -1217,7 +1222,7 @@ "testing", "xunit" ], - "time": "2017-05-22T07:45:30+00:00" + "time": "2017-05-22 07:45:30" }, { "name": "phpunit/phpunit-mock-objects", @@ -1276,7 +1281,7 @@ "mock", "xunit" ], - "time": "2017-03-03T06:30:20+00:00" + "time": "2017-03-03 06:30:20" }, { "name": "psr/http-message", @@ -1326,7 +1331,7 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" + "time": "2016-08-06 14:39:51" }, { "name": "psr/log", @@ -1373,7 +1378,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1418,7 +1423,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2017-03-04 06:30:41" }, { "name": "sebastian/comparator", @@ -1482,7 +1487,7 @@ "compare", "equality" ], - "time": "2017-03-03T06:26:08+00:00" + "time": "2017-03-03 06:26:08" }, { "name": "sebastian/diff", @@ -1534,7 +1539,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -1584,7 +1589,7 @@ "environment", "hhvm" ], - "time": "2017-05-18T10:10:00+00:00" + "time": "2017-05-18 10:10:00" }, { "name": "sebastian/exporter", @@ -1651,7 +1656,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2017-04-03 13:19:02" }, { "name": "sebastian/global-state", @@ -1702,7 +1707,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2017-04-27 15:39:26" }, { "name": "sebastian/object-enumerator", @@ -1749,7 +1754,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-03-12T15:17:29+00:00" + "time": "2017-03-12 15:17:29" }, { "name": "sebastian/object-reflector", @@ -1794,7 +1799,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "time": "2017-03-29 09:07:27" }, { "name": "sebastian/recursion-context", @@ -1847,7 +1852,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "time": "2017-03-03 06:23:57" }, { "name": "sebastian/resource-operations", @@ -1889,7 +1894,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", @@ -1932,7 +1937,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "stecman/symfony-console-completion", @@ -1977,20 +1982,20 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24T05:08:54+00:00" + "time": "2016-02-24 05:08:54" }, { "name": "symfony/browser-kit", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57" + "reference": "c2c8ceb1aa9dab9eae54e9150e6a588ce3e53be1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/9fab1ab6f77b77f3df5fc5250fc6956811699b57", - "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c2c8ceb1aa9dab9eae54e9150e6a588ce3e53be1", + "reference": "c2c8ceb1aa9dab9eae54e9150e6a588ce3e53be1", "shasum": "" }, "require": { @@ -2007,7 +2012,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2034,20 +2039,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-04-12 14:14:56" }, { "name": "symfony/console", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38" + "reference": "c80e63f3f5e3a331bfc25e6e9332b10422eb9b05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", - "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", + "url": "https://api.github.com/repos/symfony/console/zipball/c80e63f3f5e3a331bfc25e6e9332b10422eb9b05", + "reference": "c80e63f3f5e3a331bfc25e6e9332b10422eb9b05", "shasum": "" }, "require": { @@ -2055,10 +2060,15 @@ "symfony/debug": "~2.8|~3.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, "require-dev": { "psr/log": "~1.0", + "symfony/dependency-injection": "~3.3", "symfony/event-dispatcher": "~2.8|~3.0", "symfony/filesystem": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" }, "suggest": { @@ -2070,7 +2080,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2097,20 +2107,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-04-26T01:39:17+00:00" + "time": "2017-05-28 14:08:56" }, { "name": "symfony/css-selector", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "02983c144038e697c959e6b06ef6666de759ccbc" + "reference": "4d882dced7b995d5274293039370148e291808f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/02983c144038e697c959e6b06ef6666de759ccbc", - "reference": "02983c144038e697c959e6b06ef6666de759ccbc", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/4d882dced7b995d5274293039370148e291808f2", + "reference": "4d882dced7b995d5274293039370148e291808f2", "shasum": "" }, "require": { @@ -2119,7 +2129,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2150,20 +2160,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:55:58+00:00" + "time": "2017-05-01 15:01:29" }, { "name": "symfony/debug", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686" + "reference": "ef5f19a7a68075a0bd05969a329ead3b0776fb7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/fd6eeee656a5a7b384d56f1072243fe1c0e81686", - "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686", + "url": "https://api.github.com/repos/symfony/debug/zipball/ef5f19a7a68075a0bd05969a329ead3b0776fb7a", + "reference": "ef5f19a7a68075a0bd05969a329ead3b0776fb7a", "shasum": "" }, "require": { @@ -2174,13 +2184,12 @@ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2207,20 +2216,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-04-19T20:17:50+00:00" + "time": "2017-05-27 16:02:27" }, { "name": "symfony/dom-crawler", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286" + "reference": "fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f1ad34e8af09ed17570e027cf0c58a12eddec286", - "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1", + "reference": "fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1", "shasum": "" }, "require": { @@ -2236,7 +2245,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2263,29 +2272,32 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-05-25 23:10:31" }, { "name": "symfony/event-dispatcher", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b8a401f733b43251e1d088c589368b2a94155e40" + "reference": "a9f8b02b0ef07302eca92cd4bba73200b7980e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8a401f733b43251e1d088c589368b2a94155e40", - "reference": "b8a401f733b43251e1d088c589368b2a94155e40", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a9f8b02b0ef07302eca92cd4bba73200b7980e9c", + "reference": "a9f8b02b0ef07302eca92cd4bba73200b7980e9c", "shasum": "" }, "require": { "php": ">=5.5.9" }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, "require-dev": { "psr/log": "~1.0", "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", + "symfony/dependency-injection": "~3.3", "symfony/expression-language": "~2.8|~3.0", "symfony/stopwatch": "~2.8|~3.0" }, @@ -2296,7 +2308,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2323,20 +2335,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:58:48+00:00" + "time": "2017-05-04 12:23:07" }, { "name": "symfony/finder", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9cf076f8f492f4b1ffac40aae9c2d287b4ca6930" + "reference": "30cb2a2c09627823a7243638dd456de4e2748fed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9cf076f8f492f4b1ffac40aae9c2d287b4ca6930", - "reference": "9cf076f8f492f4b1ffac40aae9c2d287b4ca6930", + "url": "https://api.github.com/repos/symfony/finder/zipball/30cb2a2c09627823a7243638dd456de4e2748fed", + "reference": "30cb2a2c09627823a7243638dd456de4e2748fed", "shasum": "" }, "require": { @@ -2345,7 +2357,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2372,7 +2384,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-05-25 23:10:31" }, { "name": "symfony/polyfill-mbstring", @@ -2431,20 +2443,20 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/process", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0" + "reference": "8e30690c67aafb6c7992d6d8eb0d707807dd3eaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", - "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", + "url": "https://api.github.com/repos/symfony/process/zipball/8e30690c67aafb6c7992d6d8eb0d707807dd3eaf", + "reference": "8e30690c67aafb6c7992d6d8eb0d707807dd3eaf", "shasum": "" }, "require": { @@ -2453,7 +2465,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2480,20 +2492,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-05-22 12:32:03" }, { "name": "symfony/yaml", - "version": "v3.2.8", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6" + "reference": "885db865f6b2b918404a1fae28f9ac640f71f994" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/acec26fcf7f3031e094e910b94b002fa53d4e4d6", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/885db865f6b2b918404a1fae28f9ac640f71f994", + "reference": "885db865f6b2b918404a1fae28f9ac640f71f994", "shasum": "" }, "require": { @@ -2508,7 +2520,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2535,7 +2547,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:55:58+00:00" + "time": "2017-05-28 10:56:20" }, { "name": "theseer/tokenizer", @@ -2575,7 +2587,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2017-04-07 12:08:54" }, { "name": "webmozart/assert", @@ -2625,7 +2637,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2016-11-23 20:04:58" } ], "packages-dev": [], diff --git a/entryPoint.php b/entryPoint.php index 965097a7a..50bfdc756 100644 --- a/entryPoint.php +++ b/entryPoint.php @@ -2,6 +2,6 @@ require_once 'bootstrap.php'; -/** @var Magento\Xxyyzz\Dummy $dummy */ -$dummy = $objectManager->create(\Magento\Xxyyzz\Dummy::class); +/** @var Magento\AcceptanceTestFramework\Dummy $dummy */ +$dummy = $objectManager->create(\Magento\AcceptanceTestFramework\Dummy::class); $dummy->readPageObjects(); diff --git a/etc/_envs/chrome.yml b/etc/_envs/chrome.yml index 6839edb67..c606d764e 100644 --- a/etc/_envs/chrome.yml +++ b/etc/_envs/chrome.yml @@ -1,9 +1,9 @@ # `chrome` environment config goes here modules: enabled: - - \Magento\Xxyyzz\Module\MagentoWebDriver - - \Magento\Xxyyzz\Helper\Acceptance + - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver + - \Magento\AcceptanceTestFramework\Helper\Acceptance config: - \Magento\Xxyyzz\Module\MagentoWebDriver: + \Magento\AcceptanceTestFramework\Module\MagentoWebDriver: browser: chrome window_size: maximize \ No newline at end of file diff --git a/etc/_envs/firefox.yml b/etc/_envs/firefox.yml index 55ce4aa71..83ee9f944 100644 --- a/etc/_envs/firefox.yml +++ b/etc/_envs/firefox.yml @@ -1,9 +1,9 @@ # `firefox` environment config goes here modules: enabled: - - \Magento\Xxyyzz\Module\MagentoWebDriver - - \Magento\Xxyyzz\Helper\Acceptance + - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver + - \Magento\AcceptanceTestFramework\Helper\Acceptance config: - \Magento\Xxyyzz\Module\MagentoWebDriver: + \Magento\AcceptanceTestFramework\Module\MagentoWebDriver: browser: firefox window_size: maximize \ No newline at end of file diff --git a/etc/_envs/phantomjs.yml b/etc/_envs/phantomjs.yml index ef13b921c..aae0ebfca 100644 --- a/etc/_envs/phantomjs.yml +++ b/etc/_envs/phantomjs.yml @@ -1,8 +1,8 @@ # `phantomjs` environment config goes here modules: enabled: - - \Magento\Xxyyzz\Module\MagentoWebDriver - - \Magento\Xxyyzz\Helper\Acceptance + - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver + - \Magento\AcceptanceTestFramework\Helper\Acceptance config: - \Magento\Xxyyzz\Module\MagentoWebDriver: + \Magento\AcceptanceTestFramework\Module\MagentoWebDriver: browser: phantomjs \ No newline at end of file diff --git a/etc/di.xml b/etc/di.xml index 2f45f205d..23e48f866 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -5,93 +5,93 @@ * See COPYING.txt for license details. */ --> - - - - - - - - - - - + + + + + + + + + + + developer - + data - + converterArgumentParser - Magento\TestFramework\Data\Argument\Interpreter\Composite + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite data - + - Magento\TestFramework\Data\Argument\Interpreter\DataObject + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\DataObject arrayArgumentInterpreterProxy - Magento\TestFramework\Data\Argument\Interpreter\Boolean - Magento\TestFramework\Data\Argument\Interpreter\Number - Magento\TestFramework\Data\Argument\Interpreter\StringUtils - Magento\TestFramework\Data\Argument\Interpreter\NullType - Magento\TestFramework\Data\Argument\Interpreter\Constant + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Boolean + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Number + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\StringUtils + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\NullType + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Constant xsi:type - + - Magento\TestFramework\Data\Argument\Interpreter\Composite + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite - + - Magento\TestFramework\Data\Argument\Interpreter\ArrayType + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\ArrayType - + - Magento\TestFramework\Config\Reader\Page + Magento\AcceptanceTestFramework\Config\Reader\Page - + - Magento/TestFramework/PageObject/etc/pageObject.xsd + Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd - + - Magento\TestFramework\Config\FileResolver\Module - Magento\TestFramework\Config\Converter - Magento\TestFramework\Config\SchemaLocator\Page + Magento\AcceptanceTestFramework\Config\FileResolver\Module + Magento\AcceptanceTestFramework\Config\Converter + Magento\AcceptanceTestFramework\Config\SchemaLocator\Page name name - name + name Page.xml etc - + - Magento\TestFramework\PageObject\Config\Data + Magento\AcceptanceTestFramework\Page\Config\Data diff --git a/lib/Magento/TestFramework/ObjectManager/ConfigLoader/Primary.php b/lib/Magento/TestFramework/ObjectManager/ConfigLoader/Primary.php deleted file mode 100644 index 3f94f6646..000000000 --- a/lib/Magento/TestFramework/ObjectManager/ConfigLoader/Primary.php +++ /dev/null @@ -1,70 +0,0 @@ -createArgumentInterpreter() - ), - new \Magento\TestFramework\ObjectManager\Config\SchemaLocator(), - new \Magento\TestFramework\Config\ValidationState($this->_appMode) - ); - - return $reader->read(); - } - - - /** - * Return newly created instance on an argument interpreter, suitable for processing DI arguments - * - * @return \Magento\TestFramework\Data\Argument\InterpreterInterface - */ - protected function createArgumentInterpreter() - { - $booleanUtils = new \Magento\TestFramework\Stdlib\BooleanUtils(); - $constInterpreter = new \Magento\TestFramework\Data\Argument\Interpreter\Constant(); - $result = new \Magento\TestFramework\Data\Argument\Interpreter\Composite( - [ - 'boolean' => new \Magento\TestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), - 'string' => new \Magento\TestFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), - 'number' => new \Magento\TestFramework\Data\Argument\Interpreter\Number(), - 'null' => new \Magento\TestFramework\Data\Argument\Interpreter\NullType(), - 'object' => new \Magento\TestFramework\Data\Argument\Interpreter\DataObject($booleanUtils), - 'const' => $constInterpreter, - 'init_parameter' => new \Magento\TestFramework\Data\Argument\Interpreter\Argument($constInterpreter) - ], - \Magento\TestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE - ); - // Add interpreters that reference the composite - $result->addInterpreter('array', new \Magento\TestFramework\Data\Argument\Interpreter\ArrayType($result)); - return $result; - } -} diff --git a/lib/Magento/TestFramework/ObjectManagerFactory.php b/lib/Magento/TestFramework/ObjectManagerFactory.php deleted file mode 100644 index 09a6b6cf8..000000000 --- a/lib/Magento/TestFramework/ObjectManagerFactory.php +++ /dev/null @@ -1,119 +0,0 @@ -configClassName(); - - $factory = new Factory($diConfig); - $argInterpreter = $this->createArgumentInterpreter(new BooleanUtils()); - $argumentMapper = new \Magento\TestFramework\ObjectManager\Config\Mapper\Dom($argInterpreter); - - - $sharedInstances['Magento\TestFramework\Data\Argument\InterpreterInterface'] = $argInterpreter; - $sharedInstances['Magento\TestFramework\ObjectManager\Config\Mapper\Dom'] = $argumentMapper; - - /** @var \Magento\TestFramework\ObjectManager $objectManager */ - $objectManager = new $this->locatorClassName($factory, $diConfig, $sharedInstances); - - $factory->setObjectManager($objectManager); - ObjectManager::setInstance($objectManager); - - self::configure($objectManager); - - return $objectManager; - } - - /** - * Return newly created instance on an argument interpreter, suitable for processing DI arguments. - * - * @param \Magento\TestFramework\Stdlib\BooleanUtils $booleanUtils - * @return \Magento\TestFramework\Data\Argument\InterpreterInterface - */ - protected function createArgumentInterpreter( - \Magento\TestFramework\Stdlib\BooleanUtils $booleanUtils - ) { - $constInterpreter = new \Magento\TestFramework\Data\Argument\Interpreter\Constant(); - $result = new \Magento\TestFramework\Data\Argument\Interpreter\Composite( - [ - 'boolean' => new \Magento\TestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), - 'string' => new \Magento\TestFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), - 'number' => new \Magento\TestFramework\Data\Argument\Interpreter\Number(), - 'null' => new \Magento\TestFramework\Data\Argument\Interpreter\NullType(), - 'const' => $constInterpreter, - 'object' => new \Magento\TestFramework\Data\Argument\Interpreter\DataObject($booleanUtils), - 'init_parameter' => new \Magento\TestFramework\Data\Argument\Interpreter\Argument($constInterpreter), - ], - \Magento\TestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE - ); - // Add interpreters that reference the composite - $result->addInterpreter('array', new \Magento\TestFramework\Data\Argument\Interpreter\ArrayType($result)); - return $result; - } - - /** - * Get Object Manager instance. - * - * @return ObjectManager - */ - public static function getObjectManager() - { - if (!$objectManager = ObjectManager::getInstance()) { - $objectManagerFactory = new self(); - $objectManager = $objectManagerFactory->create(); - } - - return $objectManager; - } - - /** - * Configure Object Manager. - * This method is static to have the ability to configure multiple instances of Object manager when needed. - * - * @param \Magento\TestFramework\ObjectManagerInterface $objectManager - * @return void - */ - public static function configure(\Magento\TestFramework\ObjectManagerInterface $objectManager) - { - $objectManager->configure( - $objectManager->get(\Magento\TestFramework\ObjectManager\ConfigLoader\Primary::class)->load() - ); - } -} diff --git a/lib/Magento/TestFramework/Code/Reader/ClassReader.php b/src/Magento/AcceptanceTestFramework/Code/Reader/ClassReader.php similarity index 97% rename from lib/Magento/TestFramework/Code/Reader/ClassReader.php rename to src/Magento/AcceptanceTestFramework/Code/Reader/ClassReader.php index 48bc28d91..4c2483766 100644 --- a/lib/Magento/TestFramework/Code/Reader/ClassReader.php +++ b/src/Magento/AcceptanceTestFramework/Code/Reader/ClassReader.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Code\Reader; +namespace Magento\AcceptanceTestFramework\Code\Reader; class ClassReader implements ClassReaderInterface { diff --git a/lib/Magento/TestFramework/Code/Reader/ClassReaderInterface.php b/src/Magento/AcceptanceTestFramework/Code/Reader/ClassReaderInterface.php similarity index 92% rename from lib/Magento/TestFramework/Code/Reader/ClassReaderInterface.php rename to src/Magento/AcceptanceTestFramework/Code/Reader/ClassReaderInterface.php index 2ce7a1996..53f6102e6 100644 --- a/lib/Magento/TestFramework/Code/Reader/ClassReaderInterface.php +++ b/src/Magento/AcceptanceTestFramework/Code/Reader/ClassReaderInterface.php @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Code\Reader; +namespace Magento\AcceptanceTestFramework\Code\Reader; interface ClassReaderInterface { diff --git a/lib/Magento/TestFramework/Config/Converter.php b/src/Magento/AcceptanceTestFramework/Config/Converter.php similarity index 95% rename from lib/Magento/TestFramework/Config/Converter.php rename to src/Magento/AcceptanceTestFramework/Config/Converter.php index 82e0729a9..c1b1d4391 100644 --- a/lib/Magento/TestFramework/Config/Converter.php +++ b/src/Magento/AcceptanceTestFramework/Config/Converter.php @@ -3,15 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; -use Magento\TestFramework\ObjectManager\Config\Mapper\ArgumentParser; -use Magento\TestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\ArgumentParser; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; /** * Converter for configuration data. */ -class Converter implements \Magento\TestFramework\Config\ConverterInterface +class Converter implements \Magento\AcceptanceTestFramework\Config\ConverterInterface { /** * Unique identifier of node. diff --git a/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php b/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php similarity index 96% rename from lib/Magento/TestFramework/Config/Converter/Dom/Flat.php rename to src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php index b47d2650e..7a3c40064 100644 --- a/lib/Magento/TestFramework/Config/Converter/Dom/Flat.php +++ b/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php @@ -3,9 +3,9 @@ * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config\Converter\Dom; +namespace Magento\AcceptanceTestFramework\Config\Converter\Dom; -use Magento\TestFramework\Config\Dom\ArrayNodeConfig; +use Magento\AcceptanceTestFramework\Config\Dom\ArrayNodeConfig; /** * Universal converter of any XML data to an array representation with no data loss diff --git a/lib/Magento/TestFramework/Config/ConverterInterface.php b/src/Magento/AcceptanceTestFramework/Config/ConverterInterface.php similarity index 86% rename from lib/Magento/TestFramework/Config/ConverterInterface.php rename to src/Magento/AcceptanceTestFramework/Config/ConverterInterface.php index 17ebde571..a5a9a6937 100644 --- a/lib/Magento/TestFramework/Config/ConverterInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/ConverterInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Interface ConverterInterface diff --git a/lib/Magento/TestFramework/Config/Data.php b/src/Magento/AcceptanceTestFramework/Config/Data.php similarity index 82% rename from lib/Magento/TestFramework/Config/Data.php rename to src/Magento/AcceptanceTestFramework/Config/Data.php index 36c7cc26d..52cf7a7da 100644 --- a/lib/Magento/TestFramework/Config/Data.php +++ b/src/Magento/AcceptanceTestFramework/Config/Data.php @@ -4,17 +4,17 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Class Data */ -class Data implements \Magento\TestFramework\Config\DataInterface +class Data implements \Magento\AcceptanceTestFramework\Config\DataInterface { /** * Configuration reader model * - * @var \Magento\TestFramework\Config\ReaderInterface + * @var \Magento\AcceptanceTestFramework\Config\ReaderInterface */ protected $reader; @@ -28,9 +28,9 @@ class Data implements \Magento\TestFramework\Config\DataInterface /** * Constructor * - * @param \Magento\TestFramework\Config\ReaderInterface $reader + * @param \Magento\AcceptanceTestFramework\Config\ReaderInterface $reader */ - public function __construct(\Magento\TestFramework\Config\ReaderInterface $reader) + public function __construct(\Magento\AcceptanceTestFramework\Config\ReaderInterface $reader) { $this->reader = $reader; $this->load(); diff --git a/lib/Magento/TestFramework/Config/DataInterface.php b/src/Magento/AcceptanceTestFramework/Config/DataInterface.php similarity index 94% rename from lib/Magento/TestFramework/Config/DataInterface.php rename to src/Magento/AcceptanceTestFramework/Config/DataInterface.php index bfc161c47..a20324c41 100644 --- a/lib/Magento/TestFramework/Config/DataInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/DataInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Interface DataInterface diff --git a/lib/Magento/TestFramework/Config/Dom.php b/src/Magento/AcceptanceTestFramework/Config/Dom.php similarity index 97% rename from lib/Magento/TestFramework/Config/Dom.php rename to src/Magento/AcceptanceTestFramework/Config/Dom.php index 5e9cc63e3..da2fe4bb2 100644 --- a/lib/Magento/TestFramework/Config/Dom.php +++ b/src/Magento/AcceptanceTestFramework/Config/Dom.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Magento configuration XML DOM utility @@ -329,7 +329,7 @@ public function getDom() * * @param string $xml * @return \DOMDocument - * @throws \Magento\TestFramework\Config\Dom\ValidationException + * @throws \Magento\AcceptanceTestFramework\Config\Dom\ValidationException */ protected function _initDom($xml) { @@ -338,7 +338,7 @@ protected function _initDom($xml) if ($this->_schemaFile) { $errors = self::validateDomDocument($dom, $this->_schemaFile, $this->_errorFormat); if (count($errors)) { - throw new \Magento\TestFramework\Config\Dom\ValidationException(implode("\n", $errors)); + throw new \Magento\AcceptanceTestFramework\Config\Dom\ValidationException(implode("\n", $errors)); } } return $dom; diff --git a/lib/Magento/TestFramework/Config/Dom/ArrayNodeConfig.php b/src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php similarity index 97% rename from lib/Magento/TestFramework/Config/Dom/ArrayNodeConfig.php rename to src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php index 8afa93f4f..d4e61ed40 100644 --- a/lib/Magento/TestFramework/Config/Dom/ArrayNodeConfig.php +++ b/src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config\Dom; +namespace Magento\AcceptanceTestFramework\Config\Dom; /** * Configuration of nodes that represent numeric or associative arrays diff --git a/lib/Magento/TestFramework/Config/Dom/NodeMergingConfig.php b/src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php similarity index 95% rename from lib/Magento/TestFramework/Config/Dom/NodeMergingConfig.php rename to src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php index 0396fe5e3..d40b2f217 100644 --- a/lib/Magento/TestFramework/Config/Dom/NodeMergingConfig.php +++ b/src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config\Dom; +namespace Magento\AcceptanceTestFramework\Config\Dom; /** * Configuration of identifier attributes to be taken into account during merging diff --git a/lib/Magento/TestFramework/Config/Dom/NodePathMatcher.php b/src/Magento/AcceptanceTestFramework/Config/Dom/NodePathMatcher.php similarity index 95% rename from lib/Magento/TestFramework/Config/Dom/NodePathMatcher.php rename to src/Magento/AcceptanceTestFramework/Config/Dom/NodePathMatcher.php index 15ba5fd7e..bf221f6d8 100644 --- a/lib/Magento/TestFramework/Config/Dom/NodePathMatcher.php +++ b/src/Magento/AcceptanceTestFramework/Config/Dom/NodePathMatcher.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config\Dom; +namespace Magento\AcceptanceTestFramework\Config\Dom; /** * Matching of XPath expressions to path patterns diff --git a/lib/Magento/TestFramework/Config/Dom/ValidationException.php b/src/Magento/AcceptanceTestFramework/Config/Dom/ValidationException.php similarity index 82% rename from lib/Magento/TestFramework/Config/Dom/ValidationException.php rename to src/Magento/AcceptanceTestFramework/Config/Dom/ValidationException.php index 426ff28f8..bccf358a2 100644 --- a/lib/Magento/TestFramework/Config/Dom/ValidationException.php +++ b/src/Magento/AcceptanceTestFramework/Config/Dom/ValidationException.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config\Dom; +namespace Magento\AcceptanceTestFramework\Config\Dom; /** * \Exception that should be thrown by DOM model when incoming xml is not valid. diff --git a/lib/Magento/TestFramework/Config/FileResolver/Module.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php similarity index 83% rename from lib/Magento/TestFramework/Config/FileResolver/Module.php rename to src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php index 77ae357cb..9b96e39c3 100644 --- a/lib/Magento/TestFramework/Config/FileResolver/Module.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config\FileResolver; +namespace Magento\AcceptanceTestFramework\Config\FileResolver; -use Magento\TestFramework\Util\Iterator\File; -use Magento\TestFramework\Config\FileResolverInterface; -use Magento\TestFramework\Util\ModuleResolver; +use Magento\AcceptanceTestFramework\Util\Iterator\File; +use Magento\AcceptanceTestFramework\Config\FileResolverInterface; +use Magento\AcceptanceTestFramework\Util\ModuleResolver; /** * Provides the list of configuration files collected through modules test folders. diff --git a/lib/Magento/TestFramework/Config/FileResolver/Primary.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php similarity index 91% rename from lib/Magento/TestFramework/Config/FileResolver/Primary.php rename to src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php index e76e664d7..aa6b57b4f 100644 --- a/lib/Magento/TestFramework/Config/FileResolver/Primary.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php @@ -4,10 +4,10 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config\FileResolver; +namespace Magento\AcceptanceTestFramework\Config\FileResolver; -use Magento\TestFramework\Util\Iterator\File; -use Magento\TestFramework\Config\FileResolverInterface; +use Magento\AcceptanceTestFramework\Util\Iterator\File; +use Magento\AcceptanceTestFramework\Config\FileResolverInterface; /** * Provides the list of global configuration files. diff --git a/lib/Magento/TestFramework/Config/FileResolverInterface.php b/src/Magento/AcceptanceTestFramework/Config/FileResolverInterface.php similarity index 89% rename from lib/Magento/TestFramework/Config/FileResolverInterface.php rename to src/Magento/AcceptanceTestFramework/Config/FileResolverInterface.php index 6a478cdf1..6c45afa00 100644 --- a/lib/Magento/TestFramework/Config/FileResolverInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolverInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Interface FileResolverInterface diff --git a/lib/Magento/TestFramework/Config/Reader.php b/src/Magento/AcceptanceTestFramework/Config/Reader.php similarity index 90% rename from lib/Magento/TestFramework/Config/Reader.php rename to src/Magento/AcceptanceTestFramework/Config/Reader.php index 284d5daf9..990fd4876 100644 --- a/lib/Magento/TestFramework/Config/Reader.php +++ b/src/Magento/AcceptanceTestFramework/Config/Reader.php @@ -3,13 +3,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Class Reader * Module declaration reader. Reads scenario.xml declaration files from module /etc directories. */ -class Reader extends \Magento\TestFramework\Config\Reader\Filesystem +class Reader extends \Magento\AcceptanceTestFramework\Config\Reader\Filesystem { /** * List of name attributes for merge. @@ -40,7 +40,7 @@ public function __construct( ValidationStateInterface $validationState, $fileName = 'scenario.xml', $idAttributes = [], - $domDocumentClass = 'Magento\TestFramework\Config\Dom', + $domDocumentClass = 'Magento\AcceptanceTestFramework\Config\Dom', $defaultScope = 'etc' ) { $this->_fileResolver = $fileResolver; diff --git a/lib/Magento/TestFramework/Config/Reader/Filesystem.php b/src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php similarity index 75% rename from lib/Magento/TestFramework/Config/Reader/Filesystem.php rename to src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php index a21936dce..5b84cc050 100644 --- a/lib/Magento/TestFramework/Config/Reader/Filesystem.php +++ b/src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php @@ -6,24 +6,24 @@ * See COPYING.txt for license details. * */ -namespace Magento\TestFramework\Config\Reader; +namespace Magento\AcceptanceTestFramework\Config\Reader; /** * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Filesystem implements \Magento\TestFramework\Config\ReaderInterface +class Filesystem implements \Magento\AcceptanceTestFramework\Config\ReaderInterface { /** * File locator * - * @var \Magento\TestFramework\Config\FileResolverInterface + * @var \Magento\AcceptanceTestFramework\Config\FileResolverInterface */ protected $_fileResolver; /** * Config converter * - * @var \Magento\TestFramework\Config\ConverterInterface + * @var \Magento\AcceptanceTestFramework\Config\ConverterInterface */ protected $_converter; @@ -63,7 +63,7 @@ class Filesystem implements \Magento\TestFramework\Config\ReaderInterface protected $_domDocumentClass; /** - * @var \Magento\TestFramework\Config\ValidationStateInterface + * @var \Magento\AcceptanceTestFramework\Config\ValidationStateInterface */ protected $validationState; @@ -80,23 +80,23 @@ class Filesystem implements \Magento\TestFramework\Config\ReaderInterface /** * Constructor * - * @param \Magento\TestFramework\Config\FileResolverInterface $fileResolver - * @param \Magento\TestFramework\Config\ConverterInterface $converter - * @param \Magento\TestFramework\Config\SchemaLocatorInterface $schemaLocator - * @param \Magento\TestFramework\Config\ValidationStateInterface $validationState + * @param \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver + * @param \Magento\AcceptanceTestFramework\Config\ConverterInterface $converter + * @param \Magento\AcceptanceTestFramework\Config\SchemaLocatorInterface $schemaLocator + * @param \Magento\AcceptanceTestFramework\Config\ValidationStateInterface $validationState * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass * @param string $defaultScope */ public function __construct( - \Magento\TestFramework\Config\FileResolverInterface $fileResolver, - \Magento\TestFramework\Config\ConverterInterface $converter, - \Magento\TestFramework\Config\SchemaLocatorInterface $schemaLocator, - \Magento\TestFramework\Config\ValidationStateInterface $validationState, + \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver, + \Magento\AcceptanceTestFramework\Config\ConverterInterface $converter, + \Magento\AcceptanceTestFramework\Config\SchemaLocatorInterface $schemaLocator, + \Magento\AcceptanceTestFramework\Config\ValidationStateInterface $validationState, $fileName, $idAttributes = [], - $domDocumentClass = \Magento\TestFramework\Config\Dom::class, + $domDocumentClass = \Magento\AcceptanceTestFramework\Config\Dom::class, $defaultScope = 'global' ) { $this->_fileResolver = $fileResolver; @@ -138,7 +138,7 @@ public function read($scope = null) */ protected function _readFiles($fileList) { - /** @var \Magento\TestFramework\Config\Dom $configMerger */ + /** @var \Magento\AcceptanceTestFramework\Config\Dom $configMerger */ $configMerger = null; foreach ($fileList as $key => $content) { try { @@ -147,7 +147,7 @@ protected function _readFiles($fileList) } else { $configMerger->merge($content); } - } catch (\Magento\TestFramework\Config\Dom\ValidationException $e) { + } catch (\Magento\AcceptanceTestFramework\Config\Dom\ValidationException $e) { throw new \Exception("Invalid XML in file " . $key . ":\n" . $e->getMessage()); } } @@ -171,7 +171,7 @@ protected function _readFiles($fileList) * * @param string $mergerClass * @param string $initialContents - * @return \Magento\TestFramework\Config\Dom + * @return \Magento\AcceptanceTestFramework\Config\Dom * @throws \UnexpectedValueException */ protected function _createConfigMerger($mergerClass, $initialContents) @@ -182,7 +182,7 @@ protected function _createConfigMerger($mergerClass, $initialContents) null, $this->_perFileSchema ); - if (!$result instanceof \Magento\TestFramework\Config\Dom) { + if (!$result instanceof \Magento\AcceptanceTestFramework\Config\Dom) { throw new \UnexpectedValueException( "Instance of the DOM config merger is expected, got {$mergerClass} instead." ); diff --git a/lib/Magento/TestFramework/Config/ReaderInterface.php b/src/Magento/AcceptanceTestFramework/Config/ReaderInterface.php similarity index 89% rename from lib/Magento/TestFramework/Config/ReaderInterface.php rename to src/Magento/AcceptanceTestFramework/Config/ReaderInterface.php index af5b98c9b..211a18b77 100644 --- a/lib/Magento/TestFramework/Config/ReaderInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/ReaderInterface.php @@ -6,7 +6,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Config reader interface. diff --git a/lib/Magento/TestFramework/Config/ReplacerInterface.php b/src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php similarity index 87% rename from lib/Magento/TestFramework/Config/ReplacerInterface.php rename to src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php index c1592f2c5..516140609 100644 --- a/lib/Magento/TestFramework/Config/ReplacerInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Config replacer interface. diff --git a/lib/Magento/TestFramework/Config/SchemaLocator.php b/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php similarity index 88% rename from lib/Magento/TestFramework/Config/SchemaLocator.php rename to src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php index bdea23c54..befa3378c 100644 --- a/lib/Magento/TestFramework/Config/SchemaLocator.php +++ b/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php @@ -3,13 +3,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Class SchemaLocator * Scenario configuration schema locator */ -class SchemaLocator implements \Magento\TestFramework\Config\SchemaLocatorInterface +class SchemaLocator implements \Magento\AcceptanceTestFramework\Config\SchemaLocatorInterface { /** * XSD schema path diff --git a/lib/Magento/TestFramework/Config/SchemaLocatorInterface.php b/src/Magento/AcceptanceTestFramework/Config/SchemaLocatorInterface.php similarity index 89% rename from lib/Magento/TestFramework/Config/SchemaLocatorInterface.php rename to src/Magento/AcceptanceTestFramework/Config/SchemaLocatorInterface.php index 532401786..be9d027f6 100644 --- a/lib/Magento/TestFramework/Config/SchemaLocatorInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/SchemaLocatorInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Interface SchemaLocatorInterface diff --git a/lib/Magento/TestFramework/Config/ValidationState.php b/src/Magento/AcceptanceTestFramework/Config/ValidationState.php similarity index 92% rename from lib/Magento/TestFramework/Config/ValidationState.php rename to src/Magento/AcceptanceTestFramework/Config/ValidationState.php index 66271fdbf..445f4d09b 100644 --- a/lib/Magento/TestFramework/Config/ValidationState.php +++ b/src/Magento/AcceptanceTestFramework/Config/ValidationState.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Class ValidationState diff --git a/lib/Magento/TestFramework/Config/ValidationStateInterface.php b/src/Magento/AcceptanceTestFramework/Config/ValidationStateInterface.php similarity index 86% rename from lib/Magento/TestFramework/Config/ValidationStateInterface.php rename to src/Magento/AcceptanceTestFramework/Config/ValidationStateInterface.php index cea5cb286..4d46015e1 100644 --- a/lib/Magento/TestFramework/Config/ValidationStateInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/ValidationStateInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Config; +namespace Magento\AcceptanceTestFramework\Config; /** * Config validation state interface. diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Argument.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php similarity index 77% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/Argument.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php index 0a54a52b6..65f530884 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/Argument.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php @@ -3,10 +3,10 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; -use Magento\TestFramework\Data\Argument\MissingOptionalValueException; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Data\Argument\MissingOptionalValueException; /** * Interpreter that returns value of an application argument, retrieving its name from a constant diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/ArrayType.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php similarity index 96% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/ArrayType.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php index de108a863..1ad061761 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/ArrayType.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php @@ -3,9 +3,9 @@ * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; /** * Interpreter of array data type that supports arrays of unlimited depth diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php similarity index 81% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php index 4572171da..6759c3444 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/Boolean.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php @@ -3,10 +3,10 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; -use Magento\TestFramework\Stdlib\BooleanUtils; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Stdlib\BooleanUtils; /** * Interpreter of boolean data type, such as boolean itself or boolean string diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Composite.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php similarity index 95% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/Composite.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php index 127bdae11..72aca9d97 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/Composite.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; /** * Interpreter that aggregates named interpreters and delegates every evaluation to one of them diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Constant.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Constant.php similarity index 80% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/Constant.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Constant.php index e3c8466b6..9a5fe62ec 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/Constant.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Constant.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; /** * Interpreter that returns value of a constant by its name diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/DataObject.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php similarity index 76% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/DataObject.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php index 4351a10f8..c62b07167 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/DataObject.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php @@ -4,15 +4,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; -use Magento\TestFramework\Stdlib\BooleanUtils; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Stdlib\BooleanUtils; class DataObject implements InterpreterInterface { /** - * @var \Magento\TestFramework\Stdlib\BooleanUtils + * @var \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils */ protected $booleanUtils; diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/NullType.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/NullType.php similarity index 73% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/NullType.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/NullType.php index 16ed11db5..aca27b08d 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/NullType.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/NullType.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; /** * Interpreter of NULL data type diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/Number.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Number.php similarity index 81% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/Number.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Number.php index bb62f2a19..8ed8186dc 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/Number.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Number.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; /** * Interpreter of numeric data, such as integer, float, or numeric string diff --git a/lib/Magento/TestFramework/Data/Argument/Interpreter/StringUtils.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/StringUtils.php similarity index 83% rename from lib/Magento/TestFramework/Data/Argument/Interpreter/StringUtils.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/StringUtils.php index ff34c9800..fe21a2daa 100644 --- a/lib/Magento/TestFramework/Data/Argument/Interpreter/StringUtils.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/StringUtils.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\Interpreter; +namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; -use Magento\TestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; /** * Interpreter of string data type that may optionally perform text translation diff --git a/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php b/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php similarity index 89% rename from lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php index 3aa23e4f8..abf4b3a64 100644 --- a/lib/Magento/TestFramework/Data/Argument/InterpreterInterface.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument; +namespace Magento\AcceptanceTestFramework\Data\Argument; /** * Interface that encapsulates complexity of expression computation diff --git a/lib/Magento/TestFramework/Data/Argument/InterpreterInterface/Proxy.php b/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php similarity index 66% rename from lib/Magento/TestFramework/Data/Argument/InterpreterInterface/Proxy.php rename to src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php index 9f2a0944b..b578a9483 100644 --- a/lib/Magento/TestFramework/Data/Argument/InterpreterInterface/Proxy.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php @@ -3,17 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Data\Argument\InterpreterInterface; +namespace Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; /** - * Proxy class for \Magento\TestFramework\Data\Argument\InterpreterInterface + * Proxy class for \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface */ -class Proxy implements \Magento\TestFramework\Data\Argument\InterpreterInterface +class Proxy implements \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface { /** * Object Manager instance * - * @var \Magento\TestFramework\ObjectManagerInterface + * @var \Magento\AcceptanceTestFramework\ObjectManagerInterface */ protected $objectManager = null; @@ -27,7 +27,7 @@ class Proxy implements \Magento\TestFramework\Data\Argument\InterpreterInterface /** * Proxied instance * - * @var \Magento\TestFramework\Data\Argument\InterpreterInterface + * @var \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface */ protected $subject = null; @@ -41,13 +41,13 @@ class Proxy implements \Magento\TestFramework\Data\Argument\InterpreterInterface /** * Proxy constructor * - * @param \Magento\TestFramework\ObjectManagerInterface $objectManager + * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager * @param string $instanceName * @param bool $shared */ public function __construct( - \Magento\TestFramework\ObjectManagerInterface $objectManager, - $instanceName = \Magento\TestFramework\Data\Argument\InterpreterInterface::class, + \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager, + $instanceName = \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface::class, $shared = true ) { $this->objectManager = $objectManager; @@ -68,7 +68,7 @@ public function __sleep() */ public function __wakeup() { - $this->objectManager = \Magento\TestFramework\ObjectManager::getInstance(); + $this->objectManager = \Magento\AcceptanceTestFramework\ObjectManager::getInstance(); } /** @@ -82,7 +82,7 @@ public function __clone() /** * Get proxied instance * - * @return \Magento\TestFramework\Data\Argument\InterpreterInterface + * @return \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface */ protected function _getSubject() { diff --git a/lib/Magento/TestFramework/Data/etc/types.xsd b/src/Magento/AcceptanceTestFramework/Data/etc/types.xsd similarity index 100% rename from lib/Magento/TestFramework/Data/etc/types.xsd rename to src/Magento/AcceptanceTestFramework/Data/etc/types.xsd diff --git a/src/Magento/Xxyyzz/Dummy.php b/src/Magento/AcceptanceTestFramework/Dummy.php similarity index 65% rename from src/Magento/Xxyyzz/Dummy.php rename to src/Magento/AcceptanceTestFramework/Dummy.php index 6b6136e3e..abacd5700 100644 --- a/src/Magento/Xxyyzz/Dummy.php +++ b/src/Magento/AcceptanceTestFramework/Dummy.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\Xxyyzz; +namespace Magento\AcceptanceTestFramework; -use Magento\TestFramework\Config\DataInterface; +use Magento\AcceptanceTestFramework\Config\DataInterface; /** * Class Dummy @@ -20,6 +20,6 @@ public function __construct(DataInterface $pageObjects) public function readPageObjects() { - var_dump($this->pageObjects->get('page/CatalogProductIndex')); + var_dump($this->pageObjects->get('page/AdminProduct')); } } diff --git a/src/Magento/Xxyyzz/Helper/Acceptance.php b/src/Magento/AcceptanceTestFramework/Helper/Acceptance.php similarity index 65% rename from src/Magento/Xxyyzz/Helper/Acceptance.php rename to src/Magento/AcceptanceTestFramework/Helper/Acceptance.php index e6fedaef5..9df936002 100644 --- a/src/Magento/Xxyyzz/Helper/Acceptance.php +++ b/src/Magento/AcceptanceTestFramework/Helper/Acceptance.php @@ -1,5 +1,5 @@ getModule('\Magento\Xxyyzz\Module\MagentoWebDriver')->_reconfigure(array($config => $value)); + $this->getModule('\Magento\AcceptanceTestFramework\Module\MagentoWebDriver')->_reconfigure(array($config => $value)); } /** @@ -29,6 +29,6 @@ public function changeConfiguration($config, $value) */ public function getConfiguration($config) { - return $this->getModule('\Magento\Xxyyzz\Module\MagentoWebDriver')->_getConfig($config); + return $this->getModule('\Magento\AcceptanceTestFramework\Module\MagentoWebDriver')->_getConfig($config); } } diff --git a/src/Magento/Xxyyzz/Helper/AdminUrlList.php b/src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php similarity index 99% rename from src/Magento/Xxyyzz/Helper/AdminUrlList.php rename to src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php index e49d9d71c..8912c32e5 100644 --- a/src/Magento/Xxyyzz/Helper/AdminUrlList.php +++ b/src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php @@ -1,5 +1,5 @@ _sharedInstances['Magento\TestFramework\ObjectManager'] = $this; + $this->_sharedInstances['Magento\AcceptanceTestFramework\ObjectManager'] = $this; } /** diff --git a/lib/Magento/TestFramework/ObjectManager/Config.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config.php similarity index 88% rename from lib/Magento/TestFramework/ObjectManager/Config.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Config.php index c764224de..318f1787a 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager; +namespace Magento\AcceptanceTestFramework\ObjectManager; -use Magento\TestFramework\ObjectManager\Config\Config as ObjectManagerConfig; +use Magento\AcceptanceTestFramework\ObjectManager\Config\Config as ObjectManagerConfig; /** * Class Config diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Config.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php similarity index 91% rename from lib/Magento/TestFramework/ObjectManager/Config/Config.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php index b14f13f40..7846e98a1 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/Config.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php @@ -3,20 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager\Config; +namespace Magento\AcceptanceTestFramework\ObjectManager\Config; -use Magento\TestFramework\ObjectManager\DefinitionInterface; -use Magento\TestFramework\ObjectManager\RelationsInterface; +use Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface; +use Magento\AcceptanceTestFramework\ObjectManager\RelationsInterface; /** * Class Config */ -class Config implements \Magento\TestFramework\ObjectManager\ConfigInterface +class Config implements \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface { /** * Class definitions * - * @var \Magento\TestFramework\ObjectManager\DefinitionInterface + * @var \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface */ protected $_definitions; @@ -75,8 +75,8 @@ class Config implements \Magento\TestFramework\ObjectManager\ConfigInterface */ public function __construct(RelationsInterface $relations = null, DefinitionInterface $definitions = null) { - $this->_relations = $relations ? : new \Magento\TestFramework\ObjectManager\Relations\Runtime(); - $this->_definitions = $definitions ? : new \Magento\TestFramework\ObjectManager\Definition\Runtime(); + $this->_relations = $relations ? : new \Magento\AcceptanceTestFramework\ObjectManager\Relations\Runtime(); + $this->_definitions = $definitions ? : new \Magento\AcceptanceTestFramework\ObjectManager\Definition\Runtime(); } /** diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Mapper/ArgumentParser.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php similarity index 79% rename from lib/Magento/TestFramework/ObjectManager/Config/Mapper/ArgumentParser.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php index 9b3da9712..9f4131798 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/Mapper/ArgumentParser.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php @@ -3,11 +3,11 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager\Config\Mapper; +namespace Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper; -use Magento\TestFramework\Config\Converter\Dom\Flat as FlatConverter; -use Magento\TestFramework\Config\Dom\ArrayNodeConfig; -use Magento\TestFramework\Config\Dom\NodePathMatcher; +use Magento\AcceptanceTestFramework\Config\Converter\Dom\Flat as FlatConverter; +use Magento\AcceptanceTestFramework\Config\Dom\ArrayNodeConfig; +use Magento\AcceptanceTestFramework\Config\Dom\NodePathMatcher; /** * Parser of a DI argument node that returns its array representation with no data loss diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php similarity index 94% rename from lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php index df999dc68..cea88ed19 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/Mapper/Dom.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php @@ -3,12 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager\Config\Mapper; +namespace Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper; -use Magento\TestFramework\Data\Argument\InterpreterInterface; -use Magento\TestFramework\Stdlib\BooleanUtils; +use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\AcceptanceTestFramework\Stdlib\BooleanUtils; -class Dom implements \Magento\TestFramework\Config\ConverterInterface +class Dom implements \Magento\AcceptanceTestFramework\Config\ConverterInterface { /** * @var BooleanUtils diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php similarity index 59% rename from lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php index f88fc2218..a1745fdef 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/Reader/Dom.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php @@ -3,15 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - -namespace Magento\TestFramework\ObjectManager\Config\Reader; +namespace Magento\AcceptanceTestFramework\ObjectManager\Config\Reader; /** * Class Dom * * @internal */ -class Dom extends \Magento\TestFramework\Config\Reader\Filesystem +class Dom extends \Magento\AcceptanceTestFramework\Config\Reader\Filesystem { /** * Name of an attribute that stands for data type of node values @@ -19,20 +18,20 @@ class Dom extends \Magento\TestFramework\Config\Reader\Filesystem const TYPE_ATTRIBUTE = 'xsi:type'; /** - * @param \Magento\TestFramework\Config\FileResolverInterface $fileResolver - * @param \Magento\TestFramework\ObjectManager\Config\Mapper\Dom $converter - * @param \Magento\TestFramework\ObjectManager\Config\SchemaLocator $schemaLocator - * @param \Magento\TestFramework\Config\ValidationStateInterface $validationState + * @param \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver + * @param \Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom $converter + * @param \Magento\AcceptanceTestFramework\ObjectManager\Config\SchemaLocator $schemaLocator + * @param \Magento\AcceptanceTestFramework\Config\ValidationStateInterface $validationState * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass * @param string $defaultScope */ public function __construct( - \Magento\TestFramework\Config\FileResolverInterface $fileResolver, - \Magento\TestFramework\ObjectManager\Config\Mapper\Dom $converter, - \Magento\TestFramework\ObjectManager\Config\SchemaLocator $schemaLocator, - \Magento\TestFramework\Config\ValidationStateInterface $validationState, + \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver, + \Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom $converter, + \Magento\AcceptanceTestFramework\ObjectManager\Config\SchemaLocator $schemaLocator, + \Magento\AcceptanceTestFramework\Config\ValidationStateInterface $validationState, $fileName = 'di.xml', $idAttributes = [ '/config/preference' => 'for', @@ -40,7 +39,7 @@ public function __construct( '/config/(type|virtualType)/arguments/argument' => 'name', '/config/(type|virtualType)/arguments/argument(/item)+' => 'name' ], - $domDocumentClass = 'Magento\TestFramework\Config\Dom', + $domDocumentClass = 'Magento\AcceptanceTestFramework\Config\Dom', $defaultScope = 'etc' ) { parent::__construct( @@ -60,7 +59,7 @@ public function __construct( * * @param string $mergerClass * @param string $initialContents - * @return \Magento\TestFramework\Config\Dom + * @return \Magento\AcceptanceTestFramework\Config\Dom */ protected function _createConfigMerger($mergerClass, $initialContents) { diff --git a/lib/Magento/TestFramework/ObjectManager/Config/Reader/DomFactory.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php similarity index 59% rename from lib/Magento/TestFramework/ObjectManager/Config/Reader/DomFactory.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php index 036bd5487..41101a12f 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/Reader/DomFactory.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php @@ -5,17 +5,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager\Config\Reader; +namespace Magento\AcceptanceTestFramework\ObjectManager\Config\Reader; /** - * Factory class for \Magento\TestFramework\ObjectManager\Config\Reader\Dom + * Factory class for \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom */ class DomFactory { /** * Object Manager instance * - * @var \Magento\TestFramework\ObjectManagerInterface + * @var \Magento\AcceptanceTestFramework\ObjectManagerInterface */ protected $_objectManager = null; @@ -29,12 +29,12 @@ class DomFactory /** * Factory constructor * - * @param \Magento\TestFramework\ObjectManagerInterface $objectManager + * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager * @param string $instanceName */ public function __construct( - \Magento\TestFramework\ObjectManagerInterface $objectManager, - $instanceName = \Magento\TestFramework\ObjectManager\Config\Reader\Dom::class + \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager, + $instanceName = \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom::class ) { $this->_objectManager = $objectManager; $this->_instanceName = $instanceName; @@ -44,7 +44,7 @@ public function __construct( * Create class instance with specified parameters * * @param array $data - * @return \Magento\TestFramework\ObjectManager\Config\Reader\Dom + * @return \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom */ public function create(array $data = []) { diff --git a/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/SchemaLocator.php similarity index 81% rename from lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Config/SchemaLocator.php index 901f4eb2b..ea45a4e49 100644 --- a/lib/Magento/TestFramework/ObjectManager/Config/SchemaLocator.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/SchemaLocator.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager\Config; +namespace Magento\AcceptanceTestFramework\ObjectManager\Config; -use Magento\TestFramework\Config\SchemaLocatorInterface; +use Magento\AcceptanceTestFramework\Config\SchemaLocatorInterface; /** * Class SchemaLocator diff --git a/lib/Magento/TestFramework/ObjectManager/ConfigInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php similarity index 94% rename from lib/Magento/TestFramework/ObjectManager/ConfigInterface.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php index 4902d2b81..207514b83 100644 --- a/lib/Magento/TestFramework/ObjectManager/ConfigInterface.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager; +namespace Magento\AcceptanceTestFramework\ObjectManager; /** * Interface ConfigInterface diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php new file mode 100644 index 000000000..48effe944 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php @@ -0,0 +1,70 @@ +createArgumentInterpreter() + ), + new \Magento\AcceptanceTestFramework\ObjectManager\Config\SchemaLocator(), + new \Magento\AcceptanceTestFramework\Config\ValidationState($this->_appMode) + ); + + return $reader->read(); + } + + + /** + * Return newly created instance on an argument interpreter, suitable for processing DI arguments + * + * @return \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface + */ + protected function createArgumentInterpreter() + { + $booleanUtils = new \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils(); + $constInterpreter = new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Constant(); + $result = new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite( + [ + 'boolean' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), + 'string' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), + 'number' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Number(), + 'null' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\NullType(), + 'object' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\DataObject($booleanUtils), + 'const' => $constInterpreter, + 'init_parameter' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Argument($constInterpreter) + ], + \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE + ); + // Add interpreters that reference the composite + $result->addInterpreter('array', new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\ArrayType($result)); + return $result; + } +} diff --git a/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php similarity index 71% rename from lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php index 930b97d7d..f9d7073b2 100644 --- a/lib/Magento/TestFramework/ObjectManager/Definition/Runtime.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php @@ -4,12 +4,12 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager\Definition; +namespace Magento\AcceptanceTestFramework\ObjectManager\Definition; /** * Class Runtime */ -class Runtime implements \Magento\TestFramework\ObjectManager\DefinitionInterface +class Runtime implements \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface { /** * @var array @@ -17,11 +17,11 @@ class Runtime implements \Magento\TestFramework\ObjectManager\DefinitionInterfac protected $_definitions = []; /** - * @param \Magento\TestFramework\Code\Reader\ClassReader $reader + * @param \Magento\AcceptanceTestFramework\Code\Reader\ClassReader $reader */ - public function __construct(\Magento\TestFramework\Code\Reader\ClassReader $reader = null) + public function __construct(\Magento\AcceptanceTestFramework\Code\Reader\ClassReader $reader = null) { - $this->_reader = $reader ? : new \Magento\TestFramework\Code\Reader\ClassReader(); + $this->_reader = $reader ? : new \Magento\AcceptanceTestFramework\Code\Reader\ClassReader(); } /** diff --git a/lib/Magento/TestFramework/ObjectManager/DefinitionInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManager/DefinitionInterface.php similarity index 93% rename from lib/Magento/TestFramework/ObjectManager/DefinitionInterface.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/DefinitionInterface.php index 2cad86934..ff41f69f0 100644 --- a/lib/Magento/TestFramework/ObjectManager/DefinitionInterface.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/DefinitionInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager; +namespace Magento\AcceptanceTestFramework\ObjectManager; /** * Interface DefinitionInterface diff --git a/lib/Magento/TestFramework/ObjectManager/Factory.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php similarity index 90% rename from lib/Magento/TestFramework/ObjectManager/Factory.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php index 8b8d432bf..8743dea87 100644 --- a/lib/Magento/TestFramework/ObjectManager/Factory.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php @@ -4,34 +4,34 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager; +namespace Magento\AcceptanceTestFramework\ObjectManager; -use Magento\TestFramework\System\Code\ClassReader; +use Magento\AcceptanceTestFramework\System\Code\ClassReader; /** * Class Factory * * @internal */ -class Factory extends \Magento\TestFramework\ObjectManager\Factory\Dynamic\Developer +class Factory extends \Magento\AcceptanceTestFramework\ObjectManager\Factory\Dynamic\Developer { /** - * @var \Magento\TestFramework\System\Code\ClassReader + * @var \Magento\AcceptanceTestFramework\System\Code\ClassReader */ protected $classReader; /** * @constructor * - * @param \Magento\TestFramework\ObjectManager\ConfigInterface $config - * @param \Magento\TestFramework\ObjectManagerInterface $objectManager - * @param \Magento\TestFramework\ObjectManager\DefinitionInterface $definitions + * @param \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config + * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager + * @param \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface $definitions * @param array $globalArguments */ public function __construct( - \Magento\TestFramework\ObjectManager\ConfigInterface $config, - \Magento\TestFramework\ObjectManagerInterface $objectManager = null, - \Magento\TestFramework\ObjectManager\DefinitionInterface $definitions = null, + \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config, + \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager = null, + \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface $definitions = null, $globalArguments = [] ) { parent::__construct($config, $objectManager, $definitions, $globalArguments); diff --git a/lib/Magento/TestFramework/ObjectManager/Factory/Dynamic/Developer.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php similarity index 83% rename from lib/Magento/TestFramework/ObjectManager/Factory/Dynamic/Developer.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php index 3389e9991..dad7e355f 100644 --- a/lib/Magento/TestFramework/ObjectManager/Factory/Dynamic/Developer.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php @@ -3,31 +3,31 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager\Factory\Dynamic; +namespace Magento\AcceptanceTestFramework\ObjectManager\Factory\Dynamic; /** * Class Developer */ -class Developer implements \Magento\TestFramework\ObjectManager\FactoryInterface +class Developer implements \Magento\AcceptanceTestFramework\ObjectManager\FactoryInterface { /** * Object manager * - * @var \Magento\TestFramework\ObjectManagerInterface + * @var \Magento\AcceptanceTestFramework\ObjectManagerInterface */ protected $objectManager; /** * Object manager config * - * @var \Magento\TestFramework\ObjectManager\ConfigInterface + * @var \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface */ protected $config; /** * Definition list * - * @var \Magento\TestFramework\ObjectManager\DefinitionInterface + * @var \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface */ protected $definitions; @@ -39,30 +39,30 @@ class Developer implements \Magento\TestFramework\ObjectManager\FactoryInterface protected $creationStack = []; /** - * @param \Magento\TestFramework\ObjectManager\ConfigInterface $config - * @param \Magento\TestFramework\ObjectManagerInterface $objectManager - * @param \Magento\TestFramework\ObjectManager\DefinitionInterface $definitions + * @param \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config + * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager + * @param \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface $definitions * @param array $globalArguments */ public function __construct( - \Magento\TestFramework\ObjectManager\ConfigInterface $config, - \Magento\TestFramework\ObjectManagerInterface $objectManager = null, - \Magento\TestFramework\ObjectManager\DefinitionInterface $definitions = null, + \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config, + \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager = null, + \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface $definitions = null, $globalArguments = [] ) { $this->config = $config; $this->objectManager = $objectManager; - $this->definitions = $definitions ?: new \Magento\TestFramework\ObjectManager\Definition\Runtime(); + $this->definitions = $definitions ?: new \Magento\AcceptanceTestFramework\ObjectManager\Definition\Runtime(); $this->globalArguments = $globalArguments; } /** * Set object manager * - * @param \Magento\TestFramework\ObjectManagerInterface $objectManager + * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager * @return void */ - public function setObjectManager(\Magento\TestFramework\ObjectManagerInterface $objectManager) + public function setObjectManager(\Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager) { $this->objectManager = $objectManager; } diff --git a/lib/Magento/TestFramework/ObjectManager/FactoryInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManager/FactoryInterface.php similarity index 89% rename from lib/Magento/TestFramework/ObjectManager/FactoryInterface.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/FactoryInterface.php index d425535e4..d77b62ffc 100644 --- a/lib/Magento/TestFramework/ObjectManager/FactoryInterface.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/FactoryInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager; +namespace Magento\AcceptanceTestFramework\ObjectManager; /** * Interface FactoryInterface diff --git a/lib/Magento/TestFramework/ObjectManager/ObjectManager.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php similarity index 84% rename from lib/Magento/TestFramework/ObjectManager/ObjectManager.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php index 5952f8666..e231a89d0 100644 --- a/lib/Magento/TestFramework/ObjectManager/ObjectManager.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php @@ -4,15 +4,15 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager; +namespace Magento\AcceptanceTestFramework\ObjectManager; /** * Class ObjectManager */ -class ObjectManager implements \Magento\TestFramework\ObjectManagerInterface +class ObjectManager implements \Magento\AcceptanceTestFramework\ObjectManagerInterface { /** - * @var \Magento\TestFramework\ObjectManager\FactoryInterface + * @var \Magento\AcceptanceTestFramework\ObjectManager\FactoryInterface */ protected $_factory; @@ -38,7 +38,7 @@ public function __construct(FactoryInterface $factory, ConfigInterface $config, $this->_config = $config; $this->_factory = $factory; $this->_sharedInstances = $sharedInstances; - $this->_sharedInstances['Magento\TestFramework\ObjectManagerInterface'] = $this; + $this->_sharedInstances['Magento\AcceptanceTestFramework\ObjectManagerInterface'] = $this; } /** diff --git a/lib/Magento/TestFramework/ObjectManager/Relations/Runtime.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php similarity index 61% rename from lib/Magento/TestFramework/ObjectManager/Relations/Runtime.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php index 82987cf1f..4318f8284 100644 --- a/lib/Magento/TestFramework/ObjectManager/Relations/Runtime.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php @@ -3,15 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager\Relations; +namespace Magento\AcceptanceTestFramework\ObjectManager\Relations; /** * Class Runtime */ -class Runtime implements \Magento\TestFramework\ObjectManager\RelationsInterface +class Runtime implements \Magento\AcceptanceTestFramework\ObjectManager\RelationsInterface { /** - * @var \Magento\TestFramework\Code\Reader\ClassReader + * @var \Magento\AcceptanceTestFramework\Code\Reader\ClassReader */ protected $_classReader; @@ -23,11 +23,11 @@ class Runtime implements \Magento\TestFramework\ObjectManager\RelationsInterface protected $_default = []; /** - * @param \Magento\TestFramework\Code\Reader\ClassReader $classReader + * @param \Magento\AcceptanceTestFramework\Code\Reader\ClassReader $classReader */ - public function __construct(\Magento\TestFramework\Code\Reader\ClassReader $classReader = null) + public function __construct(\Magento\AcceptanceTestFramework\Code\Reader\ClassReader $classReader = null) { - $this->_classReader = $classReader ? : new \Magento\TestFramework\Code\Reader\ClassReader(); + $this->_classReader = $classReader ? : new \Magento\AcceptanceTestFramework\Code\Reader\ClassReader(); } /** diff --git a/lib/Magento/TestFramework/ObjectManager/RelationsInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManager/RelationsInterface.php similarity index 89% rename from lib/Magento/TestFramework/ObjectManager/RelationsInterface.php rename to src/Magento/AcceptanceTestFramework/ObjectManager/RelationsInterface.php index 3c78b344c..4a9919b40 100644 --- a/lib/Magento/TestFramework/ObjectManager/RelationsInterface.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/RelationsInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\ObjectManager; +namespace Magento\AcceptanceTestFramework\ObjectManager; /** * Interface RelationsInterface diff --git a/lib/Magento/TestFramework/ObjectManager/etc/config.xsd b/src/Magento/AcceptanceTestFramework/ObjectManager/etc/config.xsd similarity index 100% rename from lib/Magento/TestFramework/ObjectManager/etc/config.xsd rename to src/Magento/AcceptanceTestFramework/ObjectManager/etc/config.xsd diff --git a/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php b/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php new file mode 100644 index 000000000..587e9582d --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php @@ -0,0 +1,119 @@ +configClassName(); + + $factory = new Factory($diConfig); + $argInterpreter = $this->createArgumentInterpreter(new BooleanUtils()); + $argumentMapper = new \Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom($argInterpreter); + + + $sharedInstances['Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface'] = $argInterpreter; + $sharedInstances['Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom'] = $argumentMapper; + + /** @var \Magento\AcceptanceTestFramework\ObjectManager $objectManager */ + $objectManager = new $this->locatorClassName($factory, $diConfig, $sharedInstances); + + $factory->setObjectManager($objectManager); + ObjectManager::setInstance($objectManager); + + self::configure($objectManager); + + return $objectManager; + } + + /** + * Return newly created instance on an argument interpreter, suitable for processing DI arguments. + * + * @param \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils $booleanUtils + * @return \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface + */ + protected function createArgumentInterpreter( + \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils $booleanUtils + ) { + $constInterpreter = new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Constant(); + $result = new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite( + [ + 'boolean' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), + 'string' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), + 'number' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Number(), + 'null' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\NullType(), + 'const' => $constInterpreter, + 'object' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\DataObject($booleanUtils), + 'init_parameter' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Argument($constInterpreter), + ], + \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE + ); + // Add interpreters that reference the composite + $result->addInterpreter('array', new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\ArrayType($result)); + return $result; + } + + /** + * Get Object Manager instance. + * + * @return ObjectManager + */ + public static function getObjectManager() + { + if (!$objectManager = ObjectManager::getInstance()) { + $objectManagerFactory = new self(); + $objectManager = $objectManagerFactory->create(); + } + + return $objectManager; + } + + /** + * Configure Object Manager. + * This method is static to have the ability to configure multiple instances of Object manager when needed. + * + * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager + * @return void + */ + public static function configure(\Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager) + { + $objectManager->configure( + $objectManager->get(\Magento\AcceptanceTestFramework\ObjectManager\ConfigLoader\Primary::class)->load() + ); + } +} diff --git a/lib/Magento/TestFramework/ObjectManagerInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php similarity index 94% rename from lib/Magento/TestFramework/ObjectManagerInterface.php rename to src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php index a321f1026..1c9650c1a 100644 --- a/lib/Magento/TestFramework/ObjectManagerInterface.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework; +namespace Magento\AcceptanceTestFramework; /** * Interface ObjectManagerInterface diff --git a/src/Magento/Xxyyzz/Page/AbstractAdminPage.php b/src/Magento/AcceptanceTestFramework/Page/AbstractAdminPage.php similarity index 98% rename from src/Magento/Xxyyzz/Page/AbstractAdminPage.php rename to src/Magento/AcceptanceTestFramework/Page/AbstractAdminPage.php index 8aa67330f..1364162f8 100644 --- a/src/Magento/Xxyyzz/Page/AbstractAdminPage.php +++ b/src/Magento/AcceptanceTestFramework/Page/AbstractAdminPage.php @@ -1,7 +1,7 @@ + + + + + + + diff --git a/src/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php b/src/Magento/AcceptanceTestFramework/Page/Catalog/AdminCategoryPage.php similarity index 96% rename from src/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php rename to src/Magento/AcceptanceTestFramework/Page/Catalog/AdminCategoryPage.php index 7b1d3f42a..e949506ae 100644 --- a/src/Magento/Xxyyzz/Page/Catalog/AdminCategoryPage.php +++ b/src/Magento/AcceptanceTestFramework/Page/Catalog/AdminCategoryPage.php @@ -1,7 +1,7 @@ + + + + + + + + + + diff --git a/src/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php b/src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsGrid.php similarity index 94% rename from src/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php rename to src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsGrid.php index 2ff2ba34d..47a11cd6e 100644 --- a/src/Magento/Xxyyzz/Page/Cms/AdminCmsGrid.php +++ b/src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsGrid.php @@ -1,7 +1,7 @@ + + + + + + + + + + diff --git a/src/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php b/src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/AdminConfigurableProductPage.php similarity index 98% rename from src/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php rename to src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/AdminConfigurableProductPage.php index bbed8a98e..90a7b1fb5 100644 --- a/src/Magento/Xxyyzz/Page/ConfigurableProduct/AdminConfigurableProductPage.php +++ b/src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/AdminConfigurableProductPage.php @@ -1,9 +1,9 @@ - + - + diff --git a/src/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php b/src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerGrid.php similarity index 97% rename from src/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php rename to src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerGrid.php index a50a66889..2e0fd2a95 100644 --- a/src/Magento/Xxyyzz/Page/Customer/AdminCustomerGrid.php +++ b/src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerGrid.php @@ -1,7 +1,7 @@ - + - + diff --git a/src/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php b/src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderAddPage.php similarity index 99% rename from src/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php rename to src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderAddPage.php index 729e0ecea..4b92b76b4 100644 --- a/src/Magento/Xxyyzz/Page/Sales/AdminOrderAddPage.php +++ b/src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderAddPage.php @@ -1,7 +1,7 @@ - + - + diff --git a/lib/Magento/TestFramework/PageObject/etc/pageObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd similarity index 73% rename from lib/Magento/TestFramework/PageObject/etc/pageObject.xsd rename to src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd index 0ec078c9b..0b1827509 100644 --- a/lib/Magento/TestFramework/PageObject/etc/pageObject.xsd +++ b/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd @@ -65,10 +65,10 @@ - + - An element that contains configuration data of a block render. + A ui element that contains data for selenium web driver to perform default action on them. @@ -94,54 +94,74 @@ - - - - Strategy according to value of "locator" attribute. - - - - + - The name of the render. + The name of the element. - + - The path to the render PHP class file. + The type of the element, e.g. select, radio, etc. - + - Locator of the render. For example, CSS selector "#maincontent". + Locator of the element. - + - Strategy according to value of "locator" attribute. + If the element is a required field in the ui. + + + + + + + The group that the element belongs in the ui. + + + + + + + If the element depends on other element to be enabled. - + - + + + + + + + + + + + + + + diff --git a/lib/Magento/TestFramework/Stdlib/BooleanUtils.php b/src/Magento/AcceptanceTestFramework/Stdlib/BooleanUtils.php similarity index 96% rename from lib/Magento/TestFramework/Stdlib/BooleanUtils.php rename to src/Magento/AcceptanceTestFramework/Stdlib/BooleanUtils.php index 033d41ed7..1444c7c0b 100644 --- a/lib/Magento/TestFramework/Stdlib/BooleanUtils.php +++ b/src/Magento/AcceptanceTestFramework/Stdlib/BooleanUtils.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Stdlib; +namespace Magento\AcceptanceTestFramework\Stdlib; /** * Utility methods for the boolean data type diff --git a/src/Magento/Xxyyzz/Step/Backend/AdminStep.php b/src/Magento/AcceptanceTestFramework/Step/Backend/AdminStep.php similarity index 58% rename from src/Magento/Xxyyzz/Step/Backend/AdminStep.php rename to src/Magento/AcceptanceTestFramework/Step/Backend/AdminStep.php index 184f3f86f..49c3b007b 100644 --- a/src/Magento/Xxyyzz/Step/Backend/AdminStep.php +++ b/src/Magento/AcceptanceTestFramework/Step/Backend/AdminStep.php @@ -1,9 +1,9 @@ amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLoginPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLoginPage); $I->waitForPageLoad(); } public function goToTheAdminLogoutPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLogoutPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLogoutPage); } // Sales public function goToTheAdminOrdersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrdersGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrdersGrid); $I->waitForPageLoad(); } public function goToTheAdminOrderForIdPage($orderId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); $I->waitForPageLoad(); } public function goToTheAdminAddOrderPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderPage); $I->waitForPageLoad(); } public function goToTheAdminAddOrderForCustomerIdPage($customerId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); $I->waitForPageLoad(); } public function goToTheAdminInvoicesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminInvoicesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminInvoicesGrid); $I->waitForPageLoad(); } public function goToTheAdminAddInvoiceForOrderIdPage($orderId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); $I->waitForPageLoad(); } public function goToTheAdminShipmentsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminShipmentsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShipmentsGrid); $I->waitForPageLoad(); } public function goToTheAdminShipmentForIdPage($shipmentId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); $I->waitForPageLoad(); } public function goToTheAdminCreditMemosGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemosGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreditMemosGrid); $I->waitForPageLoad(); } public function goToTheAdminCreditMemoForIdPage($creditMemoId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); $I->waitForPageLoad(); } public function goToTheAdminBillingAgreementsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBillingAgreementsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBillingAgreementsGrid); $I->waitForPageLoad(); } public function goToTheAdminTransactionsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTransactionsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTransactionsGrid); $I->waitForPageLoad(); } @@ -217,70 +217,70 @@ public function goToTheAdminTransactionsGrid() public function goToTheAdminCatalogPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogGrid); $I->waitForPageLoad(); } public function goToTheAdminProductForIdPage($productId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductForIdPage . $productId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductForIdPage . $productId)); $I->waitForPageLoad(); } public function goToTheAdminAddSimpleProductPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSimpleProductPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSimpleProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddConfigurableProductPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddConfigurableProductPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddConfigurableProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddGroupedProductPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddGroupedProductPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddGroupedProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddVirtualProductPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddVirtualProductPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddVirtualProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddBundledProductPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddBundleProductPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddBundleProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddDownloadableProductPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddDownloadableProductPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddDownloadableProductPage); $I->waitForPageLoad(); } public function goToTheAdminCategoriesPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoriesPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCategoriesPage); $I->waitForPageLoad(); } public function goToTheAdminCategoryForIdPage($categoryId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); $I->waitForPageLoad(); } @@ -302,28 +302,28 @@ public function goToTheAdminAddSubCategoryForStoreIdPage($storeId) public function goToTheAdminAllCustomersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllCustomersGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllCustomersGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomersNowOnlineGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomerForIdPage($customerId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); $I->waitForPageLoad(); } public function goToTheAdminAddCustomerPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomerPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomerPage); $I->waitForPageLoad(); } @@ -331,203 +331,203 @@ public function goToTheAdminAddCustomerPage() public function goToTheAdminCatalogPriceRuleGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); $I->waitForPageLoad(); } public function goToTheAdminCatalogPriceRuleForIdPage($catalogPriceRuleId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); $I->waitForPageLoad(); } public function goToTheAdminAddCatalogPriceRulePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); $I->waitForPageLoad(); } public function goToTheAdminCartPriceRulesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCartPriceRulesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCartPriceRulesGrid); $I->waitForPageLoad(); } public function goToTheAdminCartPriceRuleForIdPage($cartPriceRuleId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); $I->waitForPageLoad(); } public function goToTheAdminAddCartPriceRulePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCartPriceRulePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCartPriceRulePage); $I->waitForPageLoad(); } public function goToTheAdminEmailTemplatesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminEmailTemplatesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEmailTemplatesGrid); $I->waitForPageLoad(); } public function goToTheAdminEmailTemplateForIdPage($emailTemplateId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); $I->waitForPageLoad(); } public function goToTheAdminAddEmailTemplatePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddEmailTemplatePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddEmailTemplatePage); $I->waitForPageLoad(); } public function goToTheAdminNewsletterTemplateGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterTemplateGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterTemplateGrid); $I->waitForPageLoad(); } public function goToTheAdminNewsletterTemplateByIdPage($newsletterTemplateId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); $I->waitForPageLoad(); } public function goToTheAdminAddNewsletterTemplatePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); $I->waitForPageLoad(); } public function goToTheAdminNewsletterQueueGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterQueueGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterQueueGrid); $I->waitForPageLoad(); } public function goToTheAdminNewsletterSubscribersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); $I->waitForPageLoad(); } public function goToTheAdminURLRewritesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminURLRewritesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminURLRewritesGrid); $I->waitForPageLoad(); } public function goToTheAdminURLRewriteForId($urlRewriteId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); $I->waitForPageLoad(); } public function goToTheAdminAddURLRewritePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddURLRewritePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddURLRewritePage); $I->waitForPageLoad(); } public function goToTheAdminSearchTermsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermsGrid); $I->waitForPageLoad(); } public function goToTheAdminSearchTermForIdPage($searchTermId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); $I->waitForPageLoad(); } public function goToTheAdminAddSearchTermPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSearchTermPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSearchTermPage); $I->waitForPageLoad(); } public function goToTheAdminSearchSynonymsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchSynonymsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchSynonymsGrid); $I->waitForPageLoad(); } public function goToTheAdminSearchSynonymGroupByIdPage($searchSynonymId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); $I->waitForPageLoad(); } public function goToTheAdminAddSearchSynonymGroupPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); $I->waitForPageLoad(); } public function goToTheAdminSiteMapGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSiteMapGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSiteMapGrid); $I->waitForPageLoad(); } public function goToTheAdminSiteMapForIdPage($siteMapId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); $I->waitForPageLoad(); } public function goToTheAdminAddSiteMapPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSiteMapPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSiteMapPage); $I->waitForPageLoad(); } public function goToTheAdminReviewsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReviewsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminReviewsGrid); $I->waitForPageLoad(); } public function goToTheAdminReviewForIdPage($reviewId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); $I->waitForPageLoad(); } public function goToTheAdminAddReviewPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddReviewPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddReviewPage); $I->waitForPageLoad(); } @@ -535,98 +535,98 @@ public function goToTheAdminAddReviewPage() public function goToTheAdminPagesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminPagesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPagesGrid); $I->waitForPageLoad(); } public function goToTheAdminPageForIdPage($pageId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); $I->waitForPageLoad(); } public function goToTheAdminAddPagePage() { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddPagePage)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddPagePage)); $I->waitForPageLoad(); } public function goToTheAdminBlocksGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBlocksGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBlocksGrid); $I->waitForPageLoad(); } public function goToTheAdminBlockForIdPage($blockId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); $I->waitForPageLoad(); } public function goToTheAdminAddBlockPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddBlockPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddBlockPage); $I->waitForPageLoad(); } public function goToTheAdminWidgetsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminWidgetsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWidgetsGrid); $I->waitForPageLoad(); } public function goToTheAdminAddWidgetPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddWidgetPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddWidgetPage); $I->waitForPageLoad(); } public function goToTheAdminDesignConfigurationGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDesignConfigurationGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDesignConfigurationGrid); $I->waitForPageLoad(); } public function goToTheAdminThemesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminThemesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminThemesGrid); $I->waitForPageLoad(); } public function goToTheAdminThemeByIdPage($themeId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); $I->waitForPageLoad(); } public function goToTheAdminStoreContentScheduleGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreContentScheduleGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreContentScheduleGrid); $I->waitForPageLoad(); } public function goToTheAdminStoreContentScheduleForIdPage($storeContentScheduleId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); $I->waitForPageLoad(); } public function goToTheAdminAddStoreDesignChangePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddStoreDesignChangePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddStoreDesignChangePage); $I->waitForPageLoad(); } @@ -634,49 +634,49 @@ public function goToTheAdminAddStoreDesignChangePage() public function goToTheAdminProductsInCartGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsInCartGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductsInCartGrid); $I->waitForPageLoad(); } public function goToTheAdminSearchTermsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminAbandonedCartsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAbandonedCartsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAbandonedCartsGrid); $I->waitForPageLoad(); } public function goToTheAdminNewsletterProblemsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomerReviewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminProductReviewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductReviewsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductReviewsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminProductReviewsForProductIdPage($productId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); $I->waitForPageLoad(); } @@ -690,119 +690,119 @@ public function goToTheAdminProductReviewIdForProductIdPage($productReviewId, $p public function goToTheAdminOrdersReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrdersReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrdersReportGrid); $I->waitForPageLoad(); } public function goToTheAdminTaxReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxReportGrid); $I->waitForPageLoad(); } public function goToTheAdminInvoiceReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminInvoiceReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminInvoiceReportGrid); $I->waitForPageLoad(); } public function goToTheAdminShippingReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminShippingReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShippingReportGrid); $I->waitForPageLoad(); } public function goToTheAdminRefundsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRefundsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRefundsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminCouponsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCouponsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCouponsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminPayPalSettlementReportsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); $I->waitForPageLoad(); } public function goToTheAdminBraintreeSettlementReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); $I->waitForPageLoad(); } public function goToTheAdminOrderTotalReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderTotalReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderTotalReportGrid); $I->waitForPageLoad(); } public function goToTheAdminOrderCountReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderCountReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderCountReportGrid); $I->waitForPageLoad(); } public function goToTheAdminNewAccountsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewAccountsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewAccountsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminProductViewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductViewsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductViewsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminBestsellersReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBestsellersReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBestsellersReportGrid); $I->waitForPageLoad(); } public function goToTheAdminLowStockReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLowStockReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLowStockReportGrid); $I->waitForPageLoad(); } public function goToTheAdminOrderedProductsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderedProductsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderedProductsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminDownloadsReportGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDownloadsReportGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDownloadsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminRefreshStatisticsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRefreshStatisticsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRefreshStatisticsGrid); $I->waitForPageLoad(); } @@ -810,231 +810,231 @@ public function goToTheAdminRefreshStatisticsGrid() public function goToTheAdminAllStoresGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllStoresGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllStoresGrid); $I->waitForPageLoad(); } public function goToTheAdminCreateStoreViewPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateStoreViewPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateStoreViewPage); $I->waitForPageLoad(); } public function goToTheAdminCreateStorePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateStorePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateStorePage); $I->waitForPageLoad(); } public function goToTheAdminCreateWebsitePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateWebsitePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateWebsitePage); $I->waitForPageLoad(); } public function goToTheAdminWebsiteForIdPage($websiteId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); $I->waitForPageLoad(); } public function goToTheAdminStoreViewForIdPage($storeViewId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); $I->waitForPageLoad(); } public function goToTheAdminStoreForIdPage($storeId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); $I->waitForPageLoad(); } public function goToTheAdminConfigurationGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminConfigurationGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminConfigurationGrid); $I->waitForPageLoad(); } public function goToTheAdminTermsAndConditionsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTermsAndConditionsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTermsAndConditionsGrid); $I->waitForPageLoad(); } public function goToTheAdminTermsAndConditionForIdPage($termsAndConditionsId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); $I->waitForPageLoad(); } public function goToTheAdminAddNewTermsAndConditionsPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); $I->waitForPageLoad(); } public function goToTheAdminOrderStatusGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderStatusGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderStatusGrid); $I->waitForPageLoad(); } public function goToTheAdminAddOrderStatusPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderStatusPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderStatusPage); $I->waitForPageLoad(); } public function goToTheAdminTaxRulesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxRulesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxRulesGrid); $I->waitForPageLoad(); } public function goToTheAdminTaxRuleForIdPage($taxRuleId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); $I->waitForPageLoad(); } public function goToTheAdminAddTaxRulePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddTaxRulePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddTaxRulePage); $I->waitForPageLoad(); } public function goToTheAdminTaxZonesAndRatesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); $I->waitForPageLoad(); } public function goToTheAdminTaxZoneAndRateForIdPage($taxZoneAndRateId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); $I->waitForPageLoad(); } public function goToTheAdminAddTaxZoneAndRatePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); $I->waitForPageLoad(); } public function goToTheAdminCurrencyRatesPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCurrencyRatesPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCurrencyRatesPage); $I->waitForPageLoad(); } public function goToTheAdminCurrencySymbolsPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCurrencySymbolsPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCurrencySymbolsPage); $I->waitForPageLoad(); } public function goToTheAdminProductAttributesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductAttributesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductAttributesGrid); $I->waitForPageLoad(); } public function goToTheAdminProductAttributeForIdPage($productAttributeId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); $I->waitForPageLoad(); } public function goToTheAdminAddProductAttributePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddProductAttributePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddProductAttributePage); $I->waitForPageLoad(); } public function goToTheAdminAttributeSetGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAttributeSetsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAttributeSetsGrid); $I->waitForPageLoad(); } public function goToTheAdminAttributeSetByIdPage($attributeSetId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); $I->waitForPageLoad(); } public function goToTheAdminAddAttributeSetPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddAttributeSetPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddAttributeSetPage); $I->waitForPageLoad(); } public function goToTheAdminRatingGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRatingsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRatingsGrid); $I->waitForPageLoad(); } public function goToTheAdminRatingForIdPage($ratingId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); $I->waitForPageLoad(); } public function goToTheAdminAddRatingPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddRatingPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddRatingPage); $I->waitForPageLoad(); } public function goToTheAdminCustomerGroupsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerGroupsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerGroupsGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomerGroupForIdPage($customerGroupId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); $I->waitForPageLoad(); } public function goToTheAdminAddCustomerGroupPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomerGroupPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomerGroupPage); $I->waitForPageLoad(); } @@ -1042,168 +1042,168 @@ public function goToTheAdminAddCustomerGroupPage() public function goToTheAdminImportPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportPage); $I->waitForPageLoad(); } public function goToTheAdminExportPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminExportPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminExportPage); $I->waitForPageLoad(); } public function goToTheAdminImportAndExportTaxRatesPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); $I->waitForPageLoad(); } public function goToTheAdminImportHistoryGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportHistoryGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportHistoryGrid); $I->waitForPageLoad(); } public function goToTheAdminIntegrationsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminIntegrationsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIntegrationsGrid); $I->waitForPageLoad(); } public function goToTheAdminIntegrationForIdPage($integrationId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); $I->waitForPageLoad(); } public function goToTheAdminAddIntegrationPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddIntegrationPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddIntegrationPage); $I->waitForPageLoad(); } public function goToTheAdminCacheManagementGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCacheManagementGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCacheManagementGrid); $I->waitForPageLoad(); } public function goToTheAdminBackupsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBackupsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBackupsGrid); $I->waitForPageLoad(); } public function goToTheAdminIndexManagementGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminIndexManagementGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIndexManagementGrid); $I->waitForPageLoad(); } public function goToTheAdminWebSetupWizardPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminWebSetupWizardPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWebSetupWizardPage); $I->waitForPageLoad(); } public function goToTheAdminAllUsersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllUsersGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllUsersGrid); $I->waitForPageLoad(); } public function goToTheAdminUserForIdPage($userId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserByIdPage . $userId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserByIdPage . $userId)); $I->waitForPageLoad(); } public function goToTheAdminAddUserPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewUserPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewUserPage); $I->waitForPageLoad(); } public function goToTheAdminLockedUsersGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLockedUsersGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLockedUsersGrid); $I->waitForPageLoad(); } public function goToTheAdminUserRolesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserRolesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserRolesGrid); $I->waitForPageLoad(); } public function goToTheAdminUserRoleForIdPage($userRoleId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); $I->waitForPageLoad(); } public function goToTheAdminAddUserRolePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddUserRolePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddUserRolePage); $I->waitForPageLoad(); } public function goToTheAdminNotificationsGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNotificationsGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNotificationsGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomVariablesGrid() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomVariablesGrid); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomVariablesGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomVariableForId($customVariableId) { $I = $this; - $I->amOnPage((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); + $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); $I->waitForPageLoad(); } public function goToTheAdminAddCustomVariablePage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomVariablePage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomVariablePage); $I->waitForPageLoad(); } public function goToTheAdminEncryptionKeyPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminEncryptionKeyPage); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEncryptionKeyPage); $I->waitForPageLoad(); } public function goToTheAdminFindPartnersAndExtensionsPage() { $I = $this; - $I->amOnPage(\Magento\Xxyyzz\Helper\AdminUrlList::$adminFindPartnersAndExtensions); + $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminFindPartnersAndExtensions); $I->waitForPageLoad(); } @@ -1211,104 +1211,104 @@ public function goToTheAdminFindPartnersAndExtensionsPage() public function shouldBeOnTheAdminLoginPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLoginPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLoginPage); } public function shouldBeOnTheAdminDashboardPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDashboardPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDashboardPage); $I->see('Dashboard', self::$adminPageTitle); } public function shouldBeOnTheAdminForgotYourPasswordPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminForgotYourPasswordPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminForgotYourPasswordPage); } // Sales public function shouldBeOnTheAdminOrdersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrdersGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrdersGrid); $I->see('Orders', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderForIdPage($orderId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); $I->see($orderId, self::$adminPageTitle); } public function shouldBeOnTheAdminAddOrderPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderPage); $I->see('Create New Order', self::$adminPageTitle); } public function shouldBeOnTheAdminAddOrderForCustomerIdPage($customerId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); $I->see('Create New Order', self::$adminPageTitle); } public function shouldBeOnTheAdminInvoicesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminInvoicesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminInvoicesGrid); $I->see('Invoices', self::$adminPageTitle); } public function shouldBeOnTheAdminAddInvoiceForOrderIdPage($orderId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); $I->see('New Invoice', self::$adminPageTitle); } public function shouldBeOnTheAdminShipmentsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminShipmentsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShipmentsGrid); $I->see('Shipments', self::$adminPageTitle); } public function shouldBeOnTheAdminShipmentForIdPage($shipmentId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); $I->see('New Shipment'); } public function shouldBeOnTheAdminCreditMemosGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemosGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreditMemosGrid); $I->see('Credit Memos', self::$adminPageTitle); } public function shouldBeOnTheAdminCreditMemoForIdPage($creditMemoId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); $I->see('View Memo', self::$adminPageTitle); } public function shouldBeOnTheAdminBillingAgreementsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBillingAgreementsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBillingAgreementsGrid); $I->see('Billing Agreements', self::$adminPageTitle); } public function shouldBeOnTheAdminTransactionsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTransactionsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTransactionsGrid); $I->see('Transactions', self::$adminPageTitle); } @@ -1316,70 +1316,70 @@ public function shouldBeOnTheAdminTransactionsGrid() public function shouldBeOnTheAdminCatalogGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogGrid); $I->see('Catalog', self::$adminPageTitle); } public function shouldBeOnTheAdminProductForIdPage($productId, $productName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductForIdPage . $productId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductForIdPage . $productId)); $I->see($productName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddSimpleProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSimpleProductPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSimpleProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddConfigurableProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddConfigurableProductPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddConfigurableProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddGroupedProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddGroupedProductPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddGroupedProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddVirtualProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddVirtualProductPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddVirtualProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddBundledProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddBundleProductPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddBundleProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddDownloadableProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddDownloadableProductPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddDownloadableProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminCategoriesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoriesPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCategoriesPage); $I->see('Default Category', self::$adminPageTitle); } public function shouldBeOnTheAdminCategoryForIdPage($categoryId, $categoryName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); $I->see($categoryName, self::$adminPageTitle); } @@ -1401,28 +1401,28 @@ public function shouldBeOnTheAdminAddSubCategoryForStoreIdPage($storeId) public function shouldBeOnTheAdminAllCustomersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllCustomersGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllCustomersGrid); $I->see('Customers', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomersNowOnlineGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); $I->see('Customers Now Online', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomerForIdPage($customerId, $customerName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); $I->see($customerName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCustomerPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomerPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomerPage); $I->see('New Customer', self::$adminPageTitle); } @@ -1430,203 +1430,203 @@ public function shouldBeOnTheAdminAddCustomerPage() public function shouldBeOnTheAdminCatalogPriceRuleGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); $I->see('Catalog Price Rule', self::$adminPageTitle); } public function shouldBeOnTheAdminCatalogPriceRuleForIdPage($catalogPriceRuleId, $catalogPriceRuleName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); $I->see($catalogPriceRuleName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCatalogPriceRulePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); $I->see('New Catalog Price Rule', self::$adminPageTitle); } public function shouldBeOnTheAdminCartPriceRulesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCartPriceRulesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCartPriceRulesGrid); $I->see('Cart Price Rules', self::$adminPageTitle); } public function shouldBeOnTheAdminCartPriceRuleForIdPage($cartPriceRuleId, $cartPriceRuleName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); $I->see($cartPriceRuleName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCartPriceRulePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCartPriceRulePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCartPriceRulePage); $I->see('New Cart Price Rule', self::$adminPageTitle); } public function shouldBeOnTheAdminEmailTemplatesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminEmailTemplatesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEmailTemplatesGrid); $I->see('Email Templates', self::$adminPageTitle); } public function shouldBeOnTheAdminEmailTemplateForIdPage($emailTemplateId, $templateName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); $I->see($templateName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddEmailTemplatePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddEmailTemplatePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddEmailTemplatePage); $I->see('New Template', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterTemplateGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterTemplateGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterTemplateGrid); $I->see('Newsletter Templates', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterTemplateByIdPage($newsletterTemplateId, $templateName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); $I->see($templateName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddNewsletterTemplatePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); $I->see('New Template', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterQueueGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterQueueGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterQueueGrid); $I->see('Newsletter Queue', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterSubscribersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); $I->see('Newsletter Subscribers', self::$adminPageTitle); } public function shouldBeOnTheAdminURLRewritesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminURLRewritesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminURLRewritesGrid); $I->see('URL Rewrites', self::$adminPageTitle); } public function shouldBeOnTheAdminURLRewriteForId($urlRewriteId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); $I->see('Edit URL Rewrite for a', self::$adminPageTitle); } public function shouldBeOnTheAdminAddURLRewritePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddURLRewritePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddURLRewritePage); $I->see('Add New URL Rewrite', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchTermsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermsGrid); $I->see('Search Terms', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchTermForIdPage($searchTermId, $searchQuery) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); $I->see($searchQuery, self::$adminPageTitle); } public function shouldBeOnTheAdminAddSearchTermPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSearchTermPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSearchTermPage); $I->see('New Search', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchSynonymsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchSynonymsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchSynonymsGrid); $I->see('Search Synonyms', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchSynonymGroupByIdPage($searchSynonymId, $synonyms) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); $I->see($synonyms, self::$adminPageTitle); } public function shouldBeOnTheAdminAddSearchSynonymGroupPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); $I->see('New Synonym Group', self::$adminPageTitle); } public function shouldBeOnTheAdminSiteMapGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSiteMapGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSiteMapGrid); $I->see('Site Map', self::$adminPageTitle); } public function shouldBeOnTheAdminSiteMapForIdPage($siteMapId, $fileName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); $I->see($fileName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddSiteMapPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddSiteMapPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSiteMapPage); $I->see('New Site Map', self::$adminPageTitle); } public function shouldBeOnTheAdminReviewsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminReviewsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminReviewsGrid); $I->see('Reviews', self::$adminPageTitle); } public function shouldBeOnTheAdminReviewForIdPage($reviewId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); $I->see('Edit Review', self::$adminPageTitle); } public function shouldBeOnTheAdminAddReviewPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddReviewPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddReviewPage); $I->see('New Review', self::$adminPageTitle); } @@ -1634,98 +1634,98 @@ public function shouldBeOnTheAdminAddReviewPage() public function shouldBeOnTheAdminPagesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminPagesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPagesGrid); $I->see('Pages', self::$adminPageTitle); } public function shouldBeOnTheAdminPageForIdPage($pageId, $pageTitle) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); $I->see($pageTitle, self::$adminPageTitle); } public function shouldBeOnTheAdminAddPagePage() { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddPagePage)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddPagePage)); $I->see('New Page', self::$adminPageTitle); } public function shouldBeOnTheAdminBlocksGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBlocksGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBlocksGrid); $I->see('Blocks', self::$adminPageTitle); } public function shouldBeOnTheAdminBlockForIdPage($blockId, $blockTitle) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); $I->see($blockTitle, self::$adminPageTitle); } public function shouldBeOnTheAdminAddBlockPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddBlockPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddBlockPage); $I->see('New Block', self::$adminPageTitle); } public function shouldBeOnTheAdminWidgetsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminWidgetsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWidgetsGrid); $I->see('Widgets', self::$adminPageTitle); } public function shouldBeOnTheAdminAddWidgetPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddWidgetPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddWidgetPage); $I->see('Widgets', self::$adminPageTitle); } public function shouldBeOnTheAdminDesignConfigurationGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDesignConfigurationGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDesignConfigurationGrid); $I->see('Design Configuration', self::$adminPageTitle); } public function shouldBeOnTheAdminThemesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminThemesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminThemesGrid); $I->see('Themes', self::$adminPageTitle); } public function shouldBeOnTheAdminThemeByIdPage($themeId, $themeTitle) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); $I->see($themeTitle); } public function shouldBeOnTheAdminStoreContentScheduleGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreContentScheduleGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreContentScheduleGrid); $I->see('Store Design Schedule', self::$adminPageTitle); } public function shouldBeOnTheAdminStoreContentScheduleForIdPage($storeContentScheduleId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); $I->see('Edit Store Design Change', self::$adminPageTitle); } public function shouldBeOnTheAdminAddStoreDesignChangePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddStoreDesignChangePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddStoreDesignChangePage); $I->see('New Store Design Change'); } @@ -1733,49 +1733,49 @@ public function shouldBeOnTheAdminAddStoreDesignChangePage() public function shouldBeOnTheAdminProductsInCartGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductsInCartGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductsInCartGrid); $I->see('Products in Carts', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchTermsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminSearchTermsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermsReportGrid); $I->see('Search Terms Report', self::$adminPageTitle); } public function shouldBeOnTheAdminAbandonedCartsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAbandonedCartsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAbandonedCartsGrid); $I->see('Abandoned Carts', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterProblemsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); $I->see('Newsletter Problems Report', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomerReviewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); $I->see('Customer Reviews Report', self::$adminPageTitle); } public function shouldBeOnTheAdminProductReviewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductReviewsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductReviewsReportGrid); $I->see('Product Reviews Report', self::$adminPageTitle); } public function shouldBeOnTheAdminProductReviewsForProductIdPage($productId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); $I->see('Reviews', self::$adminPageTitle); } @@ -1789,119 +1789,119 @@ public function shouldBeOnTheAdminProductReviewIdForProductIdPage($productReview public function shouldBeOnTheAdminOrdersReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrdersReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrdersReportGrid); $I->see('Orders Report', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxReportGrid); $I->see('Tax Report', self::$adminPageTitle); } public function shouldBeOnTheAdminInvoiceReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminInvoiceReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminInvoiceReportGrid); $I->see('Invoice Report', self::$adminPageTitle); } public function shouldBeOnTheAdminShippingReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminShippingReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShippingReportGrid); $I->see('Shipping Report', self::$adminPageTitle); } public function shouldBeOnTheAdminRefundsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRefundsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRefundsReportGrid); $I->see('Refunds Report', self::$adminPageTitle); } public function shouldBeOnTheAdminCouponsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCouponsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCouponsReportGrid); $I->see('Coupons Report', self::$adminPageTitle); } public function shouldBeOnTheAdminPayPalSettlementReportsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); $I->see('PayPal Settlement Reports', self::$adminPageTitle); } public function shouldBeOnTheAdminBraintreeSettlementReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); $I->see('Braintree Settlement Report', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderTotalReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderTotalReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderTotalReportGrid); $I->see('Order Total Report', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderCountReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderCountReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderCountReportGrid); $I->see('Order Count Report', self::$adminPageTitle); } public function shouldBeOnTheAdminNewAccountsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNewAccountsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewAccountsReportGrid); $I->see('New Accounts Report', self::$adminPageTitle); } public function shouldBeOnTheAdminProductViewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductViewsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductViewsReportGrid); $I->see('Product Views Report', self::$adminPageTitle); } public function shouldBeOnTheAdminBestsellersReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBestsellersReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBestsellersReportGrid); $I->see('Bestsellers Report', self::$adminPageTitle); } public function shouldBeOnTheAdminLowStockReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLowStockReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLowStockReportGrid); $I->see('Low Stock Report', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderedProductsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderedProductsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderedProductsReportGrid); $I->see('Ordered Products Report', self::$adminPageTitle); } public function shouldBeOnTheAdminDownloadsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminDownloadsReportGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDownloadsReportGrid); $I->see('Downloads Report', self::$adminPageTitle); } public function shouldBeOnTheAdminRefreshStatisticsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRefreshStatisticsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRefreshStatisticsGrid); $I->see('Refresh Statistics', self::$adminPageTitle); } @@ -1909,228 +1909,228 @@ public function shouldBeOnTheAdminRefreshStatisticsGrid() public function shouldBeOnTheAdminAllStoresGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllStoresGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllStoresGrid); $I->see('Stores', self::$adminPageTitle); } public function shouldBeOnTheAdminCreateStoreViewPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateStoreViewPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateStoreViewPage); $I->see('Stores', self::$adminPageTitle); } public function shouldBeOnTheAdminCreateStorePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateStorePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateStorePage); $I->see('Stores', self::$adminPageTitle); } public function shouldBeOnTheAdminCreateWebsitePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCreateWebsitePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateWebsitePage); $I->see('Stores'); } public function shouldBeOnTheAdminWebsiteForIdPage($websiteId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); } public function shouldBeOnTheAdminStoreViewForIdPage($storeViewId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); } public function shouldBeOnTheAdminStoreForIdPage($storeId) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); } public function shouldBeOnTheAdminConfigurationGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminConfigurationGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminConfigurationGrid); $I->see('Configuration', self::$adminPageTitle); } public function shouldBeOnTheAdminTermsAndConditionsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTermsAndConditionsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTermsAndConditionsGrid); $I->see('Terms and Conditions', self::$adminPageTitle); } public function shouldBeOnTheAdminTermsAndConditionForIdPage($termsAndConditionsId, $conditionName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); $I->see($conditionName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddNewTermsAndConditionsPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); $I->see('New Condition', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderStatusGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminOrderStatusGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderStatusGrid); $I->see('Order Status', self::$adminPageTitle); } public function shouldBeOnTheAdminAddOrderStatusPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddOrderStatusPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderStatusPage); $I->see('Create New Order Status', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxRulesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxRulesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxRulesGrid); $I->see('Tax Rules', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxRuleForIdPage($taxRuleId, $taxRuleName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); $I->see($taxRuleName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddTaxRulePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddTaxRulePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddTaxRulePage); $I->see('New Tax Rule', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxZonesAndRatesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); $I->see('Tax Zones and Rates', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxZoneAndRateForIdPage($taxZoneAndRateId, $taxIdentifier) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); $I->see($taxIdentifier, self::$adminPageTitle); } public function shouldBeOnTheAdminAddTaxZoneAndRatePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); $I->see('New Tax Rate', self::$adminPageTitle); } public function shouldBeOnTheAdminCurrencyRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCurrencyRatesPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCurrencyRatesPage); $I->see('Currency Rates', self::$adminPageTitle); } public function shouldBeOnTheAdminCurrencySymbolsPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCurrencySymbolsPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCurrencySymbolsPage); $I->see('Currency Symbols', self::$adminPageTitle); } public function shouldBeOnTheAdminProductAttributesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductAttributesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductAttributesGrid); $I->see('Product Attributes', self::$adminPageTitle); } public function shouldBeOnTheAdminProductAttributeForIdPage($productAttributeId, $productAttributeDefaultLabel) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); $I->see($productAttributeDefaultLabel, self::$adminPageTitle); } public function shouldBeOnTheAdminAddProductAttributePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddProductAttributePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddProductAttributePage); $I->see('New Product Attribute', self::$adminPageTitle); } public function shouldBeOnTheAdminAttributeSetsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAttributeSetsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAttributeSetsGrid); $I->see('Attribute Sets', self::$adminPageTitle); } public function shouldBeOnTheAdminAttributeSetByIdPage($attributeSetId, $attributeSetName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); $I->see($attributeSetName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddAttributeSetPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddAttributeSetPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddAttributeSetPage); $I->see('New Attribute Set', self::$adminPageTitle); } public function shouldBeOnTheAdminRatingsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminRatingsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRatingsGrid); $I->see('Ratings', self::$adminPageTitle); } public function shouldBeOnTheAdminRatingForIdPage($ratingId, $ratingDefaultValue) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); $I->see($ratingDefaultValue, self::$adminPageTitle); } public function shouldBeOnTheAdminAddRatingPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddRatingPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddRatingPage); $I->see('New Rating', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomerGroupsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerGroupsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerGroupsGrid); $I->see('Customer Groups', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomerGroupForIdPage($customerGroupId, $customerGroupName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); $I->see($customerGroupName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCustomerGroupPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomerGroupPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomerGroupPage); $I->see('New Customer Group', self::$adminPageTitle); } @@ -2138,42 +2138,42 @@ public function shouldBeOnTheAdminAddCustomerGroupPage() public function shouldBeOnTheAdminImportPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportPage); $I->see('Import', self::$adminPageTitle); } public function shouldBeOnTheAdminExportPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminExportPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminExportPage); $I->see('Export', self::$adminPageTitle); } public function shouldBeOnTheAdminImportAndExportTaxRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); $I->see('Import and Export Tax Rates', self::$adminPageTitle); } public function shouldBeOnTheAdminImportHistoryGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminImportHistoryGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportHistoryGrid); $I->see('Import History', self::$adminPageTitle); } public function shouldBeOnTheAdminIntegrationsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminIntegrationsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIntegrationsGrid); $I->see('Integrations', self::$adminPageTitle); } public function shouldBeOnTheAdminIntegrationForIdPage($integrationId, $integrationName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); $I->see('Edit', self::$adminPageTitle); $I->see($integrationName, self::$adminPageTitle); $I->see('Integration', self::$adminPageTitle); @@ -2182,125 +2182,125 @@ public function shouldBeOnTheAdminIntegrationForIdPage($integrationId, $integrat public function shouldBeOnTheAdminAddIntegrationPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddIntegrationPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddIntegrationPage); $I->see('New Integration', self::$adminPageTitle); } public function shouldBeOnTheAdminCacheManagementGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCacheManagementGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCacheManagementGrid); $I->see('Cache Management', self::$adminPageTitle); } public function shouldBeOnTheAdminBackupsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminBackupsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBackupsGrid); $I->see('Backups', self::$adminPageTitle); } public function shouldBeOnTheAdminIndexManagementGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminIndexManagementGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIndexManagementGrid); $I->see('Index Management', self::$adminPageTitle); } public function shouldBeOnTheAdminWebSetupWizardPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminWebSetupWizardPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWebSetupWizardPage); $I->see('Setup Wizard', self::$adminPageTitle); } public function shouldBeOnTheAdminAllUsersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAllUsersGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllUsersGrid); $I->see('Users', self::$adminPageTitle); } public function shouldBeOnTheAdminUserForIdPage($userId, $userFirstAndLastName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserByIdPage . $userId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserByIdPage . $userId)); $I->see($userFirstAndLastName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddUserPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddNewUserPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewUserPage); $I->see('New User', self::$adminPageTitle); } public function shouldBeOnTheAdminLockedUsersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminLockedUsersGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLockedUsersGrid); $I->see('Locked Users', self::$adminPageTitle); } public function shouldBeOnTheAdminUserRolesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserRolesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserRolesGrid); $I->see('Roles', self::$adminPageTitle); } public function shouldBeOnTheAdminUserRoleForIdPage($userRoleId, $userRoleName) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); $I->see($userRoleName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddUserRolePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddUserRolePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddUserRolePage); $I->see('New Role', self::$adminPageTitle); } public function shouldBeOnTheAdminNotificationsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminNotificationsGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNotificationsGrid); $I->see('Notifications', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomVariablesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomVariablesGrid); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomVariablesGrid); $I->see('Custom Variables', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomVariableForId($customVariableId, $customVariableCode) { $I = $this; - $I->seeInCurrentUrl((\Magento\Xxyyzz\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); + $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); $I->see($customVariableCode, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCustomVariablePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminAddCustomVariablePage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomVariablePage); $I->see('New Custom Variable', self::$adminPageTitle); } public function shouldBeOnTheAdminEncryptionKeyPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminEncryptionKeyPage); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEncryptionKeyPage); $I->see('Encryption Key', self::$adminPageTitle); } public function shouldBeOnTheAdminFindPartnersAndExtensionsPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\Xxyyzz\Helper\AdminUrlList::$adminFindPartnersAndExtensions); + $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminFindPartnersAndExtensions); $I->see('Magento Marketplace', self::$adminPageTitle); } } diff --git a/lib/Magento/TestFramework/System/Code/ClassReader.php b/src/Magento/AcceptanceTestFramework/System/Code/ClassReader.php similarity index 96% rename from lib/Magento/TestFramework/System/Code/ClassReader.php rename to src/Magento/AcceptanceTestFramework/System/Code/ClassReader.php index 30aed2340..15c8de9ec 100644 --- a/lib/Magento/TestFramework/System/Code/ClassReader.php +++ b/src/Magento/AcceptanceTestFramework/System/Code/ClassReader.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\System\Code; +namespace Magento\AcceptanceTestFramework\System\Code; /** * Class ClassReader diff --git a/lib/Magento/TestFramework/Util/Iterator/AbstractIterator.php b/src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php similarity index 97% rename from lib/Magento/TestFramework/Util/Iterator/AbstractIterator.php rename to src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php index d598cad2c..a453b534c 100644 --- a/lib/Magento/TestFramework/Util/Iterator/AbstractIterator.php +++ b/src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Util\Iterator; +namespace Magento\AcceptanceTestFramework\Util\Iterator; /** * Class AbstractIterator diff --git a/lib/Magento/TestFramework/Util/Iterator/File.php b/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php similarity index 94% rename from lib/Magento/TestFramework/Util/Iterator/File.php rename to src/Magento/AcceptanceTestFramework/Util/Iterator/File.php index c915f6dd8..f2fad3fff 100644 --- a/lib/Magento/TestFramework/Util/Iterator/File.php +++ b/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Util\Iterator; +namespace Magento\AcceptanceTestFramework\Util\Iterator; /** * Class File diff --git a/lib/Magento/TestFramework/Util/ModuleResolver.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php similarity index 89% rename from lib/Magento/TestFramework/Util/ModuleResolver.php rename to src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php index 886cec5fe..1b0c407e4 100644 --- a/lib/Magento/TestFramework/Util/ModuleResolver.php +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\TestFramework\Util; +namespace Magento\AcceptanceTestFramework\Util; /** * Class ModuleResolver, resolve module path. @@ -48,7 +48,7 @@ private function __construct() */ public function getModulesPath() { - $modulePath = BP . '/src/Magento/Xxyyzz/Page'; + $modulePath = BP . '/src/Magento/AcceptanceTestFramework/Page'; $allModulePaths = glob($modulePath . '/*'); return $allModulePaths; diff --git a/src/Magento/Xxyyzz/Page/Backend/etc/Page.xml b/src/Magento/Xxyyzz/Page/Backend/etc/Page.xml deleted file mode 100644 index 5741afd4e..000000000 --- a/src/Magento/Xxyyzz/Page/Backend/etc/Page.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml b/src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml deleted file mode 100644 index 1a070b223..000000000 --- a/src/Magento/Xxyyzz/Page/Catalog/etc/Page.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Magento/Xxyyzz/Page/Cms/etc/Page.xml b/src/Magento/Xxyyzz/Page/Cms/etc/Page.xml deleted file mode 100644 index ef2d39355..000000000 --- a/src/Magento/Xxyyzz/Page/Cms/etc/Page.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - From 9508811b64dea6fdf8f22f5bff9cce542440736b Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 9 Jun 2017 15:49:06 -0500 Subject: [PATCH 083/149] MQE-112: Implemented page objects (codeceptoin format) generator, which generates php codes based on page objects defined in xml in each magento modules. --- .gitignore | 2 +- bootstrap.php | 12 +- composer.json | 13 +- composer.lock | 492 +++----- entryPoint.php | 5 + etc/di.xml | 67 +- .../Config/FileResolver/Mask.php | 85 ++ .../Config/FileResolver/Primary.php | 6 +- .../Config/SchemaLocator.php | 4 +- .../Generate/AbstractGenerate.php | 188 +++ .../Generate/GeneratePage.php | 444 +++++++ .../Generate/GenerateResult.php | 105 ++ .../Generate/LauncherInterface.php | 15 + .../Module/MagentoWebDriver.php | 11 +- .../{AbstractAdminPage.php => AdminPage.php} | 43 +- .../Page/Backend/AdminLogin.php | 177 --- .../Page/Backend/AdminSideNavigation.php | 1023 ----------------- .../Page/Backend/etc/Page.xml | 8 - .../AdminGrid.php} | 35 +- .../Page/Block/Block.php | 97 ++ .../Page/Block/BlockFactory.php | 41 + .../Page/Block/BlockInterface.php | 15 + .../Page/Catalog/AdminCategoryPage.php | 121 -- .../Page/Catalog/AdminProductGridPage.php | 109 -- .../Page/Catalog/AdminProductPage.php | 193 ---- .../Page/Catalog/StorefrontCategoryPage.php | 93 -- .../Page/Catalog/StorefrontProductPage.php | 84 -- .../Page/Catalog/etc/Page.xml | 11 - .../Page/Cms/AdminCmsGrid.php | 62 - .../Page/Cms/AdminCmsPage.php | 476 -------- .../Page/Cms/StorefrontCmsPage.php | 25 - .../Page/Cms/etc/Page.xml | 11 - .../AdminConfigurableProductPage.php | 423 ------- .../Page/ConfigurableProduct/etc/Page.xml | 7 - .../Page/Customer/AdminCustomerGrid.php | 135 --- .../Page/Customer/AdminCustomerPage.php | 656 ----------- .../StorefrontCustomerAccountCreatePage.php | 84 -- ...StorefrontCustomerAccountDashboardPage.php | 87 -- .../StorefrontCustomerAccountLoginPage.php | 64 -- .../Page/Customer/etc/Page.xml | 7 - .../Page/ExternalPage.php | 18 + ...tractFrontendPage.php => FrontendPage.php} | 43 +- .../AcceptanceTestFramework/Page/Page.php | 144 +++ .../Page/PageInterface.php | 26 + .../Page/Sales/AdminOrderAddPage.php | 949 --------------- .../Page/Sales/AdminOrderDetailsPage.php | 510 -------- .../Page/Sales/AdminOrderGrid.php | 97 -- .../Page/Sales/Invoice/AdminInvoiceGrid.php | 102 -- .../Page/Sales/Shipment/AdminShipmentGrid.php | 81 -- .../Page/Sales/etc/Page.xml | 10 - .../Page/etc/pageObject.xsd | 18 +- .../Util/ModuleResolver.php | 188 ++- .../Util/ModuleResolver/SequenceSorter.php | 19 + .../SequenceSorterInterface.php | 16 + 54 files changed, 1673 insertions(+), 6084 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php create mode 100644 src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php create mode 100644 src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php create mode 100644 src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php create mode 100644 src/Magento/AcceptanceTestFramework/Generate/LauncherInterface.php rename src/Magento/AcceptanceTestFramework/Page/{AbstractAdminPage.php => AdminPage.php} (85%) delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Backend/AdminLogin.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Backend/AdminSideNavigation.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Backend/etc/Page.xml rename src/Magento/AcceptanceTestFramework/Page/{AdminGridPage.php => Block/AdminGrid.php} (94%) create mode 100644 src/Magento/AcceptanceTestFramework/Page/Block/Block.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/Block/BlockFactory.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/Block/BlockInterface.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Catalog/AdminCategoryPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Catalog/AdminProductGridPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Catalog/AdminProductPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Catalog/StorefrontCategoryPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Catalog/StorefrontProductPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Catalog/etc/Page.xml delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsGrid.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Cms/StorefrontCmsPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Cms/etc/Page.xml delete mode 100644 src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/AdminConfigurableProductPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/etc/Page.xml delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerGrid.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountCreatePage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountDashboardPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountLoginPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Customer/etc/Page.xml create mode 100644 src/Magento/AcceptanceTestFramework/Page/ExternalPage.php rename src/Magento/AcceptanceTestFramework/Page/{AbstractFrontendPage.php => FrontendPage.php} (55%) create mode 100644 src/Magento/AcceptanceTestFramework/Page/Page.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/PageInterface.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderAddPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderDetailsPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderGrid.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Sales/Invoice/AdminInvoiceGrid.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Sales/Shipment/AdminShipmentGrid.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Sales/etc/Page.xml create mode 100644 src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php create mode 100644 src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorterInterface.php diff --git a/.gitignore b/.gitignore index 8091249d3..ed0d4c119 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .idea composer.phar -vendor/* +vendor/* \ No newline at end of file diff --git a/bootstrap.php b/bootstrap.php index 63dd7060e..2404df1ba 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,11 +1,11 @@ load(); + +$objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); diff --git a/composer.json b/composer.json index 20a371ea7..4f6348c33 100755 --- a/composer.json +++ b/composer.json @@ -1,17 +1,20 @@ { - "name": "magento/acceptance-test-framework", + "name": "magento/magento2-acceptance-test-framework", "type": "library", "description": "Magento Acceptance Testing Framework", "keywords": ["magento", "automation", "acceptance", "testing"], "require": { - "php": ">=7.0", - "codeception/codeception": "~2.2|2.3", + "php": "~7.0", + "codeception/codeception": "2.2|2.3", "flow/jsonpath": ">0.2", - "fzaninotto/faker": "^1.6" + "fzaninotto/faker": "^1.6", + "vlucas/phpdotenv": "~2.4" }, "autoload": { "psr-4": { - "Magento\\AcceptanceTestFramework\\": "src/Magento/AcceptanceTestFramework" + "Magento\\AcceptanceTestFramework\\": [ + "src/Magento/AcceptanceTestFramework" + ] } } } diff --git a/composer.lock b/composer.lock index b2e0113c3..5414dec1c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "cf76c055cde25733e922c75ad3d479a5", - "content-hash": "ace050b01aa009d3ee82eb5bc4a02cf1", + "hash": "f94a316ccaf873e9783bddf79366b003", + "content-hash": "24d3de389360bc5bbca6f844131f99c4", "packages": [ { "name": "behat/gherkin", @@ -68,16 +68,16 @@ }, { "name": "codeception/codeception", - "version": "2.3.2", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "1ebec015a322d66952f69954551d513984f02d14" + "reference": "b54eaf4007484f36145c1dc8c64da1874adbc340" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/1ebec015a322d66952f69954551d513984f02d14", - "reference": "1ebec015a322d66952f69954551d513984f02d14", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b54eaf4007484f36145c1dc8c64da1874adbc340", + "reference": "b54eaf4007484f36145c1dc8c64da1874adbc340", "shasum": "" }, "require": { @@ -89,7 +89,7 @@ "guzzlehttp/psr7": "~1.0", "php": ">=5.4.0 <8.0", "phpunit/php-code-coverage": ">=2.2.4 <6.0", - "phpunit/phpunit": ">4.8.20 <7.0", + "phpunit/phpunit": ">4.8.20 <6.0", "phpunit/phpunit-mock-objects": ">2.3 <5.0", "sebastian/comparator": ">1.1 <3.0", "sebastian/diff": "^1.4", @@ -136,11 +136,7 @@ "psr-4": { "Codeception\\": "src\\Codeception", "Codeception\\Extension\\": "ext" - }, - "files": [ - "shim.php", - "phpunit5-loggers.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -162,7 +158,7 @@ "functional testing", "unit testing" ], - "time": "2017-05-27 00:46:03" + "time": "2017-05-22 23:47:35" }, { "name": "doctrine/instantiator", @@ -579,108 +575,6 @@ ], "time": "2017-04-12 18:52:22" }, - { - "name": "phar-io/manifest", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^1.0.1", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05 18:14:27" - }, - { - "name": "phar-io/version", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2017-03-05 17:38:23" - }, { "name": "phpdocumentor/reflection-common", "version": "1.0", @@ -892,41 +786,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.2.1", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "dc421f9ca5082a0c0cb04afb171c765f79add85b" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/dc421f9ca5082a0c0cb04afb171c765f79add85b", - "reference": "dc421f9ca5082a0c0cb04afb171c765f79add85b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", + "php": "^5.6 || ^7.0", "phpunit/php-file-iterator": "^1.3", "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.11 || ^2.0", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^3.0", - "sebastian/version": "^2.0", - "theseer/tokenizer": "^1.1" + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" }, "require-dev": { - "ext-xdebug": "^2.5", - "phpunit/phpunit": "^6.0" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-xdebug": "^2.5.3" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -952,7 +845,7 @@ "testing", "xunit" ], - "time": "2017-04-21 08:03:57" + "time": "2017-04-02 07:44:40" }, { "name": "phpunit/php-file-iterator", @@ -1142,16 +1035,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.1.4", + "version": "5.7.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "42b7f394a8e009516582331b1e03a1aba40175d1" + "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/42b7f394a8e009516582331b1e03a1aba40175d1", - "reference": "42b7f394a8e009516582331b1e03a1aba40175d1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3cb94a5f8c07a03c8b7527ed7468a2926203f58b", + "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b", "shasum": "" }, "require": { @@ -1160,35 +1053,33 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.3", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.2", - "phpunit/php-file-iterator": "^1.4", - "phpunit/php-text-template": "^1.2", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^4.0", - "sebastian/comparator": "^2.0", - "sebastian/diff": "^1.4.3 || ^2.0", - "sebastian/environment": "^3.0.2", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^1.1 || ^2.0", - "sebastian/object-enumerator": "^3.0.2", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0" + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0.3|~2.0", + "symfony/yaml": "~2.1|~3.0" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpdocumentor/reflection-docblock": "3.0.2" }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "~1.1" }, "bin": [ "phpunit" @@ -1196,7 +1087,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1.x-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -1222,33 +1113,33 @@ "testing", "xunit" ], - "time": "2017-05-22 07:45:30" + "time": "2017-05-22 07:42:55" }, { "name": "phpunit/phpunit-mock-objects", - "version": "4.0.1", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "eabce450df194817a7d7e27e19013569a903a2bf" + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/eabce450df194817a7d7e27e19013569a903a2bf", - "reference": "eabce450df194817a7d7e27e19013569a903a2bf", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": "^7.0", + "php": "^5.6 || ^7.0", "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^3.0" + "sebastian/exporter": "^1.2 || ^2.0" }, "conflict": { - "phpunit/phpunit": "<6.0" + "phpunit/phpunit": "<5.4.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^5.4" }, "suggest": { "ext-soap": "*" @@ -1256,7 +1147,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { @@ -1281,7 +1172,7 @@ "mock", "xunit" ], - "time": "2017-03-03 06:30:20" + "time": "2016-12-08 20:27:08" }, { "name": "psr/http-message", @@ -1427,30 +1318,30 @@ }, { "name": "sebastian/comparator", - "version": "2.0.0", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "20f84f468cb67efee293246e6a09619b891f55f0" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/20f84f468cb67efee293246e6a09619b891f55f0", - "reference": "20f84f468cb67efee293246e6a09619b891f55f0", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^1.2", - "sebastian/exporter": "^3.0" + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1487,7 +1378,7 @@ "compare", "equality" ], - "time": "2017-03-03 06:26:08" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", @@ -1543,28 +1434,28 @@ }, { "name": "sebastian/environment", - "version": "3.0.3", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3" + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3", - "reference": "02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1589,34 +1480,34 @@ "environment", "hhvm" ], - "time": "2017-05-18 10:10:00" + "time": "2016-11-26 07:53:53" }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1656,27 +1547,27 @@ "export", "exporter" ], - "time": "2017-04-03 13:19:02" + "time": "2016-11-19 08:54:04" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.2" }, "suggest": { "ext-uopz": "*" @@ -1684,7 +1575,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1707,34 +1598,33 @@ "keywords": [ "global state" ], - "time": "2017-04-27 15:39:26" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/object-enumerator", - "version": "3.0.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8" + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/31dd3379d16446c5d86dec32ab1ad1f378581ad8", - "reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.0", - "sebastian/recursion-context": "^3.0" + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1754,77 +1644,32 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-03-12 15:17:29" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29 09:07:27" + "time": "2017-02-18 15:18:39" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1852,7 +1697,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03 06:23:57" + "time": "2016-11-19 07:33:16" }, { "name": "sebastian/resource-operations", @@ -1986,7 +1831,7 @@ }, { "name": "symfony/browser-kit", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -2043,16 +1888,16 @@ }, { "name": "symfony/console", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c80e63f3f5e3a331bfc25e6e9332b10422eb9b05" + "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c80e63f3f5e3a331bfc25e6e9332b10422eb9b05", - "reference": "c80e63f3f5e3a331bfc25e6e9332b10422eb9b05", + "url": "https://api.github.com/repos/symfony/console/zipball/70d2a29b2911cbdc91a7e268046c395278238b2e", + "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e", "shasum": "" }, "require": { @@ -2065,6 +1910,7 @@ }, "require-dev": { "psr/log": "~1.0", + "symfony/config": "~3.3", "symfony/dependency-injection": "~3.3", "symfony/event-dispatcher": "~2.8|~3.0", "symfony/filesystem": "~2.8|~3.0", @@ -2107,11 +1953,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-05-28 14:08:56" + "time": "2017-06-02 19:24:58" }, { "name": "symfony/css-selector", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2164,16 +2010,16 @@ }, { "name": "symfony/debug", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "ef5f19a7a68075a0bd05969a329ead3b0776fb7a" + "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/ef5f19a7a68075a0bd05969a329ead3b0776fb7a", - "reference": "ef5f19a7a68075a0bd05969a329ead3b0776fb7a", + "url": "https://api.github.com/repos/symfony/debug/zipball/e9c50482841ef696e8fa1470d950a79c8921f45d", + "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d", "shasum": "" }, "require": { @@ -2216,11 +2062,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-05-27 16:02:27" + "time": "2017-06-01 21:01:25" }, { "name": "symfony/dom-crawler", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -2276,16 +2122,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a9f8b02b0ef07302eca92cd4bba73200b7980e9c" + "reference": "4054a102470665451108f9b59305c79176ef98f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a9f8b02b0ef07302eca92cd4bba73200b7980e9c", - "reference": "a9f8b02b0ef07302eca92cd4bba73200b7980e9c", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4054a102470665451108f9b59305c79176ef98f0", + "reference": "4054a102470665451108f9b59305c79176ef98f0", "shasum": "" }, "require": { @@ -2335,20 +2181,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-05-04 12:23:07" + "time": "2017-06-04 18:15:29" }, { "name": "symfony/finder", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "30cb2a2c09627823a7243638dd456de4e2748fed" + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/30cb2a2c09627823a7243638dd456de4e2748fed", - "reference": "30cb2a2c09627823a7243638dd456de4e2748fed", + "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4", + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", "shasum": "" }, "require": { @@ -2384,20 +2230,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-05-25 23:10:31" + "time": "2017-06-01 21:01:25" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "reference": "f29dca382a6485c3cbe6379f0c61230167681937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937", "shasum": "" }, "require": { @@ -2409,7 +2255,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -2443,11 +2289,11 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2017-06-09 14:24:12" }, { "name": "symfony/process", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2496,16 +2342,16 @@ }, { "name": "symfony/yaml", - "version": "v3.3.0", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "885db865f6b2b918404a1fae28f9ac640f71f994" + "reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/885db865f6b2b918404a1fae28f9ac640f71f994", - "reference": "885db865f6b2b918404a1fae28f9ac640f71f994", + "url": "https://api.github.com/repos/symfony/yaml/zipball/9752a30000a8ca9f4b34b5227d15d0101b96b063", + "reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063", "shasum": "" }, "require": { @@ -2547,47 +2393,57 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-28 10:56:20" + "time": "2017-06-02 22:05:06" }, { - "name": "theseer/tokenizer", - "version": "1.1.0", + "name": "vlucas/phpdotenv", + "version": "v2.4.0", "source": { "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", + "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Dotenv\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "BSD-3-Clause-Attribution" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "http://www.vancelucas.com" } ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07 12:08:54" + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "time": "2016-09-01 10:05:43" }, { "name": "webmozart/assert", @@ -2647,7 +2503,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0" + "php": "~7.0" }, "platform-dev": [] } diff --git a/entryPoint.php b/entryPoint.php index 50bfdc756..9f7d4417e 100644 --- a/entryPoint.php +++ b/entryPoint.php @@ -1,5 +1,10 @@ - + + - - - - developer - - + - - - data - - - - - converterArgumentParser - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite - data - - @@ -52,23 +36,41 @@ Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite + + + developer + + + + + converterArgumentParser + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite + data + + + + + + Magento\AcceptanceTestFramework\Page\Config\Data + + + + + + Magento\AcceptanceTestFramework\Page\Config\Data + + + Magento\AcceptanceTestFramework\Data\Argument\Interpreter\ArrayType - - - - Magento\AcceptanceTestFramework\Config\Reader\Page - - - Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd @@ -76,7 +78,7 @@ - Magento\AcceptanceTestFramework\Config\FileResolver\Module + Magento\AcceptanceTestFramework\Config\FileResolver\Mask Magento\AcceptanceTestFramework\Config\Converter Magento\AcceptanceTestFramework\Config\SchemaLocator\Page @@ -84,14 +86,13 @@ name name - Page.xml - etc + #\.xml$# + Page - - + - Magento\AcceptanceTestFramework\Page\Config\Data + Magento\AcceptanceTestFramework\Config\Reader\Page - + diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php new file mode 100644 index 000000000..371e2c25a --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php @@ -0,0 +1,85 @@ +moduleResolver = $moduleResolver; + } else { + $this->moduleResolver = ModuleResolver::getInstance(); + } + } + + /** + * Retrieve the list of configuration files with given name that relate to specified scope + * + * @param string $filename + * @param string $scope + * @return array|\Iterator,\Countable + */ + public function get($filename, $scope) + { + $paths = $this->getFileCollection($filename, $scope); + + return new File($paths); + } + + /** + * Get scope of paths. + * + * @param string $filename + * @param string $scope + * @return array + */ + protected function getFileCollection($filename, $scope) + { + $paths = []; + $modulesPath = $this->moduleResolver->getModulesPath(); + + foreach ($modulesPath as $modulePath) { + $path = $modulePath; + if (is_readable($path)) { + $directoryIterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator( + $path, + \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS + ) + ); + $regexpIterator = new \RegexIterator($directoryIterator, $filename); + /** @var \SplFileInfo $file */ + foreach ($regexpIterator as $file) { + if ($file->isFile() && $file->isReadable()) { + $paths[] = $file->getRealPath(); + } + } + } + } + + return $this->moduleResolver->sortFilesByModuleSequence($paths); + } +} diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php index aa6b57b4f..ce5917e7d 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php @@ -57,7 +57,7 @@ private function getFilePaths($filename, $scope) */ private function getPathPatterns($filename, $scope) { - if (substr($scope, 0, strlen(BP)) === BP) { + if (substr($scope, 0, strlen(FW_BP)) === FW_BP) { $patterns = [ $scope . '/' . $filename, $scope . '/*/' . $filename @@ -68,8 +68,8 @@ private function getPathPatterns($filename, $scope) $patterns = [ $defaultPath . '/' . $scope . '/' . $filename, $defaultPath . '/' . $scope . '/*/' . $filename, - BP . '/' . $scope . '/' . $filename, - BP . '/' . $scope . '/*/' . $filename + FW_BP . '/' . $scope . '/' . $filename, + FW_BP . '/' . $scope . '/*/' . $filename ]; } return str_replace('/', DIRECTORY_SEPARATOR, $patterns); diff --git a/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php b/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php index befa3378c..757ee52b5 100644 --- a/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php +++ b/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php @@ -26,8 +26,8 @@ class SchemaLocator implements \Magento\AcceptanceTestFramework\Config\SchemaLoc */ public function __construct($schemaPath) { - if (constant('BP') && file_exists(BP . '/' . $schemaPath)) { - $this->schemaPath = BP . '/' . $schemaPath; + if (constant('FW_BP') && file_exists(FW_BP . '/' . $schemaPath)) { + $this->schemaPath = FW_BP . '/' . $schemaPath; } else { $path = dirname(dirname(dirname(__DIR__))); $path = str_replace('\\', '/', $path); diff --git a/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php b/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php new file mode 100644 index 000000000..2d7b6bdeb --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php @@ -0,0 +1,188 @@ +objectManager = $objectManager; + $this->configData = $configData; + } + + /** + * Generate single class. + * + * @param string $className + * @return string|bool + */ + abstract public function generate($className); + + /** + * Convert class name to camel-case. + * + * @param string $class + * @return string + */ + protected function toCamelCase($class) + { + $class = str_replace('_', ' ', $class); + $class = str_replace('\\', ' ', $class); + $class = str_replace('/', ' ', $class); + + return str_replace(' ', '', ucwords($class)); + } + + /** + * Prepare data for phpdoc attribute "copyright". + * + * @return string + */ + protected function getCopyright() + { + return 'Copyright © 2017 Magento. All rights reserved.'; + } + + /** + * Prepare data for phpdoc attribute "license". + * + * @return string + */ + protected function getLicenseNote() + { + return 'See COPYING.txt for license details.'; + } + + /** + * Get file phpdoc with license and copyright information. + * + * @return string + */ + protected function getFilePhpDoc() + { + $content = "/**\n"; + $content .= " * " . $this->getCopyright() . "\n"; + $content .= " * " . $this->getLicenseNote() . "\n"; + $content .= " */\n\n"; + return $content; + } + + /** + * Add error message. + * + * @param string $message + * @return void + */ + protected function addError($message) + { + $this->errors[] = $message; + } + + /** + * Get list of occurred errors. + * + * @return string[] + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Get short class name based on full class name. + * + * @param string $class + * @return string + */ + protected function getShortClassName($class) + { + $classNameArray = explode('\\', $class); + return end($classNameArray); + } + + /** + * Get namespace class name based on full class name. + * + * @param string $class + * @return string + */ + protected function getNamespace($class) + { + $classNameArray = explode('\\', $class); + return implode("\\", array_slice($classNameArray, 0, -1)); + } + + /** + * Create class with specified content. + * + * @param string $class + * @param string $content + * @return string + */ + protected function createClass($class, $content) + { + $fileName = $this->getShortClassName($class) . '.php'; + $relativeFilePath = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; + $relativeFolderPath = str_replace(DIRECTORY_SEPARATOR . $fileName, '', $relativeFilePath); + + $filePath = TESTS_BP . '/generated/' . $relativeFilePath; + if (file_exists($filePath)) { + unlink($filePath); + } + + $folderPath = TESTS_BP . '/generated/' . $relativeFolderPath; + if (!is_dir($folderPath)) { + mkdir($folderPath, 0777, true); + } + + $result = @file_put_contents($filePath, $content); + + if ($result === false) { + $error = error_get_last(); + $this->addError(sprintf('Unable to generate %s class. Error: %s', $class, $error['message'])); + return false; + } + + $this->cnt++; + + return $filePath; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php b/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php new file mode 100644 index 000000000..d958290db --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php @@ -0,0 +1,444 @@ +cnt = 0; + + foreach ($this->configData->get('page') as $name => $data) { + $this->generateClass($name, $data); + } + + \Magento\AcceptanceTestFramework\Generate\GenerateResult::addResult('Page Classes', $this->cnt); + } + + /** + * Generate single page class. + * + * @param string $className + * @return string|bool + * @throws \InvalidArgumentException + */ + public function generate($className) + { + $classNameParts = explode('\\', $className); + $classDataKey = 'page/' . end($classNameParts); + + if (!$this->configData->get($classDataKey)) { + throw new \InvalidArgumentException('Invalid class name: ' . $className); + } + + return $this->generateClass( + end($classNameParts), $this->configData->get($classDataKey) + ); + } + + /** + * Generate page class from XML source. + * + * @param string $name + * @param array $data + * @return string|bool + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + protected function generateClass($name, array $data) + { + $className = ucfirst($name); + $mca = isset($data['mca']) ? $data['mca'] : ''; + $area = isset($data['area']) ? $data['area'] : ''; + $areaPage = $this->getParentPage($area, $mca); + $folderPath = str_replace('_', '/AcceptanceTest/', $data['module']) . '/Page'; + $folderPath .= (empty($area) ? '' : ('/' . $area)); + $class = str_replace('/', '\\', $folderPath . '/' . $className); + $blocks = isset($data['block']) ? $data['block'] : []; + + $content = "getFilePhpDoc(); + $content .= "namespace {$this->getNamespace($class)};\n\n"; + $content .= "use Magento\\AcceptanceTestFramework\\Page\\{$areaPage};\n\n"; + + $content .= "/**\n"; + $content .= " * Class {$className}\n"; + $content .= " */\n"; + $content .= "class {$className} extends {$areaPage}\n"; + $content .= "{\n"; + $content .= " const MCA = '{$mca}';\n\n"; + + + $content .= " /**\n"; + $content .= " * Blocks' config\n"; + $content .= " *\n"; + $content .= " * @var array\n"; + $content .= " */\n"; + $content .= " protected \$blocks = [\n"; + foreach ($blocks as $blockName => $block) { + $block['class'] = $block['class'] . '\\' . ucfirst($blockName); + + $blocks[$blockName]['class'] = $block['class']; + $this->generateBlock($blockName, $block); + $content .= $this->generatePageClassBlock($blockName, $block, ' '); + } + $content .= " ];\n"; + + foreach ($blocks as $blockName => $block) { + $content .= "\n /**\n"; + $content .= " * @return \\" . $block['class'] . "\n"; + $content .= " */\n"; + $content .= ' public function get' . ucfirst($blockName) . '()' . "\n"; + $content .= " {\n"; + $content .= " return \$this->getBlockInstance('{$blockName}');\n"; + $content .= " }\n"; + } + + $content .= "}\n"; + + return $this->createClass($class, $content); + } + + /** + * Generate block for page class. + * + * @param string $blockName + * @param array $params + * @param string $indent + * @return string + */ + protected function generatePageClassBlock($blockName, array $params, $indent = '') + { + $content = $indent . "'{$blockName}' => [\n"; + foreach ($params as $key => $value) { + if (is_array($value)) { + $content .= $this->generatePageClassBlock($key, $value, $indent . ' '); + } else { + $escaped = str_replace('\'', '"', $value); + $content .= $indent . " '{$key}' => '{$escaped}',\n"; + } + } + $content .= $indent . "],\n"; + + return $content; + } + + /** + * Determine parent page class. + * + * @param string $area + * @param string $mca + * @return string + */ + protected function getParentPage($area, $mca) + { + if (strpos($area, 'Adminhtml') === false) { + if (strpos($mca, 'http') === false) { + $areaPage = 'FrontendPage'; + } else { + $areaPage = 'ExternalPage'; + } + } else { + $areaPage = 'AdminPage'; + } + return $areaPage; + } + + /** + * Generate block class from XML source. + * + * @param string $blockName + * @param array $block + * @return string|bool + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + protected function generateBlock($blockName, array $block) + { + $className = ucfirst($blockName); + $parentClass = "Magento\\AcceptanceTestFramework\\Page\\Block\\Block"; + if (isset($block['parent_class'])) { + $parentClass = $block['parent_class']; + } + $parentClassName = $this->getShortClassName($parentClass); + + $content = "getFilePhpDoc(); + $content .= "namespace {$this->getNamespace($block['class'])};\n\n"; + $content .= "use {$parentClass};\n\n"; + $content .= "/**\n"; + $content .= " * Class {$className}\n"; + $content .= " */\n"; + $content .= "class {$className} extends {$parentClassName}\n"; + $content .= "{\n"; + + if (isset($block['element'])) { + $elements = $block['element']; + foreach ($elements as $element => $attributes) { + $attributes['locator'] = str_replace('\'', '"', $attributes['locator']); + /** + * Generate contents: + * public static $productName = '.admin__field[data-index=name] input'; + */ + $content .= " public static $$element = '" . $attributes['locator'] . "';\n"; + } + foreach ($elements as $element => $attributes) { + switch ($attributes['type']) { + case 'input': + $content .= $this->generateCodeForInputAction($element, $attributes); + break; + case 'text': + $content .= $this->generateCodeForTextAction($element, $attributes); + break; + case 'button': + $content .= $this->generateCodeForButtonAction($element, $attributes); + break; + case 'checkbox': + $content .= $this->generateCodeForCheckboxAction($element, $attributes); + break; + case 'radio': + $content .= $this->generateCodeForRadioAction($element, $attributes); + break; + case 'select': + $content .= $this->generateCodeForSelectAction($element, $attributes); + break; + case 'multiselect': + $content .= $this->generateCodeForMultiSelectAction($element, $attributes); + break; + default: + break; + } + } + } + $content .= "}\n"; + + return $this->createClass($block['class'], $content); + } + + /** + * Generate code for input action; and + * generate code for asserting value in input field; and + * generate code for returning text from input field; and + * generate waitForPageLoad() if it's needed. + * + * public function fillFieldProductName($value) + * { + * $this->acceptanceTester->fillField(self::$productName, $value); + * } + * + * public function seeProductName($expectedValue) + * { + * $this->acceptanceTester->seeInField(self::$productName, $expectedValue); + * } + * + * public function grabTextFromProductName($expectedValue) + * { + * $result = $this->acceptanceTester->grabTextFrom(self::$productName); + * return $result; + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForInputAction($element, $attributes) + { + $waitRequired = false; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $waitRequired = true; + } + + $content = "\n"; + $content .= " public function fillField" . ucfirst($element). "(\$value)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->fillField(self::$$element, \$value);\n"; + if ($waitRequired) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + + $content .= "\n"; + $content .= " public function seeInField" . ucfirst($element). "(\$expectedValue)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->seeInField(self::$$element, \$expectedValue);\n"; + if ($waitRequired) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + + $content .= "\n"; + $content .= " public function grabTextFrom" . ucfirst($element). "()\n"; + $content .= " {\n"; + $content .= " \$result = \$this->acceptanceTester->grabTextFrom(self::$$element);\n"; + if ($waitRequired) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " return \$result;\n"; + $content .= " }\n"; + return $content; + } + + /** + * Generate code for returning text from text field; and generate waitForPageLoad() if it's needed. + * + * public function grabTextFromProductName($expectedValue) + * { + * $result = $this->acceptanceTester->grabTextFrom(self::$productName); + * $this->acceptanceTester->waitForPageLoad(); + * return $result + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForTextAction($element, $attributes) + { + $content = "\n"; + $content .= " public function grabTextFrom" . ucfirst($element). "()\n"; + $content .= " {\n"; + $content .= " \$result = \$this->acceptanceTester->grabTextFrom(self::$$element);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " return \$result;\n"; + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing button action; and generate waitForPageLoad() if it's needed. + * + * public function clickButtonMyButton() + * { + * $this->acceptanceTester->click(self::$myButton); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForButtonAction($element, $attributes) + { + $content = "\n"; + $content .= " public function clickButton" . ucfirst($element). "()\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->click(self::$$element);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing checkbox action; and generate waitForPageLoad() if it's needed. + * + * public function clickCheckBoxMyCheckboxButton($optionsArray) + * { + * $this->acceptanceTester->checkOption(self::$myCheckboxButton, $optionsArray); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForCheckboxAction($element, $attributes) + { + $content = "\n"; + $content .= " public function clickCheckBox" . ucfirst($element). "(\$optionsArray)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->checkOption(self::$$element, \$optionsArray);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing radio button action; and generate waitForPageLoad() if it's needed. + * + * public function clickRadioButtonMyRadioButton($option) + * { + * $this->acceptanceTester->selectOption(self::$myRadioButton, $option); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForRadioAction($element, $attributes) + { + $content = "\n"; + $content .= " public function clickRadioButton" . ucfirst($element). "(\$option)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->selectOption(self::$$element, \$option);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing dropdown select action; and generate waitForPageLoad() if it's needed. + * + * public function selectOptionMySelectButton($option) + * { + * $this->acceptanceTester->selectOption(self::$mySelectButton, $option); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForSelectAction($element, $attributes) + { + $content = "\n"; + $content .= " public function selectOption" . ucfirst($element). "(\$option)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->selectOption(self::$$element, \$option);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing search and multi-select action; and generate waitForPageLoad() if it's needed. + * e.g. Categories multi-select element + * + * public function selectOptionMySelectButton($optionArray, $requireAction = false) + * { + * $this->acceptanceTester->searchAndMultiSelectOption(self::$mySelectButton, $optionArray, $requireAction = false); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForMultiSelectAction($element, $attributes) + { + $content = "\n"; + $content .= " public function clickCheckBox" . ucfirst($element). "(\$optionsArray)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->searchAndMultiSelectOption(self::$$element, \$optionsArray, \$requireAction = false);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php b/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php new file mode 100644 index 000000000..7e0b6012d --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php @@ -0,0 +1,105 @@ + $item, + 'count' => $count, + 'time' => $time + ]; + } + + /** + * Get generated results. + * + * @return array + */ + public static function getResults() + { + return self::$results; + } + + /** + * Display results. + * + * @return void + */ + public static function displayResults() + { + global $argv; + + $results = self::getResults(); + if (isset($argv)) { + $lengths = [ + 'item' => strlen('Item'), + 'count' => strlen('Count'), + 'time' => strlen('Time') + ]; + foreach ($results as $result) { + $lengths['item'] = max($lengths['item'], strlen($result['item'])); + $lengths['count'] = max($lengths['count'], strlen($result['count'])); + $lengths['time'] = max($lengths['time'], strlen($result['time'])); + } + echo "|| " . self::prepareForShell('Item', $lengths['item']); + echo " || " . self::prepareForShell('Count', $lengths['count']); + echo " || " . self::prepareForShell('Time', $lengths['time']) . " ||\n"; + foreach ($results as $result) { + echo "|| " . self::prepareForShell($result['item'], $lengths['item']); + echo " || " . self::prepareForShell($result['count'], $lengths['count']); + echo " || " . self::prepareForShell($result['time'], $lengths['time']) . " ||\n"; + } + echo "\n"; + } else { + echo ''; + foreach ($results as $result) { + echo ""; + } + echo "
ItemCountTime
{$result['item']}{$result['count']}{$result['time']}
"; + } + } + + /** + * Prepare results for shell output. + * + * @param string $string + * @param int $length + * @return string + */ + protected static function prepareForShell($string, $length) + { + $suffixLength = $length - strlen($string); + $suffix = ''; + for ($i = 0; $suffixLength > $i; $i++) { + $suffix .= ' '; + } + return $string . $suffix; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Generate/LauncherInterface.php b/src/Magento/AcceptanceTestFramework/Generate/LauncherInterface.php new file mode 100644 index 000000000..d33f0c4b7 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Generate/LauncherInterface.php @@ -0,0 +1,15 @@ +_findElements($locator); + } } diff --git a/src/Magento/AcceptanceTestFramework/Page/AbstractAdminPage.php b/src/Magento/AcceptanceTestFramework/Page/AdminPage.php similarity index 85% rename from src/Magento/AcceptanceTestFramework/Page/AbstractAdminPage.php rename to src/Magento/AcceptanceTestFramework/Page/AdminPage.php index 1364162f8..1760bdada 100644 --- a/src/Magento/AcceptanceTestFramework/Page/AbstractAdminPage.php +++ b/src/Magento/AcceptanceTestFramework/Page/AdminPage.php @@ -1,14 +1,15 @@ acceptanceTester = $I; - $this->pageLoadTimeout = $I->getConfiguration('pageload_timeout'); - } - - public static function of(AcceptanceTester $I) - { - return new static($I); - } - - /** - * Basic route example for your current URL - * You can append any additional parameter to URL - * and use it in tests like: Page\Edit::route('/123-post'); - */ - public static function route($param) + protected function initUrl() { - return static::$URL.$param; + $this->url = static::ADMIN_BASE_URL . static::MCA; } public function openTabGoToAndVerifyUrl($pageUrl) diff --git a/src/Magento/AcceptanceTestFramework/Page/Backend/AdminLogin.php b/src/Magento/AcceptanceTestFramework/Page/Backend/AdminLogin.php deleted file mode 100644 index f4a7c1064..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Backend/AdminLogin.php +++ /dev/null @@ -1,177 +0,0 @@ -acceptanceTester; - $I->click(self::$logoImage); - } - - public function clickOnForgotYourPassword() - { - $I = $this->acceptanceTester; - $I->click(self::$forgotYourPassword); - } - - public function clickOnSignIn() - { - $I = $this->acceptanceTester; - $I->click(self::$signIn); - } - - public function enterTheUsername($username) - { - $I = $this->acceptanceTester; - $I->fillField(self::$username, $username); - } - - public function enterThePassword($password) - { - $I = $this->acceptanceTester; - $I->fillField(self::$password, $password); - } - - public function enterTheLoginCredentials($username, $password) - { - $I = $this->acceptanceTester; - $this->enterTheUsername($username); - $this->enterThePassword($password); - } - - public function shouldSeeTheLoginMainArea() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$mainArea); - } - - public function shouldSeeTheLoginLogoLink() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$logoLink); - } - - public function shouldSeeTheLoginLogoImage() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$logoImage); - } - - public function shouldSeeTheLoginTitle() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$title); - } - - public function shouldSeeTheLoginUsernameTitle() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$usernameTitle); - } - - public function shouldSeeTheLoginUsernameField() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$username); - } - - public function shouldSeeTheLoginPasswordTitle() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$passwordTitle); - } - - public function shouldSeeTheLoginPasswordField() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$password); - } - - public function shouldSeeTheLoginForgotPasswordLink() - { - $I->seeElement(self::$forgotYourPassword); - } - - public function shouldSeeTheLoginSignInButton() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$signIn); - } - - public function shouldSeeTheLoginCopyrightText() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$copyRight); - } - - public function shouldSeeTheLoginPageFields() - { - $this->shouldSeeTheLoginMainArea(); - $this->shouldSeeTheLoginLogoLink(); - $this->shouldSeeTheLoginLogoImage(); - $this->shouldSeeTheLoginTitle(); - $this->shouldSeeTheLoginUsernameTitle(); - $this->shouldSeeTheLoginUsernameField(); - $this->shouldSeeTheLoginPasswordTitle(); - $this->shouldSeeTheLoginPasswordField(); - $this->shouldSeeTheLoginForgotPasswordLink(); - $this->shouldSeeTheLoginSignInButton(); - $this->shouldSeeTheLoginCopyrightText(); - } - - public function enterTheEmailAddress($emailAddress) - { - $I = $this->acceptanceTester; - $I->fillField(self::$emailAddress, $emailAddress); - } - - public function clickOnRetrievePassword() - { - $I = $this->acceptanceTester; - $I->click(self::$retrievePassword); - } - - public function clickOnBackToSignIn() - { - $I = $this->acceptanceTester; - $I->click(self::$backToSignIn); - } - - public function shouldSeeTheForgotYourPasswordFields() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$forgotPasswordMain); - $I->seeElement(self::$logoLink); - $I->seeElement(self::$logoImage); - $I->seeElement(self::$title); - $I->seeElement(self::$emailAddressTitle); - $I->seeElement(self::$emailAddress); - $I->seeElement(self::$retrievePassword); - $I->seeElement(self::$backToSignIn); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Backend/AdminSideNavigation.php b/src/Magento/AcceptanceTestFramework/Page/Backend/AdminSideNavigation.php deleted file mode 100644 index 7dac360e5..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Backend/AdminSideNavigation.php +++ /dev/null @@ -1,1023 +0,0 @@ -acceptanceTester; - $I->click(self::$dashboardButton); - $I->waitForPageLoad(); - } - - public function clickOnSalesInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$salesButton); - $I->waitForPageLoad(); - } - - public function clickOnOrdersInTheSalesNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$salesNavOrders); - $I->waitForPageLoad(); - } - - public function clickOnInvoicesInTheSalesNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$salesNavInvoices); - $I->waitForPageLoad(); - } - - public function clickOnShipmentsInTheSalesNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$salesNavShipments); - $I->waitForPageLoad(); - } - - public function clickOnCreditMemosInTheSalesNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$salesNavCreditMemos); - $I->waitForPageLoad(); - } - - public function clickOnBillingAgreementsInTheSalesNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$salesNavBillingAgreements); - $I->waitForPageLoad(); - } - - public function clickOnTransactionsInTheSalesNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$salesNavTransactions); - $I->waitForPageLoad(); - } - - public function clickOnProductsInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$productsButton); - $I->waitForPageLoad(); - } - - public function clickOnCatalogInTheProductNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$productNavCatalog); - $I->waitForPageLoad(); - } - - public function clickOnCategoriesInTheProductNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$productNavCategories); - $I->waitForPageLoad(); - } - - public function clickOnCustomersInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$customersButton); - $I->waitForPageLoad(); - } - - public function clickOnAllCustomersInTheCustomersNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$customersNavAllCustomers); - $I->waitForPageLoad(); - } - - public function clickOnNowOnlineInTheCustomersNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$customersNavNowOnline); - $I->waitForPageLoad(); - } - - public function clickOnMarketingInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingButton); - $I->waitForPageLoad(); - } - - public function clickOnCatalogPriceRulesInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavPromotionsCatalogPriceRule); - $I->waitForPageLoad(); - } - - public function clickOnCartPriceRulesInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavPromotionsCartPriceRules); - $I->waitForPageLoad(); - } - - public function clickOnEmailTemplatesInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavCommunicationsEmailTemplates); - $I->waitForPageLoad(); - } - - public function clickOnNewsletterTemplatesInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavCommunicationsNewsletterTemplates); - $I->waitForPageLoad(); - } - - public function clickOnNewsletterQueueInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavCommunicationsNewsletterQueue); - $I->waitForPageLoad(); - } - - public function clickOnNewsletterSubscribersInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavCommunicationsNewsletterSubscribers); - $I->waitForPageLoad(); - } - - public function clickOnURLRewritesInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavSEOSearchURLRewrites); - $I->waitForPageLoad(); - } - - public function clickOnSearchTermsInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavSEOSearchTerms); - $I->waitForPageLoad(); - } - - public function clickOnSearchSynonymsInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavSEOSearchSynonyms); - $I->waitForPageLoad(); - } - - public function clickOnSiteMapInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavSEOSearchSiteMap); - $I->waitForPageLoad(); - } - - public function clickOnContentReviewsInTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$marketingNavUserContentReviews); - $I->waitForPageLoad(); - } - - public function clickOnContentInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$contentButton); - $I->waitForPageLoad(); - } - - public function clickOnPagesInTheContentNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$contentNavElementsPages); - $I->waitForPageLoad(); - } - - public function clickOnBlocksInTheContentNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$contentNavElementsBlocks); - $I->waitForPageLoad(); - } - - public function clickOnWidgetsInTheContentNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$contentNavElementsWidgets); - $I->waitForPageLoad(); - } - - public function clickOnConfigurationInTheContentNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$contentNavDesignConfiguration); - $I->waitForPageLoad(); - } - - public function clickOnThemesInTheContentNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$contentNavDesignThemes); - $I->waitForPageLoad(); - } - - public function clickOnScheduleInTheContentNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$contentNavDesignSchedule); - $I->waitForPageLoad(); - } - - public function clickOnReportsInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsButton); - $I->waitForPageLoad(); - } - - public function clickOnProductsInCartInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavMarketingProductsInCart); - $I->waitForPageLoad(); - } - - public function clickOnSearchTermsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavMarketingSearchTerms); - $I->waitForPageLoad(); - } - - public function clickOnAbandonedCartsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavMarketingAbandonedCarts); - $I->waitForPageLoad(); - } - - public function clickOnNewsletterProblemReportsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavMarketingNewsletterProblemReports); - $I->waitForPageLoad(); - } - - public function clickOnByCustomersInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavReviewsByCustomers); - $I->waitForPageLoad(); - } - - public function clickOnByProductsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavReviewsByProducts); - $I->waitForPageLoad(); - } - - public function clickOnOrdersInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesOrders); - $I->waitForPageLoad(); - } - - public function clickOTaxInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesTax); - $I->waitForPageLoad(); - } - - public function clickOnInvoicedInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesInvoiced); - $I->waitForPageLoad(); - } - - public function clickOnShippingInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesShipping); - $I->waitForPageLoad(); - } - - public function clickOnRefundsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesRefunds); - $I->waitForPageLoad(); - } - - public function clickOnCouponsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesCoupons); - $I->waitForPageLoad(); - } - - public function clickOnPayPalSettlementInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesPayPalSettlement); - $I->waitForPageLoad(); - } - - public function clickOnBraintreeSettlementInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavSalesBraintreeSettlement); - $I->waitForPageLoad(); - } - - public function clickOnOrderTotalInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavCustomersOrderTotal); - $I->waitForPageLoad(); - } - - public function clickOnOrderCountInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavCustomersOrderCount); - $I->waitForPageLoad(); - } - - public function clickOnNewInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavCustomersNew); - $I->waitForPageLoad(); - } - - public function clickOnViewsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavProductsViews); - $I->waitForPageLoad(); - } - - public function clickOnBestSellersInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavProductsBestsellers); - $I->waitForPageLoad(); - } - - public function clickOnLowStockInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavProductsLowStock); - $I->waitForPageLoad(); - } - - public function clickOnOrderedInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavProductsOrdered); - $I->waitForPageLoad(); - } - - public function clickOnDownloadsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavProductsDownloads); - $I->waitForPageLoad(); - } - - public function clickOnRefreshStatisticsInTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$reportsNavStatisticsRefreshStatistics); - $I->waitForPageLoad(); - } - - public function clickOnStoresInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesButton); - $I->waitForPageLoad(); - } - - public function clickOnAllStoresInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavSettingsAllStores); - $I->waitForPageLoad(); - } - - public function clickOnConfigurationInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavSettingsConfiguration); - $I->waitForPageLoad(); - } - - public function clickOnTermsAndConditionsInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavSettingsTermsAndConditions); - $I->waitForPageLoad(); - } - - public function clickOnOrderStatusInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavSettingsOrderStatus); - $I->waitForPageLoad(); - } - - public function clickOnTaxRuleInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavTaxesTaxRules); - $I->waitForPageLoad(); - } - - public function clickOnTaxZonesAndRatesInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavTaxesTaxZonesAndRates); - $I->waitForPageLoad(); - } - - public function clickOnTaxRatesInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavCurrencyRates); - $I->waitForPageLoad(); - } - - public function clickOnTaxSymbolsInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavCurrencySymbols); - $I->waitForPageLoad(); - } - - public function clickOnCurrencyRatesInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavCurrencyRates); - $I->waitForPageLoad(); - } - - public function clickOnCurrencySymbolsInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavCurrencySymbols); - $I->waitForPageLoad(); - } - - public function clickOnProductInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavAttributesProduct); - $I->waitForPageLoad(); - } - - public function clickOnAttributesSetInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavAttributesSet); - $I->waitForPageLoad(); - } - - public function clickOnRatingsInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavAttributesRating); - $I->waitForPageLoad(); - } - - public function clickOnCustomerGroupInTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$storesNavOtherSettingsCustomerGroups); - $I->waitForPageLoad(); - } - - public function clickOnSystemInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemButton); - $I->waitForPageLoad(); - } - - public function clickOnImportInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavDataTransferImport); - $I->waitForPageLoad(); - } - - public function clickOnExportInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavDataTransferExport); - $I->waitForPageLoad(); - } - - public function clickOnImportExportTaxRatesInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavDataTransferImportExportTaxRates); - $I->waitForPageLoad(); - } - - public function clickOnImportHistoryInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavDataTransferImportHistory); - $I->waitForPageLoad(); - } - - public function clickOnIntegrationsInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavExtensionsIntegrations); - $I->waitForPageLoad(); - } - - public function clickOnCacheManagementInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavToolsCacheManagement); - $I->waitForPageLoad(); - } - - public function clickOnBackupsInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavToolsBackups); - $I->waitForPageLoad(); - } - - public function clickOnIndexManagementInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavToolsIndexManagement); - $I->waitForPageLoad(); - } - - public function clickOnWebSetupWizardInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavToolsWebSetupWizard); - $I->waitForLoadingMaskToDisappear(); - } - - public function clickOnAllUsersInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavPermissionsAllUsers); - $I->waitForPageLoad(); - } - - public function clickOnLockedUsersInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavPermissionsLockedUsers); - $I->waitForPageLoad(); - } - - public function clickOnUserRolesInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavPermissionsUserRoles); - $I->waitForPageLoad(); - } - - public function clickOnNotificationsInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavOtherSettingsNotifications); - $I->waitForPageLoad(); - } - - public function clickOnCustomVariablesInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavOtherSettingsCustomVariables); - $I->waitForPageLoad(); - } - - public function clickOnManageEncryptionKeyInTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$systemNavOtherSettingsManageEncryptionKey); - $I->waitForPageLoad(); - } - - public function clickOnFindPartnersAndExtensionsInTheSideNavMenu() - { - $I = $this->acceptanceTester; - $I->click(self::$findPartnersExtensionsButton); - $I->wait(1); - } - - public function shouldSeeTheSalesNavMainArea() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$salesNavMainArea); - } - - public function shouldSeeTheSalesNavTitle() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$salesNavTitle); - } - - public function shouldSeeTheSalesNavOrders() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$salesNavOrders); - } - - public function shouldSeeTheSalesNavInvoices() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$salesNavInvoices); - } - - public function shouldSeeTheSalesNavShipments() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$salesNavShipments); - } - - public function shouldSeeTheSalesNavCreditMemos() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$salesNavCreditMemos); - } - - public function shouldSeeTheSalesNavBillingAgreements() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$salesNavBillingAgreements); - } - - public function shouldSeeTheSalesNavTransactions() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$salesNavTransactions); - } - - public function shouldSeeTheSalesNavMenu() - { - $this->shouldSeeTheSalesNavMainArea(); - $this->shouldSeeTheSalesNavTitle(); - $this->shouldSeeTheSalesNavOrders(); - $this->shouldSeeTheSalesNavInvoices(); - $this->shouldSeeTheSalesNavShipments(); - $this->shouldSeeTheSalesNavCreditMemos(); - $this->shouldSeeTheSalesNavBillingAgreements(); - $this->shouldSeeTheSalesNavTransactions(); - } - - public function shouldSeeTheProductNavMenu() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$productNavMainArea); - $I->seeElement(self::$productNavTitle); - $I->seeElement(self::$productNavCatalog); - $I->seeElement(self::$productNavCategories); - } - - public function shouldSeeTheCustomersNavMenu() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$customersNavAllCustomers); - $I->seeElement(self::$customersNavNowOnline); - } - - public function shouldSeeTheMarketingNavMenu() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$marketingNavPromotionsMainArea); - $I->seeElement(self::$marketingNavPromotionsTitle); - $I->seeElement(self::$marketingNavPromotionsCatalogPriceRule); - $I->seeElement(self::$marketingNavPromotionsCartPriceRules); - - $I->seeElement(self::$marketingNavCommunicationsMainArea); - $I->seeElement(self::$marketingNavCommunicationsTitle); - $I->seeElement(self::$marketingNavCommunicationsEmailTemplates); - $I->seeElement(self::$marketingNavCommunicationsNewsletterTemplates); - $I->seeElement(self::$marketingNavCommunicationsNewsletterQueue); - $I->seeElement(self::$marketingNavCommunicationsNewsletterSubscribers); - - $I->seeElement(self::$marketingNavSEOSearchMainArea); - $I->seeElement(self::$marketingNavSEOSearchTitle); - $I->seeElement(self::$marketingNavSEOSearchURLRewrites); - $I->seeElement(self::$marketingNavSEOSearchTerms); - $I->seeElement(self::$marketingNavSEOSearchSynonyms); - $I->seeElement(self::$marketingNavSEOSearchSiteMap); - - $I->seeElement(self::$marketingNavUserContentMainArea); - $I->seeElement(self::$marketingNavUserContentTitle); - $I->seeElement(self::$marketingNavUserContentReviews); - } - - public function shouldSeeTheContentNavMenu() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$contentNavElementsMainArea); - $I->seeElement(self::$contentNavElementsTitle); - $I->seeElement(self::$contentNavElementsPages); - $I->seeElement(self::$contentNavElementsBlocks); - $I->seeElement(self::$contentNavElementsWidgets); - - $I->seeElement(self::$contentNavDesignMainArea); - $I->seeElement(self::$contentNavDesignTitle); - $I->seeElement(self::$contentNavDesignConfiguration); - $I->seeElement(self::$contentNavDesignThemes); - $I->seeElement(self::$contentNavDesignSchedule); - } - - public function shouldSeeTheReportsNavMenu() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$reportsNavMarketingMainArea); - $I->seeElement(self::$reportsNavMarketingTitle); - $I->seeElement(self::$reportsNavMarketingProductsInCart); - $I->seeElement(self::$reportsNavMarketingSearchTerms); - $I->seeElement(self::$reportsNavMarketingAbandonedCarts); - $I->seeElement(self::$reportsNavMarketingNewsletterProblemReports); - - $I->seeElement(self::$reportsNavReviewsMainArea); - $I->seeElement(self::$reportsNavReviewsTitle); - $I->seeElement(self::$reportsNavReviewsByCustomers); - $I->seeElement(self::$reportsNavReviewsByProducts); - - $I->seeElement(self::$reportsNavSalesMainArea); - $I->seeElement(self::$reportsNavSalesTitle); - $I->seeElement(self::$reportsNavSalesOrders); - $I->seeElement(self::$reportsNavSalesTax); - $I->seeElement(self::$reportsNavSalesInvoiced); - $I->seeElement(self::$reportsNavSalesShipping); - $I->seeElement(self::$reportsNavSalesRefunds); - $I->seeElement(self::$reportsNavSalesCoupons); - $I->seeElement(self::$reportsNavSalesPayPalSettlement); - $I->seeElement(self::$reportsNavSalesBraintreeSettlement); - - $I->seeElement(self::$reportsNavCustomersMainArea); - $I->seeElement(self::$reportsNavCustomersTitle); - $I->seeElement(self::$reportsNavCustomersOrderTotal); - $I->seeElement(self::$reportsNavCustomersOrderCount); - $I->seeElement(self::$reportsNavCustomersNew); - - $I->seeElement(self::$reportsNavProductsMainArea); - $I->seeElement(self::$reportsNavProductsTitle); - $I->seeElement(self::$reportsNavProductsViews); - $I->seeElement(self::$reportsNavProductsBestsellers); - $I->seeElement(self::$reportsNavProductsLowStock); - $I->seeElement(self::$reportsNavProductsOrdered); - $I->seeElement(self::$reportsNavProductsDownloads); - - $I->seeElement(self::$reportsNavStatisticsMainArea); - $I->seeElement(self::$reportsNavStatisticsTitle); - $I->seeElement(self::$reportsNavStatisticsRefreshStatistics); - } - - public function shouldSeeTheStoresNavMenu() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$storesNavSettingsMainArea); - $I->seeElement(self::$storesNavSettingsTitle); - $I->seeElement(self::$storesNavSettingsAllStores); - $I->seeElement(self::$storesNavSettingsConfiguration); - $I->seeElement(self::$storesNavSettingsTermsAndConditions ); - $I->seeElement(self::$storesNavSettingsOrderStatus); - - $I->seeElement(self::$storesNavTaxesMainArea); - $I->seeElement(self::$storesNavTaxesTitle); - $I->seeElement(self::$storesNavTaxesTaxRules); - $I->seeElement(self::$storesNavTaxesTaxZonesAndRates); - - $I->seeElement(self::$storesNavCurrencyMainArea); - $I->seeElement(self::$storesNavCurrencyTitle); - $I->seeElement(self::$storesNavCurrencyRates); - $I->seeElement(self::$storesNavCurrencySymbols); - - $I->seeElement(self::$storesNavAttributesMainArea); - $I->seeElement(self::$storesNavAttributesTitle); - $I->seeElement(self::$storesNavAttributesProduct); - $I->seeElement(self::$storesNavAttributesSet); - $I->seeElement(self::$storesNavAttributesRating); - - $I->seeElement(self::$storesNavOtherSettingsMainArea); - $I->seeElement(self::$storesNavOtherSettingsTitle); - $I->seeElement(self::$storesNavOtherSettingsCustomerGroups); - } - - public function shouldSeeTheSystemNavMenu() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$systemNavDataTransferMainArea); - $I->seeElement(self::$systemNavDataTransferTitle); - $I->seeElement(self::$systemNavDataTransferImport); - $I->seeElement(self::$systemNavDataTransferExport); - $I->seeElement(self::$systemNavDataTransferImportExportTaxRates); - $I->seeElement(self::$systemNavDataTransferImportHistory); - - $I->seeElement(self::$systemNavExtensionsMainArea); - $I->seeElement(self::$systemNavExtensionsTitle); - $I->seeElement(self::$systemNavExtensionsIntegrations); - - $I->seeElement(self::$systemNavToolsMainArea); - $I->seeElement(self::$systemNavToolsTitle); - $I->seeElement(self::$systemNavToolsCacheManagement); - $I->seeElement(self::$systemNavToolsBackups); - $I->seeElement(self::$systemNavToolsIndexManagement); - $I->seeElement(self::$systemNavToolsWebSetupWizard); - - $I->seeElement(self::$systemNavPermissionsMainArea); - $I->seeElement(self::$systemNavPermissionsTitle); - $I->seeElement(self::$systemNavPermissionsAllUsers); - $I->seeElement(self::$systemNavPermissionsLockedUsers); - $I->seeElement(self::$systemNavPermissionsUserRoles); - - $I->seeElement(self::$systemNavOtherSettingsMainArea); - $I->seeElement(self::$systemNavOtherSettingsTitle); - $I->seeElement(self::$systemNavOtherSettingsNotifications); - $I->seeElement(self::$systemNavOtherSettingsCustomVariables); - $I->seeElement(self::$systemNavOtherSettingsManageEncryptionKey); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Backend/etc/Page.xml b/src/Magento/AcceptanceTestFramework/Page/Backend/etc/Page.xml deleted file mode 100644 index 742ea0328..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Backend/etc/Page.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/Magento/AcceptanceTestFramework/Page/AdminGridPage.php b/src/Magento/AcceptanceTestFramework/Page/Block/AdminGrid.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Page/AdminGridPage.php rename to src/Magento/AcceptanceTestFramework/Page/Block/AdminGrid.php index 3a926b5de..20a06431b 100644 --- a/src/Magento/AcceptanceTestFramework/Page/AdminGridPage.php +++ b/src/Magento/AcceptanceTestFramework/Page/Block/AdminGrid.php @@ -1,18 +1,10 @@ .admin__data-grid-wrap tbody tr:nth-child(%s) .admin__control-checkbox'; - - /** - * @var AcceptanceTester - */ - protected $acceptanceTester; - - public function __construct(AcceptanceTester $I) - { - $this->acceptanceTester = $I; - $this->pageLoadTimeout = $I->getConfiguration('pageload_timeout'); - } - - public static function of(AcceptanceTester $I) - { - return new static($I); - } - - public static function route($param) - { - return static::$URL.$param; - } public function enterSearchKeyword($searchKeyboard) { @@ -176,7 +147,7 @@ public function searchAndFiltersByValue($value, $selector, $type = 'textfield') break; case 'textfield': default: - $I->fillField($selector, $value); + $I->fillField($selector, $value); } $I->click(self::$filtersApplyButton); $I->waitForPageLoad(); diff --git a/src/Magento/AcceptanceTestFramework/Page/Block/Block.php b/src/Magento/AcceptanceTestFramework/Page/Block/Block.php new file mode 100644 index 000000000..63da125f5 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/Block/Block.php @@ -0,0 +1,97 @@ +rootElement = $element; + $this->acceptanceTester = $acceptanceTester; + $this->init(); + } + + /** + * Initialize for children classes + * @return void + */ + protected function init() + { + // + } + + /** + * Check if the root element of the block is visible or not + * + * @return bool + */ + public function isVisible() + { + try { + $this->waitForElementVisible($this->rootElement); + return true; + } catch (\Exception $e) { + return false; + } + } + + /** + * Wait for element is visible in the block + * + * @param string $selector + * @return bool|null + */ + public function waitForElementVisible($selector) + { + return $this->acceptanceTester->waitForElementVisible($selector); + } + + /** + * Wait for element is not visible in the block + * + * @param string $selector + * @return bool|null + */ + public function waitForElementNotVisible($selector) + { + return $this->acceptanceTester->waitForElementVisible($selector); + } +} diff --git a/src/Magento/AcceptanceTestFramework/Page/Block/BlockFactory.php b/src/Magento/AcceptanceTestFramework/Page/Block/BlockFactory.php new file mode 100644 index 000000000..c259783c8 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/Block/BlockFactory.php @@ -0,0 +1,41 @@ +getConstructor(); + if (is_null($reflectedConstructor)) { + $object = new $class; + } else { + $object = $reflectedClass->newInstanceArgs($arguments); + } + if (!$object instanceof BlockInterface) { + $interfaceClass = '\Magento\AcceptanceTestFramework\Page\Block\BlockInterface'; + throw new \UnexpectedValueException( + sprintf('Block class "%s" has to implement '. $interfaceClass . 'interface.', $class) + ); + } + } else { + throw new \UnexpectedValueException( + sprintf('Class "%s" does not exist.', $class) + ); + } + return $object; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Page/Block/BlockInterface.php b/src/Magento/AcceptanceTestFramework/Page/Block/BlockInterface.php new file mode 100644 index 000000000..1f684050c --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/Block/BlockInterface.php @@ -0,0 +1,15 @@ +acceptanceTester; - $I->amOnPage(self::route($param)); - $I->waitForPageLoad(); - } - - public function amOnAdminCategoryPageById($id) - { - $I = $this->acceptanceTester; - $I->amOnPage(self::$URL . 'edit/id/' . $id); - $I->waitForPageLoad(); - } - - public function addRootCategory() - { - $I = $this->acceptanceTester; - $I->click(self::$addRootCategoryButton); - $I->waitForPageLoad(); - } - - public function addSubCategory() - { - $I = $this->acceptanceTester; - $I->click(self::$addSubCategoryButton); - $I->waitForPageLoad(); - } - - public function clickOnContent() - { - self::clickOnCollapsibleArea('Content'); - } - - public function clickOnDisplaySettings() - { - self::clickOnCollapsibleArea('Display Settings'); - } - - public function clickOnSearchEngineOptimization() - { - self::clickOnCollapsibleArea('Search Engine Optimization'); - } - - public function clickOnProductsInCategory() - { - self::clickOnCollapsibleArea('Products in Category'); - } - - public function clickOnDesign() - { - self::clickOnCollapsibleArea('Design'); - } - - public function clickOnScheduleDesignUpdate() - { - self::clickOnCollapsibleArea('Schedule Design Update'); - } - - public function fillFieldCategoryName($name) - { - $I = $this->acceptanceTester; - $I->fillField(self::$categoryName, $name); - } - - public function fillFieldCategoryUrlKey($name) - { - $I = $this->acceptanceTester; - $I->fillField(self::$categoryUrlKey, $name); - } - - public function saveCategory() - { - $I = $this->acceptanceTester; - $I->click(self::$saveCategoryButton); - $I->waitForPageLoad(); - } - - public function addBasicCategory($categoryDetails) - { - self::addRootCategory(); - - self::fillFieldCategoryName($categoryDetails['categoryName']); - - self::clickOnSearchEngineOptimization(); - self::fillFieldCategoryUrlKey($categoryDetails['urlKey']); - - self::saveCategory(); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Catalog/AdminProductGridPage.php b/src/Magento/AcceptanceTestFramework/Page/Catalog/AdminProductGridPage.php deleted file mode 100644 index e5500e021..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Catalog/AdminProductGridPage.php +++ /dev/null @@ -1,109 +0,0 @@ -acceptanceTester; - $I->amOnPage(self::$URL); - $I->waitForPageLoad(); - } - - public function clickAddNewProductButton() - { - $I = $this->acceptanceTester; - $I->click(self::$addNewProductButton); - $I->waitForPageLoad(); - } - - public function clickOnAddNewProductDropDown() - { - $I = $this->acceptanceTester; - $I->click(self::$addNewProductDropDownButton); - } - - public function clickOnAddSimpleProductOption() - { - $I = $this->acceptanceTester; - self::clickOnAddNewProductDropDown(); - $I->click(self::$addNewSimpleProductOption); - } - - public function clickOnAddConfigurableProductOption() - { - $I = $this->acceptanceTester; - self::clickOnAddNewProductDropDown(); - $I->click(self::$addNewConfigurableProductOption); - } - - public function clickOnAddGroupedProductOption() - { - $I = $this->acceptanceTester; - self::clickOnAddNewProductDropDown(); - $I->click(self::$addNewGroupedProductOption); - } - - public function clickOnAddVirtualProductOption() - { - $I = $this->acceptanceTester; - self::clickOnAddNewProductDropDown(); - $I->click(self::$addNewVirtualProductOption); - } - - public function clickOnAddBundleProductOption() - { - $I = $this->acceptanceTester; - self::clickOnAddNewProductDropDown(); - $I->click(self::$addNewBundleProductOption); - } - - public function clickOnAddDownloadableProductOption() - { - $I = $this->acceptanceTester; - self::clickOnAddNewProductDropDown(); - $I->click(self::$addNewDownloadableProductOption); - } - - public function searchBySku($sku) - { - $this->searchAndFiltersByValue($sku, self::$filterProductSkuField); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Catalog/AdminProductPage.php b/src/Magento/AcceptanceTestFramework/Page/Catalog/AdminProductPage.php deleted file mode 100644 index a79d06eaf..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Catalog/AdminProductPage.php +++ /dev/null @@ -1,193 +0,0 @@ -span'; - public static $productPrice = '.admin__field[data-index=price] input'; - public static $productQuantity = '.admin__field[data-index=quantity_and_stock_status_qty] input'; - public static $productStockStatus = '.admin__field[data-index=quantity_and_stock_status] select'; - public static $productTaxClass = '.admin__field[data-index=tax_class_id] select'; - public static $producAttributeSetMultiSelect= '.admin__field[data-index=attribute_set_id]'; - public static $producAttributeMultiSelectText - = '.admin__field[data-index=attribute_set_id] .action-select.admin__action-multiselect>div'; - public static $producCategoriesMultiSelect = '.admin__field[data-index=category_ids]'; - public static $producCategoriesMultiSelectText - = '.admin__field[data-index=category_ids] .admin__action-multiselect-crumb:nth-child(%s)>span'; - public static $productCountryOfManufacture = '.admin__field[data-index=country_of_manufacture] select'; - - /** - * Product form loading spinner. - */ - public static $productFormLoadingSpinner - = '.admin__form-loading-mask[data-component="product_form.product_form"] .spinner'; - - public static $productUrlKey = '.admin__field[data-index=url_key] input'; - - public function amOnAdminNewProductPage() - { - $I = $this->acceptanceTester; - $I->waitForPageLoad(); - $I->seeInCurrentUrl(static::$URL . 'new'); - } - - public function amOnAdminEditProductPageById($id) - { - $I = $this->acceptanceTester; - $I->amOnPage(self::route('edit/id/' . $id)); - $I->waitForPageLoad(); - } - - public function clickOnAddProductButton() - { - $I = $this->acceptanceTester; - $I->click(self::$productAddProductButton); - $I->waitForPageLoad(); - } - - public function seeProductAttributeSet($name) - { - $I = $this->acceptanceTester; - $I->assertEquals($name, $I->grabTextFrom(self::$producAttributeMultiSelectText)); - } - - public function seeProductName($name) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$productName, $name); - } - - public function seeProductSku($sku) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$productSku, $sku); - } - - public function seeProductPrice($price) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$productPrice, $I->formatMoney($price)['number']); - } - - public function seeProductQuantity($qty) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$productQuantity, $qty); - } - - public function seeProductStockStatus($status) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$productStockStatus, $status); - } - - /** - * @param array $names - */ - public function seeProductCategories(array $names) - { - $I = $this->acceptanceTester; - $count = 2; - foreach ($names as $name) { - $I->assertEquals($name, $I->grabTextFrom(sprintf(self::$producCategoriesMultiSelectText, $count))); - $count += 1; - } - } - - public function seeProductUrlKey($urlKey) - { - $I = $this->acceptanceTester; - $this->expandCollapsibleArea('search-engine-optimization'); - $I->seeInField(self::$productUrlKey, $urlKey); - } - - // Fill new product - public function selectProductAttributeSet($name) - { - $I = $this->acceptanceTester; - $I->searchAndMultiSelectOption(self::$producAttributeSetMultiSelect, [$name]); - } - - public function fillFieldProductName($name) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productName, $name); - } - - public function fillFieldProductSku($sku) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productSku, $sku); - } - - public function fillFieldProductPrice($price) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productPrice, $price); - } - - public function fillFieldProductQuantity($qty) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productQuantity, $qty); - } - - public function selectProductStockStatus($status) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$productStockStatus, $status); - } - - public function fillFieldProductUrlKey($urlKey) - { - $this->expandCollapsibleArea('search-engine-optimization'); - $I = $this->acceptanceTester; - $I->fillField(self::$productUrlKey, $urlKey); - } - - /** - * @param array $names - */ - public function selectProductCategories(array $names) - { - $I = $this->acceptanceTester; - $I->searchAndMultiSelectOption(self::$producCategoriesMultiSelect, $names, true); - } - - public function saveProduct() - { - $I = $this->acceptanceTester; - $I->performOn(self::$productSaveButton, ['click' => self::$productSaveButton]); - $I->waitForPageLoad(); - } - - public function addBasicProductUnderCategory($productData, $categoryData) - { - self::clickOnAddProductButton(); - - self::fillFieldProductName($productData['productName']); - self::fillFieldProductSku($productData['sku']); - self::fillFieldProductPrice($productData['price']); - self::selectProductCategories(array($categoryData['categoryName'])); - - self::saveProduct(); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Catalog/StorefrontCategoryPage.php b/src/Magento/AcceptanceTestFramework/Page/Catalog/StorefrontCategoryPage.php deleted file mode 100644 index 333bb742c..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Catalog/StorefrontCategoryPage.php +++ /dev/null @@ -1,93 +0,0 @@ -span'; - - public static $compareBlock = '.block.block-compare'; - public static $wishlistBlock = '.block.block-wishlist'; - - public static $viewAsGridButton = '.modes>strong[title=Grid]'; - public static $activeGridMode = '.modes-mode.active.mode-grid'; - public static $viewAsListButton = '.modes>strong[title=List]'; - public static $activeListMode = '.modes-mode.active.mode-list'; - public static $sortByButton = '#sorter'; - public static $totalNumberOfProductsText = '#toolbar-amount>span:last-child'; - - public static $pageNextButton = './/*[contains(@class,"toolbar-products")][2]//a[@title="Next"]'; - public static $pagePreviousButton = './/*[contains(@class,"toolbar-products")][2]//a[@title="Previous"]'; - public static $activePage = '//li[@class="item current"]//span[text()=%s]'; - - public static $productListItem = '.products.list.items.product-items>li'; - public static $productLinks = '//a[contains(@href, "%s.html")]'; - public static $productName = '//a[text()[contains(.," %s ")]]'; - public static $productPrice - = '//a[text()[contains(.," %s ")]]/parent::strong/following-sibling::div[1]//*[@class="price"]'; - - public function amOnCategoryPage($categoryUrlKey, $params = '') - { - $I = $this->acceptanceTester; - $I->amOnPage(self::route($categoryUrlKey . '.html' . $params)); - $I->waitForPageLoad(); - } - - public function seeCategoryNameInTitleHeading($name) - { - $I = $this->acceptanceTester; - $I->see($name, self::$pageTitleHeading); - } - - public function seeProductLinksInPage($name, $link) - { - $this->goToPageForProduct($name); - $I = $this->acceptanceTester; - $I->canSeeElement(sprintf(self::$productLinks, $link)); - } - - public function seeProductNameInPage($name) - { - $this->goToPageForProduct($name); - $I = $this->acceptanceTester; - $I->canSeeElement(sprintf(self::$productName, $name)); - } - - public function seeProductPriceInPage($name, $price) - { - $this->goToPageForProduct($name); - $I = $this->acceptanceTester; - $actualPrice = $I->parseFloat(substr($I->grabTextFrom(sprintf(self::$productPrice, $name)), 1)); - $price = $I->parseFloat($price); - $I->assertEquals($price, $actualPrice, '', 0.01); - } - - public function goToPageForProduct($name) - { - $I = $this->acceptanceTester; - $name = sprintf(self::$productName, $name); - do { - try { - $I->executeInSelenium(function(RemoteWebDriver $webDriver) use ($name) { - $webDriver->findElement(WebDriverBy::xpath($name)); - }); - break; - } catch (WebDriverException $e) { - try { - $I->click(self::$pageNextButton); - $I->waitForPageLoad(); - } catch (ElementNotFound $e) { - break; - } - } - } while (true); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Catalog/StorefrontProductPage.php b/src/Magento/AcceptanceTestFramework/Page/Catalog/StorefrontProductPage.php deleted file mode 100644 index 77796b637..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Catalog/StorefrontProductPage.php +++ /dev/null @@ -1,84 +0,0 @@ -span'; - public static $productSku = '.product.attribute.sku>.value'; - - /** - * Product options data. - */ - public static $productOptionsDropDown = '#product-options-wrapper .super-attribute-select'; - - public function amOnProductPage($productUrlKey) - { - $I = $this->acceptanceTester; - $I->amOnPage(self::route($productUrlKey . '.html')); - $I->waitForPageLoad(); - } - - public function seeProductNameInPage($name) - { - $I = $this->acceptanceTester; - $I->seeElement(sprintf(self::$productName, $name)); - } - - public function seeProductPriceInPage($price) - { - $I = $this->acceptanceTester; - $actualPrice = $I->grabTextFrom(sprintf(self::$productPrice)); - $actualPrice = $I->parseFloat(substr($actualPrice, 1)); - $price = $I->parseFloat($price); - $pos = strpos($actualPrice, '.'); - if ( $pos !== false) { - $actualPrice = substr($actualPrice, 0, $pos+3); - } - $I->assertEquals($price, $actualPrice); - } - - public function seeProductStockStatusInPage($status) - { - $I = $this->acceptanceTester; - $I->seeElement(sprintf(self::$productStockStatus, $status)); - } - - public function seeProductSkuInPage($sku) - { - $I = $this->acceptanceTester; - $I->seeElement(sprintf(self::$productSku, $sku)); - } - - public function selectProductOption($option) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$productOptionsDropDown, $option); - } - - /** - * @param array $options - */ - public function seeProductOptions(array $options) - { - $I = $this->acceptanceTester; - foreach ($options as $option) { - for($c = 2; $c < count($options)+2; $c++) { - try { - $I->see($option, self::$productOptionsDropDown . ' option:nth-child('. strval($c). ')'); - break; - } catch (\PHPUnit_Framework_AssertionFailedError $e) { - continue; - } - } - } - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Catalog/etc/Page.xml b/src/Magento/AcceptanceTestFramework/Page/Catalog/etc/Page.xml deleted file mode 100644 index 79d0e5eca..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Catalog/etc/Page.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsGrid.php b/src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsGrid.php deleted file mode 100644 index 47a11cd6e..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsGrid.php +++ /dev/null @@ -1,62 +0,0 @@ -acceptanceTester; - $I->click(self::$addNewPageButton); - $I->waitForPageLoad(); - } - - public function clickOnActionSelectLinkFor($keyText) - { - $I = $this->acceptanceTester; - $selector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] .action-select'; - - $I->click($selector); - $I->waitForPageLoad(); - } - - public function clickOnActionEditFor($keyText) - { - $I = $this->acceptanceTester; - $selector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] ' . self::$actionEdit; - - self::clickOnActionSelectLinkFor($keyText); - $I->click($selector); - $I->waitForPageLoad(); - } - - public function clickOnActionDeleteFor($keyText) - { - $I = $this->acceptanceTester; - $selector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] ' . self::$actionEdit; - - self::clickOnActionSelectLinkFor($keyText); - $I->click($selector); - $I->waitForPageLoad(); - } - - public function clickOnActionViewFor($keyText) - { - $I = $this->acceptanceTester; - $selector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] ' . self::$actionEdit; - - self::clickOnActionSelectLinkFor($keyText); - $I->click($selector); - $I->waitForPageLoad(); - } -} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsPage.php b/src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsPage.php deleted file mode 100644 index 33da515e3..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Cms/AdminCmsPage.php +++ /dev/null @@ -1,476 +0,0 @@ -acceptanceTester; - $I->amOnPage(self::route($param)); - $I->waitForPageLoad(); - } - - public function amOnAdminCmsPageById($id) - { - $I = $this->acceptanceTester; - $I->amOnPage(self::$URL . 'edit/page_id/' . $id); - $I->waitForPageLoad(); - } - - public function seePageNameInPageTitle($name) - { - $I = $this->acceptanceTester; - $I->see($name, self::$pageTitle); - } - - public function clickOnAddNewPageButton() - { - $I = $this->acceptanceTester; - $I->click(self::$cmsAddNewPageButton); - $I->waitForPageLoad(); - } - - public function clickOnEnablePageToggle() - { - $I = $this->acceptanceTester; - $I->click(self::$cmsEnablePageToggle); - } - - public function seeEnablePageToggleIs($expectedState) - { - $I = $this->acceptanceTester; - $I->seeCheckboxIsChecked(self::$cmsEnablePageToggle, $expectedState); - } - - public function enterPageTitle($pageTitle) - { - $I = $this->acceptanceTester; - $I->fillField(self::$pageTitleField, $pageTitle); - } - - public function verifyPageTitle($pageTitle) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$pageTitleField, $pageTitle); - } - - public function enterPageContentHeading($pageContentTitle) - { - $I = $this->acceptanceTester; - $I->fillField(self::$contentHeadingField, $pageContentTitle); - } - - public function verifyPageContentHeading($pageContentTitle) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$contentHeadingField, $pageContentTitle); - } - - public function clickOnInsertWidgetButton() - { - $I = $this->acceptanceTester; - $I->click(self::$insertWidgetButton); - } - - // TODO: Add Methods for the "Insert Widget" section and controls - - public function clickOnInsertImageButton() - { - $I = $this->acceptanceTester; - $I->click(self::$insertImageButton); - } - - // TODO: Add Methods for the "Insert Image" section and controls - - public function clickOnInsertVariableButton() - { - $I = $this->acceptanceTester; - $I->click(self::$insertVariableButton); - } - - // TODO: Add Methods for the "Insert Variable" section and controls - - public function enterPageContentBody($pageContentBody) - { - $I = $this->acceptanceTester; - $I->fillField(self::$contentBodyField, $pageContentBody); - } - - public function verifyPageContentBody($pageContentBody) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$contentBodyField, $pageContentBody); - } - - public function enterUrlKey($urlKey) - { - $I = $this->acceptanceTester; - $I->fillField(self::$urlKeyField, $urlKey); - } - - public function verifyUrlKey($urlKey) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$urlKeyField, $urlKey); - } - - public function enterMetaTitle($metaTitle) - { - $I = $this->acceptanceTester; - $I->fillField(self::$metaTitleField, $metaTitle); - } - - public function verifyMetaTitle($metaTitle) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$metaTitleField, $metaTitle); - } - - public function enterMetaKeywords($metaKeywords) - { - $I = $this->acceptanceTester; - $I->fillField(self::$metaKeywordsField, $metaKeywords); - } - - public function verifyMetaKeywords($metaKeywords) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$metaKeywordsField, $metaKeywords); - } - - public function enterMetaDescription($metaDescription) - { - $I = $this->acceptanceTester; - $I->fillField(self::$metaDescriptionField, $metaDescription); - } - - public function verifyMetaDescription($metaDescription) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$metaDescriptionField, $metaDescription); - } - - public function selectStoreView($storeView) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$storeViewMainArea, $storeView); - } - - public function selectDefaultStoreView() - { - self::selectStoreView('Default Store View'); - } - - public function verifyStoreView($storeView) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$storeViewMainArea, $storeView); - } - - public function verifyDefaultStoreView() - { - self::verifyStoreView('Default Store View'); - } - - public function pressShiftOnTheKeyboard() - { - $I = $this->acceptanceTester; - $I->pressKey(self::$storeViewMainArea, \WebDriverKeys::SHIFT); - } - - public function selectMultipleStoreViews($storeViews) - { - // TODO: Add multi-select support for the "Store View" setting - } - - public function selectLayout($layout) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$layoutButton, $layout); - } - - public function selectLayout1Column() - { - self::selectLayout('1 column'); - } - - public function selectLayout2ColumnsWithLeftBar() - { - self::selectLayout('2 columns with left bar'); - } - - public function selectLayout2ColumnsWithRightBar() - { - self::selectLayout('2 columns with right bar'); - } - - public function selectLayout3Column() - { - self::selectLayout('3 columns'); - } - - public function verifyLayout($layout) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$layoutButton, $layout); - } - - public function verifyLayout1Column() - { - self::verifyLayout('1 column'); - } - - public function verifyLayout2ColumnsWithLeftBar() - { - self::verifyLayout('2 columns with left bar'); - } - - public function verifyLayout2ColumnsWithRightBar() - { - self::verifyLayout('2 columns with right bar'); - } - - public function verifyLayout3Column() - { - self::verifyLayout('3 columns'); - } - - public function enterLayoutUpdateXml($layoutXml) - { - $I = $this->acceptanceTester; - $I->fillField(self::$layoutUpdateXmlField, $layoutXml); - } - - public function verifyLayoutUpdateXml($layoutXml) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$layoutUpdateXmlField, $layoutXml); - } - - // TODO: Add calendar modal support - - public function enterFrom($fromDate) - { - $I = $this->acceptanceTester; - $I->fillField(self::$fromField, $fromDate); - } - - public function verifyFrom($fromDate) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$fromField, $fromDate); - } - - public function enterTo($toDate) - { - $I = $this->acceptanceTester; - $I->fillField(self::$toField, $toDate); - } - - public function verifyTo($toDate) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$toField, $toDate); - } - - public function selectNewTheme($newTheme) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$newThemeButton, $newTheme); - } - - public function selectNewThemeMagentoBlank() - { - self::selectNewTheme('Magento Blank'); - } - - public function selectNewThemeMagentoLuma() - { - self::selectNewTheme('Magento Luma'); - } - - public function verifyNewTheme($newTheme) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$newThemeButton, $newTheme); - } - - public function verifyNewThemeMagentoBlank() - { - self::verifyNewTheme('Magento Blank'); - } - - public function verifyNewThemeMagentoLuma() - { - self::verifyNewTheme('Magento Luma'); - } - - public function selectNewLayout($newLayout) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$newLayoutButton, $newLayout); - } - - public function selectNewLayoutEmpty() - { - self::selectNewLayout('Empty'); - } - - public function selectNewLayout1Column() - { - self::selectNewLayout('1 column'); - } - - public function selectNewLayout2ColumnsWithLeftBar() - { - self::selectNewLayout('2 columns with left bar'); - } - - public function selectNewLayout2ColumnsWithRightBar() - { - self::selectNewLayout('2 columns with right bar'); - } - - public function selectNewLayout3Columns() - { - self::selectNewLayout('3 columns'); - } - - public function verifyNewLayout($newLayout) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$newLayoutButton, $newLayout); - } - - public function verifyNewLayoutEmpty() - { - self::verifyNewLayout('Empty'); - } - - public function verifyNewLayout1Column() - { - self::verifyNewLayout('1 column'); - } - - public function verifyNewLayout2ColumnsWithLeftBar() - { - self::verifyNewLayout('2 columns with left bar'); - } - - public function verifyNewLayout2ColumnsWithRightBar() - { - self::verifyNewLayout('2 columns with right bar'); - } - - public function verifyNewLayout3Columns() - { - self::verifyNewLayout('3 columns'); - } - - public function clickOnSavePageButton() - { - $I = $this->acceptanceTester; - $I->click(self::$savePageButton); - $I->waitForPageLoad(); - } - - public function seeSaveSuccessMessage() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$pageSaveSuccessMessage); - } - - public function clickOnPageContent() - { - self::clickOnCollapsibleArea('Content'); - } - - public function clickOnPageSearchEngineOptimisation() - { - self::clickOnCollapsibleArea('Search Engine Optimisation'); - } - - public function clickOnPagePageInWebsites() - { - self::clickOnCollapsibleArea('Page in Websites'); - } - - public function clickOnPageDesign() - { - self::clickOnCollapsibleArea('Design'); - } - - public function clickOnPageCustomDesignUpdate() - { - self::clickOnCollapsibleArea('Custom Design Update'); - } - - public function addBasicPage($pageDetails) - { - self::clickOnAddNewPageButton(); - - self::clickOnPageContent(); - - self::enterPageTitle($pageDetails['pageTitle']); - self::enterPageContentHeading($pageDetails['contentHeading']); - self::enterPageContentBody($pageDetails['contentBody']); - - self::clickOnPageSearchEngineOptimisation(); - self::enterUrlKey($pageDetails['urlKey']); - - self::clickOnSavePageButton(); - } -} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Page/Cms/StorefrontCmsPage.php b/src/Magento/AcceptanceTestFramework/Page/Cms/StorefrontCmsPage.php deleted file mode 100644 index 8fff9c979..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Cms/StorefrontCmsPage.php +++ /dev/null @@ -1,25 +0,0 @@ -acceptanceTester; - $I->see($pageContentTitle, self::$pageTitleWrapper); - } - - public function verifyPageContentBody($pageContentBody) - { - $I = $this->acceptanceTester; - $I->see($pageContentBody, self::$pageMainContent); - } -} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Page/Cms/etc/Page.xml b/src/Magento/AcceptanceTestFramework/Page/Cms/etc/Page.xml deleted file mode 100644 index e6d8686ed..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Cms/etc/Page.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/AdminConfigurableProductPage.php b/src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/AdminConfigurableProductPage.php deleted file mode 100644 index 90a7b1fb5..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/AdminConfigurableProductPage.php +++ /dev/null @@ -1,423 +0,0 @@ -tr:last-child'; - - /** - * Choose Affected Attribute Set Modal Popup - */ - public static $affectedAttributeSetModalPopup - = '.product_form_product_form_configurable_attribute_set_handler_modal._show'; - public static $affectedAttributeSetCurrentRadioButton - = '.product_form_product_form_configurable_attribute_set_handler_modal._show ' - . 'input[data-index=affectedAttributeSetCurrent]'; - public static $affectedAttributeSetNewRadioButton - = '.product_form_product_form_configurable_attribute_set_handler_modal._show ' - . 'input[data-index=affectedAttributeSetNew]'; - public static $affectedAttributeSetNewAttributeNameField - = '.product_form_product_form_configurable_attribute_set_handler_modal._show' - . ' div[data-index=configurableNewAttributeSetName] input'; - public static $affectedAttributeSetExistingRadioButton - = '.product_form_product_form_configurable_attribute_set_handler_modal._show ' - . 'input[data-index=affectedAttributeSetExisting]'; - public static $affectedAttributeSetConfirmButton = 'button[data-index=confirm_button]'; - - /** - * @var AdminGridPage - */ - public static $configurableAttributesGrid; - - public function __construct(AcceptanceTester $I) - { - parent::__construct($I); - if (is_null(self::$configurableAttributesGrid)) { - self::$configurableAttributesGrid = new AdminGridPage($I); - } - } - - public function amOnCreateProductConfigurationsForm() - { - $I = $this->acceptanceTester; - $I->waitForPageLoad(); - $I->seeElement(self::$createProductConfigurationsForm); - } - - public function filterAndSelectAttributeByCode($code) - { - self::$configurableAttributesGrid->searchAndFiltersByValue($code, self::$filterAttributeCode); - } - - public function checkCheckboxInCurrentNthRow(int $n) - { - self::$configurableAttributesGrid->checkCheckboxInCurrentNthRow($n); - } - - public function clickCreateConfigurationsButton() - { - $I = $this->acceptanceTester; - $I->scrollTo(self::$productCountryOfManufacture); - $I->click(self::$createConfigurationsButton); - $I->waitForElementVisible(self::$createProductConfigurationsForm, $this->pageLoadTimeout); - } - - public function clickEditConfigurationsButton() - { - $I = $this->acceptanceTester; - $I->scrollTo(self::$productCountryOfManufacture); - $I->click(self::$editConfigurationsButton); - $I->waitForElementVisible(self::$createProductConfigurationsForm, $this->pageLoadTimeout); - } - - public function clickAddProductsManuallyButton() - { - $I = $this->acceptanceTester; - $I->scrollTo(self::$productCountryOfManufacture); - $I->click(self::$addProductsManuallyButton); - $I->waitForElementVisible(self::$createProductConfigurationsForm, $this->pageLoadTimeout); - } - - public function clickNextButton() - { - $I = $this->acceptanceTester; - $I->click(self::$nextButton); - $I->waitForPageLoad(); - } - - public function clickCreateNewAttributeValue($attribute) - { - $I = $this->acceptanceTester; - $I->click(sprintf(self::$attributeCreateNewValueButton, $attribute)); - $I->waitForPageLoad(); - } - - public function fillFieldAttributeOptionValue($attribute, $option) - { - $I = $this->acceptanceTester; - $I->fillField(sprintf(self::$newAttributeOptionText, $attribute), $option); - $I->waitForPageLoad(); - } - - public function clickSaveAttributeOption($attribute) - { - $I = $this->acceptanceTester; - $I->click(sprintf(self::$newAttributeOptionSave, $attribute)); - $I->waitForPageLoad(); - } - - public function clickRemoveAttributeOption($attribute) - { - $I = $this->acceptanceTester; - $I->click(sprintf(self::$newAttributeOptionRemove, $attribute)); - $I->waitForPageLoad(); - } - - public function clickApplySingleImageRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$applySingleImageRadioButton); - $I->waitForPageLoad(); - } - - public function clickApplyUniqueImageRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$applyUniqueImageRadioButton); - $I->waitForPageLoad(); - } - - public function clickSkipImageRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$skipImageRadioButton); - } - - public function clickApplySinglePriceRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$applySinglePriceRadioButton); - $I->waitForPageLoad(); - } - - public function clickApplyUniquePriceRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$applyUniquePriceRadioButton); - $I->waitForPageLoad(); - } - - public function clickSkipPriceRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$skipPriceRadioButton); - } - - public function clickApplySingleQuantityRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$applySingleQuantityRadioButton); - $I->waitForPageLoad(); - } - - public function clickApplyUniqueQuantityRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$applyUniqueQuantityRadioButton); - $I->waitForPageLoad(); - } - - public function clickSkipQuantityRadioButton() - { - $I = $this->acceptanceTester; - $I->click(self::$skipQuantityRadioButton); - } - - public function fillFieldApplySinglePrice($price) - { - $I = $this->acceptanceTester; - $I->fillField(self::$applySinglePriceField, $price); - } - - public function fillFieldApplySingleQuantity($quantity) - { - $I = $this->acceptanceTester; - $I->fillField(self::$applySingleQuantityField, $quantity); - } - - /** - * @param string $attribute - */ - public function selectAttributeToApplyUniquePrice($attribute) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$applyUniquePriceDropDown, $attribute); - $I->waitForPageLoad(); - } - - /** - * @param string $attribute - */ - public function selectAttributeToApplyUniqueQuantity($attribute) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$applyUniqueQuantityDropDown, $attribute); - $I->waitForPageLoad(); - } - - /** - * @param array $prices - */ - public function fillFieldWithUniquePrice(array $prices) - { - $I = $this->acceptanceTester; - $c = 0; - foreach ($prices as $price) { - $I->fillField(sprintf(self::$applyUniquePriceField, $c), $price); - $c++; - } - } - - /** - * @param array $quantities - */ - public function fillFieldWithUniqueQuantity(array $quantities) - { - $I = $this->acceptanceTester; - for ($c = 0; $c < count($quantities); $c++) { - $I->fillField(sprintf(self::$applyUniqueQuantityField, $c), $quantities[$c]); - } - } - - /** - * check and select attribute option, create if it does not exist. - * - * @param $attribute - * @param $option - */ - public function checkAndSelectAttributeOption($attribute, $option) - { - $I = $this->acceptanceTester; - try { - $I->seeElement(sprintf(self::$attributeOption, $attribute, $option)); - try { - $I->dontSeeCheckboxIsChecked(sprintf(self::$attributeOptionCheckbox, $attribute, $option)); - $I->checkOption(sprintf(self::$attributeOptionCheckbox, $attribute, $option)); - } catch (ElementNotFound $e) { - } - } catch (\PHPUnit_Framework_AssertionFailedError $e) { - $this->clickCreateNewAttributeValue($attribute); - $this->fillFieldAttributeOptionValue($attribute, $option); - $this->clickSaveAttributeOption($attribute); - $I->checkOption(sprintf(self::$attributeOptionCheckbox, $attribute, $option)); - } - } - - public function seeProductPriceDisabled() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$productPrice, ['disabled' => 'true']); - } - - public function seeProductQuantityDisabled() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$productQuantity, ['disabled' => 'true']); - } - - /** - * @see $texts in configurable product variations section. - * - * @param array $texts - */ - public function seeInConfigurableVariations(array $texts) - { - $I = $this->acceptanceTester; - $I->waitForPageLoad(); - foreach ($texts as $text) { - $I->see($text, self::$configurableVariationsGrid); - } - } - - /** - * @param int $number - */ - public function assertNumberOfConfigurableVariations(int $number) - { - $I = $this->acceptanceTester; - $I->waitForPageLoad(); - $I->assertEquals($number, intval($this->getIndexForLastConfigurableVariation())+1); - } - - public function saveProduct($attributeSetOption = 'current', $newAttributeName = '') - { - parent::saveProduct(); - $I = $this->acceptanceTester; - try { - $I->seeElement(self::$affectedAttributeSetModalPopup); - switch ($attributeSetOption) { - case 'new': - $this->clickAffectedAttributeSetNewRadioButton(); - $this->fillFieldAffectedAttributeSetNewAttributeName($newAttributeName); - break; - case 'existing': - $this->clickAffectedAttributeSetExistingRadioButton(); - break; - case 'current': - default: - //TODO: handle this radiobutton - //$this->clickAffectedAttributeSetCurrentRadioButton(); //default - break; - } - $this->clickAffectedAttributeSetConfirmButton(); - } catch (\PHPUnit_Framework_AssertionFailedError $e) { - } - } - - public function clickAffectedAttributeSetCurrentRadioButton() - { - $I = $this->acceptanceTester; - $I->selectOption(self::$affectedAttributeSetCurrentRadioButton, 'current'); - $I->waitForPageLoad(); - } - - public function clickAffectedAttributeSetNewRadioButton() - { - $I = $this->acceptanceTester; - $I->selectOption(self::$affectedAttributeSetNewRadioButton, 'new'); - $I->waitForPageLoad(); - } - - public function fillFieldAffectedAttributeSetNewAttributeName($attributeName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$affectedAttributeSetNewAttributeNameField, $attributeName); - $I->waitForPageLoad(); - } - - public function clickAffectedAttributeSetExistingRadioButton() - { - $I = $this->acceptanceTester; - $I->selectOption(self::$affectedAttributeSetExistingRadioButton, 'new'); - $I->waitForPageLoad(); - } - - public function clickAffectedAttributeSetConfirmButton() - { - $I = $this->acceptanceTester; - $I->click(self::$affectedAttributeSetConfirmButton); - $I->waitForPageLoad(); - } - - private function getIndexForLastConfigurableVariation() - { - $I = $this->acceptanceTester; - return $I->grabAttributeFrom(self::$lastConfigurableVariation, 'data-repeat-index'); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/etc/Page.xml b/src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/etc/Page.xml deleted file mode 100644 index 37f5102ce..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/ConfigurableProduct/etc/Page.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerGrid.php b/src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerGrid.php deleted file mode 100644 index 2e0fd2a95..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerGrid.php +++ /dev/null @@ -1,135 +0,0 @@ -acceptanceTester; - $I->click(self::$addNewCustomerButton); - $I->waitForPageLoad(); - } - - public function enterFilterIdFrom($idFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterIdFromField, $idFrom); - } - - public function enterFilterIdTo($idTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterIdToField, $idTo); - } - - public function enterFilterCustomerSinceFrom($customerSinceFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterCustomerSinceFromField, $customerSinceFrom); - } - - public function enterFilterCustomerSinceTo($customerSinceTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterCustomerSinceToField, $customerSinceTo); - } - - public function enterFilterDateOfBirthFrom($dateOfBirthFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterDateOfBirthFromField, $dateOfBirthFrom); - } - - public function enterFilterDateOfBirthTo($dateOfBirthTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterDateOfBirthToField, $dateOfBirthTo); - } - - public function enterFilterName($name) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterNameField, $name); - } - - public function enterFilterEmail($email) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterEmailField, $email); - } - - public function selectFilterGroup($group) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$filterGroupDropDown, $group); - } - - public function enterFilterPhone($phoneNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterPhoneField, $phoneNumber); - } - - public function enterFilterZipCode($zipCode) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterZipCodeField, $zipCode); - } - - public function selectFilterCountry($country) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$filterCountryDropDown, $country); - } - - public function enterFilterStateProvince($stateProvince) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterStateProvinceField, $stateProvince); - } - - public function selectFilterWebSite($website) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$filterWebSiteDropDown, $website); - } - - public function enterFilterTaxVatNumber($taxVatNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterTaxVatNumberField, $taxVatNumber); - } - - public function selectFilterGender($gender) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$filterGenderDropDown, $gender); - } -} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerPage.php b/src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerPage.php deleted file mode 100644 index 643255fd4..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Customer/AdminCustomerPage.php +++ /dev/null @@ -1,656 +0,0 @@ -acceptanceTester; - self::clickOnAdminAddButton(); - $I->waitForPageLoad(); - } - - public function clickOnSaveCustomerButton() - { - $I = $this->acceptanceTester; - $I->click(self::$saveCustomerButton); - $I->waitForPageLoad(); - } - - public function clickOnDeleteCustomerButton() - { - $I = $this->acceptanceTester; - $I->click(self::$deleteCustomerButton); - } - - public function clickOnCreateOrderButton() - { - $I = $this->acceptanceTester; - $I->click(self::$createOrderButton); - } - - public function clickOnResetPasswordButton() - { - $I = $this->acceptanceTester; - $I->click(self::$resetPasswordButton); - } - - public function clickOnForceSignInButton() - { - $I = $this->acceptanceTester; - $I->click(self::$forceSignInButton); - } - - public function clickOnCustomerViewLink() - { - $I = $this->acceptanceTester; - $I->click(self::$customerViewLink); - } - - public function clickOnAccountInformationLink() - { - $I = $this->acceptanceTester; - $I->scrollToTopOfPage(); - $I->click(self::$accountInformationLink); - } - - public function clickOnAddressesLink() - { - $I = $this->acceptanceTester; - $I->scrollToTopOfPage(); - $I->click(self::$addressesLink); - } - - public function clickOnOrdersLink() - { - $I = $this->acceptanceTester; - $I->click(self::$ordersLink); - } - - public function clickOnBillingAgreementsLink() - { - $I = $this->acceptanceTester; - $I->click(self::$billingAgreementsLink); - } - - public function clickOnNewsletterLink() - { - $I = $this->acceptanceTester; - $I->click(self::$newsletterLink); - } - - public function clickOnProductReviewsLink() - { - $I = $this->acceptanceTester; - $I->click(self::$productReviewsLink); - } - - public function clickOnWishListLink() - { - $I = $this->acceptanceTester; - $I->click(self::$wishListLink); - } - - // TODO: Add Methods for the "Customer View" section and controls - - public function selectAssociateToWebsite($associateWebsite) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$associateToWebsiteDropDown, $associateWebsite); - } - - public function verifyAssociateToWebsite($associateWebsite) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$associateToWebsiteDropDown, $associateWebsite); - } - - public function selectAssociateToWebsiteMainWebsite() - { - self::selectAssociateToWebsite('Main Website'); - } - - public function verifyAssociateToWebsiteMainWebsite() - { - self::verifyAssociateToWebsite('Main Website'); - } - - public function selectGroup($group) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$groupDropDown, $group); - } - - public function verifyGroup($group) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$groupDropDown, $group); - } - - public function selectGroupGeneral() - { - self::selectGroup('General'); - } - - public function verifyGroupGeneral() - { - self::verifyGroup('General'); - } - - public function selectGroupWholesale() - { - $I = $this->acceptanceTester; - self::selectGroup('Wholesale'); - } - - public function verifyGroupWholesale() - { - self::verifyGroup('Wholesale'); - } - - public function clickOnDisableAutomaticGroupCheckbox() - { - $I = $this->acceptanceTester; - $I->checkOption(self::$disableAutomaticGroupCheckbox); - } - - public function seeDisableAutomaticGroupIs($expectedState) - { - $I = $this->acceptanceTester; - $I->seeCheckboxIsChecked(self::$disableAutomaticGroupCheckbox, $expectedState); - } - - public function enterPrefix($prefix) - { - $I = $this->acceptanceTester; - $I->fillField(self::$prefixField, $prefix); - } - - public function verifyPrefix($prefix) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$prefixField, $prefix); - } - - public function enterFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$firstNameField, $firstName); - } - - public function verifyFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$firstNameField, $firstName); - } - - public function enterMiddleName($middleName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$middleNameField, $middleName); - } - - public function verifyMiddleName($middleName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$middleNameField, $middleName); - } - - public function enterLastName($lastName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$lastNameField, $lastName); - } - - public function verifyLastName($lastName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$lastNameField, $lastName); - } - - public function enterSuffix($suffix) - { - $I = $this->acceptanceTester; - $I->fillField(self::$suffixField, $suffix); - } - - public function verifySuffix($suffix) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$suffixField, $suffix); - } - - public function enterEmailAddress($emailAddress) - { - $I = $this->acceptanceTester; - $I->fillField(self::$emailField, $emailAddress); - } - - public function verifyEmailAddress($emailAddress) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$emailField, $emailAddress); - } - - public function enterDateOfBirth($dateOfBirth) - { - $I = $this->acceptanceTester; - $I->fillField(self::$dateOfBirthField, $dateOfBirth); - } - - public function verifyDateOfBirth($dateOfBirth) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$dateOfBirthField, $dateOfBirth); - } - - public function enterTaxVatNumber($taxVatNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$taxVatNumberField, $taxVatNumber); - } - - public function verifyTaxVatNumber($taxVatNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$taxVatNumberField, $taxVatNumber); - } - - public function selectGender($gender) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$genderDropDown, $gender); - } - - public function verifyGender($gender) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$genderDropDown, $gender); - } - - public function selectGenderMale() - { - self::selectGender('Male'); - } - - public function selectGenderFemale() - { - self::selectGender('Female'); - } - - public function selectGenderNotSpecified() - { - self::selectGender('Not Specified'); - } - - public function verifyGenderMale() - { - self::verifyGender('Male'); - } - - public function verifyGenderFemale() - { - self::verifyGender('Female'); - } - - public function verifyGenderNotSpecified() - { - self::verifyGender('Not Specified'); - } - - public function selectSendWelcomeEmailFrom($storeName) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$sendWelcomeEmailFromDropDown, $storeName); - } - - public function verifySendWelcomeEmailFrom($storeName) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$sendWelcomeEmailFromDropDown, $storeName); - } - - public function selectSendWelcomeEmailFromDefaultStoreView() - { - self::selectSendWelcomeEmailFrom('Default Store View'); - } - - public function verifySendWelcomeEmailFromDefaultStoreView() - { - self::verifySendWelcomeEmailFrom('Default Store View'); - } - - public function clickOnAddNewAddressButton() - { - $I = $this->acceptanceTester; - $I->click(self::$addNewAddressesButton); - } - - public function clickOnAddNewAddressDefaultBillingAddress() - { - $I = $this->acceptanceTester; - $I->click(self::$newAddressDefaultBilling); - } - - public function verifyAddAddressDefaultBillingAddress($expectedState) - { - $I = $this->acceptanceTester; - if ($expectedState) { - $I->seeCheckboxIsChecked(self::$newAddressDefaultBilling); - } else { - $I->dontSeeCheckboxIsChecked(self::$newAddressDefaultBilling); - } - } - - public function verifyAddAddressDefaultShippingAddress($expectedState) - { - $I = $this->acceptanceTester; - if ($expectedState) { - $I->seeCheckboxIsChecked(self::$newAddressDefaultShipping); - } else { - $I->dontSeeCheckboxIsChecked(self::$newAddressDefaultShipping); - } - } - - public function clickOnAddNewAddressDefaultShippingAddress() - { - $I = $this->acceptanceTester; - $I->click(self::$newAddressDefaultShipping); - } - - public function enterAddAddressPrefix($prefix) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addPrefixField, $prefix); - } - - public function verifyAddAddressPrefix($prefix) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addPrefixField, $prefix); - } - - // TODO: Find better solution for the First/Last Name field validation issue. - - public function enterAddAddressFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addFirstNameField, $firstName); - } - - public function verifyAddAddressFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addFirstNameField, $firstName); - } - - public function enterAddAddressMiddleName($middleName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addMiddleNameField, $middleName); - } - - public function verifyAddAddressMiddleName($middleName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addMiddleNameField, $middleName); - } - - public function enterAddAddressLastName($lastName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addLastNameField, $lastName); - } - - public function verifyAddAddressLastName($lastName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addLastNameField, $lastName); - } - - public function enterAddAddressSuffix($suffix) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addSuffixField, $suffix); - } - - public function verifyAddAddressSuffix($suffix) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addSuffixField, $suffix); - } - - public function enterAddAddressCompany($company) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addCompanyField, $company); - } - - public function verifyAddAddressCompany($company) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addCompanyField, $company); - } - - public function enterAddAddressAddress1($address1) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addAddress1Field, $address1); - } - - public function verifyAddAddressAddress1($address1) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addAddress1Field, $address1); - } - - public function enterAddAddressAddress2($address2) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addAddress2Field, $address2); - } - - public function verifyAddAddressAddress2($address2) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addAddress2Field, $address2); - } - - public function enterAddAddressCity($city) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addCityField, $city); - } - - public function verifyAddAddressCity($city) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addCityField, $city); - } - - public function enterAddAddressCountry($country) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$addCountryDropDown, $country); - } - - public function verifyAddAddressCountry($country) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$addCountryDropDown, $country); - } - - public function enterAddAddressState($stateProvince) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$addStateDropDown, $stateProvince); - } - - public function enterAddAddressProvince($province) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addProvinceField, $province); - } - - public function verifyAddAddressState($state) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$addStateDropDown, $state); - } - - public function verifyAddAddressProvince($province) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addProvinceField, $province); - } - - public function enterAddAddressZipPostalCode($zipCode) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addZipPostalCodeField, $zipCode); - } - - public function verifyAddAddressZipPostalCode($zipCode) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addZipPostalCodeField, $zipCode); - } - - public function enterAddAddressPhoneNumber($phoneNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addPhoneNumberField, $phoneNumber); - } - - public function verifyAddAddressPhoneNumber($phoneNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addPhoneNumberField, $phoneNumber); - } - - public function enterAddAddressVatNumber($vatNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$addVatNumberField, $vatNumber); - } - - public function verifyAddAddressVatNumber($vatNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$addVatNumberField, $vatNumber); - } - - // TODO: Add Methods for the "Orders" section and controls - // TODO: Add Methods for the "Billing Agreements" section and controls - // TODO: Add Methods for the "Newsletter" section and controls - // TODO: Add Methods for the "Product Reviews" section and controls - // TODO: Add Methods for the "Wish List" section and controls - - public function addBasicCustomerWithAddress($customerDetails) - { - self::clickOnAddCustomerButton(); - - self::clickOnAddressesLink(); - self::clickOnAddNewAddressButton(); - - self::clickOnAddNewAddressDefaultBillingAddress(); - self::clickOnAddNewAddressDefaultShippingAddress(); - - self::enterAddAddressPrefix($customerDetails['prefix']); - self::enterAddAddressFirstName($customerDetails['firstname']); - self::enterAddAddressMiddleName($customerDetails['middlename']); - self::enterAddAddressLastName($customerDetails['lastname']); - self::enterAddAddressSuffix($customerDetails['suffix']); - self::enterAddAddressCompany($customerDetails['company']); - self::enterAddAddressAddress1($customerDetails['address']['address1']); - self::enterAddAddressAddress2($customerDetails['address']['address2']); - self::enterAddAddressCity($customerDetails['address']['city']); - self::enterAddAddressCountry($customerDetails['address']['country']); - self::enterAddAddressState($customerDetails['address']['state']); - self::enterAddAddressZipPostalCode($customerDetails['address']['zipCode']); - self::enterAddAddressPhoneNumber($customerDetails['phoneNumber']); - self::enterAddAddressVatNumber($customerDetails['taxVatNumber']); - - self::clickOnAccountInformationLink(); - - self::enterFirstName($customerDetails['firstname']); - self::enterLastName($customerDetails['lastname']); - self::enterEmailAddress($customerDetails['email']); - self::selectAssociateToWebsiteMainWebsite(); - self::selectGroupGeneral(); - - self::clickOnAdminSaveButton(); - } -} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountCreatePage.php b/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountCreatePage.php deleted file mode 100644 index 45b430822..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountCreatePage.php +++ /dev/null @@ -1,84 +0,0 @@ -acceptanceTester; - $I->amOnPage(self::$URL); - $I->waitForPageLoad(); - } - - public function fillFieldFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$customerFirstName, $firstName); - } - - public function fillFieldLastName($lastName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$customerLastName, $lastName); - } - - public function fillFieldEmail($email) - { - $I = $this->acceptanceTester; - $I->fillField(self::$customerEmail, $email); - } - - public function fillFieldPassword($password) - { - $I = $this->acceptanceTester; - $I->fillField(self::$customerPassword, $password); - } - - public function fillFieldConfirmPassword($password) - { - $I = $this->acceptanceTester; - $I->fillField(self::$customerConfirmPassword, $password); - } - - public function setNewsletterSubscribe($checked) - { - $I = $this->acceptanceTester; - try { - $I->dontSeeCheckboxIsChecked(self::$newsletterSubscribe); - if ($checked) { - $I->click(self::$newsletterSubscribe); - } - } catch (\Exception $e) { - $I->seeCheckboxIsChecked(self::$newsletterSubscribe); - if ($checked) { - $I->click(self::$newsletterSubscribe); - } - } - } - - public function clickCreateAccountButton() - { - $I = $this->acceptanceTester; - $I->click(self::$createAccountSubmitButton); - $I->waitForPageLoad(); - $I->seeInCurrentUrl('customer/account'); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountDashboardPage.php b/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountDashboardPage.php deleted file mode 100644 index 879701a2d..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountDashboardPage.php +++ /dev/null @@ -1,87 +0,0 @@ -span'; - public static $contactInfomationForgotPwdLink = '.box.box-information .action.change-password'; - - public static $newsletterText = '.box.box-newsletter p'; - public static $newsletterEditLink = '.box.box-newsletter .action.edit>span'; - - protected $contactInfomationName; - protected $contactInfomationEmail; - - public function amOnCustomerAccountDashboardPage() - { - $I = $this->acceptanceTester; - $I->amOnPage(self::$URL); - $I->waitForPageLoad(); - $this->setCustomerContactInformation(); - } - - public function seeContactInformationName($name) - { - $this->setCustomerContactInformation(); - $I = $this->acceptanceTester; - $I->assertEquals($name, $this->contactInfomationName); - } - - public function seeContactInformationEmail($email) - { - $this->setCustomerContactInformation(); - $I = $this->acceptanceTester; - $I->assertEquals($email, $this->contactInfomationEmail); - } - - public function seeNewsletterText($text) - { - $I = $this->acceptanceTester; - $I->see($text, self::$newsletterText); - } - - public function clickContactInformationEditLink() - { - $I = $this->acceptanceTester; - $I->click(self::$contactInfomationEditLink); - $I->waitForPageLoad(); - $I->seeInCurrentUrl('customer/account/edit'); - } - - public function clickContactInformationForgotPasswordLink() - { - $I = $this->acceptanceTester; - $I->click(self::$contactInfomationForgotPwdLink); - $I->waitForPageLoad(); - $I->seeInCurrentUrl('customer/account/edit/changepass'); - } - - public function clickNewsletterEditLink() - { - $I = $this->acceptanceTester; - $I->click(self::$newsletterEditLink); - $I->waitForPageLoad(); - $I->seeInCurrentUrl('newsletter/manage'); - } - - private function setCustomerContactInformation() - { - if(!isset($this->contactInfomationName) || !isset($this->contactInfomationEmail)) { - $I = $this->acceptanceTester; - $contacts = explode("\n", $I->grabTextFrom(self::$contactInfomationText)); - $this->contactInfomationName = $contacts[0]; - $this->contactInfomationEmail = $contacts[1]; - } - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountLoginPage.php b/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountLoginPage.php deleted file mode 100644 index 86b875df6..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Customer/StorefrontCustomerAccountLoginPage.php +++ /dev/null @@ -1,64 +0,0 @@ -span'; - public static $createNewAccountLink = '.action.create.primary>span'; - - public function amOnCustomerAccountLoginPage() - { - $I = $this->acceptanceTester; - $I->amOnPage(self::$URL); - $I->waitForPageLoad(); - } - - public function fillFieldCustomerEmail($email) - { - $I = $this->acceptanceTester; - $I->fillField(self::$customerEmailField, $email); - } - - public function fillFieldCustomerPassword($password) - { - $I = $this->acceptanceTester; - $I->fillField(self::$customerPasswordField, $password); - } - - public function clickSignInButton() - { - $I = $this->acceptanceTester; - $I->click(self::$customerSignInButton); - $I->waitForPageLoad(); - $I->seeInCurrentUrl('customer/account'); - } - - public function clickCreateAccountButton() - { - $I = $this->acceptanceTester; - $I->click(self::$createNewAccountLink); - $I->waitForPageLoad(); - $I->seeInCurrentUrl('customer/account/create'); - } - - public function signInWithCredentials($email, $password) - { - $this->fillFieldCustomerEmail($email); - $this->fillFieldCustomerPassword($password); - $this->clickSignInButton(); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Customer/etc/Page.xml b/src/Magento/AcceptanceTestFramework/Page/Customer/etc/Page.xml deleted file mode 100644 index 9dd6b1a7d..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Customer/etc/Page.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Magento/AcceptanceTestFramework/Page/ExternalPage.php b/src/Magento/AcceptanceTestFramework/Page/ExternalPage.php new file mode 100644 index 000000000..e95fa5cc5 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/ExternalPage.php @@ -0,0 +1,18 @@ +url = static::MCA; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Page/AbstractFrontendPage.php b/src/Magento/AcceptanceTestFramework/Page/FrontendPage.php similarity index 55% rename from src/Magento/AcceptanceTestFramework/Page/AbstractFrontendPage.php rename to src/Magento/AcceptanceTestFramework/Page/FrontendPage.php index dda525e8d..27291e64b 100644 --- a/src/Magento/AcceptanceTestFramework/Page/AbstractFrontendPage.php +++ b/src/Magento/AcceptanceTestFramework/Page/FrontendPage.php @@ -1,14 +1,15 @@ acceptanceTester = $I; - $this->pageLoadTimeout = $I->getConfiguration('pageload_timeout'); - } - - public static function of(AcceptanceTester $I) - { - return new static($I); - } - - /** - * Basic route example for your current URL - * You can append any additional parameter to URL - * and use it in tests like: Page\Edit::route('/123-post'); - */ - public static function route($param) + protected function initUrl() { - return static::$URL.$param; + $this->url = static::FRONTEND_BASE_URL . static::MCA; } public function seeInPageTitle($name) diff --git a/src/Magento/AcceptanceTestFramework/Page/Page.php b/src/Magento/AcceptanceTestFramework/Page/Page.php new file mode 100644 index 000000000..f5cb5c4c6 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/Page.php @@ -0,0 +1,144 @@ +blockFactory = $blockFactory; + $this->acceptanceTester = $acceptanceTester; + $this->pageLoadTimeout = $this->acceptanceTester->getConfiguration('pageload_timeout'); + $this->initUrl(); + } + + /** + * Init page and set page url. + * + * @return void + */ + protected function initUrl() + { + // + } + + /** + * Open page using browser. + * + * @param array $params + * @return $this + */ + public function open(array $params = []) + { + $url = $this->url; + + foreach ($params as $paramName => $paramValue) { + if (strpos($url, '?') !== false) { + $url .= '&'; + } else { + $url .= '?'; + } + $url .= $paramName . '=' . $paramValue; + } + + $this->acceptanceTester->amOnPage($url); + + return $this; + } + + /** + * Retrieve an instance of block. + * + * @param string $blockName + * @return BlockInterface + * @throws \InvalidArgumentException + */ + public function getBlockInstance($blockName) + { + if (!isset($this->blockInstances[$blockName])) { + $blockMeta = isset($this->blocks[$blockName]) ? $this->blocks[$blockName] : []; + $class = isset($blockMeta['class']) ? $blockMeta['class'] : false; + if ($class) { + $element = $this->acceptanceTester->findElement($blockMeta['locator'])[0]; + $block = $this->blockFactory->create( + $class, + [ + 'element' => $element, + $this->acceptanceTester + ] + ); + } else { + throw new \InvalidArgumentException( + sprintf('There is no such block "%s" declared for the page "%s" ', $blockName, $class) + ); + } + + $this->blockInstances[$blockName] = $block; + } + + return $this->blockInstances[$blockName]; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Page/PageInterface.php b/src/Magento/AcceptanceTestFramework/Page/PageInterface.php new file mode 100644 index 000000000..c3a645644 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/PageInterface.php @@ -0,0 +1,26 @@ +acceptanceTester; - $I->click(self::$selectCustomerCreateNewCustomerButton); - $I->waitForPageLoad(); - } - - public function clickOnCustomerSearchButton() - { - $I = $this->acceptanceTester; - $I->click(self::$selectCustomerSearchButton); - $I->waitForPageLoad(); - } - - public function clickOnCustomerResetFilterButton() - { - $I = $this->acceptanceTester; - $I->click(self::$selectCustomerResetFilterButton); - $I->waitForPageLoad(); - } - - public function enterCustomerIdSearchTerm($customerId) - { - $I = $this->acceptanceTester; - $I->fillField(self::$selectCustomerIdSearchField, $customerId); - } - - public function enterCustomerNameSearchTerm($customerName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$selectCustomerNameSearchField, $customerName); - } - - public function enterCustomerEmailSearchTerm($customerEmail) - { - $I = $this->acceptanceTester; - $I->fillField(self::$selectCustomerEmailSearchField, $customerEmail); - } - - public function enterCustomerPhoneSearchTerm($customerPhone) - { - $I = $this->acceptanceTester; - $I->fillField(self::$selectCustomerPhoneSearchField, $customerPhone); - } - - public function enterZipPostalCodeSearchTerm($zipPostalCode) - { - $I = $this->acceptanceTester; - $I->fillField(self::$selectCustomerZipPostCodeSearchField, $zipPostalCode); - } - - public function enterCustomerCountrySearchTerm($country) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$selectCustomerCountrySearchDropDown, $country); - } - - public function enterCustomerStateProvinceSearchTerm($stateProvince) - { - $I = $this->acceptanceTester; - $I->fillField(self::$selectCustomerStateProvinceSearchField, $stateProvince); - } - - public function enterSignedUpPointSearchTerm($signedUpPoint) - { - $I = $this->acceptanceTester; - $I->fillField(self::$selectCustomerSignedUpPointSearchField, $signedUpPoint); - } - - public function clickOnCustomerFor($customerEmail) - { - $I = $this->acceptanceTester; - $selector = "//td[contains(text(), '" . $customerEmail . "')]/parent::tr"; - - $I->waitForLoadingMaskToDisappear(); - $I->click($selector); - $I->waitForPageLoad(); - } - - /** - * Sales - Orders - "Please select a Store" Methods - */ - public function clickOnDefaultStoreView() - { - $I = $this->acceptanceTester; - $I->waitForLoadingMaskToDisappear(); - $I->click(self::$defaultStoreViewLink); - $I->waitForPageLoad(); - } - - /** - * Sales - Orders - "Customer's Activities" Methods - Left panel - */ - - // TODO: Add Customer's Activities methods - - /** - * Sales - Orders - "Items Ordered" Methods - */ - public function clickOnAddProductsButton() - { - $I = $this->acceptanceTester; - $I->waitForLoadingMaskToDisappear(); - $I->click(self::$addProductsToOrderButton); - $I->waitForPageLoad(); - } - - public function enterIdSearchField($productId) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productIdSearchField, $productId); - } - - public function enterProductNameSearchField($productName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productNameSearchField, $productName); - } - - public function enterProductSkuSearchField($productSku) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productSkuSearchField, $productSku); - } - - public function enterProductPriceFromSearchField($productPriceFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productPriceFromSearchField, $productPriceFrom); - } - - public function enterProductPriceToSearchField($productPriceTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$productPriceToSearchField, $productPriceTo); - } - - public function selectProductSearchField($value) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$productSelectSearchDropDown, $value); - } - - public function clickOnProductSkuFor($productSku) - { - $I = $this->acceptanceTester; - $selector = "//td[contains(@class, 'col-sku')][contains(text(), '" . $productSku . "')]/parent::tr"; - $I->click($selector); - } - - public function enterProductQtyFor($productSku, $productQty) - { - $I = $this->acceptanceTester; - $selector = "//td[contains(@class, 'col-sku')][contains(text(), '" . $productSku . "')]/parent::tr"; - $I->fillField($selector, $productQty); - } - - public function clickOnAddSelectedProductsToOrderButton() - { - $I = $this->acceptanceTester; - $I->click(self::$addSelectedProductToOrderButton); - $I->waitForLoadingMaskToDisappear(); - } - - public function clickOnProductsSearchButton() - { - $I = $this->acceptanceTester; - $I->click(self::$productsSearchButton); - $I->waitForLoadingMaskToDisappear(); - } - - public function clickOnProductsSearchResetButton() - { - $I = $this->acceptanceTester; - $I->click(self::$productsResetFilterButton); - $I->waitForLoadingMaskToDisappear(); - } - - // TODO: Add Product methods - - - /** - * Sales - Orders - "Account Information" Methods - */ - public function enterAccountInformationGroup($groupName) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$groupDropDown, $groupName); - } - - public function selectAccountInformationGroupGeneral() - { - self::enterAccountInformationGroup('General'); - } - - public function enterAccountInformationEmail($customerEmail) - { - $I = $this->acceptanceTester; - $I->fillField(self::$emailAddressField, $customerEmail); - } - - public function verifyAccountInformationEmail($customerEmail) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$emailAddressField, $customerEmail); - } - - /** - * Sales - Orders - "Address Information" Methods - Billing - */ - public function enterBillingPrefix($prefix) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingPrefixField, $prefix); - } - - public function verifyBillingPrefix($prefix) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingPrefixField, $prefix); - } - - public function enterBillingFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingFirstNameField, $firstName); - } - - public function verifyBillingFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingFirstNameField, $firstName); - } - - public function enterBillingMiddleName($middleName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingMiddleNameField, $middleName); - } - - public function verifyBillingMiddleName($middleName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingMiddleNameField, $middleName); - } - - public function enterBillingLastName($lastName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingLastNameField, $lastName); - } - - public function verifyBillingLastName($lastName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingLastNameField, $lastName); - } - - public function enterBillingSuffix($suffix) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingSuffixField, $suffix); - } - - public function verifyBillingSuffix($suffix) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingSuffixField, $suffix); - } - - public function enterBillingCompany($company) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingCompanyField, $company); - } - - public function verifyBillingCompany($company) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingCompanyField, $company); - } - - public function enterBillingAddress1($address1) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingAddress1Field, $address1); - } - - public function verifyBillingAddress1($address1) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingAddress1Field, $address1); - } - - public function enterBillingAddress2($address2) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingAddress2Field, $address2); - } - - public function verifyBillingAddress2($address2) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingAddress2Field, $address2); - } - - public function enterBillingCity($city) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingCityField, $city); - } - - public function verifyBillingCity($city) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingCityField, $city); - } - - public function enterBillingCountry($country) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$billingCountryDropDown, $country); - } - - public function verifyBillingCountry($country) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$billingCountryDropDown, $country); - } - - public function enterBillingState($stateProvince) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$billingStateDropDown, $stateProvince); - } - - public function enterBillingProvince($province) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingProvinceField, $province); - } - - public function verifyBillingState($state) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$billingStateDropDown, $state); - } - - public function verifyBillingProvince($province) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingProvinceField, $province); - } - - public function enterBillingZipPostalCode($zipCode) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingZipPostalCodeField, $zipCode); - } - - public function verifyBillingZipPostalCode($zipCode) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingZipPostalCodeField, $zipCode); - } - - public function enterBillingPhoneNumber($phoneNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingPhoneNumberField, $phoneNumber); - } - - public function verifyBillingPhoneNumber($phoneNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingPhoneNumberField, $phoneNumber); - } - - public function enterBillingFaxNumber($faxNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingFaxNumberField, $faxNumber); - } - - public function verifyBillingFaxNumber($faxNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingFaxNumberField, $faxNumber); - } - - public function enterBillingVatNumber($taxVatNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$billingVatNumberField, $taxVatNumber); - } - - public function verifyBillingVatNumber($taxVatNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$billingVatNumberField, $taxVatNumber); - } - - public function clickOnBillingValidateVatNumberLink() - { - $I = $this->acceptanceTester; - $I->click(self::$billingValidateVatNumberLink); - $I->waitForLoadingMaskToDisappear(); - } - - public function clickOnBillingSaveInAddressBook() - { - $I = $this->acceptanceTester; - $I->click(self::$billingSaveInAddressBook); - } - - /** - * Sales - Orders - "Address Information" Methods - Shipping - */ - public function clickOnSameAsBillingAddress() - { - $I = $this->acceptanceTester; - $I->click(self::$sameAsBillingAddressCheckbox); - } - - public function enterShippingPrefix($prefix) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingPrefixField, $prefix); - } - - public function verifyShippingPrefix($prefix) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingPrefixField, $prefix); - } - - public function enterShippingFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingFirstNameField, $firstName); - } - - public function verifyShippingFirstName($firstName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingFirstNameField, $firstName); - } - - public function enterShippingMiddleName($middleName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingMiddleNameField, $middleName); - } - - public function verifyShippingMiddleName($middleName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingMiddleNameField, $middleName); - } - - public function enterShippingLastName($lastName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingLastNameField, $lastName); - } - - public function verifyShippingLastName($lastName) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingLastNameField, $lastName); - } - - public function enterShippingSuffix($suffix) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingSuffixField, $suffix); - } - - public function verifyShippingSuffix($suffix) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingSuffixField, $suffix); - } - - public function enterShippingCompany($company) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingCompanyField, $company); - } - - public function verifyShippingCompany($company) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingCompanyField, $company); - } - - public function enterShippingAddress1($address1) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingAddress1Field, $address1); - } - - public function verifyShippingAddress1($address1) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingAddress1Field, $address1); - } - - public function enterShippingAddress2($address2) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingAddress2Field, $address2); - } - - public function verifyShippingAddress2($address2) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingAddress2Field, $address2); - } - - public function enterShippingCity($city) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingCityField, $city); - } - - public function verifyShippingCity($city) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingCityField, $city); - } - - public function enterShippingCountry($country) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$shippingCountryDropDown, $country); - } - - public function verifyShippingCountry($country) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$shippingCountryDropDown, $country); - } - - public function enterShippingState($stateProvince) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$shippingStateDropDown, $stateProvince); - } - - public function enterShippingProvince($province) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingProvinceField, $province); - } - - public function verifyShippingState($state) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$shippingStateDropDown, $state); - } - - public function verifyShippingProvince($province) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingProvinceField, $province); - } - - public function enterShippingZipPostalCode($zipCode) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingZipPostalCodeField, $zipCode); - } - - public function verifyShippingZipPostalCode($zipCode) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingZipPostalCodeField, $zipCode); - } - - public function enterShippingPhoneNumber($phoneNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingPhoneNumberField, $phoneNumber); - } - - public function verifyShippingPhoneNumber($phoneNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingPhoneNumberField, $phoneNumber); - } - - public function enterShippingFaxNumber($faxNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingFaxNumberField, $faxNumber); - } - - public function verifyShippingFaxNumber($faxNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingFaxNumberField, $faxNumber); - } - - public function enterShippingVatNumber($taxVatNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$shippingVatNumberField, $taxVatNumber); - } - - public function verifyShippingVatNumber($taxVatNumber) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$shippingVatNumberField, $taxVatNumber); - } - - public function clickOnShippingValidateVatNumberLink() - { - $I = $this->acceptanceTester; - $I->click(self::$shippingValidateVatNumberLink); - $I->waitForLoadingMaskToDisappear(); - } - - public function clickOnShippingSaveInAddressBook() - { - $I = $this->acceptanceTester; - $I->click(self::$shippingSaveInAddressBookCheckbox); - } - - public function verifyBillingAddress($customerData) - { - self::verifyBillingPrefix($customerData['prefix']); - self::verifyBillingFirstName($customerData['firstname']); - self::verifyBillingMiddleName($customerData['middlename']); - self::verifyBillingLastName($customerData['lastname']); - self::verifyBillingSuffix($customerData['suffix']); - self::verifyBillingCompany($customerData['company']); - self::verifyBillingAddress1($customerData['address']['address1']); - self::verifyBillingAddress2($customerData['address']['address2']); - self::verifyBillingCity($customerData['address']['city']); - self::verifyBillingCountry($customerData['address']['country']); - self::verifyBillingState($customerData['address']['state']); - self::verifyBillingZipPostalCode($customerData['address']['zipCode']); - self::verifyBillingPhoneNumber($customerData['phoneNumber']); - self::verifyBillingFaxNumber($customerData['faxNumber']); - } - - public function verifyShippingAddress($customerData) - { - self::verifyShippingPrefix($customerData['prefix']); - self::verifyShippingFirstName($customerData['firstname']); - self::verifyShippingMiddleName($customerData['middlename']); - self::verifyShippingLastName($customerData['lastname']); - self::verifyShippingSuffix($customerData['suffix']); - self::verifyShippingCompany($customerData['company']); - self::verifyShippingAddress1($customerData['address']['address1']); - self::verifyShippingAddress2($customerData['address']['address2']); - self::verifyShippingCity($customerData['address']['city']); - self::verifyShippingCountry($customerData['address']['country']); - self::verifyShippingState($customerData['address']['state']); - self::verifyShippingZipPostalCode($customerData['address']['zipCode']); - self::verifyShippingPhoneNumber($customerData['phoneNumber']); - self::verifyShippingFaxNumber($customerData['faxNumber']); - } - - /** - * Sales - Orders - "Payment & Shipping Information" Methods - */ - public function clickOnGetShippingMethodsAndRatesLink() - { - $I = $this->acceptanceTester; - $I->click(self::$getShippingMethodsAndRatesLink); - $I->waitForLoadingMaskToDisappear(); - } - - // TODO: Add Payment Method selection Methods - - // TODO: Add more Shipping Method selection Methods - - public function clickOnShippingMethod($shippingMethodName) - { - $I = $this->acceptanceTester; - $selector = "//label[contains(@class, 'admin__field-label')][contains(text(), '" . $shippingMethodName . "')]/parent::li"; - $I->click($selector); - $I->waitForLoadingMaskToDisappear(); - } - - public function clickOnFixedShippingMethod() - { - self::clickOnShippingMethod('Fixed'); - } - - public function clickOnTableRateShippingMethod() - { - self::clickOnShippingMethod('Table Rate'); - } - - public function clickOnFreeShippingMethod() - { - self::clickOnShippingMethod('Free'); - } - - /** - * Sales - Orders - "Order Total" Methods - */ - public function enterOrderComments($comments) - { - $I = $this->acceptanceTester; - $I->fillField(self::$orderCommentsField, $comments); - } - - public function verifyOrderComments($comments) - { - $I = $this->acceptanceTester; - $I->seeInField(self::$orderCommentsField, $comments); - } - - public function getSubTotalPriceValue() - { - $I = $this->acceptanceTester; - return $I->grabTextFrom(self::$subTotalPrice); - } - - public function getShippingHandlingValue() - { - $I = $this->acceptanceTester; - return $I->grabTextFrom(self::$shippingAndHandlingPrice); - } - - public function getDiscountPriceValue() - { - $I = $this->acceptanceTester; - return $I->grabTextFrom(self::$discountPrice); - } - - public function getTaxPriceValue() - { - $I = $this->acceptanceTester; - return $I->grabTextFrom(self::$taxPrice); - } - - public function getGrandTotalPriceValue() - { - $I = $this->acceptanceTester; - return $I->grabTextFrom(self::$grandTotalPrice); - } - - public function verifySubTotalPrice($expectedValue) - { - $I = $this->acceptanceTester; - $I->assertEquals(self::getSubTotalPriceValue(), $expectedValue); - } - - public function verifyShippingHandlingPrice($expectedValue) - { - $I = $this->acceptanceTester; - $I->assertEquals(self::getShippingHandlingValue(), $expectedValue); - } - - public function verifyDiscountPrice($expectedValue) - { - $I = $this->acceptanceTester; - $I->assertEquals(self::getDiscountPriceValue(), $expectedValue); - } - - public function verifyTaxPrice($expectedValue) - { - $I = $this->acceptanceTester; - $I->assertEquals(self::getTaxPriceValue(), $expectedValue); - } - - public function verifyGrandTotalPrice($expectedValue) - { - $I = $this->acceptanceTester; - $I->assertEquals(self::getGrandTotalPriceValue(), $expectedValue); - } - - public function clickOnAppendComments() - { - $I = $this->acceptanceTester; - $I->click(self::$appendCommentsCheckbox); - } - - public function clickOnEmailOrderConfirmation() - { - $I = $this->acceptanceTester; - $I->click(self::$emailOrderConfirmationCheckbox); - } - - public function clickOnBottomSubmitButton() - { - $I = $this->acceptanceTester; - $I->click(self::$bottomSubmitOrderButton); - $I->waitForPageLoad(); - } -} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderDetailsPage.php b/src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderDetailsPage.php deleted file mode 100644 index eb1343262..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderDetailsPage.php +++ /dev/null @@ -1,510 +0,0 @@ -acceptanceTester; - $I->seeElement(self::$youCreatedAnOrderSuccessMessage); - } - - public function clickOnBackButton() - { - $I = $this->acceptanceTester; - $I->click(self::$backButton); - } - - public function clickOnCancelButton() - { - $I = $this->acceptanceTester; - $I->click(self::$cancelButton); - } - - public function clickOnSendEmailButton() - { - $I = $this->acceptanceTester; - $I->click(self::$sendEmailButton); - } - - public function clickOnHoldButton() - { - $I = $this->acceptanceTester; - $I->click(self::$holdButton); - } - - public function clickOnInvoiceButton() - { - $I = $this->acceptanceTester; - $I->click(self::$invoiceButton); - } - - public function clickOnShipButton() - { - $I = $this->acceptanceTester; - $I->click(self::$shipButton); - } - - public function clickOnReorderButton() - { - $I = $this->acceptanceTester; - $I->click(self::$reorderButton); - } - - public function clickOnEditOrderButton() - { - $I = $this->acceptanceTester; - $I->click(self::$editButton); - } - - public function clickOnInformationSection() - { - $I = $this->acceptanceTester; - $I->click(self::$informationSectionLink); - } - - public function clickOnInvoicesSection() - { - $I = $this->acceptanceTester; - $I->click(self::$invoicesSectionLink); - } - - public function clickOnCreditMemosSection() - { - $I = $this->acceptanceTester; - $I->click(self::$creditMemosSectionLink); - } - - public function clickOnShipmentsSection() - { - $I = $this->acceptanceTester; - $I->click(self::$shipmentsSectionLink); - } - - public function clickOnCommentsHistorySection() - { - $I = $this->acceptanceTester; - $I->click(self::$commentsHistoryLink); - } - - public function verifyThereIsAnOrderNumber() - { - $I = $this->acceptanceTester; - $I->see('Order #', self::$orderIdTitle); - } - - public function verifyThatTheOrderWasPlacedToday() - { - $I = $this->acceptanceTester; - $today = date("M j, Y"); - $I->see($today, self::$orderDateText); - } - - public function verifyOrderStatus($expectedStatus) - { - $I = $this->acceptanceTester; - $I->see($expectedStatus, self::$orderStatusText); - } - - public function verifyOrderStatusPending() - { - self::verifyOrderStatus('Pending'); - } - - public function verifyPurchasedFrom($expectedStore) - { - $I = $this->acceptanceTester; - $I->see($expectedStore, self::$purchasedFromText); - } - - public function verifyPurchasedFromDefaultStoreView() - { - self::verifyPurchasedFrom('Default Store View'); - } - - public function verifyCustomerName($customerName) - { - $I = $this->acceptanceTester; - $I->see($customerName, self::$customerNameText); - } - - public function verifyCustomerEmail($customerEmail) - { - $I = $this->acceptanceTester; - $I->see($customerEmail, self::$emailText); - } - - public function verifyCustomerGroup($customerGroup) - { - $I = $this->acceptanceTester; - $I->see($customerGroup, self::$customerGroupText); - } - - public function verifyBillingFirstName($billingFirstName) - { - $I = $this->acceptanceTester; - $I->see($billingFirstName, self::$billingAddressText); - } - - public function verifyBillingLastName($billingLastName) - { - $I = $this->acceptanceTester; - $I->see($billingLastName, self::$billingAddressText); - } - - public function verifyBillingCompany($billingCompany) - { - $I = $this->acceptanceTester; - $I->see($billingCompany, self::$billingAddressText); - } - - public function verifyBillingAddress1($billingAddress1) - { - $I = $this->acceptanceTester; - $I->see($billingAddress1, self::$billingAddressText); - } - - public function verifyBillingAddress2($billingAddress2) - { - $I = $this->acceptanceTester; - $I->see($billingAddress2, self::$billingAddressText); - } - - public function verifyBillingCity($billingCity) - { - $I = $this->acceptanceTester; - $I->see($billingCity, self::$billingAddressText); - } - - public function verifyBillingCountry($billingCountry) - { - $I = $this->acceptanceTester; - $I->see($billingCountry, self::$billingAddressText); - } - - public function verifyBillingState($billingState) - { - $I = $this->acceptanceTester; - $I->see($billingState, self::$billingAddressText); - } - - public function verifyBillingProvince($billingProvince) - { - $I = $this->acceptanceTester; - $I->see($billingProvince, self::$billingAddressText); - } - - public function verifyBillingZipPostalCode($billingZipPostalCode) - { - $I = $this->acceptanceTester; - $I->see($billingZipPostalCode, self::$billingAddressText); - } - - public function verifyBillingPhoneNumber($billingPhoneNumber) - { - $I = $this->acceptanceTester; - $I->see($billingPhoneNumber, self::$billingAddressText); - } - - public function verifyBillingVatTaxNumber($billingVatTaxNumber) - { - $I = $this->acceptanceTester; - $I->see($billingVatTaxNumber, self::$billingAddressText); - } - - public function verifyBillingAddressInformation($customerData) - { - self::verifyBillingFirstName($customerData['firstname']); - self::verifyBillingLastName($customerData['lastname']); - self::verifyBillingCompany($customerData['company']); - self::verifyBillingAddress1($customerData['address']['address1']); - self::verifyBillingAddress2($customerData['address']['address2']); - self::verifyBillingCity($customerData['address']['city']); - self::verifyBillingState($customerData['address']['state']); - self::verifyBillingZipPostalCode($customerData['address']['zipCode']); - self::verifyBillingCountry($customerData['address']['country']); - self::verifyBillingPhoneNumber($customerData['phoneNumber']); - self::verifyBillingVatTaxNumber($customerData['taxVatNumber']); - } - - public function verifyShippingFirstName($shippingFirstName) - { - $I = $this->acceptanceTester; - $I->see($shippingFirstName, self::$shippingAddressText); - } - - public function verifyShippingLastName($shippingLastName) - { - $I = $this->acceptanceTester; - $I->see($shippingLastName, self::$shippingAddressText); - } - - public function verifyShippingCompany($shippingCompany) - { - $I = $this->acceptanceTester; - $I->see($shippingCompany, self::$shippingAddressText); - } - - public function verifyShippingAddress1($shippingAddress1) - { - $I = $this->acceptanceTester; - $I->see($shippingAddress1, self::$shippingAddressText); - } - - public function verifyShippingAddress2($shippingAddress2) - { - $I = $this->acceptanceTester; - $I->see($shippingAddress2, self::$shippingAddressText); - } - - public function verifyShippingCity($shippingCity) - { - $I = $this->acceptanceTester; - $I->see($shippingCity, self::$shippingAddressText); - } - - public function verifyShippingCountry($shippingCountry) - { - $I = $this->acceptanceTester; - $I->see($shippingCountry, self::$shippingAddressText); - } - - public function verifyShippingState($shippingState) - { - $I = $this->acceptanceTester; - $I->see($shippingState, self::$shippingAddressText); - } - - public function verifyShippingProvince($shippingProvince) - { - $I = $this->acceptanceTester; - $I->see($shippingProvince, self::$shippingAddressText); - } - - public function verifyShippingZipPostalCode($shippingZipPostalCode) - { - $I = $this->acceptanceTester; - $I->see($shippingZipPostalCode, self::$shippingAddressText); - } - - public function verifyShippingPhoneNumber($shippingPhoneNumber) - { - $I = $this->acceptanceTester; - $I->see($shippingPhoneNumber, self::$shippingAddressText); - } - - public function verifyShippingVatTaxNumber($shippingVatTaxNumber) - { - $I = $this->acceptanceTester; - $I->see($shippingVatTaxNumber, self::$shippingAddressText); - } - - public function verifyShippingAddressInformation($customerData) - { - self::verifyShippingFirstName($customerData['firstname']); - self::verifyShippingLastName($customerData['lastname']); - self::verifyShippingCompany($customerData['company']); - self::verifyShippingAddress1($customerData['address']['address1']); - self::verifyShippingAddress2($customerData['address']['address2']); - self::verifyShippingCity($customerData['address']['city']); - self::verifyShippingState($customerData['address']['state']); - self::verifyShippingZipPostalCode($customerData['address']['zipCode']); - self::verifyShippingCountry($customerData['address']['country']); - self::verifyShippingPhoneNumber($customerData['phoneNumber']); - self::verifyShippingVatTaxNumber($customerData['taxVatNumber']); - } - - public function verifyPaymentType($expectedPaymentType) - { - $I = $this->acceptanceTester; - $I->see($expectedPaymentType, self::$paymentTypeText); - } - - public function verifyPaymentTypeCheckMoneyOrder() - { - self::verifyPaymentType('Check / Money order'); - } - - public function verifyPaymentCurrencyType($expectedCurrency) - { - $I = $this->acceptanceTester; - $I->see($expectedCurrency, self::$orderCurrencyTypeText); - } - - public function verifyPaymentCurrencyUSD() - { - self::verifyPaymentCurrencyType('USD'); - } - - public function verifyShippingMethodType($expectedShippingMethod) - { - $I = $this->acceptanceTester; - $I->see($expectedShippingMethod, self::$shippingMethodNameText); - } - - public function verifyShippingMethodFixedRate() - { - self::verifyShippingMethodType('Flat Rate - Fixed'); - } - - public function verifyShippingMethodPrice($expectedPrice) - { - $I = $this->acceptanceTester; - $I->see($expectedPrice, self::$shippingMethodPriceText); - } - - public function verifyItemsOrderedFor($productDetails) - { - $I = $this->acceptanceTester; - $selector = "//div[contains(@class, 'product-title')][contains(text(), '" . $productDetails['productName'] . "')]/parent::div/parent::td/parent::tr"; - - $I->see($productDetails['productName'], $selector); - $I->see($productDetails['sku'], $selector); - $I->see($productDetails['price'], $selector); - - // TODO: Add more "Items Ordered" Methods - } - - public function verifyOrderStatusDropDown($expectedStatus) - { - $I = $this->acceptanceTester; - $I->seeOptionIsSelected(self::$orderStatusDropDown, $expectedStatus); - } - - public function verifyOrderStatusDropDownPending() - { - self::verifyOrderStatusDropDown('Pending'); - } - - public function verifyOrderComments($expectedOrderComments) - { - $I = $this->acceptanceTester; - $I->see($expectedOrderComments, self::$orderCommentsField); - } - - public function enterOrderComments($orderComments) - { - $I = $this->acceptanceTester; - $I->fillField(self::$orderCommentsField, $orderComments); - } - - public function clickOnNotifyCustomerByEmail() - { - $I = $this->acceptanceTester; - $I->click(self::$notifyCustomerByEmailCheckbox); - } - - public function clickOnVisibleOnStorefront() - { - $I = $this->acceptanceTester; - $I->click(self::$visibleOnStorefrontCheckbox); - } - - public function clickOnSubmitCommentButton() - { - $I = $this->acceptanceTester; - $I->click(self::$submitCommentButton); - } - - public function verifySubTotalPrice($expectedSubTotal) - { - $I = $this->acceptanceTester; - $I->see($expectedSubTotal, self::$subtotalPriceText); - } - - public function verifyShippingHandlingPrice($expectedShippingHandling) - { - $I = $this->acceptanceTester; - $I->see($expectedShippingHandling, self::$shippingHandlingPriceText); - } - - public function verifyGrandTotalPrice($expectedGrandTotal) - { - $I = $this->acceptanceTester; - $I->see($expectedGrandTotal, self::$grandTotalPriceText); - } - - public function verifyTotalPaidPrice($expectedTotalPaid) - { - $I = $this->acceptanceTester; - $I->see($expectedTotalPaid, self::$totalPaidPriceText); - } - - public function verifyTotalRefundedPrice($expectedRefunded) - { - $I = $this->acceptanceTester; - $I->see($expectedRefunded, self::$totalRefundedPriceText); - } - - public function verifyTotalDuePrice($expectedTotalDue) - { - $I = $this->acceptanceTester; - $I->see($expectedTotalDue, self::$totalDuePriceText); - } -} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderGrid.php b/src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderGrid.php deleted file mode 100644 index 442ccd550..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Sales/AdminOrderGrid.php +++ /dev/null @@ -1,97 +0,0 @@ -acceptanceTester; - $I->click(self::$createNewOrderButton); - $I->waitForPageLoad(); - } - - public function enterPurchaseDateFromFilter($purchaseDateFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterPurchaseDateFromField, $purchaseDateFrom); - } - - public function enterPurchaseDateToFilter($purchaseDateTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterPurchaseDateToField, $purchaseDateTo); - } - - public function enterGrandTotalBaseFromFilter($grandTotalBaseFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterGrandTotalBaseFromField, $grandTotalBaseFrom); - } - - public function enterGrandTotalBaseToFilter($grandTotalBaseTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterGrandTotalBaseToField, $grandTotalBaseTo); - } - - public function enterGrandTotalPurchasedFromFilter($grandTotalPurchasedFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterGrandTotalPurchasedFromField, $grandTotalPurchasedFrom); - } - - public function enterGrandTotalPurchasedToFilter($grandTotalPurchasedTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterGrandTotalPurchasedToField, $grandTotalPurchasedTo); - } - - public function selectPurchasePointFilter($purchasePoint) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$filterPurchasePointDropDownMenu, $purchasePoint); - } - - public function enterIdFilter($id) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterIdField, $id); - } - - public function enterBillToNameFilter($billToName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterBillToNameField, $billToName); - } - - public function enterShipToNameFilter($shipToName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterShipToNameField, $shipToName); - } - - public function selectStatusFilter($status) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$filterStatusDropDownMenu, $status); - } -} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Page/Sales/Invoice/AdminInvoiceGrid.php b/src/Magento/AcceptanceTestFramework/Page/Sales/Invoice/AdminInvoiceGrid.php deleted file mode 100644 index 7302ccc41..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Sales/Invoice/AdminInvoiceGrid.php +++ /dev/null @@ -1,102 +0,0 @@ -acceptanceTester; - $I->fillField(self::$filterInvoiceDateFromField, $invoiceDateFrom); - } - - public function enterFilterInvoiceDateTo($invoiceDateTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterInvoiceDateToField, $invoiceDateTo); - } - - public function enterFilterOrderDateFrom($orderDateFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterOrderDateFromField, $orderDateFrom); - } - - public function enterFilterOrderDateTo($orderDateTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterOrderDateToField, $orderDateTo); - } - - public function enterFilterBaseGrandTotalFrom($baseGrandTotalFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterBaseGrandTotalFromField, $baseGrandTotalFrom); - } - - public function enterFilterBaseGrandTotalTo($baseGrandTotalTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterBaseGrandTotalToField, $baseGrandTotalTo); - } - - public function enterFilterGrandTotalFrom($grandTotalFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterGrandTotalFromField, $grandTotalFrom); - } - - public function enterFilterGrandTotalTo($grandTotalTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterGrandTotalToField, $grandTotalTo); - } - - public function selectPurchasedFrom($purchasedFrom) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$filterPurchasedFromDropDown, $purchasedFrom); - } - - public function selectStatus($status) - { - $I = $this->acceptanceTester; - $I->selectOption(self::$filterStatusDropDown, $status); - } - - public function enterInvoice($invoice) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterInvoiceField, $invoice); - } - - public function enterOrder($order) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterOrderField, $order); - } - - public function enterBillToName($billToName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterBillToNameField, $billToName); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Sales/Shipment/AdminShipmentGrid.php b/src/Magento/AcceptanceTestFramework/Page/Sales/Shipment/AdminShipmentGrid.php deleted file mode 100644 index e3de23134..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Sales/Shipment/AdminShipmentGrid.php +++ /dev/null @@ -1,81 +0,0 @@ -acceptanceTester; - $I->fillField(self::$filterShipDateFromField, $shipDateFrom); - } - - public function enterFilterShipDateTo($shipDateTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterShipDateToField, $shipDateTo); - } - - public function enterFilterOrderDateFrom($orderDateFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterOrderDateFromField, $orderDateFrom); - } - - public function enterFilterOrderDateTo($orderDateTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterOrderDateToField, $orderDateTo); - } - - public function enterTotalQtyFrom($totalQtyFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterTotalQtyFromField, $totalQtyFrom); - } - - public function enterTotalQtyTo($totalQtyTo) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterTotalQtyToField, $totalQtyTo); - } - - public function selectPurchasedFrom($purchasedFrom) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterPurchasedFromDropDown, $purchasedFrom); - } - - public function enterShipment($shipment) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterShipmentField, $shipment); - } - - public function enterOrder($order) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterOrderField, $order); - } - - public function enterShipToName($shipToName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$filterShipToNameField, $shipToName); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Sales/etc/Page.xml b/src/Magento/AcceptanceTestFramework/Page/Sales/etc/Page.xml deleted file mode 100644 index 47a9c545b..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Sales/etc/Page.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd index 0b1827509..eecd71269 100644 --- a/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd +++ b/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd @@ -38,7 +38,7 @@ - + MCA path for the page. For example: "catalog/product/view". @@ -94,6 +94,13 @@ + + + + Parent block class name, if not specified, Magento\AcceptanceTestFramework\Page\Block\Block is used. + + + @@ -120,7 +127,7 @@ - + If the element is a required field in the ui. @@ -141,6 +148,13 @@ + + + + If waitForPageLoad() is required after default action. + + + diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php index 1b0c407e4..2bae29f1e 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php @@ -7,12 +7,59 @@ namespace Magento\AcceptanceTestFramework\Util; /** - * Class ModuleResolver, resolve module path. + * Class ModuleResolver, resolve module path based on enabled modules of target Magento instance. * * @api */ class ModuleResolver { + /** + * Environment field name for module whitelist. + */ + const MODULE_WHITELIST = 'MODULE_WHITELIST'; + + /** + * Enabled modules. + * + * @var array|null + */ + protected $enabledModules = null; + + /** + * Paths for enabled modules. + * + * @var array|null + */ + protected $enabledModulePaths = null; + + /** + * Configuration instance. + * + * @var \Magento\AcceptanceTestFramework\Config\DataInterface + */ + protected $configuration; + + /** + * Admin url for integration token. + * + * @var string + */ + protected $adminTokenUrl = "rest/V1/integration/admin/token"; + + /** + * Url for with module list. + * + * @var string + */ + protected $moduleUrl = "rest/V1/modules"; + + /** + * List of known directory that does not map to a Magento module. + * + * @var array + */ + protected $knownDirectories = ['SampleData' => 1]; + /** * ModuleResolver instance. * @@ -20,6 +67,13 @@ class ModuleResolver */ private static $instance = null; + /** + * SequenceSorter instance. + * + * @var ModuleResolver\SequenceSorterInterface + */ + protected $sequenceSorter; + /** * Get ModuleResolver instance. * @@ -34,11 +88,63 @@ public static function getInstance() } /** - * ModuleResolver constructor. + * @constructor */ private function __construct() { - // + $objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); + $this->sequenceSorter = $objectManager->get('Magento\AcceptanceTestFramework\Util\ModuleResolver\SequenceSorterInterface'); + } + + /** + * Return an array of enabled modules of target Magento instance. + * + * @return array + */ + public function getEnabledModules() + { + if (isset($this->enabledModules)) { + return $this->enabledModules; + } + + $token = $this->getAdminToken(); + if (!$token || !is_string($token)) { + $this->enabledModules = []; + return $this->enabledModules; + } + + $url = $_ENV['MAGENTO_BASE_URL'] . $this->moduleUrl; + + $headers = [ + 'Authorization: Bearer ' . $token, + ]; + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + $response = curl_exec($ch); + + if (!$response) { + $this->enabledModules = []; + } else { + $this->enabledModules = json_decode($response); + } + return $this->enabledModules; + } + + /** + * Return an array of module whitelist that not exist in target Magento instance. + * + * @return array + */ + protected function getModuleWhitelist() + { + $moduleWhitelist = getenv(self::MODULE_WHITELIST); + + if (empty($moduleWhitelist)) { + return []; + } + return array_map('trim', explode(',', $moduleWhitelist)); } /** @@ -48,9 +154,79 @@ private function __construct() */ public function getModulesPath() { - $modulePath = BP . '/src/Magento/AcceptanceTestFramework/Page'; - $allModulePaths = glob($modulePath . '/*'); + if (isset($this->enabledModulePaths)) { + return $this->enabledModulePaths; + } - return $allModulePaths; + $enabledModules = $this->getEnabledModules(); + $modulePath = defined('TESTS_MODULE_PATH') ? TESTS_MODULE_PATH : TESTS_BP; + $allModulePaths = glob($modulePath . '*/*'); + if (empty($enabledModules)) { + $this->enabledModulePaths = $allModulePaths; + return $this->enabledModulePaths; + } + + $enabledModules = array_merge($enabledModules, $this->getModuleWhitelist()); + $enabledDirectories = []; + foreach ($enabledModules as $module) { + $directoryName = explode('_', $module)[1]; + $enabledDirectories[$directoryName] = $directoryName; + } + + foreach ($allModulePaths as $index => $modulePath) { + $moduleShortName = basename($modulePath); + if (!isset($enabledDirectories[$moduleShortName]) && !isset($this->knownDirectories[$moduleShortName])) { + unset($allModulePaths[$index]); + } + } + + $this->enabledModulePaths = $allModulePaths; + return $this->enabledModulePaths; + } + + /** + * Get the API token for admin. + * + * @return string|bool + */ + protected function getAdminToken() + { + $login = $_ENV['MAGENTO_ADMIN_USERNAME']; + $password = $_ENV['MAGENTO_ADMIN_PASSWORD']; + if (!$login || !$password || !isset($_ENV['MAGENTO_BASE_URL'])) { + return false; + } + + $url = $_ENV['MAGENTO_BASE_URL'] . $this->adminTokenUrl; + $data = [ + 'username' => $login, + 'password' => $password + ]; + $headers = [ + 'Content-Type: application/json', + ]; + + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + + $response = curl_exec($ch); + if (!$response) { + return $response; + } + return json_decode($response); + } + + /** + * Sort files according module sequence. + * + * @param array $files + * @return array + */ + public function sortFilesByModuleSequence(array $files) + { + return $this->sequenceSorter->sort($files); } } diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php new file mode 100644 index 000000000..ac80d06fb --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php @@ -0,0 +1,19 @@ + Date: Thu, 15 Jun 2017 23:10:09 +0300 Subject: [PATCH 084/149] MQE-148: Add static tests to Acceptance Test Framework and run it on Travis CI --- .travis.yml | 7 + composer.json | 3 + composer.lock | 82 ++- .../Magento/Sniffs/Annotations/Helper.php | 576 +++++++++++++++ .../RequireAnnotatedAttributesSniff.php | 357 +++++++++ .../RequireAnnotatedMethodsSniff.php | 694 ++++++++++++++++++ .../Sniffs/Arrays/ShortArraySyntaxSniff.php | 28 + .../Magento/Sniffs/Files/LineLengthSniff.php | 34 + .../LiteralNamespacesSniff.php | 66 ++ .../Sniffs/MicroOptimizations/IsNullSniff.php | 36 + .../NamingConventions/InterfaceNameSniff.php | 42 ++ .../NamingConventions/ReservedWordsSniff.php | 113 +++ .../Whitespace/EmptyLineMissedSniff.php | 66 ++ .../Whitespace/MultipleEmptyLinesSniff.php | 49 ++ dev/tests/static/Magento/ruleset.xml | 29 + .../Util/Iterator/File.php | 1 - 16 files changed, 2179 insertions(+), 4 deletions(-) create mode 100644 .travis.yml create mode 100644 dev/tests/static/Magento/Sniffs/Annotations/Helper.php create mode 100644 dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedAttributesSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/Arrays/ShortArraySyntaxSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/Files/LineLengthSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/LiteralNamespaces/LiteralNamespacesSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/MicroOptimizations/IsNullSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/NamingConventions/InterfaceNameSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/NamingConventions/ReservedWordsSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/Whitespace/EmptyLineMissedSniff.php create mode 100644 dev/tests/static/Magento/Sniffs/Whitespace/MultipleEmptyLinesSniff.php create mode 100644 dev/tests/static/Magento/ruleset.xml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..4aeda749c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: php +php: + - 7.0 + - 7.1 +install: composer install --no-interaction --prefer-source +script: + - vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento diff --git a/composer.json b/composer.json index 4f6348c33..090aea1c1 100755 --- a/composer.json +++ b/composer.json @@ -10,6 +10,9 @@ "fzaninotto/faker": "^1.6", "vlucas/phpdotenv": "~2.4" }, + "require-dev": { + "squizlabs/php_codesniffer": "1.5.3" + }, "autoload": { "psr-4": { "Magento\\AcceptanceTestFramework\\": [ diff --git a/composer.lock b/composer.lock index 5414dec1c..cf83200a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f94a316ccaf873e9783bddf79366b003", - "content-hash": "24d3de389360bc5bbca6f844131f99c4", + "hash": "0f1b9e63e095d2fd8ef798ef2e0d45d6", + "content-hash": "914002cc8b4343fa30ba1b75bd356c68", "packages": [ { "name": "behat/gherkin", @@ -2496,7 +2496,83 @@ "time": "2016-11-23 20:04:58" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "squizlabs/php_codesniffer", + "version": "1.5.3", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "396178ada8499ec492363587f037125bf7b07fcc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/396178ada8499ec492363587f037125bf7b07fcc", + "reference": "396178ada8499ec492363587f037125bf7b07fcc", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.1.2" + }, + "suggest": { + "phpunit/php-timer": "dev-master" + }, + "bin": [ + "scripts/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-phpcs-fixer": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/CommentParser/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2014-05-01 03:07:07" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], diff --git a/dev/tests/static/Magento/Sniffs/Annotations/Helper.php b/dev/tests/static/Magento/Sniffs/Annotations/Helper.php new file mode 100644 index 000000000..53a03b574 --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/Annotations/Helper.php @@ -0,0 +1,576 @@ + + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + * + * @SuppressWarnings(PHPMD) + */ +class Helper +{ + const ERROR_PARSING = 'ErrorParsing'; + + const AMBIGUOUS_TYPE = 'AmbiguousType'; + + const MISSING = 'Missing'; + + const WRONG_STYLE = 'WrongStyle'; + + const WRONG_END = 'WrongEnd'; + + const FAILED_PARSE = 'FailedParse'; + + const CONTENT_AFTER_OPEN = 'ContentAfterOpen'; + + const MISSING_SHORT = 'MissingShort'; + + const EMPTY_DOC = 'Empty'; + + const SPACING_BETWEEN = 'SpacingBetween'; + + const SPACING_BEFORE_SHORT = 'SpacingBeforeShort'; + + const SPACING_BEFORE_TAGS = 'SpacingBeforeTags'; + + const SHORT_SINGLE_LINE = 'ShortSingleLine'; + + const SHORT_NOT_CAPITAL = 'ShortNotCapital'; + + const SHORT_FULL_STOP = 'ShortFullStop'; + + const SPACING_AFTER = 'SpacingAfter'; + + const SEE_ORDER = 'SeeOrder'; + + const EMPTY_SEE = 'EmptySee'; + + const SEE_INDENT = 'SeeIndent'; + + const DUPLICATE_RETURN = 'DuplicateReturn'; + + const MISSING_PARAM_TAG = 'MissingParamTag'; + + const SPACING_AFTER_LONG_NAME = 'SpacingAfterLongName'; + + const SPACING_AFTER_LONG_TYPE = 'SpacingAfterLongType'; + + const MISSING_PARAM_TYPE = 'MissingParamType'; + + const MISSING_PARAM_NAME = 'MissingParamName'; + + const EXTRA_PARAM_COMMENT = 'ExtraParamComment'; + + const PARAM_NAME_NO_MATCH = 'ParamNameNoMatch'; + + const PARAM_NAME_NO_CASE_MATCH = 'ParamNameNoCaseMatch'; + + const INVALID_TYPE_HINT = 'InvalidTypeHint'; + + const INCORRECT_TYPE_HINT = 'IncorrectTypeHint'; + + const TYPE_HINT_MISSING = 'TypeHintMissing'; + + const INCORRECT_PARAM_VAR_NAME = 'IncorrectParamVarName'; + + const RETURN_ORDER = 'ReturnOrder'; + + const MISSING_RETURN_TYPE = 'MissingReturnType'; + + const INVALID_RETURN = 'InvalidReturn'; + + const INVALID_RETURN_VOID = 'InvalidReturnVoid'; + + const INVALID_NO_RETURN = 'InvalidNoReturn'; + + const INVALID_RETURN_NOT_VOID = 'InvalidReturnNotVoid'; + + const INCORRECT_INHERIT_DOC = 'IncorrectInheritDoc'; + + const RETURN_INDENT = 'ReturnIndent'; + + const MISSING_RETURN = 'MissingReturn'; + + const RETURN_NOT_REQUIRED = 'ReturnNotRequired'; + + const INVALID_THROWS = 'InvalidThrows'; + + const THROWS_NOT_CAPITAL = 'ThrowsNotCapital'; + + const THROWS_ORDER = 'ThrowsOrder'; + + const EMPTY_THROWS = 'EmptyThrows'; + + const THROWS_NO_FULL_STOP = 'ThrowsNoFullStop'; + + const SPACING_AFTER_PARAMS = 'SpacingAfterParams'; + + const SPACING_BEFORE_PARAMS = 'SpacingBeforeParams'; + + const SPACING_BEFORE_PARAM_TYPE = 'SpacingBeforeParamType'; + + const LONG_NOT_CAPITAL = 'LongNotCapital'; + + const TAG_NOT_ALLOWED = 'TagNotAllowed'; + + const DUPLICATE_VAR = 'DuplicateVar'; + + const VAR_ORDER = 'VarOrder'; + + const MISSING_VAR_TYPE = 'MissingVarType'; + + const INCORRECT_VAR_TYPE = 'IncorrectVarType'; + + const VAR_INDENT = 'VarIndent'; + + const MISSING_VAR = 'MissingVar'; + + const MISSING_PARAM_COMMENT = 'MissingParamComment'; + + const PARAM_COMMENT_NOT_CAPITAL = 'ParamCommentNotCapital'; + + const PARAM_COMMENT_FULL_STOP = 'ParamCommentFullStop'; + + // tells phpcs to use the default level + const ERROR = 0; + + // default level of warnings is 5 + const WARNING = 6; + + const INFO = 2; + + // Lowest possible level. + const OFF = 1; + + const LEVEL = 'level'; + + const MESSAGE = 'message'; + + /** + * Map of Error Type to Error Severity + * + * @var array + */ + protected static $reportingLevel = [ + self::ERROR_PARSING => [self::LEVEL => self::ERROR, self::MESSAGE => '%s'], + self::FAILED_PARSE => [self::LEVEL => self::ERROR, self::MESSAGE => '%s'], + self::AMBIGUOUS_TYPE => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Ambiguous type "%s" for %s is NOT recommended', + ], + self::MISSING => [self::LEVEL => self::ERROR, self::MESSAGE => 'Missing %s doc comment'], + self::WRONG_STYLE => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'You must use "/**" style comments for a %s comment', + ], + self::WRONG_END => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'You must use "*/" to end a function comment; found "%s"', + ], + self::EMPTY_DOC => [self::LEVEL => self::WARNING, self::MESSAGE => '%s doc comment is empty'], + self::CONTENT_AFTER_OPEN => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'The open comment tag must be the only content on the line', + ], + self::MISSING_SHORT => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Missing short description in %s doc comment', + ], + self::SPACING_BETWEEN => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'There must be exactly one blank line between descriptions in %s comment', + ], + self::SPACING_BEFORE_SHORT => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Extra newline(s) found before %s comment short description', + ], + self::SPACING_BEFORE_TAGS => [ + self::LEVEL => self::INFO, + self::MESSAGE => 'There must be exactly one blank line before the tags in %s comment', + ], + self::SHORT_SINGLE_LINE => [ + self::LEVEL => self::OFF, + self::MESSAGE => '%s comment short description must be on a single line', + ], + self::SHORT_NOT_CAPITAL => [ + self::LEVEL => self::WARNING, + self::MESSAGE => '%s comment short description must start with a capital letter', + ], + self::SHORT_FULL_STOP => [ + self::LEVEL => self::OFF, + self::MESSAGE => '%s comment short description must end with a full stop', + ], + self::SPACING_AFTER => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Additional blank lines found at end of %s comment', + ], + self::SEE_ORDER => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'The @see tag is in the wrong order; the tag precedes @return', + ], + self::EMPTY_SEE => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Content missing for @see tag in %s comment', + ], + self::SEE_INDENT => [ + self::LEVEL => self::OFF, + self::MESSAGE => '@see tag indented incorrectly; expected 1 spaces but found %s', + ], + self::DUPLICATE_RETURN => [ + self::LEVEL => self::ERROR, + self::MESSAGE => 'Only 1 @return tag is allowed in function comment', + ], + self::MISSING_PARAM_TAG => [self::LEVEL => self::ERROR, self::MESSAGE => 'Doc comment for "%s" missing'], + self::SPACING_AFTER_LONG_NAME => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'Expected 1 space after the longest variable name', + ], + self::SPACING_AFTER_LONG_TYPE => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'Expected 1 space after the longest type', + ], + self::MISSING_PARAM_TYPE => [self::LEVEL => self::ERROR, self::MESSAGE => 'Missing type at position %s'], + self::MISSING_PARAM_NAME => [ + self::LEVEL => self::ERROR, + self::MESSAGE => 'Missing parameter name at position %s', + ], + self::EXTRA_PARAM_COMMENT => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Superfluous doc comment at position %s', + ], + self::PARAM_NAME_NO_MATCH => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Doc comment for var %s does not match actual variable name %s at position %s', + ], + self::PARAM_NAME_NO_CASE_MATCH => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Doc comment for var %s does not match case of actual variable name %s at position %s', + ], + self::INVALID_TYPE_HINT => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Unknown type hint "%s" found for %s at position %s', + ], + self::INCORRECT_TYPE_HINT => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Expected type hint "%s"; found "%s" for %s at position %s', + ], + self::TYPE_HINT_MISSING => [ + self::LEVEL => self::INFO, + self::MESSAGE => 'Type hint "%s" missing for %s at position %s', + ], + self::INCORRECT_PARAM_VAR_NAME => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Expected "%s"; found "%s" for %s at position %s', + ], + self::RETURN_ORDER => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'The @return tag is in the wrong order; the tag follows @see (if used)', + ], + self::MISSING_RETURN_TYPE => [ + self::LEVEL => self::ERROR, + self::MESSAGE => 'Return type missing for @return tag in function comment', + ], + self::INVALID_RETURN => [ + self::LEVEL => self::ERROR, + self::MESSAGE => 'Function return type "%s" is invalid', + ], + self::INVALID_RETURN_VOID => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Function return type is void, but function contains return statement', + ], + self::INVALID_NO_RETURN => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Function return type is not void, but function has no return statement', + ], + self::INVALID_RETURN_NOT_VOID => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Function return type is not void, but function is returning void here', + ], + self::INCORRECT_INHERIT_DOC => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'The incorrect inherit doc tag usage. Should be {@inheritdoc}', + ], + self::RETURN_INDENT => [ + self::LEVEL => self::OFF, + self::MESSAGE => '@return tag indented incorrectly; expected 1 space but found %s', + ], + self::MISSING_RETURN => [ + self::LEVEL => self::ERROR, + self::MESSAGE => 'Missing @return tag in function comment', + ], + self::RETURN_NOT_REQUIRED => [ + self::LEVEL => self::WARNING, + self::MESSAGE => '@return tag is not required for constructor and destructor', + ], + self::INVALID_THROWS => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Exception type and comment missing for @throws tag in function comment', + ], + self::THROWS_NOT_CAPITAL => [ + self::LEVEL => self::WARNING, + self::MESSAGE => '@throws tag comment must start with a capital letter', + ], + self::THROWS_ORDER => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'The @throws tag is in the wrong order; the tag follows @return', + ], + self::EMPTY_THROWS => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'Comment missing for @throws tag in function comment', + ], + self::THROWS_NO_FULL_STOP => [ + self::LEVEL => self::OFF, + self::MESSAGE => '@throws tag comment must end with a full stop', + ], + self::SPACING_AFTER_PARAMS => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'Last parameter comment requires a blank newline after it', + ], + self::SPACING_BEFORE_PARAMS => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Parameters must appear immediately after the comment', + ], + self::SPACING_BEFORE_PARAM_TYPE => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'Expected 1 space before variable type', + ], + self::LONG_NOT_CAPITAL => [ + self::LEVEL => self::WARNING, + self::MESSAGE => '%s comment long description must start with a capital letter', + ], + self::TAG_NOT_ALLOWED => [ + self::LEVEL => self::WARNING, + self::MESSAGE => '@%s tag is not allowed in variable comment', + ], + self::DUPLICATE_VAR => [ + self::LEVEL => self::ERROR, + self::MESSAGE => 'Only 1 @var tag is allowed in variable comment', + ], + self::VAR_ORDER => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'The @var tag must be the first tag in a variable comment', + ], + self::MISSING_VAR_TYPE => [ + self::LEVEL => self::ERROR, + self::MESSAGE => 'Var type missing for @var tag in variable comment', + ], + self::INCORRECT_VAR_TYPE => [ + self::LEVEL => self::ERROR, + self::MESSAGE => 'Expected "%s"; found "%s" for @var tag in variable comment', + ], + self::VAR_INDENT => [ + self::LEVEL => self::OFF, + self::MESSAGE => '@var tag indented incorrectly; expected 1 space but found %s', + ], + self::MISSING_VAR => [ + self::LEVEL => self::WARNING, + self::MESSAGE => 'Missing @var tag in variable comment', + ], + self::MISSING_PARAM_COMMENT => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'Missing comment for param "%s" at position %s', + ], + self::PARAM_COMMENT_NOT_CAPITAL => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'Param comment must start with a capital letter', + ], + self::PARAM_COMMENT_FULL_STOP => [ + self::LEVEL => self::OFF, + self::MESSAGE => 'Param comment must end with a full stop', + ], + ]; + + /** + * List of allowed types + * + * @var string[] + */ + protected static $allowedTypes = [ + 'array', + 'boolean', + 'bool', + 'float', + 'integer', + 'int', + 'object', + 'string', + 'resource', + 'callable', + 'true', + 'false', + ]; + + /** + * The current PHP_CodeSniffer_File object we are processing. + * + * @var PHP_CodeSniffer_File + */ + protected $currentFile = null; + + /** + * Constructor for class. + * + * @param PHP_CodeSniffer_File $phpcsFile + */ + public function __construct(PHP_CodeSniffer_File $phpcsFile) + { + $this->currentFile = $phpcsFile; + } + + /** + * Returns the current file object + * + * @return PHP_CodeSniffer_File + */ + public function getCurrentFile() + { + return $this->currentFile; + } + + /** + * Returns the eol character used in the file + * + * @return string + */ + public function getEolChar() + { + return $this->currentFile->eolChar; + } + + /** + * Returns the array of allowed types for magento standard + * + * @return string[] + */ + public function getAllowedTypes() + { + return self::$allowedTypes; + } + + /** + * This method will add the message as an error or warning depending on the configuration + * + * @param int $stackPtr The stack position where the error occurred. + * @param string $code A violation code unique to the sniff message. + * @param string[] $data Replacements for the error message. + * @param int $severity The severity level for this error. A value of 0 + * @return void + */ + public function addMessage($stackPtr, $code, $data = [], $severity = 0) + { + // Does the $code key exist in the report level + if (array_key_exists($code, self::$reportingLevel)) { + $message = self::$reportingLevel[$code][self::MESSAGE]; + $level = self::$reportingLevel[$code][self::LEVEL]; + if ($level === self::WARNING || $level === self::INFO || $level === self::OFF) { + $s = $level; + if ($severity !== 0) { + $s = $severity; + } + $this->currentFile->addWarning($message, $stackPtr, $code, $data, $s); + } else { + $this->currentFile->addError($message, $stackPtr, $code, $data, $severity); + } + } + } + + /** + * Returns if we should filter a particular file + * + * @return bool + */ + public function shouldFilter() + { + $shouldFilter = false; + $filename = $this->getCurrentFile()->getFilename(); + if (preg_match('#(?:/|\\\\)dev(?:/|\\\\)tests(?:/|\\\\)#', $filename)) { + // TODO: Temporarily blacklist anything in dev/tests until a sweep of dev/tests can be made. + // This block of the if should be removed leaving only the phtml condition when dev/tests is swept. + // Skip all dev tests files + $shouldFilter = true; + } elseif (preg_match('#(?:/|\\\\)Test(?:/|\\\\)Unit(?:/|\\\\)#', $filename)) { + $shouldFilter = true; + } elseif (preg_match('/\\.phtml$/', $filename)) { + // Skip all phtml files + $shouldFilter = true; + } + + return $shouldFilter; + } + + /** + * Determine if text is a class name + * + * @param string $class + * @return bool + */ + protected function isClassName($class) + { + $return = false; + if (preg_match('/^\\\\?[A-Z]\\w+(?:\\\\\\w+)*?$/', $class)) { + $return = true; + } + return $return; + } + + /** + * Determine if the text has an ambiguous type + * + * @param string $text + * @param array &$matches Type that was detected as ambiguous is in result. + * @return bool + */ + public function isAmbiguous($text, &$matches = []) + { + return preg_match('/(mixed)/', $text, $matches); + } + + /** + * Take the type and suggest the correct one. + * + * @param string $type + * @return string + */ + public function suggestType($type) + { + $suggestedName = null; + // First check to see if this type is a list of types. If so we break it up and check each + if (preg_match('/^.*?(?:\|.*)+$/', $type)) { + // Return list of all types in this string. + $types = explode('|', $type); + if (is_array($types)) { + // Loop over all types and call this method on each. + $suggestions = []; + foreach ($types as $t) { + $suggestions[] = $this->suggestType($t); + } + // Now that we have suggestions put them back together. + $suggestedName = implode('|', $suggestions); + } else { + $suggestedName = 'Unknown'; + } + } elseif ($this->isClassName($type)) { + // If this looks like a class name. + $suggestedName = $type; + } else { + // Only one type First check if that type is a base one. + $lowerVarType = strtolower($type); + if (in_array($lowerVarType, self::$allowedTypes)) { + $suggestedName = $lowerVarType; + } + // If no name suggested yet then call the phpcs version of this method. + if (empty($suggestedName)) { + $suggestedName = PHP_CodeSniffer::suggestType($type); + } + } + return $suggestedName; + } +} diff --git a/dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedAttributesSniff.php b/dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedAttributesSniff.php new file mode 100644 index 000000000..98fc99a0e --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedAttributesSniff.php @@ -0,0 +1,357 @@ + + *
  • A variable doc comment exists.
  • + *
  • Short description ends with a full stop.
  • + *
  • There is a blank line after the short description.
  • + *
  • There is a blank line between the description and the tags.
  • + *
  • Check the order, indentation and content of each tag.
  • + * + * + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHP_CodeSniffer + * + * @SuppressWarnings(PHPMD) + */ +class RequireAnnotatedAttributesSniff extends PHP_CodeSniffer_Standards_AbstractVariableSniff +{ + /** + * The header comment parser for the current file. + * + * @var PHP_CodeSniffer_CommentParser_ClassCommentParser + */ + protected $commentParser = null; + + /** + * The sniff helper for stuff shared between the annotations sniffs + * + * @var Helper + */ + protected $helper = null; + + /** + * Extract the var comment docblock + * + * @param array $tokens + * @param string $commentToken + * @param int $stackPtr The position of the current token in the stack passed in $tokens. + * @return int|false + */ + protected function extractVarDocBlock($tokens, $commentToken, $stackPtr) + { + $commentEnd = $this->helper->getCurrentFile()->findPrevious($commentToken, $stackPtr - 3); + $break = false; + if ($commentEnd !== false && $tokens[$commentEnd]['code'] === T_COMMENT) { + $this->helper->addMessage($stackPtr, Helper::WRONG_STYLE, ['variable']); + $break = true; + } elseif ($commentEnd === false || $tokens[$commentEnd]['code'] !== T_DOC_COMMENT) { + $this->helper->addMessage($stackPtr, Helper::MISSING, ['variable']); + $break = true; + } else { + // Make sure the comment we have found belongs to us. + $commentFor = $this->helper->getCurrentFile()->findNext( + [T_VARIABLE, T_CLASS, T_INTERFACE], + $commentEnd + 1 + ); + if ($commentFor !== $stackPtr) { + $this->helper->addMessage($stackPtr, Helper::MISSING, ['variable']); + $break = true; + } + } + return $break ? false : $commentEnd; + } + + /** + * Checks for short and long descriptions on variable definitions + * + * @param PHP_CodeSniffer_CommentParser_CommentElement $comment + * @param int $commentStart + * @return void + */ + protected function checkForDescription($comment, $commentStart) + { + $short = $comment->getShortComment(); + $long = ''; + $newlineCount = 0; + if (trim($short) === '') { + $this->helper->addMessage($commentStart, Helper::MISSING_SHORT, ['variable']); + $newlineCount = 1; + } else { + // No extra newline before short description. + $newlineSpan = strspn($short, $this->helper->getEolChar()); + if ($short !== '' && $newlineSpan > 0) { + $this->helper->addMessage($commentStart + 1, Helper::SPACING_BEFORE_SHORT, ['variable']); + } + + $newlineCount = substr_count($short, $this->helper->getEolChar()) + 1; + + // Exactly one blank line between short and long description. + $long = $comment->getLongComment(); + if (empty($long) === false) { + $between = $comment->getWhiteSpaceBetween(); + $newlineBetween = substr_count($between, $this->helper->getEolChar()); + if ($newlineBetween !== 2) { + $this->helper->addMessage( + $commentStart + $newlineCount + 1, + Helper::SPACING_BETWEEN, + ['variable'] + ); + } + + $newlineCount += $newlineBetween; + + $testLong = trim($long); + if (preg_match('|\p{Lu}|u', $testLong[0]) === 0) { + $this->helper->addMessage( + $commentStart + $newlineCount, + Helper::LONG_NOT_CAPITAL, + ['Variable'] + ); + } + } + + // Short description must be single line and end with a full stop. + $testShort = trim($short); + $lastChar = $testShort[strlen($testShort) - 1]; + if (substr_count($testShort, $this->helper->getEolChar()) !== 0) { + $this->helper->addMessage($commentStart + 1, Helper::SHORT_SINGLE_LINE, ['Variable']); + } + + if (preg_match('|\p{Lu}|u', $testShort[0]) === 0) { + $this->helper->addMessage($commentStart + 1, Helper::SHORT_NOT_CAPITAL, ['Variable']); + } + + if ($lastChar !== '.') { + $this->helper->addMessage($commentStart + 1, Helper::SHORT_FULL_STOP, ['Variable']); + } + } + // Exactly one blank line before tags. + $tags = $this->commentParser->getTagOrders(); + if (count($tags) > 1) { + $newlineSpan = $comment->getNewlineAfter(); + if ($newlineSpan !== 2) { + if ($long !== '') { + $newlineCount += substr_count($long, $this->helper->getEolChar()) - $newlineSpan + 1; + } + + $this->helper->addMessage( + $commentStart + $newlineCount, + Helper::SPACING_BEFORE_TAGS, + ['variable'] + ); + $short = rtrim($short, $this->helper->getEolChar() . ' '); + } + } + } + + /** + * Called to process class member vars. + * + * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return void + */ + public function processMemberVar(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $this->helper = new Helper($phpcsFile); + // if we should skip this type we should do that + if ($this->helper->shouldFilter()) { + return; + } + $tokens = $phpcsFile->getTokens(); + $commentToken = [T_COMMENT, T_DOC_COMMENT]; + + // Extract the var comment docblock. + $commentEnd = $this->extractVarDocBlock($tokens, $commentToken, $stackPtr); + if ($commentEnd === false) { + return; + } + + $commentStart = $phpcsFile->findPrevious(T_DOC_COMMENT, $commentEnd - 1, null, true) + 1; + $commentString = $phpcsFile->getTokensAsString($commentStart, $commentEnd - $commentStart + 1); + + // Parse the header comment docblock. + try { + $this->commentParser = new PHP_CodeSniffer_CommentParser_MemberCommentParser($commentString, $phpcsFile); + $this->commentParser->parse(); + } catch (PHP_CodeSniffer_CommentParser_ParserException $e) { + $line = $e->getLineWithinComment() + $commentStart; + $data = [$e->getMessage()]; + $this->helper->addMessage($line, Helper::ERROR_PARSING, $data); + return; + } + + $comment = $this->commentParser->getComment(); + if (($comment === null) === true) { + $this->helper->addMessage($commentStart, Helper::EMPTY_DOC, ['Variable']); + return; + } + + // The first line of the comment should just be the /** code. + $eolPos = strpos($commentString, $phpcsFile->eolChar); + $firstLine = substr($commentString, 0, $eolPos); + if ($firstLine !== '/**') { + $this->helper->addMessage($commentStart, Helper::CONTENT_AFTER_OPEN); + } + + // Check for a comment description. + $this->checkForDescription($comment, $commentStart); + + // Check for unknown/deprecated tags. + $unknownTags = $this->commentParser->getUnknown(); + foreach ($unknownTags as $errorTag) { + // Unknown tags are not parsed, do not process further. + $data = [$errorTag['tag']]; + $this->helper->addMessage($commentStart + $errorTag['line'], Helper::TAG_NOT_ALLOWED, $data); + } + + // Check each tag. + $this->processVar($commentStart, $commentEnd); + $this->processSees($commentStart); + + // The last content should be a newline and the content before + // that should not be blank. If there is more blank space + // then they have additional blank lines at the end of the comment. + $words = $this->commentParser->getWords(); + $lastPos = count($words) - 1; + if (trim( + $words[$lastPos - 1] + ) !== '' || strpos( + $words[$lastPos - 1], + $this->currentFile->eolChar + ) === false || trim( + $words[$lastPos - 2] + ) === '' + ) { + $this->helper->addMessage($commentEnd, Helper::SPACING_AFTER, ['variable']); + } + } + + /** + * Process the var tag. + * + * @param int $commentStart The position in the stack where the comment started. + * @param int $commentEnd The position in the stack where the comment ended. + * + * @return void + */ + protected function processVar($commentStart, $commentEnd) + { + $var = $this->commentParser->getVar(); + + if ($var !== null) { + $errorPos = $commentStart + $var->getLine(); + $index = array_keys($this->commentParser->getTagOrders(), 'var'); + + if (count($index) > 1) { + $this->helper->addMessage($errorPos, Helper::DUPLICATE_VAR); + return; + } + + if ($index[0] !== 1) { + $this->helper->addMessage($errorPos, Helper::VAR_ORDER); + } + + $content = $var->getContent(); + if (empty($content) === true) { + $this->helper->addMessage($errorPos, Helper::MISSING_VAR_TYPE); + return; + } else { + $suggestedType = $this->helper->suggestType($content); + if ($content !== $suggestedType) { + $data = [$suggestedType, $content]; + $this->helper->addMessage($errorPos, Helper::INCORRECT_VAR_TYPE, $data); + } elseif ($this->helper->isAmbiguous($content, $matches)) { + // Warn about ambiguous types ie array or mixed + $data = [$matches[1], '@var']; + $this->helper->addMessage($errorPos, Helper::AMBIGUOUS_TYPE, $data); + } + } + + $spacing = substr_count($var->getWhitespaceBeforeContent(), ' '); + if ($spacing !== 1) { + $data = [$spacing]; + $this->helper->addMessage($errorPos, Helper::VAR_INDENT, $data); + } + } else { + $this->helper->addMessage($commentEnd, Helper::MISSING_VAR); + } + } + + /** + * Process the see tags. + * + * @param int $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processSees($commentStart) + { + $sees = $this->commentParser->getSees(); + if (empty($sees) === false) { + foreach ($sees as $see) { + $errorPos = $commentStart + $see->getLine(); + $content = $see->getContent(); + if (empty($content) === true) { + $this->helper->addMessage($errorPos, Helper::EMPTY_SEE, ['variable']); + continue; + } + + $spacing = substr_count($see->getWhitespaceBeforeContent(), ' '); + if ($spacing !== 1) { + $data = [$spacing]; + $this->helper->addMessage($errorPos, Helper::SEE_INDENT, $data); + } + } + } + } + + /** + * Called to process a normal variable. + * + * Not required for this sniff. + * + * @param PHP_CodeSniffer_File $phpcsFile The PHP_CodeSniffer file where this token was found. + * @param int $stackPtr The position where the double quoted + * string was found. + * + * @return void + */ + protected function processVariable(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + } + + /** + * Called to process variables found in double quoted strings. + * + * Not required for this sniff. + * + * @param PHP_CodeSniffer_File $phpcsFile The PHP_CodeSniffer file where this token was found. + * @param int $stackPtr The position where the double quoted + * string was found. + * + * @return void + */ + protected function processVariableInString(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + } +} diff --git a/dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php b/dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php new file mode 100644 index 000000000..63dc220b6 --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php @@ -0,0 +1,694 @@ + + * @author Marc McIntyre + * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + * + * @SuppressWarnings(PHPMD) + */ +class RequireAnnotatedMethodsSniff implements PHP_CodeSniffer_Sniff +{ + /** + * The name of the method that we are currently processing. + * + * @var string + */ + private $_methodName = ''; + + /** + * The position in the stack where the function token was found. + * + * @var int + */ + private $_functionToken = null; + + /** + * The position in the stack where the class token was found. + * + * @var int + */ + private $_classToken = null; + + /** + * The index of the current tag we are processing. + * + * @var int + */ + private $_tagIndex = 0; + + /** + * The function comment parser for the current method. + * + * @var PHP_CodeSniffer_CommentParser_FunctionCommentParser + */ + protected $commentParser = null; + + /** + * The sniff helper for stuff shared between the annotations sniffs + * + * @var Helper + */ + protected $helper = null; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return void + */ + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $this->helper = new Helper($phpcsFile); + // if we should skip this type we should do that + if ($this->helper->shouldFilter()) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $find = [T_COMMENT, T_DOC_COMMENT, T_CLASS, T_FUNCTION, T_OPEN_TAG]; + + $commentEnd = $phpcsFile->findPrevious($find, $stackPtr - 1); + + if ($commentEnd === false) { + return; + } + + // If the token that we found was a class or a function, then this + // function has no doc comment. + $code = $tokens[$commentEnd]['code']; + + if ($code === T_COMMENT) { + // The function might actually be missing a comment, and this last comment + // found is just commenting a bit of code on a line. So if it is not the + // only thing on the line, assume we found nothing. + $prevContent = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, $commentEnd); + if ($tokens[$commentEnd]['line'] === $tokens[$commentEnd]['line']) { + $this->helper->addMessage($stackPtr, Helper::MISSING, ['function']); + } else { + $this->helper->addMessage($stackPtr, Helper::WRONG_STYLE, ['function']); + } + return; + } elseif ($code !== T_DOC_COMMENT) { + $this->helper->addMessage($stackPtr, Helper::MISSING, ['function']); + return; + } elseif (trim($tokens[$commentEnd]['content']) !== '*/') { + $this->helper->addMessage($commentEnd, Helper::WRONG_END, [trim($tokens[$commentEnd]['content'])]); + return; + } + + // If there is any code between the function keyword and the doc block + // then the doc block is not for us. + $ignore = PHP_CodeSniffer_Tokens::$scopeModifiers; + $ignore[] = T_STATIC; + $ignore[] = T_WHITESPACE; + $ignore[] = T_ABSTRACT; + $ignore[] = T_FINAL; + $prevToken = $phpcsFile->findPrevious($ignore, $stackPtr - 1, null, true); + if ($prevToken !== $commentEnd) { + $this->helper->addMessage($stackPtr, Helper::MISSING, ['function']); + return; + } + + $this->_functionToken = $stackPtr; + + $this->_classToken = null; + foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condition) { + if ($condition === T_CLASS || $condition === T_INTERFACE) { + $this->_classToken = $condPtr; + break; + } + } + + // Find the first doc comment. + $commentStart = $phpcsFile->findPrevious(T_DOC_COMMENT, $commentEnd - 1, null, true) + 1; + $commentString = $phpcsFile->getTokensAsString($commentStart, $commentEnd - $commentStart + 1); + $this->_methodName = $phpcsFile->getDeclarationName($stackPtr); + + try { + $this->commentParser = new PHP_CodeSniffer_CommentParser_FunctionCommentParser($commentString, $phpcsFile); + $this->commentParser->parse(); + } catch (PHP_CodeSniffer_CommentParser_ParserException $e) { + $line = $e->getLineWithinComment() + $commentStart; + $this->helper->addMessage($line, Helper::FAILED_PARSE, [$e->getMessage()]); + return; + } + + $comment = $this->commentParser->getComment(); + if (($comment === null) === true) { + $this->helper->addMessage($commentStart, Helper::EMPTY_DOC, ['Function']); + return; + } + + // The first line of the comment should just be the /** code. + $eolPos = strpos($commentString, $phpcsFile->eolChar); + $firstLine = substr($commentString, 0, $eolPos); + if ($firstLine !== '/**') { + $this->helper->addMessage($commentStart, Helper::CONTENT_AFTER_OPEN); + } + + // If the comment has an inherit doc note just move on + if (preg_match('/\{\@inheritdoc\}/', $commentString)) { + return; + } elseif (preg_match('/\{?\@?inherit[dD]oc\}?/', $commentString)) { + $this->helper->addMessage($commentStart, Helper::INCORRECT_INHERIT_DOC); + return; + } + + $this->processParams($commentStart, $commentEnd); + $this->processSees($commentStart); + $this->processReturn($commentStart, $commentEnd); + $this->processThrows($commentStart); + + // Check for a comment description. + $short = $comment->getShortComment(); + if (trim($short) === '') { + $this->helper->addMessage($commentStart, Helper::MISSING_SHORT, ['function']); + return; + } + + // No extra newline before short description. + $newlineCount = 0; + $newlineSpan = strspn($short, $phpcsFile->eolChar); + if ($short !== '' && $newlineSpan > 0) { + $this->helper->addMessage($commentStart + 1, Helper::SPACING_BEFORE_SHORT, ['function']); + } + + $newlineCount = substr_count($short, $phpcsFile->eolChar) + 1; + + // Exactly one blank line between short and long description. + $long = $comment->getLongComment(); + if (empty($long) === false) { + $between = $comment->getWhiteSpaceBetween(); + $newlineBetween = substr_count($between, $phpcsFile->eolChar); + if ($newlineBetween !== 2) { + $this->helper->addMessage( + $commentStart + $newlineCount + 1, + Helper::SPACING_BETWEEN, + ['function'] + ); + } + $newlineCount += $newlineBetween; + $testLong = trim($long); + if (preg_match('|\p{Lu}|u', $testLong[0]) === 0) { + $this->helper->addMessage($commentStart + $newlineCount, Helper::LONG_NOT_CAPITAL, ['Function']); + } + } + + // Exactly one blank line before tags. + $params = $this->commentParser->getTagOrders(); + if (count($params) > 1) { + $newlineSpan = $comment->getNewlineAfter(); + if ($newlineSpan !== 2) { + if ($long !== '') { + $newlineCount += substr_count($long, $phpcsFile->eolChar) - $newlineSpan + 1; + } + + $this->helper->addMessage( + $commentStart + $newlineCount, + Helper::SPACING_BEFORE_TAGS, + ['function'] + ); + $short = rtrim($short, $phpcsFile->eolChar . ' '); + } + } + + // Short description must be single line and end with a full stop. + $testShort = trim($short); + $lastChar = $testShort[strlen($testShort) - 1]; + if (substr_count($testShort, $phpcsFile->eolChar) !== 0) { + $this->helper->addMessage($commentStart + 1, Helper::SHORT_SINGLE_LINE, ['Function']); + } + + if (preg_match('|\p{Lu}|u', $testShort[0]) === 0) { + $this->helper->addMessage($commentStart + 1, Helper::SHORT_NOT_CAPITAL, ['Function']); + } + + if ($lastChar !== '.') { + $this->helper->addMessage($commentStart + 1, Helper::SHORT_FULL_STOP, ['Function']); + } + + // Check for unknown/deprecated tags. + // For example call: $this->processUnknownTags($commentStart, $commentEnd); + + // The last content should be a newline and the content before + // that should not be blank. If there is more blank space + // then they have additional blank lines at the end of the comment. + $words = $this->commentParser->getWords(); + $lastPos = count($words) - 1; + if (trim( + $words[$lastPos - 1] + ) !== '' || strpos( + $words[$lastPos - 1], + $this->helper->getCurrentFile()->eolChar + ) === false || trim( + $words[$lastPos - 2] + ) === '' + ) { + $this->helper->addMessage($commentEnd, Helper::SPACING_AFTER, ['function']); + } + } + + /** + * Process the see tags. + * + * @param int $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processSees($commentStart) + { + $sees = $this->commentParser->getSees(); + if (empty($sees) === false) { + $tagOrder = $this->commentParser->getTagOrders(); + $index = array_keys($this->commentParser->getTagOrders(), 'see'); + foreach ($sees as $i => $see) { + $errorPos = $commentStart + $see->getLine(); + $since = array_keys($tagOrder, 'since'); + if (count($since) === 1 && $this->_tagIndex !== 0) { + $this->_tagIndex++; + if ($index[$i] !== $this->_tagIndex) { + $this->helper->addMessage($errorPos, Helper::SEE_ORDER); + } + } + + $content = $see->getContent(); + if (empty($content) === true) { + $this->helper->addMessage($errorPos, Helper::EMPTY_SEE, ['function']); + continue; + } + } + } + } + + /** + * Process the return comment of this function comment. + * + * @param int $commentStart The position in the stack where the comment started. + * @param int $commentEnd The position in the stack where the comment ended. + * + * @return void + */ + protected function processReturn($commentStart, $commentEnd) + { + // Skip constructor and destructor. + $className = ''; + if ($this->_classToken !== null) { + $className = $this->helper->getCurrentFile()->getDeclarationName($this->_classToken); + $className = strtolower(ltrim($className, '_')); + } + + $methodName = strtolower(ltrim($this->_methodName, '_')); + $return = $this->commentParser->getReturn(); + + if ($this->_methodName !== '__construct' && $this->_methodName !== '__destruct') { + if ($return !== null) { + $tagOrder = $this->commentParser->getTagOrders(); + $index = array_keys($tagOrder, 'return'); + $errorPos = $commentStart + $return->getLine(); + $content = trim($return->getRawContent()); + + if (count($index) > 1) { + $this->helper->addMessage($errorPos, Helper::DUPLICATE_RETURN); + return; + } + + $since = array_keys($tagOrder, 'since'); + if (count($since) === 1 && $this->_tagIndex !== 0) { + $this->_tagIndex++; + if ($index[0] !== $this->_tagIndex) { + $this->helper->addMessage($errorPos, Helper::RETURN_ORDER); + } + } + + if (empty($content) === true) { + $this->helper->addMessage($errorPos, Helper::MISSING_RETURN_TYPE); + } else { + // Strip off any comments attached to our content + $parts = explode(' ', $content); + $content = $parts[0]; + // Check return type (can be multiple, separated by '|'). + $typeNames = explode('|', $content); + $suggestedNames = []; + foreach ($typeNames as $i => $typeName) { + $suggestedName = $this->helper->suggestType($typeName); + if (in_array($suggestedName, $suggestedNames) === false) { + $suggestedNames[] = $suggestedName; + } + } + + $suggestedType = implode('|', $suggestedNames); + if ($content !== $suggestedType) { + $data = [$content]; + $this->helper->addMessage($errorPos, Helper::INVALID_RETURN, $data); + } elseif ($this->helper->isAmbiguous($typeName, $matches)) { + // Warn about ambiguous types ie array or mixed + $data = [$matches[1], '@return']; + $this->helper->addMessage($errorPos, Helper::AMBIGUOUS_TYPE, $data); + } + + $tokens = $this->helper->getCurrentFile()->getTokens(); + + // If the return type is void, make sure there is + // no return statement in the function. + if ($content === 'void') { + if (isset($tokens[$this->_functionToken]['scope_closer']) === true) { + $endToken = $tokens[$this->_functionToken]['scope_closer']; + + $tokens = $this->helper->getCurrentFile()->getTokens(); + for ($returnToken = $this->_functionToken; $returnToken < $endToken; $returnToken++) { + if ($tokens[$returnToken]['code'] === T_CLOSURE) { + $returnToken = $tokens[$returnToken]['scope_closer']; + continue; + } + + if ($tokens[$returnToken]['code'] === T_RETURN) { + break; + } + } + + if ($returnToken !== $endToken) { + // If the function is not returning anything, just + // exiting, then there is no problem. + $semicolon = $this->helper->getCurrentFile()->findNext( + T_WHITESPACE, + $returnToken + 1, + null, + true + ); + if ($tokens[$semicolon]['code'] !== T_SEMICOLON) { + $this->helper->addMessage($errorPos, Helper::INVALID_RETURN_VOID); + } + } + } + } elseif ($content !== 'mixed') { + // If return type is not void, there needs to be a + // returns statement somewhere in the function that + // returns something. + if (isset($tokens[$this->_functionToken]['scope_closer']) === true) { + $endToken = $tokens[$this->_functionToken]['scope_closer']; + $returnToken = $this->helper->getCurrentFile()->findNext( + T_RETURN, + $this->_functionToken, + $endToken + ); + if ($returnToken === false) { + $this->helper->addMessage($errorPos, Helper::INVALID_NO_RETURN); + } else { + $semicolon = $this->helper->getCurrentFile()->findNext( + T_WHITESPACE, + $returnToken + 1, + null, + true + ); + if ($tokens[$semicolon]['code'] === T_SEMICOLON) { + $this->helper->addMessage($returnToken, Helper::INVALID_RETURN_NOT_VOID); + } + } + } + } + + $spacing = substr_count($return->getWhitespaceBeforeValue(), ' '); + if ($spacing !== 1) { + $data = [$spacing]; + $this->helper->addMessage($errorPos, Helper::RETURN_INDENT, $data); + } + } + } else { + $this->helper->addMessage($commentEnd, Helper::MISSING_RETURN); + } + } elseif ($return !== null) { + // No return tag for constructor and destructor. + $errorPos = $commentStart + $return->getLine(); + $this->helper->addMessage($errorPos, Helper::RETURN_NOT_REQUIRED); + } + } + + /** + * Process any throw tags that this function comment has. + * + * @param int $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processThrows($commentStart) + { + if (count($this->commentParser->getThrows()) === 0) { + return; + } + + $tagOrder = $this->commentParser->getTagOrders(); + $index = array_keys($this->commentParser->getTagOrders(), 'throws'); + + foreach ($this->commentParser->getThrows() as $i => $throw) { + $exception = $throw->getValue(); + $content = trim($throw->getComment()); + $errorPos = $commentStart + $throw->getLine(); + if (empty($exception) === true) { + $this->helper->addMessage($errorPos, Helper::INVALID_THROWS); + } elseif (empty($content) === true) { + $this->helper->addMessage($errorPos, Helper::EMPTY_THROWS); + } else { + // Assumes that $content is not empty. + // Starts with a capital letter and ends with a fullstop. + $firstChar = $content[0]; + if (strtoupper($firstChar) !== $firstChar) { + $this->helper->addMessage($errorPos, Helper::THROWS_NOT_CAPITAL); + } + + $lastChar = $content[strlen($content) - 1]; + if ($lastChar !== '.') { + $this->helper->addMessage($errorPos, Helper::THROWS_NO_FULL_STOP); + } + } + + $since = array_keys($tagOrder, 'since'); + if (count($since) === 1 && $this->_tagIndex !== 0) { + $this->_tagIndex++; + if ($index[$i] !== $this->_tagIndex) { + $this->helper->addMessage($errorPos, Helper::THROWS_ORDER); + } + } + } + } + + /** + * Process the function parameter comments. + * + * @param int $commentStart The position in the stack where + * the comment started. + * @param int $commentEnd The position in the stack where + * the comment ended. + * + * @return void + */ + protected function processParams($commentStart, $commentEnd) + { + $realParams = $this->helper->getCurrentFile()->getMethodParameters($this->_functionToken); + $params = $this->commentParser->getParams(); + $foundParams = []; + + if (empty($params) === false) { + $subStrCount = substr_count( + $params[count($params) - 1]->getWhitespaceAfter(), + $this->helper->getCurrentFile()->eolChar + ); + if ($subStrCount !== 2) { + $errorPos = $params[count($params) - 1]->getLine() + $commentStart; + $this->helper->addMessage($errorPos, Helper::SPACING_AFTER_PARAMS); + } + + // Parameters must appear immediately after the comment. + if ($params[0]->getOrder() !== 2) { + $errorPos = $params[0]->getLine() + $commentStart; + $this->helper->addMessage($errorPos, Helper::SPACING_BEFORE_PARAMS); + } + + $previousParam = null; + $spaceBeforeVar = 10000; + $spaceBeforeComment = 10000; + $longestType = 0; + $longestVar = 0; + + foreach ($params as $param) { + $paramComment = trim($param->getComment()); + $errorPos = $param->getLine() + $commentStart; + + // Make sure that there is only one space before the var type. + if ($param->getWhitespaceBeforeType() !== ' ') { + $this->helper->addMessage($errorPos, Helper::SPACING_BEFORE_PARAM_TYPE); + } + + $spaceCount = substr_count($param->getWhitespaceBeforeVarName(), ' '); + if ($spaceCount < $spaceBeforeVar) { + $spaceBeforeVar = $spaceCount; + $longestType = $errorPos; + } + + $spaceCount = substr_count($param->getWhitespaceBeforeComment(), ' '); + + if ($spaceCount < $spaceBeforeComment && $paramComment !== '') { + $spaceBeforeComment = $spaceCount; + $longestVar = $errorPos; + } + + // Make sure they are in the correct order, and have the correct name. + $pos = $param->getPosition(); + $paramName = $param->getVarName() !== '' ? $param->getVarName() : '[ UNKNOWN ]'; + + if ($previousParam !== null) { + $previousName = $previousParam->getVarName() !== '' ? $previousParam->getVarName() : 'UNKNOWN'; + } + + // Variable must be one of the supported standard type. + $typeNames = explode('|', $param->getType()); + foreach ($typeNames as $typeName) { + $suggestedName = $this->helper->suggestType($typeName); + if ($typeName !== $suggestedName) { + $data = [$suggestedName, $typeName, $paramName, $pos]; + $this->helper->addMessage($errorPos, Helper::INCORRECT_PARAM_VAR_NAME, $data); + } elseif ($this->helper->isAmbiguous($typeName, $matches)) { + // Warn about ambiguous types ie array or mixed + $data = [$matches[1], $paramName, ' at position ' . $pos . ' is NOT recommended']; + $this->helper->addMessage($commentEnd + 2, Helper::AMBIGUOUS_TYPE, $data); + } elseif (count($typeNames) === 1) { + // Check type hint for array and custom type. + $suggestedTypeHint = ''; + if (strpos($suggestedName, 'array') !== false) { + $suggestedTypeHint = 'array'; + } elseif (strpos($suggestedName, 'callable') !== false) { + $suggestedTypeHint = 'callable'; + } elseif (in_array($typeName, $this->helper->getAllowedTypes()) === false) { + $suggestedTypeHint = $suggestedName; + } else { + $suggestedTypeHint = $this->helper->suggestType($typeName); + } + + if ($suggestedTypeHint !== '' && isset($realParams[$pos - 1]) === true) { + $typeHint = $realParams[$pos - 1]['type_hint']; + if ($typeHint === '') { + $data = [$suggestedTypeHint, $paramName, $pos]; + $this->helper->addMessage($commentEnd + 2, Helper::TYPE_HINT_MISSING, $data); + } elseif ($typeHint !== $suggestedTypeHint) { + $data = [$suggestedTypeHint, $typeHint, $paramName, $pos]; + $this->helper->addMessage($commentEnd + 2, Helper::INCORRECT_TYPE_HINT, $data); + } + } elseif ($suggestedTypeHint === '' && isset($realParams[$pos - 1]) === true) { + $typeHint = $realParams[$pos - 1]['type_hint']; + if ($typeHint !== '') { + $data = [$typeHint, $paramName, $pos]; + $this->helper->addMessage($commentEnd + 2, Helper::INVALID_TYPE_HINT, $data); + } + } + } + } + + // Make sure the names of the parameter comment matches the + // actual parameter. + if (isset($realParams[$pos - 1]) === true) { + $realName = $realParams[$pos - 1]['name']; + $foundParams[] = $realName; + + // Append ampersand to name if passing by reference. + if ($realParams[$pos - 1]['pass_by_reference'] === true) { + $realName = '&' . $realName; + } + + if ($realName !== $paramName) { + $code = Helper::PARAM_NAME_NO_MATCH; + $data = [$paramName, $realName, $pos]; + + if (strtolower($paramName) === strtolower($realName)) { + $code = Helper::PARAM_NAME_NO_CASE_MATCH; + } + + $this->helper->addMessage($errorPos, $code, $data); + } + } elseif (substr($paramName, -4) !== ',...') { + // We must have an extra parameter comment. + $this->helper->addMessage($errorPos, Helper::EXTRA_PARAM_COMMENT, [$pos]); + } + + if ($param->getVarName() === '') { + $this->helper->addMessage($errorPos, Helper::MISSING_PARAM_NAME, [$pos]); + } + + if ($param->getType() === '') { + $this->helper->addMessage($errorPos, Helper::MISSING_PARAM_TYPE, [$pos]); + } + + if ($paramComment === '') { + $data = [$paramName, $pos]; + $this->helper->addMessage($errorPos, Helper::MISSING_PARAM_COMMENT, $data); + } else { + // Param comments must start with a capital letter and + // end with the full stop. + $firstChar = $paramComment[0]; + if (preg_match('|\p{Lu}|u', $firstChar) === 0) { + $this->helper->addMessage($errorPos, Helper::PARAM_COMMENT_NOT_CAPITAL); + } + $lastChar = $paramComment[strlen($paramComment) - 1]; + if ($lastChar !== '.') { + $this->helper->addMessage($errorPos, Helper::PARAM_COMMENT_FULL_STOP); + } + } + + $previousParam = $param; + } + + if ($spaceBeforeVar !== 1 && $spaceBeforeVar !== 10000 && $spaceBeforeComment !== 10000) { + $this->helper->addMessage($longestType, Helper::SPACING_AFTER_LONG_TYPE); + } + + if ($spaceBeforeComment !== 1 && $spaceBeforeComment !== 10000) { + $this->helper->addMessage($longestVar, Helper::SPACING_AFTER_LONG_NAME); + } + } + + $realNames = []; + foreach ($realParams as $realParam) { + $realNames[] = $realParam['name']; + } + + // Report missing comments. + $diff = array_diff($realNames, $foundParams); + foreach ($diff as $neededParam) { + if (count($params) !== 0) { + $errorPos = $params[count($params) - 1]->getLine() + $commentStart; + } else { + $errorPos = $commentStart; + } + + $data = [$neededParam]; + $this->helper->addMessage($errorPos, Helper::MISSING_PARAM_TAG, $data); + } + } +} diff --git a/dev/tests/static/Magento/Sniffs/Arrays/ShortArraySyntaxSniff.php b/dev/tests/static/Magento/Sniffs/Arrays/ShortArraySyntaxSniff.php new file mode 100644 index 000000000..e8e850706 --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/Arrays/ShortArraySyntaxSniff.php @@ -0,0 +1,28 @@ +addError('Short array syntax must be used; expected "[]" but found "array()"', $stackPtr); + } +} diff --git a/dev/tests/static/Magento/Sniffs/Files/LineLengthSniff.php b/dev/tests/static/Magento/Sniffs/Files/LineLengthSniff.php new file mode 100644 index 000000000..50020cb29 --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/Files/LineLengthSniff.php @@ -0,0 +1,34 @@ +previousLineContent) !== 0; + $this->previousLineContent = $lineContent; + if (! $currentLineMatch && !$previousLineMatch) { + parent::checkLineLength($phpcsFile, $stackPtr, $lineContent); + } + } +} diff --git a/dev/tests/static/Magento/Sniffs/LiteralNamespaces/LiteralNamespacesSniff.php b/dev/tests/static/Magento/Sniffs/LiteralNamespaces/LiteralNamespacesSniff.php new file mode 100644 index 000000000..31796ec4e --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/LiteralNamespaces/LiteralNamespacesSniff.php @@ -0,0 +1,66 @@ +getTokens(); + if ($sourceFile->findPrevious(T_STRING_CONCAT, $stackPtr, $stackPtr - 3) || + $sourceFile->findNext(T_STRING_CONCAT, $stackPtr, $stackPtr + 3) + ) { + return; + } + + $content = trim($tokens[$stackPtr]['content'], "\"'"); + if (preg_match($this->literalNamespacePattern, $content) === 1 && $this->classExists($content)) { + $sourceFile->addError("Use ::class notation instead.", $stackPtr); + } + } + + /** + * @param string $className + * @return bool + */ + private function classExists($className) + { + if (!isset($this->classNames[$className])) { + $this->classNames[$className] = class_exists($className) || interface_exists($className); + } + return $this->classNames[$className]; + } +} diff --git a/dev/tests/static/Magento/Sniffs/MicroOptimizations/IsNullSniff.php b/dev/tests/static/Magento/Sniffs/MicroOptimizations/IsNullSniff.php new file mode 100644 index 000000000..095025a3d --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/MicroOptimizations/IsNullSniff.php @@ -0,0 +1,36 @@ +getTokens(); + if ($tokens[$stackPtr]['content'] === $this->blacklist) { + $sourceFile->addError("is_null must be avoided. Use strict comparison instead.", $stackPtr); + } + } +} diff --git a/dev/tests/static/Magento/Sniffs/NamingConventions/InterfaceNameSniff.php b/dev/tests/static/Magento/Sniffs/NamingConventions/InterfaceNameSniff.php new file mode 100644 index 000000000..2e3e4db2a --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/NamingConventions/InterfaceNameSniff.php @@ -0,0 +1,42 @@ +getTokens(); + $declarationLine = $tokens[$stackPtr]['line']; + $suffixLength = strlen(self::INTERFACE_SUFFIX); + // Find first T_STRING after 'interface' keyword in the line and verify it + while ($tokens[$stackPtr]['line'] == $declarationLine) { + if ($tokens[$stackPtr]['type'] == 'T_STRING') { + if (substr($tokens[$stackPtr]['content'], 0 - $suffixLength) != self::INTERFACE_SUFFIX) { + $sourceFile->addError('Interface should have name that ends with "Interface" suffix.', $stackPtr); + } + break; + } + $stackPtr++; + } + } +} diff --git a/dev/tests/static/Magento/Sniffs/NamingConventions/ReservedWordsSniff.php b/dev/tests/static/Magento/Sniffs/NamingConventions/ReservedWordsSniff.php new file mode 100644 index 000000000..3d2d979c3 --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/NamingConventions/ReservedWordsSniff.php @@ -0,0 +1,113 @@ + '7', + 'float' => '7', + 'bool' => '7', + 'string' => '7', + 'true' => '7', + 'false' => '7', + 'null' => '7', + 'void' => '7.1', + 'iterable' => '7.1', + 'resource' => '7', + 'object' => '7', + 'mixed' => '7', + 'numeric' => '7', + ]; + + /** + * {@inheritdoc} + */ + public function register() + { + return [T_CLASS, T_INTERFACE, T_TRAIT, T_NAMESPACE]; + } + + /** + * Check all namespace parts + * + * @param PHP_CodeSniffer_File $sourceFile + * @param int $stackPtr + * @return void + */ + protected function validateNamespace(PHP_CodeSniffer_File $sourceFile, $stackPtr) + { + $stackPtr += 2; + $tokens = $sourceFile->getTokens(); + while ($stackPtr < $sourceFile->numTokens && $tokens[$stackPtr]['code'] !== T_SEMICOLON) { + if ($tokens[$stackPtr]['code'] === T_WHITESPACE || $tokens[$stackPtr]['code'] === T_NS_SEPARATOR) { + $stackPtr++; //skip "namespace" and whitespace + continue; + } + $namespacePart = $tokens[$stackPtr]['content']; + if (isset($this->reservedWords[strtolower($namespacePart)])) { + $sourceFile->addError( + 'Cannot use "%s" in namespace as it is reserved since PHP %s', + $stackPtr, + 'Namespace', + [$namespacePart, $this->reservedWords[$namespacePart]] + ); + } + $stackPtr++; + } + } + + /** + * Check class name not having reserved words + * + * @param PHP_CodeSniffer_File $sourceFile + * @param int $stackPtr + * @return void + */ + protected function validateClass(PHP_CodeSniffer_File $sourceFile, $stackPtr) + { + $tokens = $sourceFile->getTokens(); + $stackPtr += 2; //skip "class" and whitespace + $className = strtolower($tokens[$stackPtr]['content']); + if (isset($this->reservedWords[$className])) { + $sourceFile->addError( + 'Cannot use "%s" as class name as it is reserved since PHP %s', + $stackPtr, + 'Class', + [$className, $this->reservedWords[$className]] + ); + } + } + + /** + * {@inheritdoc} + */ + public function process(PHP_CodeSniffer_File $sourceFile, $stackPtr) + { + $tokens = $sourceFile->getTokens(); + switch ($tokens[$stackPtr]['code']) { + case T_CLASS: + case T_INTERFACE: + case T_TRAIT: + $this->validateClass($sourceFile, $stackPtr); + break; + case T_NAMESPACE: + $this->validateNamespace($sourceFile, $stackPtr); + break; + } + } +} diff --git a/dev/tests/static/Magento/Sniffs/Whitespace/EmptyLineMissedSniff.php b/dev/tests/static/Magento/Sniffs/Whitespace/EmptyLineMissedSniff.php new file mode 100644 index 000000000..41782b1e2 --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/Whitespace/EmptyLineMissedSniff.php @@ -0,0 +1,66 @@ +getTokens(); + if ($this->doCheck($phpcsFile, $stackPtr, $tokens)) { + $previous = $phpcsFile->findPrevious(T_WHITESPACE, $stackPtr - 1, null, true); + if ($tokens[$stackPtr]['line'] - $tokens[$previous]['line'] < 2) { + $error = 'Empty line missed'; + $phpcsFile->addError($error, $stackPtr, '', null); + } + } + } + + /** + * @param PHP_CodeSniffer_File $phpcsFile + * @param int $stackPtr + * @param array $tokens + * @return bool + */ + private function doCheck(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $tokens) + { + $result = false; + if ($phpcsFile->hasCondition($stackPtr, T_CLASS) || $phpcsFile->hasCondition($stackPtr, T_INTERFACE)) { + $result = true; + } + + if ($phpcsFile->hasCondition($stackPtr, T_FUNCTION)) { + $result = false; + } + $previous = $phpcsFile->findPrevious(T_WHITESPACE, $stackPtr - 1, null, true); + if ($tokens[$previous]['type'] === 'T_OPEN_CURLY_BRACKET') { + $result = false; + } + + if (strpos($tokens[$stackPtr]['content'], '/**') === false) { + $result = false; + } + + return $result; + } +} diff --git a/dev/tests/static/Magento/Sniffs/Whitespace/MultipleEmptyLinesSniff.php b/dev/tests/static/Magento/Sniffs/Whitespace/MultipleEmptyLinesSniff.php new file mode 100644 index 000000000..794f316de --- /dev/null +++ b/dev/tests/static/Magento/Sniffs/Whitespace/MultipleEmptyLinesSniff.php @@ -0,0 +1,49 @@ +getTokens(); + if ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) + || $phpcsFile->hasCondition($stackPtr, T_CLASS) + || $phpcsFile->hasCondition($stackPtr, T_INTERFACE) + ) { + if ($tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] + && $tokens[($stackPtr - 2)]['line'] === $tokens[($stackPtr - 1)]['line'] + ) { + // This is an empty line and the line before this one is not + // empty, so this could be the start of a multiple empty line block + $next = $phpcsFile->findNext(T_WHITESPACE, $stackPtr, null, true); + $lines = $tokens[$next]['line'] - $tokens[$stackPtr]['line']; + if ($lines > 1) { + $error = 'Code must not contain multiple empty lines in a row; found %s empty lines'; + $data = [$lines]; + $phpcsFile->addError($error, $stackPtr, 'MultipleEmptyLines', $data); + } + } + } + } +} diff --git a/dev/tests/static/Magento/ruleset.xml b/dev/tests/static/Magento/ruleset.xml new file mode 100644 index 000000000..434d1df53 --- /dev/null +++ b/dev/tests/static/Magento/ruleset.xml @@ -0,0 +1,29 @@ + + + + Custom Magento Acceptance Test Framework coding standard. + + + + + + + + + + + */_files/* + + + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php b/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php index f2fad3fff..191988bba 100644 --- a/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php +++ b/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php @@ -21,7 +21,6 @@ class File extends AbstractIterator protected $cached = []; /** - * @constructor * @param array $paths */ public function __construct(array $paths) From 1dfb85e2fe2de3a874da792e45cc0c545c951df4 Mon Sep 17 00:00:00 2001 From: imeron2433 Date: Mon, 19 Jun 2017 13:45:49 -0500 Subject: [PATCH 085/149] MQE-34:[Data Input] Data Generator - add relevant Entity and Field Group Objects - add interface for persistence layer - add entity schema for data parser - add sample xml file --- bootstrap.php | 2 + entryPoint.php | 7 +- etc/di.xml | 32 ++++++ .../Config/FileResolver/Module.php | 4 +- .../DataGeneratorXMLConstants.php | 21 ++++ .../DataGenerator/DataHandler.php | 63 ++++++++++++ .../DataModel/ApiModel/Address.php | 14 +++ .../DataModel/ApiModel/Customer.php | 62 ++++++++++++ .../DataModel/EntityPersistenceInterface.php | 24 +++++ .../DataGenerator/Objects/EntityXmlObject.php | 64 ++++++++++++ .../Objects/FieldGroupXmlObject.php | 33 +++++++ .../DataGenerator/etc/DataProfileSchema.xsd | 97 +++++++++++++++++++ .../DataGenerator/etc/sample.xml | 25 +++++ .../DataProfile/Test/etc/data.xml | 39 ++++++++ .../DataProfileSchemaParser.php | 25 +++++ .../Helper/EntityRESTApiHelper.php | 76 +++++++++++++++ .../Util/ModuleResolver.php | 4 +- 17 files changed, 585 insertions(+), 7 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorXMLConstants.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataHandler.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/ApiModel/Address.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/ApiModel/Customer.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/EntityPersistenceInterface.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/etc/sample.xml create mode 100644 src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml create mode 100644 src/Magento/AcceptanceTestFramework/DataProfileSchemaParser.php create mode 100644 src/Magento/AcceptanceTestFramework/Helper/EntityRESTApiHelper.php diff --git a/bootstrap.php b/bootstrap.php index 2404df1ba..9fbf9bd48 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -2,6 +2,8 @@ defined('FW_BP') || define('FW_BP', str_replace('\\', '/', (__DIR__))); defined('TESTS_BP') || define('TESTS_BP', dirname(dirname(dirname(FW_BP)))); +putenv("HOSTNAME=127.0.0.1"); +putenv("PORT=8080"); require_once __DIR__ . '/vendor/autoload.php'; diff --git a/entryPoint.php b/entryPoint.php index 9f7d4417e..4b7e1e5f9 100644 --- a/entryPoint.php +++ b/entryPoint.php @@ -8,5 +8,8 @@ require_once 'bootstrap.php'; /** @var Magento\AcceptanceTestFramework\Dummy $dummy */ -$dummy = $objectManager->create(\Magento\AcceptanceTestFramework\Dummy::class); -$dummy->readPageObjects(); +$dummy = new Magento\AcceptanceTestFramework\DataGenerator\DataHandler('test'); + +$result = $dummy->persistData(['CustomerEntityTwo'], 'API'); + +print_r($result); diff --git a/etc/di.xml b/etc/di.xml index 88c371fb0..d1f4be41b 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -95,4 +95,36 @@ Magento\AcceptanceTestFramework\Config\Reader\Page
    + + + Magento\AcceptanceTestFramework\Config\Reader\DataProfile + + + + + + Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd + + + + + + Magento\AcceptanceTestFramework\Config\FileResolver\Module + Magento\AcceptanceTestFramework\Config\Converter + Magento\AcceptanceTestFramework\Config\SchemaLocator\DataProfile + + name + name + key + + data.xml + */etc + + + + + + Magento\AcceptanceTestFramework\DataProfile\Config\Data + + diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php index 9b96e39c3..731854e75 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php @@ -41,9 +41,7 @@ public function get($filename, $scope) $paths = []; foreach ($modulesPath as $modulePath) { $path = $modulePath . DIRECTORY_SEPARATOR . $scope . DIRECTORY_SEPARATOR . $filename; - if (is_readable($path)) { - $paths[] = $path; - } + $paths = array_merge($paths, glob($path)); } $iterator = new File($paths); diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorXMLConstants.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorXMLConstants.php new file mode 100644 index 000000000..4adc2a65b --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorXMLConstants.php @@ -0,0 +1,21 @@ +moduleName = $moduleName; + } + + public function generateData($mapEntities = false) + { + $entityObjects = array(); + $this->objectManager = ObjectManagerFactory::getObjectManager(); + $entityParser = $this->objectManager->create(DataProfileSchemaParser::class); + $entities = $entityParser->readDataProfiles(); + + foreach ($entities[DataGeneratorXMLConstants::ENTITY_DATA] as $entityName => $entity) { + $entityXmlObject = new EntityXmlObject( + $entityName, + $entity[DataGeneratorXMLConstants::ENTITY_DATA_TYPE], + $entity[DataGeneratorXMLConstants::ENTITY_DATA_CONFIG], + $entity[DataGeneratorXMLConstants::DATA_OBJECT] + ); + + if ($mapEntities) { + $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; + } else { + $entityObjects[] = $entityXmlObject; + } + } + + return $entityObjects; + } + + public function persistData($entityNames, $inputMethod) + { + $entityObjects = $this->generateData(true); + $relevantEntities = array_intersect_key($entityObjects, array_flip($entityNames)); + + foreach ($relevantEntities as $relevantEntity) { + if ($inputMethod == 'API') { + return $this->createApiModel($relevantEntity)->create(); + } + } + } + + private function createApiModel($entity) + { + $apiClass = self::API_CLASS_PATH . "\\" . $entity->getType(); + $apiObject = new $apiClass($entity); + return $apiObject; + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/ApiModel/Address.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/ApiModel/Address.php new file mode 100644 index 000000000..38c0e6bef --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/ApiModel/Address.php @@ -0,0 +1,14 @@ +entityObject = $entityObject; + + if (!self::$entityRESTApiHelper) { + self::$entityRESTApiHelper = new EntityRESTApiHelper(getenv('HOSTNAME'), getenv('PORT')); + } + } + + public function create() + { + $response = self::$entityRESTApiHelper->submitAuthAPiRequest( + 'PUT', + self::CUSTOMER_CREATE_API_PATH, + $this->entityDataToJson(), + EntityRESTApiHelper::APPLICATION_JSON_HEADER + ); + + return $response; + } + + public function delete() + { + // TODO implement delete method via customer web-api; + } + + private function entityDataToJson() + { + $data = $this->entityObject->getData(); + + foreach (self::$specialDefinitions as $specialKey) { + if (array_key_exists($specialKey, $data)) { + // logic to handle special case (new obj?) + } + } + + $entityArray = [ + strtolower($this->entityObject->getType()) => $data, + + // this passwordHash param is necessary to create a new customer. + 'passwordHash' => 'someHash']; + + $json = \GuzzleHttp\json_encode($entityArray); + + return $json; + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/EntityPersistenceInterface.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/EntityPersistenceInterface.php new file mode 100644 index 000000000..129737523 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/EntityPersistenceInterface.php @@ -0,0 +1,24 @@ +name = $entityName; + $this->type = $entityType; + + foreach ($dataConfigs as $dataConfig) { + $this->dataConfigs[] = $dataConfig[DataGeneratorXMLConstants::DATA_CONFIG_VALUE]; + } + + foreach ($dataObjects as $fieldGroupName => $fieldGroupObject) { + $dataNames = array(); // array to store names of data per fieldGroupObject + $assertions = array(); // array to store assertions + + foreach ($fieldGroupObject[DataGeneratorXMLConstants::DATA_OBJECT_DATA] as $dataElement) { + $dataNames[] = $dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_KEY]; + $this->data[$dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_KEY]] = + $dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_VALUE]; + } + + foreach ($fieldGroupObject[DataGeneratorXMLConstants::DATA_OBJECT_ASSERTS] as $assertion) { + $assertions[] = $assertion[DataGeneratorXMLConstants::ASSERT_VALUE]; + } + + + $fieldGroupXmlObject = new FieldGroupXmlObject($fieldGroupName, $assertions, $dataNames); + $this->fieldGroups[$fieldGroupXmlObject->getName()] = $fieldGroupXmlObject; + } + } + + public function getName() + { + return $this->name; + } + + public function getType() + { + return $this->type; + } + + public function getFieldGroups() + { + return $this->fieldGroups; + } + + public function getData() + { + return $this->data; + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php new file mode 100644 index 000000000..3194d9fb6 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php @@ -0,0 +1,33 @@ +name = $dataObjectName; + $this->assertions = $assertions; + $this->dataNames = $data; + } + + public function getName() + { + return $this->name; + } + + public function getAssertions() + { + return $this->assertions; + } + + public function getDataNames() + { + return $this->dataNames; + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd new file mode 100644 index 000000000..eaca395e5 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd @@ -0,0 +1,97 @@ + + + + + + + The root element for configuration data. + + + + + + + + An element that contains configuration array containing all Entity elements. + + + + + + + + + + + + + Scenario elements. + + + + + + + FieldGroup elements, contains data pairs and asserts. + + + + + + + + Name of the Entity. + + + + + + + Node containing the exact name of Entity type. Used later to find specific Persistence Layer Model + class. + + + + + + + + + + + Element containing Data/Value pair. + + + + + + + Name of Assert. + + + + + + + + Name of the DataObject element. + + + + + + + + + + + + Key attribute of data/value pair. + + + + + + + \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/sample.xml b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/sample.xml new file mode 100644 index 000000000..722e5e6e7 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/sample.xml @@ -0,0 +1,25 @@ + + + + + simpleConfiguration + regressionConfiguration + + asdf + + + + AssertNumberOne + AssertNumberTwo + + + FirstNameData + + + AssertNumberOne + AssertNumberTwo + AssertNumberThree + + + \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml b/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml new file mode 100644 index 000000000..f71e96671 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml @@ -0,0 +1,39 @@ + + + + + simpleConfiguration + regressionConfiguration + + FirstNameData + LastName + address + 2017-06-12 14:00:00 + apitest@mgail.com + AssertNumberOne + AssertNumberTwo + + + adsfsdf + AssertNumberOne + AssertNumberTwo + AssertNumberThree + + + + simpleConfiguration + regressionConfiguration + + FirstNameData12 + LastName12 + 2017-06-12 14:00:00 + 1989-04-12 + 0 + apitest15432@mgail.com + 0 + AssertNumberOne + AssertNumberTwo + + + \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataProfileSchemaParser.php b/src/Magento/AcceptanceTestFramework/DataProfileSchemaParser.php new file mode 100644 index 000000000..e5e1fa13a --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataProfileSchemaParser.php @@ -0,0 +1,25 @@ +dataProfiles = $dataProfiles; + } + + public function readDataProfiles() + { + return $this->dataProfiles->get(); + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Helper/EntityRESTApiHelper.php b/src/Magento/AcceptanceTestFramework/Helper/EntityRESTApiHelper.php new file mode 100644 index 000000000..f44fba100 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Helper/EntityRESTApiHelper.php @@ -0,0 +1,76 @@ + 'application/json']; + + public function __construct($host, $port) + { + $this->guzzle_client = new Client([ + 'base_uri' => "http://${host}:${port}", + 'timeout' => 5.0, + ]); + } + + public function submitAuthAPIRequest($apiMethod, $requestURI, $jsonBody, $headers) + { + $allHeaders = $headers; + $authTokenVal = $this->getAuthToken(); + $authToken = ['Authorization' => 'Bearer ' . $authTokenVal]; + $allHeaders = array_merge($allHeaders, $authToken); + + return $this->submitAPIRequest($apiMethod, $requestURI, $jsonBody, $allHeaders); + } + + /** + * Function that sends a REST call to the integration endpoint for an authorization token. + * @return string + */ + + private function getAuthToken() + { + $jsonArray = json_encode(['username' => 'admin', 'password' => 'admin123']); + + $response = $this->submitAPIRequest( + 'POST', + self::INTEGRATION_ADMIN_TOKEN_URI, + $jsonArray, + self::APPLICATION_JSON_HEADER + ); + + if ($response->getStatusCode() != 200) { + throwException($response->getReasonPhrase() .' Could not get admin token from service, please check logs.'); + } + + $authToken = str_replace('"', "", $response->getBody()->getContents()); + return $authToken; + } + + /** + * Function that submits an api request from the guzzle client using the following parameters: + * @param string $apiMethod + * @param string $requestURI + * @param string $jsonBody + * @param array $headers + * @return \Psr\Http\Message\ResponseInterface + */ + private function submitAPIRequest($apiMethod, $requestURI, $jsonBody, $headers) + { + $response = $this->guzzle_client->request( + $apiMethod, + $requestURI, + [ + 'headers' => $headers, + 'body' => $jsonBody + ] + ); + + return $response; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php index 2bae29f1e..a9bfd736f 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php @@ -159,8 +159,8 @@ public function getModulesPath() } $enabledModules = $this->getEnabledModules(); - $modulePath = defined('TESTS_MODULE_PATH') ? TESTS_MODULE_PATH : TESTS_BP; - $allModulePaths = glob($modulePath . '*/*'); + $modulePath = FW_BP . '/src/Magento/AcceptanceTestFramework'; + $allModulePaths = glob($modulePath . '/*'); if (empty($enabledModules)) { $this->enabledModulePaths = $allModulePaths; return $this->enabledModulePaths; From 99d37977f35bca73c75894bc0deed90f0dd16085 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 29 Jun 2017 11:51:04 -0500 Subject: [PATCH 086/149] MQE-189: Fixed ModuleResolver to recover a previous bad merge. --- src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php index a9bfd736f..2bae29f1e 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php @@ -159,8 +159,8 @@ public function getModulesPath() } $enabledModules = $this->getEnabledModules(); - $modulePath = FW_BP . '/src/Magento/AcceptanceTestFramework'; - $allModulePaths = glob($modulePath . '/*'); + $modulePath = defined('TESTS_MODULE_PATH') ? TESTS_MODULE_PATH : TESTS_BP; + $allModulePaths = glob($modulePath . '*/*'); if (empty($enabledModules)) { $this->enabledModulePaths = $allModulePaths; return $this->enabledModulePaths; From fd02364fe320c77cfa00e6cd182ef0521cdcc08d Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 29 Jun 2017 11:51:04 -0500 Subject: [PATCH 087/149] MQE-189: Fixed ModuleResolver to recover a previous bad merge. --- .../AcceptanceTestFramework/Config/FileResolver/Mask.php | 2 +- src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php index 371e2c25a..df569b2ba 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php @@ -62,7 +62,7 @@ protected function getFileCollection($filename, $scope) $modulesPath = $this->moduleResolver->getModulesPath(); foreach ($modulesPath as $modulePath) { - $path = $modulePath; + $path = $modulePath . '/' . $scope . '/'; if (is_readable($path)) { $directoryIterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php index a9bfd736f..2bae29f1e 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php @@ -159,8 +159,8 @@ public function getModulesPath() } $enabledModules = $this->getEnabledModules(); - $modulePath = FW_BP . '/src/Magento/AcceptanceTestFramework'; - $allModulePaths = glob($modulePath . '/*'); + $modulePath = defined('TESTS_MODULE_PATH') ? TESTS_MODULE_PATH : TESTS_BP; + $allModulePaths = glob($modulePath . '*/*'); if (empty($enabledModules)) { $this->enabledModulePaths = $allModulePaths; return $this->enabledModulePaths; From b658d2661bf445431653ba865aebf6b274bec00c Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 10 Jul 2017 10:32:56 -0500 Subject: [PATCH 088/149] MQE-185: Refactored page object generator. --- etc/di.xml | 53 +-- .../Config/FileResolver/Mask.php | 2 +- .../Generate/AbstractGenerate.php | 14 + .../Generate/GenerateBlock.php | 337 ++++++++++++++++++ .../Generate/GeneratePage.php | 317 +--------------- .../Generate/GenerateResult.php | 4 +- .../AcceptanceTestFramework/Generate/Pool.php | 33 ++ .../Page/etc/blockObject.xsd | 128 +++++++ .../Page/etc/pageObject.xsd | 101 +----- 9 files changed, 559 insertions(+), 430 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/Generate/GenerateBlock.php create mode 100644 src/Magento/AcceptanceTestFramework/Generate/Pool.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd diff --git a/etc/di.xml b/etc/di.xml index d1f4be41b..4f45edda9 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -54,6 +54,11 @@ Magento\AcceptanceTestFramework\Page\Config\Data
    + + + Magento\AcceptanceTestFramework\Block\Config\Data + + @@ -76,6 +81,11 @@ Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd + + + Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd + + Magento\AcceptanceTestFramework\Config\FileResolver\Mask @@ -84,47 +94,40 @@ name name - name #\.xml$# Page - + - Magento\AcceptanceTestFramework\Config\Reader\Page + Magento\AcceptanceTestFramework\Config\FileResolver\Mask + Magento\AcceptanceTestFramework\Config\Converter + Magento\AcceptanceTestFramework\Config\SchemaLocator\Block + + name + name + + #\.xml$# + Block - + - Magento\AcceptanceTestFramework\Config\Reader\DataProfile + Magento\AcceptanceTestFramework\Config\Reader\Page - - + - Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd + Magento\AcceptanceTestFramework\Config\Reader\Block - - + - Magento\AcceptanceTestFramework\Config\FileResolver\Module - Magento\AcceptanceTestFramework\Config\Converter - Magento\AcceptanceTestFramework\Config\SchemaLocator\DataProfile - - name - name - key + + Magento\AcceptanceTestFramework\Generate\GeneratePage + Magento\AcceptanceTestFramework\Generate\GenerateBlock - data.xml - */etc - - - - - - Magento\AcceptanceTestFramework\DataProfile\Config\Data diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php index 371e2c25a..df569b2ba 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php @@ -62,7 +62,7 @@ protected function getFileCollection($filename, $scope) $modulesPath = $this->moduleResolver->getModulesPath(); foreach ($modulesPath as $modulePath) { - $path = $modulePath; + $path = $modulePath . '/' . $scope . '/'; if (is_readable($path)) { $directoryIterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( diff --git a/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php b/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php index 2d7b6bdeb..1e4123831 100644 --- a/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php +++ b/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php @@ -16,6 +16,20 @@ abstract class AbstractGenerate implements LauncherInterface */ protected $cnt = 0; + /** + * Execution start in Unix timestamp with microseconds. + * + * @var int + */ + protected $start; + + /** + * Execution end in Unix timestamp with microseconds. + * + * @var int + */ + protected $end; + /** * An array of errors. * diff --git a/src/Magento/AcceptanceTestFramework/Generate/GenerateBlock.php b/src/Magento/AcceptanceTestFramework/Generate/GenerateBlock.php new file mode 100644 index 000000000..fb07b1d5f --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Generate/GenerateBlock.php @@ -0,0 +1,337 @@ +cnt = 0; + $this->start = microtime(true); + foreach ($this->configData->get('block') as $name => $data) { + $this->generateClass($name, $data); + } + $this->end = microtime(true); + $time = $this->end - $this->start; + + \Magento\AcceptanceTestFramework\Generate\GenerateResult::addResult('Block Classes', $this->cnt, $time); + } + + /** + * Generate single block class. + * + * @param string $className + * @return string|bool + * @throws \InvalidArgumentException + */ + public function generate($className) + { + $classNameParts = explode('\\', $className); + $classDataKey = 'block/' . end($classNameParts); + + if (!$this->configData->get($classDataKey)) { + throw new \InvalidArgumentException('Invalid class name: ' . $className); + } + + return $this->generateClass( + end($classNameParts), $this->configData->get($classDataKey) + ); + } + + /** + * Generate block class from XML source. + * + * @param string $name + * @param array $data + * @return string|bool + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + protected function generateClass($name, array $data) + { + $class = str_replace('/', '\\', $name); + $className = $this->getShortClassName($class); + $parentClass = "Magento\\AcceptanceTestFramework\\Page\\Block\\Block"; + if (isset($data['parent_class'])) { + $parentClass = $data['parent_class']; + } + $parentClassName = $this->getShortClassName($parentClass); + + $content = "getFilePhpDoc(); + $content .= "namespace {$this->getNamespace($class)};\n\n"; + $content .= "use {$parentClass};\n\n"; + $content .= "/**\n"; + $content .= " * Class {$className}\n"; + $content .= " */\n"; + $content .= "class {$className} extends {$parentClassName}\n"; + $content .= "{\n"; + + if (isset($data['element'])) { + $elements = $data['element']; + foreach ($elements as $element => $attributes) { + $attributes['locator'] = str_replace('\'', '"', $attributes['locator']); + /** + * Generate contents: + * public static $productName = '.admin__field[data-index=name] input'; + */ + $content .= " public static $$element = '" . $attributes['locator'] . "';\n"; + } + foreach ($elements as $element => $attributes) { + switch ($attributes['type']) { + case 'input': + $content .= $this->generateCodeForInputAction($element, $attributes); + break; + case 'text': + $content .= $this->generateCodeForTextAction($element, $attributes); + break; + case 'button': + $content .= $this->generateCodeForButtonAction($element, $attributes); + break; + case 'checkbox': + $content .= $this->generateCodeForCheckboxAction($element, $attributes); + break; + case 'radio': + $content .= $this->generateCodeForRadioAction($element, $attributes); + break; + case 'select': + $content .= $this->generateCodeForSelectAction($element, $attributes); + break; + case 'multiselect': + $content .= $this->generateCodeForMultiSelectAction($element, $attributes); + break; + default: + break; + } + } + } + $content .= "}\n"; + + return $this->createClass($class, $content); + } + + /** + * Generate code for input action; and + * generate code for asserting value in input field; and + * generate code for returning text from input field; and + * generate waitForPageLoad() if it's needed. + * + * public function fillFieldProductName($value) + * { + * $this->acceptanceTester->fillField(self::$productName, $value); + * } + * + * public function seeProductName($expectedValue) + * { + * $this->acceptanceTester->seeInField(self::$productName, $expectedValue); + * } + * + * public function grabTextFromProductName($expectedValue) + * { + * $result = $this->acceptanceTester->grabTextFrom(self::$productName); + * return $result; + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForInputAction($element, $attributes) + { + $waitRequired = false; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $waitRequired = true; + } + $content = "\n"; + $content .= " public function fillField" . ucfirst($element). "(\$value)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->fillField(self::$$element, \$value);\n"; + if ($waitRequired) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + $content .= "\n"; + $content .= " public function seeInField" . ucfirst($element). "(\$expectedValue)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->seeInField(self::$$element, \$expectedValue);\n"; + if ($waitRequired) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + $content .= "\n"; + $content .= " public function grabTextFrom" . ucfirst($element). "()\n"; + $content .= " {\n"; + $content .= " \$result = \$this->acceptanceTester->grabTextFrom(self::$$element);\n"; + if ($waitRequired) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " return \$result;\n"; + $content .= " }\n"; + return $content; + } + + /** + * Generate code for returning text from text field; and generate waitForPageLoad() if it's needed. + * + * public function grabTextFromProductName($expectedValue) + * { + * $result = $this->acceptanceTester->grabTextFrom(self::$productName); + * $this->acceptanceTester->waitForPageLoad(); + * return $result + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForTextAction($element, $attributes) + { + $content = "\n"; + $content .= " public function grabTextFrom" . ucfirst($element). "()\n"; + $content .= " {\n"; + $content .= " \$result = \$this->acceptanceTester->grabTextFrom(self::$$element);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " return \$result;\n"; + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing button action; and generate waitForPageLoad() if it's needed. + * + * public function clickButtonMyButton() + * { + * $this->acceptanceTester->click(self::$myButton); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForButtonAction($element, $attributes) + { + $content = "\n"; + $content .= " public function clickButton" . ucfirst($element). "()\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->click(self::$$element);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing checkbox action; and generate waitForPageLoad() if it's needed. + * + * public function clickCheckBoxMyCheckboxButton($optionsArray) + * { + * $this->acceptanceTester->checkOption(self::$myCheckboxButton, $optionsArray); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForCheckboxAction($element, $attributes) + { + $content = "\n"; + $content .= " public function clickCheckBox" . ucfirst($element). "(\$optionsArray)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->checkOption(self::$$element, \$optionsArray);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing radio button action; and generate waitForPageLoad() if it's needed. + * + * public function clickRadioButtonMyRadioButton($option) + * { + * $this->acceptanceTester->selectOption(self::$myRadioButton, $option); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForRadioAction($element, $attributes) + { + $content = "\n"; + $content .= " public function clickRadioButton" . ucfirst($element). "(\$option)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->selectOption(self::$$element, \$option);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing dropdown select action; and generate waitForPageLoad() if it's needed. + * + * public function selectOptionMySelectButton($option) + * { + * $this->acceptanceTester->selectOption(self::$mySelectButton, $option); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForSelectAction($element, $attributes) + { + $content = "\n"; + $content .= " public function selectOption" . ucfirst($element). "(\$option)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->selectOption(self::$$element, \$option);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } + + /** + * Generate code for performing search and multi-select action; and generate waitForPageLoad() if it's needed. + * e.g. Categories multi-select element + * + * public function selectOptionMySelectButton($optionArray, $requireAction = false) + * { + * $this->acceptanceTester->searchAndMultiSelectOption(self::$mySelectButton, $optionArray, $requireAction = false); + * $this->acceptanceTester->waitForPageLoad(); + * } + * + * @param string $element + * @param array $attributes + * @return string + */ + private function generateCodeForMultiSelectAction($element, $attributes) + { + $content = "\n"; + $content .= " public function clickCheckBox" . ucfirst($element). "(\$optionsArray)\n"; + $content .= " {\n"; + $content .= " \$this->acceptanceTester->searchAndMultiSelectOption(self::$$element, \$optionsArray, \$requireAction = false);\n"; + if (isset($attributes['wait_required']) && $attributes['wait_required']) { + $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; + } + $content .= " }\n"; + return $content; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php b/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php index d958290db..207bfcef8 100644 --- a/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php +++ b/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php @@ -14,12 +14,14 @@ class GeneratePage extends AbstractGenerate public function launch() { $this->cnt = 0; - + $this->start = microtime(true); foreach ($this->configData->get('page') as $name => $data) { $this->generateClass($name, $data); } + $this->end = microtime(true); + $time = $this->end - $this->start; - \Magento\AcceptanceTestFramework\Generate\GenerateResult::addResult('Page Classes', $this->cnt); + \Magento\AcceptanceTestFramework\Generate\GenerateResult::addResult('Page Classes', $this->cnt, $time); } /** @@ -60,46 +62,41 @@ protected function generateClass($name, array $data) $folderPath = str_replace('_', '/AcceptanceTest/', $data['module']) . '/Page'; $folderPath .= (empty($area) ? '' : ('/' . $area)); $class = str_replace('/', '\\', $folderPath . '/' . $className); - $blocks = isset($data['block']) ? $data['block'] : []; $content = "getFilePhpDoc(); $content .= "namespace {$this->getNamespace($class)};\n\n"; $content .= "use Magento\\AcceptanceTestFramework\\Page\\{$areaPage};\n\n"; - $content .= "/**\n"; $content .= " * Class {$className}\n"; $content .= " */\n"; $content .= "class {$className} extends {$areaPage}\n"; $content .= "{\n"; $content .= " const MCA = '{$mca}';\n\n"; - - $content .= " /**\n"; $content .= " * Blocks' config\n"; $content .= " *\n"; $content .= " * @var array\n"; $content .= " */\n"; $content .= " protected \$blocks = [\n"; - foreach ($blocks as $blockName => $block) { - $block['class'] = $block['class'] . '\\' . ucfirst($blockName); - - $blocks[$blockName]['class'] = $block['class']; - $this->generateBlock($blockName, $block); + $blocks = isset($data['block']) ? $data['block'] : []; + foreach ($blocks as $blockClass => $block) { + $blockName = lcfirst($this->getShortClassName($blockClass)); + $block['class'] = $blockClass; $content .= $this->generatePageClassBlock($blockName, $block, ' '); } $content .= " ];\n"; - foreach ($blocks as $blockName => $block) { + foreach ($blocks as $blockClass => $block) { + $blockName = lcfirst($this->getShortClassName($blockClass)); $content .= "\n /**\n"; - $content .= " * @return \\" . $block['class'] . "\n"; + $content .= " * @return \\" . $blockClass . "\n"; $content .= " */\n"; $content .= ' public function get' . ucfirst($blockName) . '()' . "\n"; $content .= " {\n"; $content .= " return \$this->getBlockInstance('{$blockName}');\n"; $content .= " }\n"; } - $content .= "}\n"; return $this->createClass($class, $content); @@ -149,296 +146,4 @@ protected function getParentPage($area, $mca) } return $areaPage; } - - /** - * Generate block class from XML source. - * - * @param string $blockName - * @param array $block - * @return string|bool - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function generateBlock($blockName, array $block) - { - $className = ucfirst($blockName); - $parentClass = "Magento\\AcceptanceTestFramework\\Page\\Block\\Block"; - if (isset($block['parent_class'])) { - $parentClass = $block['parent_class']; - } - $parentClassName = $this->getShortClassName($parentClass); - - $content = "getFilePhpDoc(); - $content .= "namespace {$this->getNamespace($block['class'])};\n\n"; - $content .= "use {$parentClass};\n\n"; - $content .= "/**\n"; - $content .= " * Class {$className}\n"; - $content .= " */\n"; - $content .= "class {$className} extends {$parentClassName}\n"; - $content .= "{\n"; - - if (isset($block['element'])) { - $elements = $block['element']; - foreach ($elements as $element => $attributes) { - $attributes['locator'] = str_replace('\'', '"', $attributes['locator']); - /** - * Generate contents: - * public static $productName = '.admin__field[data-index=name] input'; - */ - $content .= " public static $$element = '" . $attributes['locator'] . "';\n"; - } - foreach ($elements as $element => $attributes) { - switch ($attributes['type']) { - case 'input': - $content .= $this->generateCodeForInputAction($element, $attributes); - break; - case 'text': - $content .= $this->generateCodeForTextAction($element, $attributes); - break; - case 'button': - $content .= $this->generateCodeForButtonAction($element, $attributes); - break; - case 'checkbox': - $content .= $this->generateCodeForCheckboxAction($element, $attributes); - break; - case 'radio': - $content .= $this->generateCodeForRadioAction($element, $attributes); - break; - case 'select': - $content .= $this->generateCodeForSelectAction($element, $attributes); - break; - case 'multiselect': - $content .= $this->generateCodeForMultiSelectAction($element, $attributes); - break; - default: - break; - } - } - } - $content .= "}\n"; - - return $this->createClass($block['class'], $content); - } - - /** - * Generate code for input action; and - * generate code for asserting value in input field; and - * generate code for returning text from input field; and - * generate waitForPageLoad() if it's needed. - * - * public function fillFieldProductName($value) - * { - * $this->acceptanceTester->fillField(self::$productName, $value); - * } - * - * public function seeProductName($expectedValue) - * { - * $this->acceptanceTester->seeInField(self::$productName, $expectedValue); - * } - * - * public function grabTextFromProductName($expectedValue) - * { - * $result = $this->acceptanceTester->grabTextFrom(self::$productName); - * return $result; - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForInputAction($element, $attributes) - { - $waitRequired = false; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $waitRequired = true; - } - - $content = "\n"; - $content .= " public function fillField" . ucfirst($element). "(\$value)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->fillField(self::$$element, \$value);\n"; - if ($waitRequired) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - - $content .= "\n"; - $content .= " public function seeInField" . ucfirst($element). "(\$expectedValue)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->seeInField(self::$$element, \$expectedValue);\n"; - if ($waitRequired) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - - $content .= "\n"; - $content .= " public function grabTextFrom" . ucfirst($element). "()\n"; - $content .= " {\n"; - $content .= " \$result = \$this->acceptanceTester->grabTextFrom(self::$$element);\n"; - if ($waitRequired) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " return \$result;\n"; - $content .= " }\n"; - return $content; - } - - /** - * Generate code for returning text from text field; and generate waitForPageLoad() if it's needed. - * - * public function grabTextFromProductName($expectedValue) - * { - * $result = $this->acceptanceTester->grabTextFrom(self::$productName); - * $this->acceptanceTester->waitForPageLoad(); - * return $result - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForTextAction($element, $attributes) - { - $content = "\n"; - $content .= " public function grabTextFrom" . ucfirst($element). "()\n"; - $content .= " {\n"; - $content .= " \$result = \$this->acceptanceTester->grabTextFrom(self::$$element);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " return \$result;\n"; - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing button action; and generate waitForPageLoad() if it's needed. - * - * public function clickButtonMyButton() - * { - * $this->acceptanceTester->click(self::$myButton); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForButtonAction($element, $attributes) - { - $content = "\n"; - $content .= " public function clickButton" . ucfirst($element). "()\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->click(self::$$element);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing checkbox action; and generate waitForPageLoad() if it's needed. - * - * public function clickCheckBoxMyCheckboxButton($optionsArray) - * { - * $this->acceptanceTester->checkOption(self::$myCheckboxButton, $optionsArray); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForCheckboxAction($element, $attributes) - { - $content = "\n"; - $content .= " public function clickCheckBox" . ucfirst($element). "(\$optionsArray)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->checkOption(self::$$element, \$optionsArray);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing radio button action; and generate waitForPageLoad() if it's needed. - * - * public function clickRadioButtonMyRadioButton($option) - * { - * $this->acceptanceTester->selectOption(self::$myRadioButton, $option); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForRadioAction($element, $attributes) - { - $content = "\n"; - $content .= " public function clickRadioButton" . ucfirst($element). "(\$option)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->selectOption(self::$$element, \$option);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing dropdown select action; and generate waitForPageLoad() if it's needed. - * - * public function selectOptionMySelectButton($option) - * { - * $this->acceptanceTester->selectOption(self::$mySelectButton, $option); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForSelectAction($element, $attributes) - { - $content = "\n"; - $content .= " public function selectOption" . ucfirst($element). "(\$option)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->selectOption(self::$$element, \$option);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing search and multi-select action; and generate waitForPageLoad() if it's needed. - * e.g. Categories multi-select element - * - * public function selectOptionMySelectButton($optionArray, $requireAction = false) - * { - * $this->acceptanceTester->searchAndMultiSelectOption(self::$mySelectButton, $optionArray, $requireAction = false); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForMultiSelectAction($element, $attributes) - { - $content = "\n"; - $content .= " public function clickCheckBox" . ucfirst($element). "(\$optionsArray)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->searchAndMultiSelectOption(self::$$element, \$optionsArray, \$requireAction = false);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } } diff --git a/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php b/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php index 7e0b6012d..05564a7ce 100644 --- a/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php +++ b/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php @@ -61,7 +61,7 @@ public static function displayResults() $lengths = [ 'item' => strlen('Item'), 'count' => strlen('Count'), - 'time' => strlen('Time') + 'time' => strlen('Time(s)') ]; foreach ($results as $result) { $lengths['item'] = max($lengths['item'], strlen($result['item'])); @@ -70,7 +70,7 @@ public static function displayResults() } echo "|| " . self::prepareForShell('Item', $lengths['item']); echo " || " . self::prepareForShell('Count', $lengths['count']); - echo " || " . self::prepareForShell('Time', $lengths['time']) . " ||\n"; + echo " || " . self::prepareForShell('Time(s)', $lengths['time']) . " ||\n"; foreach ($results as $result) { echo "|| " . self::prepareForShell($result['item'], $lengths['item']); echo " || " . self::prepareForShell($result['count'], $lengths['count']); diff --git a/src/Magento/AcceptanceTestFramework/Generate/Pool.php b/src/Magento/AcceptanceTestFramework/Generate/Pool.php new file mode 100644 index 000000000..f6cec6c6a --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Generate/Pool.php @@ -0,0 +1,33 @@ +generatorPool = $pool; + } + + /** + * Retrieve generator pool + * + * @return array + */ + public function getGenerators() + { + return $this->generatorPool; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd new file mode 100644 index 000000000..3f83758a8 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd @@ -0,0 +1,128 @@ + + + + + + + The root element for configuration data. + + + + + + + + An element that contains configuration data of a page. + + + + + + + + + + + + + + A ui element that contains data for selenium web driver to perform default action on them. + + + + + + + + The fully qualified class name of the block. + + + + + + + Parent block class name, if not specified, Magento\AcceptanceTestFramework\Page\Block\Block is used. + + + + + + + + + + + + The name of the element. + + + + + + + The type of the element, e.g. select, radio, etc. + + + + + + + Locator of the element. + + + + + + + If the element is a required field in the ui. + + + + + + + The group that the element belongs in the ui. + + + + + + + If the element depends on other element to be enabled. + + + + + + + If waitForPageLoad() is required after default action. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd index eecd71269..982893c95 100644 --- a/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd +++ b/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd @@ -1,6 +1,10 @@ + + The definition of a page object. + + @@ -64,26 +68,10 @@ - - - - - A ui element that contains data for selenium web driver to perform default action on them. - - - - - The name of the block. - - - - - - - The path to the block PHP class file. + The fully qualified class name of the block. @@ -94,88 +82,9 @@ - - - - Parent block class name, if not specified, Magento\AcceptanceTestFramework\Page\Block\Block is used. - - - - - - - - - - - - The name of the element. - - - - - - - The type of the element, e.g. select, radio, etc. - - - - - - - Locator of the element. - - - - - - - If the element is a required field in the ui. - - - - - - - The group that the element belongs in the ui. - - - - - - - If the element depends on other element to be enabled. - - - - - - - If waitForPageLoad() is required after default action. - - - - - - - - - - - - - - - - - - - - - From 73f7c7d70b9f0cbccb69122ff10eacaaa75c3c81 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 13 Jul 2017 11:42:32 -0500 Subject: [PATCH 089/149] MTA-4194: Merged back di.xml contents from develop. --- etc/di.xml | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/etc/di.xml b/etc/di.xml index 4f45edda9..49f71da18 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -59,7 +59,19 @@ Magento\AcceptanceTestFramework\Block\Config\Data - + + + + Magento\AcceptanceTestFramework\Generate\GeneratePage + Magento\AcceptanceTestFramework\Generate\GenerateBlock + + + + + + Magento\AcceptanceTestFramework\DataProfile\Config\Data + + Magento\AcceptanceTestFramework\Page\Config\Data @@ -122,12 +134,28 @@ Magento\AcceptanceTestFramework\Config\Reader\Block - + - - Magento\AcceptanceTestFramework\Generate\GeneratePage - Magento\AcceptanceTestFramework\Generate\GenerateBlock + Magento\AcceptanceTestFramework\Config\Reader\DataProfile + + + + + Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd + + + + + Magento\AcceptanceTestFramework\Config\FileResolver\Module + Magento\AcceptanceTestFramework\Config\Converter + Magento\AcceptanceTestFramework\Config\SchemaLocator\DataProfile + + name + name + key + data.xml + */etc - + From d8202e85dd87bba8a61c2bfb6a4e2c8c8997c2cd Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Thu, 13 Jul 2017 13:39:29 -0500 Subject: [PATCH 090/149] MQE-145 XML Parser should be able to remove nodes --- .../AcceptanceTestFramework/Config/Converter.php | 4 ++++ .../DataGenerator/etc/DataProfileSchema.xsd | 12 +++++++++++- .../AcceptanceTestFramework/Page/etc/blockObject.xsd | 10 ++++++++++ .../AcceptanceTestFramework/Page/etc/pageObject.xsd | 10 ++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Magento/AcceptanceTestFramework/Config/Converter.php b/src/Magento/AcceptanceTestFramework/Config/Converter.php index c1b1d4391..bcea63166 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Converter.php +++ b/src/Magento/AcceptanceTestFramework/Config/Converter.php @@ -79,6 +79,10 @@ protected function convertXml($elements) foreach ($elements as $element) { if ($element instanceof \DOMElement) { + if ($element->getAttribute('remove') == 'true') { + // Remove element + continue; + } if ($element->hasAttribute('xsi:type')) { if ($element->hasAttribute('path')) { $elementData = $this->getAttributes($element); diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd index eaca395e5..04b2a94c1 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd @@ -94,4 +94,14 @@ - \ No newline at end of file + + + + + + Set to true to remove this element during parsing. + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd index 3f83758a8..025370de2 100644 --- a/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd +++ b/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd @@ -125,4 +125,14 @@ + + + + + + Set to true to remove this element during parsing. + + + + diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd index 982893c95..2c77cc67b 100644 --- a/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd +++ b/src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd @@ -90,4 +90,14 @@ + + + + + + Set to true to remove this element during parsing. + + + + From ecd587fb06bfcf42810d57d55e2ab163bb4f583f Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Mon, 17 Jul 2017 13:24:42 -0500 Subject: [PATCH 091/149] MQE-150:[Data Input] Data Entity Dependencies - add EntityDataObject - rename php classes to be format generic - edit di.xml to retrieve *Data.xml files in ce-tests - add EntityDataManager and DataManager for data object retrieval. --- bootstrap.php | 13 ++- entryPoint.php | 12 +-- etc/di.xml | 10 +- .../DataGenerator/DataGeneratorConstants.php | 18 ++++ .../DataGeneratorXMLConstants.php | 21 ---- .../DataGenerator/DataHandler.php | 19 ++-- .../DataGenerator/Managers/DataManager.php | 61 ++++++++++++ .../Managers/EntityDataManager.php | 18 ++++ .../Objects/EntityDataObject.php | 96 +++++++++++++++++++ .../DataGenerator/Objects/EntityXmlObject.php | 64 ------------- .../Objects/FieldGroupXmlObject.php | 33 ------- .../DataGenerator/etc/DataProfileSchema.xsd | 49 ++++------ .../DataProfile/Test/etc/data.xml | 39 -------- 13 files changed, 237 insertions(+), 216 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorXMLConstants.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml diff --git a/bootstrap.php b/bootstrap.php index 9fbf9bd48..b67795f6d 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,13 +1,16 @@ load(); + +//$dotenv = new Dotenv\Dotenv(TESTS_BP, '.env'); +//Load constants from .env file +$env = new \Dotenv\Loader(__DIR__ . '/.env'); +$env->load(); +define('TESTS_BP', $env->getEnvironmentVariable('TESTS_BP')); +define('FW_BP', $env->getEnvironmentVariable('FW_BP')); +define('TESTS_MODULE_PATH', TESTS_BP . '/tests/acceptance/Magento/AcceptanceTest'); $objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); diff --git a/entryPoint.php b/entryPoint.php index 4b7e1e5f9..50bfdc756 100644 --- a/entryPoint.php +++ b/entryPoint.php @@ -1,15 +1,7 @@ persistData(['CustomerEntityTwo'], 'API'); - -print_r($result); +$dummy = $objectManager->create(\Magento\AcceptanceTestFramework\Dummy::class); +$dummy->readPageObjects(); diff --git a/etc/di.xml b/etc/di.xml index d1f4be41b..40ebb0fda 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -113,12 +113,12 @@ Magento\AcceptanceTestFramework\Config\Converter Magento\AcceptanceTestFramework\Config\SchemaLocator\DataProfile - name - name - key + name + key + name - data.xml - */etc + *Data.xml + Data diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php new file mode 100644 index 000000000..b6dff6976 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php @@ -0,0 +1,18 @@ +objectManager->create(DataProfileSchemaParser::class); $entities = $entityParser->readDataProfiles(); - foreach ($entities[DataGeneratorXMLConstants::ENTITY_DATA] as $entityName => $entity) { - $entityXmlObject = new EntityXmlObject( - $entityName, - $entity[DataGeneratorXMLConstants::ENTITY_DATA_TYPE], - $entity[DataGeneratorXMLConstants::ENTITY_DATA_CONFIG], - $entity[DataGeneratorXMLConstants::DATA_OBJECT] - ); + foreach ($entities[DataGeneratorConstants::ENTITY_DATA] as $entityName => $entity) { + $entityType = $entity[DataGeneratorConstants::ENTITY_DATA_TYPE]; - if ($mapEntities) { + if (strcasecmp($entityType, $type) == 0) { + $entityXmlObject = new EntityDataObject( + $entityName, + $entityType, + $entity[DataGeneratorConstants::DATA_VALUES] ?? null, + $entity[DataGeneratorConstants::REQUIRED_ENTITY] ?? null + ); $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; } else { $entityObjects[] = $entityXmlObject; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php new file mode 100644 index 000000000..ad2c59fed --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php @@ -0,0 +1,61 @@ +data = $this->parseDataEntities($type); + } + + private function parseDataEntities($type) + { + $entityObjects = array(); + $objectManager = ObjectManagerFactory::getObjectManager(); + $entityParser = $objectManager->create(DataProfileSchemaParser::class); + $entities = $entityParser->readDataProfiles(); + + foreach ($entities[DataGeneratorConstants::ENTITY_DATA] as $entityName => $entity) { + $entityType = $entity[DataGeneratorConstants::ENTITY_DATA_TYPE]; + + if (strcasecmp($entityType, $type) == 0) { + $entityXmlObject = new EntityDataObject( + $entityName, + $entityType, + $entity[DataGeneratorConstants::DATA_VALUES] ?? null, + $entity[DataGeneratorConstants::REQUIRED_ENTITY] ?? null + ); + + $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; + } + } + unset($entityName); + unset($entity); + + return $entityObjects; + } + + public function getEntity($entityName) + { + return $this->data[$entityName]; + } + + public function getAllEntities() + { + return $this->data; + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php new file mode 100644 index 000000000..4c126cc6b --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php @@ -0,0 +1,18 @@ +name = $entityName; + $this->type = $entityType; + + if ($data) { + foreach ($data as $dataElement) { + $dataElementKey = $dataElement[DataGeneratorConstants::DATA_ELEMENT_KEY]; + $dataElementValue = $dataElement[DataGeneratorConstants::DATA_ELEMENT_VALUE]; + + $this->data[$dataElementKey] = $dataElementValue; + } + unset($dataElement); + } + + if ($linkedEntities) { + foreach ($linkedEntities as $linkedEntity) { + $linkedEntityName = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_VALUE]; + $linkedEntityType = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_TYPE]; + + $this->linkedEntities[$linkedEntityName] = $linkedEntityType; + } + unset($linkedEntity); + } + } + + public function hasLinkedEntity($entityName) + { + return array_key_exists($entityName, $this->linkedEntities); + } + + public function getName() + { + return $this->name; + } + + public function getType() + { + return $this->type; + } + + /** + * This function retrieves data from an entity defined in xml. The data can be defined explicitly by the entity or + * within any entity linked to or required by the entity. The function will evaluate in the following order: + * 1) Data declared explicitly by the entity + * 2) Data declared explicitly as a known linked entity + * 3) Data declared by entities linked to linked entities + * @param string $name + * @param string $entityName + * @return string + */ + public function getDataByName($name, $entityName = null) + { + if ($entityName == null) { + return $this->data[$name]; + } elseif ($this->hasLinkedEntity($entityName)) { + $entityTypeManager = EntityDataManager::getDataManager($this->linkedEntities[$entityName]); + return $entityTypeManager->getEntity($entityName)->getDataByName($name); + } else { + foreach ($this->linkedEntities as $linkedEntityName => $linkedEntityType) { + $result = EntityDataManager::getDataManager($linkedEntityType)->getEntity($linkedEntityName) + ->getDataByName($name, $entityName); + + if ($result) { + return $result; + } + } + } + } + + public function persistEntity() + { + $this->persistDependencies(); + // TODO fetch json representation and api persistence mechanism + } + + private function persistDependencies() + { + // TODO call method to fetch json representation and api persistence mechanism + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php deleted file mode 100644 index fa109f46e..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php +++ /dev/null @@ -1,64 +0,0 @@ -name = $entityName; - $this->type = $entityType; - - foreach ($dataConfigs as $dataConfig) { - $this->dataConfigs[] = $dataConfig[DataGeneratorXMLConstants::DATA_CONFIG_VALUE]; - } - - foreach ($dataObjects as $fieldGroupName => $fieldGroupObject) { - $dataNames = array(); // array to store names of data per fieldGroupObject - $assertions = array(); // array to store assertions - - foreach ($fieldGroupObject[DataGeneratorXMLConstants::DATA_OBJECT_DATA] as $dataElement) { - $dataNames[] = $dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_KEY]; - $this->data[$dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_KEY]] = - $dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_VALUE]; - } - - foreach ($fieldGroupObject[DataGeneratorXMLConstants::DATA_OBJECT_ASSERTS] as $assertion) { - $assertions[] = $assertion[DataGeneratorXMLConstants::ASSERT_VALUE]; - } - - - $fieldGroupXmlObject = new FieldGroupXmlObject($fieldGroupName, $assertions, $dataNames); - $this->fieldGroups[$fieldGroupXmlObject->getName()] = $fieldGroupXmlObject; - } - } - - public function getName() - { - return $this->name; - } - - public function getType() - { - return $this->type; - } - - public function getFieldGroups() - { - return $this->fieldGroups; - } - - public function getData() - { - return $this->data; - } -} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php deleted file mode 100644 index 3194d9fb6..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php +++ /dev/null @@ -1,33 +0,0 @@ -name = $dataObjectName; - $this->assertions = $assertions; - $this->dataNames = $data; - } - - public function getName() - { - return $this->name; - } - - public function getAssertions() - { - return $this->assertions; - } - - public function getDataNames() - { - return $this->dataNames; - } -} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd index eaca395e5..e4f1b389e 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd @@ -23,17 +23,17 @@ - + - Scenario elements. + Element containing Data/Value pair. - + - FieldGroup elements, contains data pairs and asserts. + Element containing required entity to this parent entity. @@ -55,32 +55,6 @@ - - - - - - Element containing Data/Value pair. - - - - - - - Name of Assert. - - - - - - - - Name of the DataObject element. - - - - - @@ -94,4 +68,19 @@ + + + + + + + + Type attribute of required entity. + + + + + + + \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml b/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml deleted file mode 100644 index f71e96671..000000000 --- a/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - simpleConfiguration - regressionConfiguration - - FirstNameData - LastName - address - 2017-06-12 14:00:00 - apitest@mgail.com - AssertNumberOne - AssertNumberTwo - - - adsfsdf - AssertNumberOne - AssertNumberTwo - AssertNumberThree - - - - simpleConfiguration - regressionConfiguration - - FirstNameData12 - LastName12 - 2017-06-12 14:00:00 - 1989-04-12 - 0 - apitest15432@mgail.com - 0 - AssertNumberOne - AssertNumberTwo - - - \ No newline at end of file From 7be749709e841048f7d7e51af9afda4f32c76dd7 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Tue, 18 Jul 2017 14:41:42 -0500 Subject: [PATCH 092/149] MQE-187:[Prototype] Create a prototype Test generator for XML based PHP tests. - add Test Generator code - add Test Object Models - add Test Parser and Configuration - add environmentally set project constants for directory resolution --- .env.example | 4 + bootstrap.php | 13 +- entryPoint.php | 12 +- etc/di.xml | 66 ++- .../DataGenerator/DataGeneratorConstants.php | 18 + .../DataGeneratorXMLConstants.php | 21 - .../DataGenerator/DataHandler.php | 19 +- .../DataGenerator/Managers/DataManager.php | 61 +++ .../Managers/EntityDataManager.php | 18 + .../Objects/EntityDataObject.php | 96 ++++ .../DataGenerator/Objects/EntityXmlObject.php | 64 --- .../Objects/FieldGroupXmlObject.php | 33 -- .../DataGenerator/etc/DataProfileSchema.xsd | 57 +-- .../DataProfile/Test/etc/data.xml | 39 -- .../Test/ActionObject.php | 77 ++++ .../Test/CestDataConstants.php | 33 ++ .../Test/CestDataManager.php | 181 ++++++++ .../Test/CestHookObject.php | 32 ++ .../Test/CestObject.php | 48 ++ .../Test/TestDataParser.php | 18 + .../Test/TestObject.php | 98 ++++ .../Test/etc/sampleCest.xml | 29 ++ .../Test/etc/testSchema.xsd | 105 +++++ .../Util/TestGenerator.php | 431 ++++++++++++++++++ 24 files changed, 1343 insertions(+), 230 deletions(-) create mode 100644 .env.example create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorXMLConstants.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml create mode 100644 src/Magento/AcceptanceTestFramework/Test/ActionObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/CestDataManager.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/CestHookObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/CestObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/TestDataParser.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/TestObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml create mode 100644 src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd create mode 100644 src/Magento/AcceptanceTestFramework/Util/TestGenerator.php diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..7c5a937ea --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +MAGENTO_ADMIN_USERNAME=admin +MAGENTO_ADMIN_PASSWORD=test123 +TESTS_BP=/Users/dev/somepath/magento2ce-acceptance-tests +FW_BP=/Users/dev/somepath/magento2-acceptance-test-framework diff --git a/bootstrap.php b/bootstrap.php index 9fbf9bd48..b67795f6d 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,13 +1,16 @@ load(); + +//$dotenv = new Dotenv\Dotenv(TESTS_BP, '.env'); +//Load constants from .env file +$env = new \Dotenv\Loader(__DIR__ . '/.env'); +$env->load(); +define('TESTS_BP', $env->getEnvironmentVariable('TESTS_BP')); +define('FW_BP', $env->getEnvironmentVariable('FW_BP')); +define('TESTS_MODULE_PATH', TESTS_BP . '/tests/acceptance/Magento/AcceptanceTest'); $objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); diff --git a/entryPoint.php b/entryPoint.php index 4b7e1e5f9..50bfdc756 100644 --- a/entryPoint.php +++ b/entryPoint.php @@ -1,15 +1,7 @@ persistData(['CustomerEntityTwo'], 'API'); - -print_r($result); +$dummy = $objectManager->create(\Magento\AcceptanceTestFramework\Dummy::class); +$dummy->readPageObjects(); diff --git a/etc/di.xml b/etc/di.xml index 49f71da18..482b7f60b 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -67,11 +67,6 @@ - - - Magento\AcceptanceTestFramework\DataProfile\Config\Data - - Magento\AcceptanceTestFramework\Page\Config\Data @@ -134,6 +129,14 @@ Magento\AcceptanceTestFramework\Config\Reader\Block + + + + + + Magento\AcceptanceTestFramework\DataProfile\Config\Data + + Magento\AcceptanceTestFramework\Config\Reader\DataProfile @@ -150,12 +153,55 @@ Magento\AcceptanceTestFramework\Config\Converter Magento\AcceptanceTestFramework\Config\SchemaLocator\DataProfile - name - name - key + name + key + name + + *Data.xml + Data + + + + + + + + + Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd + + + + + Magento\AcceptanceTestFramework\Config\FileResolver\Module + Magento\AcceptanceTestFramework\Config\Converter + Magento\AcceptanceTestFramework\Config\SchemaLocator\TestData + + name + name + value + value + value + value + value + value + value + value + value + name - data.xml - */etc + *Cest.xml + Cest + + + + + + Magento\AcceptanceTestFramework\Test\Config\Data + + + + + Magento\AcceptanceTestFramework\Config\Reader\TestData diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php new file mode 100644 index 000000000..b6dff6976 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php @@ -0,0 +1,18 @@ +objectManager->create(DataProfileSchemaParser::class); $entities = $entityParser->readDataProfiles(); - foreach ($entities[DataGeneratorXMLConstants::ENTITY_DATA] as $entityName => $entity) { - $entityXmlObject = new EntityXmlObject( - $entityName, - $entity[DataGeneratorXMLConstants::ENTITY_DATA_TYPE], - $entity[DataGeneratorXMLConstants::ENTITY_DATA_CONFIG], - $entity[DataGeneratorXMLConstants::DATA_OBJECT] - ); + foreach ($entities[DataGeneratorConstants::ENTITY_DATA] as $entityName => $entity) { + $entityType = $entity[DataGeneratorConstants::ENTITY_DATA_TYPE]; - if ($mapEntities) { + if (strcasecmp($entityType, $type) == 0) { + $entityXmlObject = new EntityDataObject( + $entityName, + $entityType, + $entity[DataGeneratorConstants::DATA_VALUES] ?? null, + $entity[DataGeneratorConstants::REQUIRED_ENTITY] ?? null + ); $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; } else { $entityObjects[] = $entityXmlObject; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php new file mode 100644 index 000000000..ad2c59fed --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php @@ -0,0 +1,61 @@ +data = $this->parseDataEntities($type); + } + + private function parseDataEntities($type) + { + $entityObjects = array(); + $objectManager = ObjectManagerFactory::getObjectManager(); + $entityParser = $objectManager->create(DataProfileSchemaParser::class); + $entities = $entityParser->readDataProfiles(); + + foreach ($entities[DataGeneratorConstants::ENTITY_DATA] as $entityName => $entity) { + $entityType = $entity[DataGeneratorConstants::ENTITY_DATA_TYPE]; + + if (strcasecmp($entityType, $type) == 0) { + $entityXmlObject = new EntityDataObject( + $entityName, + $entityType, + $entity[DataGeneratorConstants::DATA_VALUES] ?? null, + $entity[DataGeneratorConstants::REQUIRED_ENTITY] ?? null + ); + + $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; + } + } + unset($entityName); + unset($entity); + + return $entityObjects; + } + + public function getEntity($entityName) + { + return $this->data[$entityName]; + } + + public function getAllEntities() + { + return $this->data; + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php new file mode 100644 index 000000000..4c126cc6b --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php @@ -0,0 +1,18 @@ +name = $entityName; + $this->type = $entityType; + + if ($data) { + foreach ($data as $dataElement) { + $dataElementKey = $dataElement[DataGeneratorConstants::DATA_ELEMENT_KEY]; + $dataElementValue = $dataElement[DataGeneratorConstants::DATA_ELEMENT_VALUE]; + + $this->data[$dataElementKey] = $dataElementValue; + } + unset($dataElement); + } + + if ($linkedEntities) { + foreach ($linkedEntities as $linkedEntity) { + $linkedEntityName = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_VALUE]; + $linkedEntityType = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_TYPE]; + + $this->linkedEntities[$linkedEntityName] = $linkedEntityType; + } + unset($linkedEntity); + } + } + + public function hasLinkedEntity($entityName) + { + return array_key_exists($entityName, $this->linkedEntities); + } + + public function getName() + { + return $this->name; + } + + public function getType() + { + return $this->type; + } + + /** + * This function retrieves data from an entity defined in xml. The data can be defined explicitly by the entity or + * within any entity linked to or required by the entity. The function will evaluate in the following order: + * 1) Data declared explicitly by the entity + * 2) Data declared explicitly as a known linked entity + * 3) Data declared by entities linked to linked entities + * @param string $name + * @param string $entityName + * @return string + */ + public function getDataByName($name, $entityName = null) + { + if ($entityName == null) { + return $this->data[$name]; + } elseif ($this->hasLinkedEntity($entityName)) { + $entityTypeManager = EntityDataManager::getDataManager($this->linkedEntities[$entityName]); + return $entityTypeManager->getEntity($entityName)->getDataByName($name); + } else { + foreach ($this->linkedEntities as $linkedEntityName => $linkedEntityType) { + $result = EntityDataManager::getDataManager($linkedEntityType)->getEntity($linkedEntityName) + ->getDataByName($name, $entityName); + + if ($result) { + return $result; + } + } + } + } + + public function persistEntity() + { + $this->persistDependencies(); + // TODO fetch json representation and api persistence mechanism + } + + private function persistDependencies() + { + // TODO call method to fetch json representation and api persistence mechanism + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php deleted file mode 100644 index fa109f46e..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityXmlObject.php +++ /dev/null @@ -1,64 +0,0 @@ -name = $entityName; - $this->type = $entityType; - - foreach ($dataConfigs as $dataConfig) { - $this->dataConfigs[] = $dataConfig[DataGeneratorXMLConstants::DATA_CONFIG_VALUE]; - } - - foreach ($dataObjects as $fieldGroupName => $fieldGroupObject) { - $dataNames = array(); // array to store names of data per fieldGroupObject - $assertions = array(); // array to store assertions - - foreach ($fieldGroupObject[DataGeneratorXMLConstants::DATA_OBJECT_DATA] as $dataElement) { - $dataNames[] = $dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_KEY]; - $this->data[$dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_KEY]] = - $dataElement[DataGeneratorXMLConstants::DATA_ELEMENT_VALUE]; - } - - foreach ($fieldGroupObject[DataGeneratorXMLConstants::DATA_OBJECT_ASSERTS] as $assertion) { - $assertions[] = $assertion[DataGeneratorXMLConstants::ASSERT_VALUE]; - } - - - $fieldGroupXmlObject = new FieldGroupXmlObject($fieldGroupName, $assertions, $dataNames); - $this->fieldGroups[$fieldGroupXmlObject->getName()] = $fieldGroupXmlObject; - } - } - - public function getName() - { - return $this->name; - } - - public function getType() - { - return $this->type; - } - - public function getFieldGroups() - { - return $this->fieldGroups; - } - - public function getData() - { - return $this->data; - } -} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php deleted file mode 100644 index 3194d9fb6..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/FieldGroupXmlObject.php +++ /dev/null @@ -1,33 +0,0 @@ -name = $dataObjectName; - $this->assertions = $assertions; - $this->dataNames = $data; - } - - public function getName() - { - return $this->name; - } - - public function getAssertions() - { - return $this->assertions; - } - - public function getDataNames() - { - return $this->dataNames; - } -} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd index 04b2a94c1..cb3104627 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd @@ -23,17 +23,17 @@ - + - Scenario elements. + Element containing Data/Value pair. - + - FieldGroup elements, contains data pairs and asserts. + Element containing required entity to this parent entity. @@ -55,32 +55,6 @@ - - - - - - Element containing Data/Value pair. - - - - - - - Name of Assert. - - - - - - - - Name of the DataObject element. - - - - - @@ -95,13 +69,18 @@ - - - - - Set to true to remove this element during parsing. - - - - + + + + + + + Type attribute of required entity. + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml b/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml deleted file mode 100644 index f71e96671..000000000 --- a/src/Magento/AcceptanceTestFramework/DataProfile/Test/etc/data.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - simpleConfiguration - regressionConfiguration - - FirstNameData - LastName - address - 2017-06-12 14:00:00 - apitest@mgail.com - AssertNumberOne - AssertNumberTwo - - - adsfsdf - AssertNumberOne - AssertNumberTwo - AssertNumberThree - - - - simpleConfiguration - regressionConfiguration - - FirstNameData12 - LastName12 - 2017-06-12 14:00:00 - 1989-04-12 - 0 - apitest15432@mgail.com - 0 - AssertNumberOne - AssertNumberTwo - - - \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Test/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/ActionObject.php new file mode 100644 index 000000000..92ebc20f4 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/ActionObject.php @@ -0,0 +1,77 @@ +name = $name; + $this->actor = $actor; + $this->function = $function; + $this->selector = $selector; + $this->parameter = $parameter; + $this->linkedAction = $linkedAction; + $this->returnVariable = $returnVariable; + $this->userInput = $userInput; + + if ($order == 'after') { + $this->orderOffset = 1; + } + } + + public function getName() + { + return $this->name; + } + + public function getActor() + { + return $this->actor; + } + + public function getFunction() + { + return $this->function; + } + + public function getParameter() + { + return $this->parameter; + } + + public function getSelector() + { + return $this->selector; + } + + public function getLinkedAction() + { + return $this->linkedAction; + } + + public function getReturnVariable() + { + return $this->returnVariable; + } + + public function getUserInput() + { + return $this->userInput; + } + + public function getOrderOffset() + { + return $this->orderOffset; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php b/src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php new file mode 100644 index 000000000..631ed0769 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php @@ -0,0 +1,33 @@ +create(TestDataParser::class); + return self::transform($cestDataParser->readTestData()); + } + + private static function transform($parsedArray) + { + $cests = []; + + foreach ($parsedArray[CestDataConstants::CEST_ROOT] as $cestName => $cestData) { + $hooks = []; + + if (array_key_exists(CestDataConstants::CEST_BEFORE_HOOK, $cestData)) { + $hooks[CestDataConstants::CEST_BEFORE_HOOK] = self::extractHook( + CestDataConstants::CEST_BEFORE_HOOK, + $cestData[CestDataConstants::CEST_BEFORE_HOOK] + ); + } + + if (array_key_exists(CestDataConstants::CEST_AFTER_HOOK, $cestData)) { + $hooks[CestDataConstants::CEST_AFTER_HOOK] = self::extractHook( + CestDataConstants::CEST_AFTER_HOOK, + $cestData[CestDataConstants::CEST_AFTER_HOOK] + ); + } + + $cests[] = new CestObject( + $cestName, + self::extractAnnotations($cestData[CestDataConstants::CEST_ANNOTATIONS]), + self::extractCestUseStatements($cestData[CestDataConstants::CEST_USE_STATEMENTS]), + self::extractTestData($cestData[CestDataConstants::CEST_TEST_TAG]), + $hooks + ); + } + + return $cests; + } + + private static function extractHook($hookType, $cestHook) + { + $hooks = []; + + foreach ($cestHook as $cestHookData) { + $hooks[] = new CestHookObject( + $hookType, + self::extractTestDependencies($cestHookData[CestDataConstants::TEST_DEPENDENCY]), + self::extractTestActions($cestHookData[CestDataConstants::TEST_ACTION]) + ); + } + + return $hooks; + } + + private static function extractAnnotations($cestAnnotations) + { + $annotations = []; + + // parse the Cest annotations + foreach ($cestAnnotations as $annotationData) { + foreach ($annotationData as $annotationKey => $annotationValue) { + $annotationValues = []; + + foreach ($annotationValue as $annotationValueKey => $annotation) { + $annotationValues[] = $annotation[CestDataConstants::ANNOTATION_VALUE]; + } + + $annotations[$annotationKey] = $annotationValues; + } + } + + return $annotations; + } + + private static function extractCestUseStatements($cestUseStatements) + { + $useStatements = []; + + // parse any use statements + foreach ($cestUseStatements as $cestUseStatement) { + $useStatements[] = $cestUseStatement[CestDataConstants::CEST_USE_PATH]; + } + + return $useStatements; + } + + private static function extractTestData($cestTestData) + { + $tests = []; + + // parse the tests + foreach ($cestTestData as $testName => $testData) { + $testAnnotations = []; + + if (array_key_exists(CestDataConstants::TEST_ANNOTATIONS, $testData)) { + $testAnnotations = self::extractAnnotations($testData[CestDataConstants::TEST_ANNOTATIONS]); + } + + $tests[] = new TestObject( + $testName, + self::extractTestDependencies($testData[CestDataConstants::TEST_DEPENDENCY]), + self::extractTestActions($testData[CestDataConstants::TEST_ACTION]), + $testAnnotations + ); + } + + return $tests; + } + + private static function extractTestDependencies($testDependencies) + { + $dependencies = []; + + foreach ($testDependencies as $dependencyName => $dependencyData) { + $dependencies[$dependencyName] = $dependencyData[CestDataConstants::TEST_DEPENDENCY_ACTOR]; + } + + return $dependencies; + } + + private static function extractTestActions($testActions) + { + $actions = []; + + foreach ($testActions as $actionName => $actionData) { + $function = $actionData[CestDataConstants::TEST_ACTION_FUNCTION]; + $actor = null; + $parameter = null; + $selector = null; + $linkedAction = null; + $userInput = null; + $returnVariable = null; + $order = null; + + if (array_key_exists(CestDataConstants::TEST_ACTION_ACTOR, $actionData)) { + $actor = $actionData[CestDataConstants::TEST_ACTION_ACTOR]; + } + + if (array_key_exists(CestDataConstants::TEST_ACTION_PARAMETER, $actionData)) { + $parameter = $actionData[CestDataConstants::TEST_ACTION_PARAMETER]; + } elseif (array_key_exists(CestDataConstants::TEST_ACTION_SELECTOR, $actionData)) { + $selector = $actionData[CestDataConstants::TEST_ACTION_SELECTOR]; + } + + if (array_key_exists(CestDataConstants::TEST_ACTION_LINK, $actionData)) { + $linkedAction = $actionData[CestDataConstants::TEST_ACTION_LINK]; + $order = $actionData [CestDataConstants::TEST_ACTION_ORDER]; + } + + if (array_key_exists(CestDataConstants::TEST_ACTION_USER_INPUT, $actionData)) { + $userInput = $actionData[CestDataConstants::TEST_ACTION_USER_INPUT]; + } + + if (array_key_exists(CestDataConstants::TEST_ACTION_RETURN_VARIABLE, $actionData)) { + $returnVariable = $actionData[CestDataConstants::TEST_ACTION_RETURN_VARIABLE]; + } + + $actions[] = new ActionObject( + $actionName, + $actor, + $function, + $selector, + $parameter, + $order, + $linkedAction, + $returnVariable, + $userInput + ); + } + + return $actions; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/CestHookObject.php b/src/Magento/AcceptanceTestFramework/Test/CestHookObject.php new file mode 100644 index 000000000..c96b9845c --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/CestHookObject.php @@ -0,0 +1,32 @@ +type = $type; + $this->dependencies = $dependencies; + $this->actions = $actions; + } + + public function getType() + { + return $this->type; + } + + public function getDependencies() + { + return $this->dependencies; + } + + public function getActions() + { + return $this->actions; + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Test/CestObject.php b/src/Magento/AcceptanceTestFramework/Test/CestObject.php new file mode 100644 index 000000000..2bc19d3ec --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/CestObject.php @@ -0,0 +1,48 @@ +name = $name; + $this->annotations = $annotations; + $this->useStatements = $useStatements; + $this->tests = $tests; + $this->hooks = $hooks; + } + + public function getName() + { + return $this->name; + } + + public function getAnnotations() + { + return $this->annotations; + } + + public function getUseStatements() + { + return $this->useStatements; + } + + public function getTests() + { + return $this->tests; + } + + public function getHooks() + { + return $this->hooks; + } +} + + diff --git a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php b/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php new file mode 100644 index 000000000..2655dfecc --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php @@ -0,0 +1,18 @@ +testData = $testData; + } + + public function readTestData() + { + return $this->testData->get(); + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Test/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/TestObject.php new file mode 100644 index 000000000..70ad2a647 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/TestObject.php @@ -0,0 +1,98 @@ +name = $name; + $this->dependencies = $dependencies; + $this->parsedSteps = $parsedSteps; + $this->annotations = $annotations; + } + + public function getName() + { + return $this->name; + } + + public function getDependencies() + { + return $this->dependencies; + } + + public function getAnnotations() + { + return $this->annotations; + } + + /** + *This method calls a function to merge custom steps and returns the resulting ordered set of steps. + * @return array + */ + public function getOrderedActions() + { + $this->mergeActions(); + return $this->orderedSteps; + } + + /** + * This method takes the steps from the parser and splits steps which need merge from steps that are ordered. + * @return void + */ + private function sortActions() + { + foreach ($this->parsedSteps as $parsedStep) { + if ($parsedStep->getLinkedAction()) { + $this->stepsToMerge[$parsedStep->getName()] = $parsedStep; + } else { + $this->orderedSteps[$parsedStep->getName()] = $parsedStep; + } + } + } + + /** + * This method runs a step sort, loops steps which need to be merged, and runs the mergeStep function on each one. + * @return void + */ + private function mergeActions() + { + $this->sortActions(); + + foreach ($this->stepsToMerge as $stepName => $stepToMerge) { + if (!array_key_exists($stepName, $this->orderedSteps)) { + $this->mergeAction($stepToMerge); + } + } + unset($stepName); + unset($stepToMerge); + } + + /** + * Recursively merges in each step and its dependencies + * @param ActionObject $stepToMerge + * @return void + */ + private function mergeAction($stepToMerge) + { + $linkedStep = $stepToMerge->getLinkedAction(); + + if (!array_key_exists($linkedStep, $this->orderedSteps)) { + $this->mergeAction($this->stepsToMerge[$stepToMerge->getLinkedAction()]); + } + + $position = array_search($linkedStep, array_keys($this->orderedSteps)) + $stepToMerge->getOrderOffset(); + $previous_items = array_slice($this->orderedSteps, 0, $position, true); + $next_items = array_slice($this->orderedSteps, $position, null, true); + $this->orderedSteps = $previous_items + [$stepToMerge->getName() => $stepToMerge] + $next_items; + } + +} diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml b/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml new file mode 100644 index 000000000..f9670ff37 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd new file mode 100644 index 000000000..9856cf10a --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set to true to remove this element during parsing. + + + + + \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php new file mode 100644 index 000000000..647e94478 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -0,0 +1,431 @@ +getName(); + $php = assembleCestPhp($cest); + $cestPhpArray[] = [$name, $php]; + } + + return $cestPhpArray; +} + +function assembleCestPhp($cestObject) +{ + $namespacePath = "Magento\AcceptanceTest\Backend"; + $usePhp = generateUseStatementsPhp($cestObject->getUseStatements()); + $classAnnotationsPhp = generateClassAnnotationsPhp($cestObject->getAnnotations()); + $className = $cestObject->getName(); + $hookPhp = generateHooksPhp($cestObject->getHooks()); + $testsPhp = generateTestsPhp($cestObject->getTests()); + + $cestPhp = " $annotationName) + { + if ($annotationType == "features") + { + $features = ""; + + foreach ($annotationName as $name) + { + $features .= sprintf("\"%s\"", $name); + + if (next($annotationName)) + { + $features .= ", "; + } + } + + $classAnnotationsPhp .= sprintf(" * @Features({%s})\n", $features); + } + + if ($annotationType == "stories") + { + $stories = ""; + + foreach ($annotationName as $name) + { + $stories .= sprintf("\"%s\"", $name); + + if (next($annotationName)) + { + $stories .= ", "; + } + } + + $classAnnotationsPhp .= sprintf(" * @Stories({%s})\n", $stories); + } + + if ($annotationType == "title") + { + $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); + } + + if ($annotationType == "description") + { + $classAnnotationsPhp .= sprintf(" * @Description(\"%s\")\n", $annotationName[0]); + } + + if ($annotationType == "severity") + { + $classAnnotationsPhp .= sprintf(" * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); + } + + if ($annotationType == "testCaseId") + { + $classAnnotationsPhp .= sprintf(" * TestCaseId(\"%s\")", $annotationName[0]); + } + + if ($annotationType == "group") + { + foreach ($annotationName as $group) + { + $classAnnotationsPhp .= sprintf(" * @group %s\n", $group); + } + } + + if ($annotationType == "env") + { + foreach ($annotationName as $env) + { + $classAnnotationsPhp .= sprintf(" * @env %s\n", $env); + } + } + } + + $classAnnotationsPhp .= " */\n"; + + return $classAnnotationsPhp; +} + +function generateDependencyString($dependenciesObject) +{ + $dependencyString = ""; + + if ($dependenciesObject) + { + foreach ($dependenciesObject as $name => $actor) + { + $dependencyString .= sprintf("%s $%s", $name, $actor); + + if (next($dependenciesObject)) + { + $dependencyString .= ", "; + } + } + } + + return $dependencyString; +} + +function generateStepsPhp($stepsObject) +{ + $stepsPhp = ""; + + foreach ($stepsObject as $steps) + { + $actor = $steps->getActor(); + $returnVariable = $steps->getReturnVariable(); + $function = $steps->getFunction(); + $parameter = $steps->getParameter(); + $userInput = $steps->getUserInput(); + $selector = $steps->getSelector(); + + if (!$actor) + { + $actor = "I"; + } + + if ($returnVariable) + { + if ($userInput) + { + $stepsPhp .= sprintf("\t\t$%s = $%s->%s(\"%s\", \"%s\");\n", $returnVariable, $actor, $function, $selector, $userInput); + } else if ($parameter) + { + $stepsPhp .= sprintf("\t\t$%s = $%s->%s(\"%s\", %s);\n", $returnVariable, $actor, $function, $selector, $parameter); + } else if ($selector) + { + $stepsPhp .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $function, $selector); + } else + { + $stepsPhp .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $function); + } + } else if ($selector) + { + if ($userInput) + { + $stepsPhp .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $function, $selector, $userInput); + } else if ($parameter) + { + $stepsPhp .= sprintf("\t\t$%s->%s(\"%s\", %s);\n", $actor, $function, $selector, $parameter); + } else + { + $stepsPhp .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $function, $selector); + } + } else + { + if ($userInput) + { + $stepsPhp .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $function, $userInput); + } else if ($parameter) + { + $stepsPhp .= sprintf("\t\t$%s->%s(%s);\n", $actor, $function, $parameter); + } else + { + $stepsPhp .= sprintf("\t\t$%s->%s();\n", $actor, $function); + } + } + } + + return $stepsPhp; +} + +function generateHooksPhp($hookObjects) +{ + $hooks = ""; + foreach ($hookObjects as $hookObject) + { + foreach ($hookObject as $hookItem) + { + $type = $hookItem->getType(); + $dependencies = generateDependencyString($hookItem->getDependencies()); + $steps = generateStepsPhp($hookItem->getActions()); + + if ($type == "after") + { + $hooks .= sprintf("\tpublic function _after(%s)\n", $dependencies); + $hooks .= "\t{\n"; + $hooks .= $steps; + $hooks .= "\t}\n\n"; + } + + if ($type == "before") + { + $hooks .= sprintf("\tpublic function _before(%s)\n", $dependencies); + $hooks .= "\t{\n"; + $hooks .= $steps; + $hooks .= "\t}\n\n"; + } + + $hooks .= ""; + } + } + + return $hooks; +} + +function generateTestAnnotationsPhp($testAnnotationsObject, $testDependenciesObject) +{ + $testAnnotationsPhp = "\t/**\n"; + + foreach ($testAnnotationsObject as $annotationType => $annotationName) + { + if ($annotationType == "features") + { + $features = ""; + + foreach ($annotationName as $name) + { + $features .= sprintf("\"%s\"", $name); + + if (next($annotationName)) + { + $features .= ", "; + } + } + + $testAnnotationsPhp .= sprintf("\t * @Features({%s})\n", $features); + } + + if ($annotationType == "stories") + { + $stories = ""; + + foreach ($annotationName as $name) + { + $stories .= sprintf("\"%s\"", $name); + + if (next($annotationName)) + { + $stories .= ", "; + } + } + + $testAnnotationsPhp .= sprintf("\t * @Stories({%s})\n", $stories); + } + + if ($annotationType == "title") + { + $testAnnotationsPhp .= sprintf("\t * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); + } + + if ($annotationType == "description") + { + $testAnnotationsPhp .= sprintf("\t * @Description(\"%s\")\n", $annotationName[0]); + } + + if ($annotationType == "severity") + { + $testAnnotationsPhp .= sprintf("\t * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); + } + + if ($annotationType == "testCaseId") + { + $testAnnotationsPhp .= sprintf("\t * @TestCaseId(\"%s\")\n", $annotationName[0]); + } + } + + foreach ($testDependenciesObject as $name => $actor) + { + if ($name) + { + $testAnnotationsPhp .= sprintf("\t * @Parameter(name = \"%s\", value = \"$%s\")\n", $name, $actor); + } + } + + foreach ($testAnnotationsObject as $annotationType => $annotationName) { + if ($annotationType == "group") + { + foreach ($annotationName as $name) + { + $testAnnotationsPhp .= sprintf("\t * @group %s\n", $name); + } + } + + if ($annotationType == "env") + { + foreach ($annotationName as $env) + { + $testAnnotationsPhp .= sprintf("\t * @env %s\n", $env); + } + } + } + + foreach ($testDependenciesObject as $name => $actor) + { + if ($name) + { + $testAnnotationsPhp .= sprintf("\t * @param %s $%s\n", $name, $actor); + } + } + + $testAnnotationsPhp .= "\t * @return void\n"; + $testAnnotationsPhp .= "\t */\n"; + + return $testAnnotationsPhp; +} + +function generateTestsPhp($testsObject) +{ + $testPhp = ""; + + foreach ($testsObject as $test) + { + $testName = $test->getName(); + $testAnnotations = generateTestAnnotationsPhp($test->getAnnotations(), $test->getDependencies()); + $dependencies = generateDependencyString($test->getDependencies()); + $steps = generateStepsPhp($test->getOrderedActions()); + + $testPhp .= $testAnnotations; + $testPhp .= sprintf("\tpublic function %s(%s)\n", $testName, $dependencies); + $testPhp .= "\t{\n"; + $testPhp .= $steps; + $testPhp .= "\t}\n"; + + if (sizeof($testsObject) > 1) + { + $testPhp .= "\n"; + } + } + + return $testPhp; +} \ No newline at end of file From f1843829ff64b670596096a396a3b3fd75f41299 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Wed, 19 Jul 2017 13:44:21 -0500 Subject: [PATCH 093/149] MQE-Page-Object-Generator - modify bootstrap.php logic to include default behavior and env var override - Add PageGenerator.php from tests project. --- bootstrap.php | 13 +++++++------ entryPoint.php | 7 ------- .../Util/PageGenerator.php | 19 +++++++++++++++++++ .../Util/TestGenerator.php | 2 +- 4 files changed, 27 insertions(+), 14 deletions(-) delete mode 100644 entryPoint.php create mode 100644 src/Magento/AcceptanceTestFramework/Util/PageGenerator.php diff --git a/bootstrap.php b/bootstrap.php index b67795f6d..df9796d94 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,16 +1,17 @@ load(); -define('TESTS_BP', $env->getEnvironmentVariable('TESTS_BP')); -define('FW_BP', $env->getEnvironmentVariable('FW_BP')); + +foreach ($_ENV as $key => $var) { + defined($key) || define($key, $var); +} + +defined('FW_BP') || define('FW_BP', str_replace('\\', '/', (__DIR__))); +defined('TESTS_BP') || define('TESTS_BP', dirname(dirname(dirname(FW_BP)))); define('TESTS_MODULE_PATH', TESTS_BP . '/tests/acceptance/Magento/AcceptanceTest'); $objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); diff --git a/entryPoint.php b/entryPoint.php deleted file mode 100644 index 50bfdc756..000000000 --- a/entryPoint.php +++ /dev/null @@ -1,7 +0,0 @@ -create(\Magento\AcceptanceTestFramework\Dummy::class); -$dummy->readPageObjects(); diff --git a/src/Magento/AcceptanceTestFramework/Util/PageGenerator.php b/src/Magento/AcceptanceTestFramework/Util/PageGenerator.php new file mode 100644 index 000000000..386f5af5b --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Util/PageGenerator.php @@ -0,0 +1,19 @@ +get('Magento\AcceptanceTestFramework\Generate\Pool'); +foreach ($generatorPool->getGenerators() as $generator) { + if (!$generator instanceof \Magento\AcceptanceTestFramework\Generate\LauncherInterface) { + throw new \InvalidArgumentException( + 'Generator ' . get_class($generator) . ' should implement LauncherInterface' + ); + } + $generator->launch(); +} + +\Magento\AcceptanceTestFramework\Generate\GenerateResult::displayResults(); diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 647e94478..43f4d2c9a 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -1,7 +1,7 @@ Date: Tue, 25 Jul 2017 09:20:12 -0500 Subject: [PATCH 094/149] MQE-212: Implemented page object in memory. --- composer.lock | 125 +++--- etc/di.xml | 62 ++- src/Magento/AcceptanceTestFramework/Dummy.php | 25 -- .../Generate/AbstractGenerate.php | 202 ---------- .../Generate/GenerateBlock.php | 337 ---------------- .../Generate/GeneratePage.php | 149 ------- .../Generate/GenerateResult.php | 105 ----- .../Generate/LauncherInterface.php | 15 - .../AcceptanceTestFramework/Generate/Pool.php | 33 -- .../Page/AdminPage.php | 178 -------- .../Page/Block/AdminGrid.php | 381 ------------------ .../Page/Block/Block.php | 97 ----- .../Page/Block/BlockFactory.php | 41 -- .../Page/Block/BlockInterface.php | 15 - .../Page/ExternalPage.php | 18 - .../Page/FrontendPage.php | 53 --- .../AcceptanceTestFramework/Page/Page.php | 144 ------- .../Page/PageInterface.php | 26 -- .../PageObject/Page/Page.php | 95 +++++ .../PageObject/Page/PageInterface.php | 42 ++ .../PageObject/Section/Section.php | 144 +++++++ .../PageObject/Section/SectionInterface.php | 72 ++++ .../etc/PageObject.xsd} | 33 +- .../etc/SectionObject.xsd} | 53 +-- .../Util/PageGenerator.php | 19 - .../XmlParser/PageParser.php | 47 +++ .../XmlParser/ParserInterface.php | 16 + .../XmlParser/SectionParser.php | 47 +++ 28 files changed, 588 insertions(+), 1986 deletions(-) delete mode 100644 src/Magento/AcceptanceTestFramework/Dummy.php delete mode 100644 src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php delete mode 100644 src/Magento/AcceptanceTestFramework/Generate/GenerateBlock.php delete mode 100644 src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php delete mode 100644 src/Magento/AcceptanceTestFramework/Generate/LauncherInterface.php delete mode 100644 src/Magento/AcceptanceTestFramework/Generate/Pool.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/AdminPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Block/AdminGrid.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Block/Block.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Block/BlockFactory.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Block/BlockInterface.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/ExternalPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/FrontendPage.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/Page.php delete mode 100644 src/Magento/AcceptanceTestFramework/Page/PageInterface.php create mode 100644 src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php create mode 100644 src/Magento/AcceptanceTestFramework/PageObject/Page/PageInterface.php create mode 100644 src/Magento/AcceptanceTestFramework/PageObject/Section/Section.php create mode 100644 src/Magento/AcceptanceTestFramework/PageObject/Section/SectionInterface.php rename src/Magento/AcceptanceTestFramework/{Page/etc/pageObject.xsd => PageObject/etc/PageObject.xsd} (72%) rename src/Magento/AcceptanceTestFramework/{Page/etc/blockObject.xsd => PageObject/etc/SectionObject.xsd} (67%) delete mode 100644 src/Magento/AcceptanceTestFramework/Util/PageGenerator.php create mode 100644 src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php create mode 100644 src/Magento/AcceptanceTestFramework/XmlParser/ParserInterface.php create mode 100644 src/Magento/AcceptanceTestFramework/XmlParser/SectionParser.php diff --git a/composer.lock b/composer.lock index cf83200a0..33a6a3722 100644 --- a/composer.lock +++ b/composer.lock @@ -357,16 +357,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.2.3", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", - "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", "shasum": "" }, "require": { @@ -376,9 +376,12 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0", + "phpunit/phpunit": "^4.0 || ^5.0", "psr/log": "^1.0" }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, "type": "library", "extra": { "branch-alias": { @@ -415,7 +418,7 @@ "rest", "web service" ], - "time": "2017-02-28 22:50:30" + "time": "2017-06-22 18:50:49" }, { "name": "guzzlehttp/promises", @@ -631,22 +634,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/46f7e8bb075036c92695b15a1ddb6971c751e585", + "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585", "shasum": "" }, "require": { "php": ">=5.5", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -672,24 +675,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30 07:12:33" + "time": "2017-07-15 11:38:20" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -719,7 +722,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25 06:54:22" + "time": "2017-07-14 14:27:02" }, { "name": "phpspec/prophecy", @@ -1035,16 +1038,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.7.20", + "version": "5.7.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b" + "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3cb94a5f8c07a03c8b7527ed7468a2926203f58b", - "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b91adfb64264ddec5a2dee9851f354aa66327db", + "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db", "shasum": "" }, "require": { @@ -1113,20 +1116,20 @@ "testing", "xunit" ], - "time": "2017-05-22 07:42:55" + "time": "2017-06-21 08:11:54" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.3", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { @@ -1172,7 +1175,7 @@ "mock", "xunit" ], - "time": "2016-12-08 20:27:08" + "time": "2017-06-30 09:13:00" }, { "name": "psr/http-message", @@ -1831,16 +1834,16 @@ }, { "name": "symfony/browser-kit", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "c2c8ceb1aa9dab9eae54e9150e6a588ce3e53be1" + "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c2c8ceb1aa9dab9eae54e9150e6a588ce3e53be1", - "reference": "c2c8ceb1aa9dab9eae54e9150e6a588ce3e53be1", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", + "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", "shasum": "" }, "require": { @@ -1884,20 +1887,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:14:56" + "time": "2017-07-12 13:03:20" }, { "name": "symfony/console", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e" + "reference": "a97e45d98c59510f085fa05225a1acb74dfe0546" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/70d2a29b2911cbdc91a7e268046c395278238b2e", - "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e", + "url": "https://api.github.com/repos/symfony/console/zipball/a97e45d98c59510f085fa05225a1acb74dfe0546", + "reference": "a97e45d98c59510f085fa05225a1acb74dfe0546", "shasum": "" }, "require": { @@ -1953,11 +1956,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-06-02 19:24:58" + "time": "2017-07-03 13:19:36" }, { "name": "symfony/css-selector", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2010,16 +2013,16 @@ }, { "name": "symfony/debug", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d" + "reference": "63b85a968486d95ff9542228dc2e4247f16f9743" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e9c50482841ef696e8fa1470d950a79c8921f45d", - "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d", + "url": "https://api.github.com/repos/symfony/debug/zipball/63b85a968486d95ff9542228dc2e4247f16f9743", + "reference": "63b85a968486d95ff9542228dc2e4247f16f9743", "shasum": "" }, "require": { @@ -2062,11 +2065,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-06-01 21:01:25" + "time": "2017-07-05 13:02:37" }, { "name": "symfony/dom-crawler", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -2122,16 +2125,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "4054a102470665451108f9b59305c79176ef98f0" + "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4054a102470665451108f9b59305c79176ef98f0", - "reference": "4054a102470665451108f9b59305c79176ef98f0", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/67535f1e3fd662bdc68d7ba317c93eecd973617e", + "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e", "shasum": "" }, "require": { @@ -2181,11 +2184,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-04 18:15:29" + "time": "2017-06-09 14:53:08" }, { "name": "symfony/finder", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2293,16 +2296,16 @@ }, { "name": "symfony/process", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8e30690c67aafb6c7992d6d8eb0d707807dd3eaf" + "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8e30690c67aafb6c7992d6d8eb0d707807dd3eaf", - "reference": "8e30690c67aafb6c7992d6d8eb0d707807dd3eaf", + "url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a", + "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", "shasum": "" }, "require": { @@ -2338,20 +2341,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-05-22 12:32:03" + "time": "2017-07-13 13:05:09" }, { "name": "symfony/yaml", - "version": "v3.3.2", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063" + "reference": "1f93a8d19b8241617f5074a123e282575b821df8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/9752a30000a8ca9f4b34b5227d15d0101b96b063", - "reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063", + "url": "https://api.github.com/repos/symfony/yaml/zipball/1f93a8d19b8241617f5074a123e282575b821df8", + "reference": "1f93a8d19b8241617f5074a123e282575b821df8", "shasum": "" }, "require": { @@ -2393,7 +2396,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-06-02 22:05:06" + "time": "2017-06-15 12:58:50" }, { "name": "vlucas/phpdotenv", diff --git a/etc/di.xml b/etc/di.xml index 482b7f60b..e7595cfdc 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -49,29 +49,6 @@ - - - Magento\AcceptanceTestFramework\Page\Config\Data - - - - - Magento\AcceptanceTestFramework\Block\Config\Data - - - - - - Magento\AcceptanceTestFramework\Generate\GeneratePage - Magento\AcceptanceTestFramework\Generate\GenerateBlock - - - - - - Magento\AcceptanceTestFramework\Page\Config\Data - - + - Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd + Magento/AcceptanceTestFramework/PageObject/etc/PageObject.xsd - + - Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd + Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd @@ -100,33 +79,47 @@ Magento\AcceptanceTestFramework\Config\SchemaLocator\Page name - name + name #\.xml$# Page - + Magento\AcceptanceTestFramework\Config\FileResolver\Mask Magento\AcceptanceTestFramework\Config\Converter - Magento\AcceptanceTestFramework\Config\SchemaLocator\Block + Magento\AcceptanceTestFramework\Config\SchemaLocator\Section - name - name + name + name #\.xml$# - Block + Section + + + + Magento\AcceptanceTestFramework\Page\Config\Data + + + Magento\AcceptanceTestFramework\Config\Reader\Page - + + + + Magento\AcceptanceTestFramework\Section\Config\Data + + + + - Magento\AcceptanceTestFramework\Config\Reader\Block + Magento\AcceptanceTestFramework\Config\Reader\Section @@ -162,7 +155,6 @@ - diff --git a/src/Magento/AcceptanceTestFramework/Dummy.php b/src/Magento/AcceptanceTestFramework/Dummy.php deleted file mode 100644 index abacd5700..000000000 --- a/src/Magento/AcceptanceTestFramework/Dummy.php +++ /dev/null @@ -1,25 +0,0 @@ -pageObjects = $pageObjects; - } - - public function readPageObjects() - { - var_dump($this->pageObjects->get('page/AdminProduct')); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php b/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php deleted file mode 100644 index 1e4123831..000000000 --- a/src/Magento/AcceptanceTestFramework/Generate/AbstractGenerate.php +++ /dev/null @@ -1,202 +0,0 @@ -objectManager = $objectManager; - $this->configData = $configData; - } - - /** - * Generate single class. - * - * @param string $className - * @return string|bool - */ - abstract public function generate($className); - - /** - * Convert class name to camel-case. - * - * @param string $class - * @return string - */ - protected function toCamelCase($class) - { - $class = str_replace('_', ' ', $class); - $class = str_replace('\\', ' ', $class); - $class = str_replace('/', ' ', $class); - - return str_replace(' ', '', ucwords($class)); - } - - /** - * Prepare data for phpdoc attribute "copyright". - * - * @return string - */ - protected function getCopyright() - { - return 'Copyright © 2017 Magento. All rights reserved.'; - } - - /** - * Prepare data for phpdoc attribute "license". - * - * @return string - */ - protected function getLicenseNote() - { - return 'See COPYING.txt for license details.'; - } - - /** - * Get file phpdoc with license and copyright information. - * - * @return string - */ - protected function getFilePhpDoc() - { - $content = "/**\n"; - $content .= " * " . $this->getCopyright() . "\n"; - $content .= " * " . $this->getLicenseNote() . "\n"; - $content .= " */\n\n"; - return $content; - } - - /** - * Add error message. - * - * @param string $message - * @return void - */ - protected function addError($message) - { - $this->errors[] = $message; - } - - /** - * Get list of occurred errors. - * - * @return string[] - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Get short class name based on full class name. - * - * @param string $class - * @return string - */ - protected function getShortClassName($class) - { - $classNameArray = explode('\\', $class); - return end($classNameArray); - } - - /** - * Get namespace class name based on full class name. - * - * @param string $class - * @return string - */ - protected function getNamespace($class) - { - $classNameArray = explode('\\', $class); - return implode("\\", array_slice($classNameArray, 0, -1)); - } - - /** - * Create class with specified content. - * - * @param string $class - * @param string $content - * @return string - */ - protected function createClass($class, $content) - { - $fileName = $this->getShortClassName($class) . '.php'; - $relativeFilePath = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; - $relativeFolderPath = str_replace(DIRECTORY_SEPARATOR . $fileName, '', $relativeFilePath); - - $filePath = TESTS_BP . '/generated/' . $relativeFilePath; - if (file_exists($filePath)) { - unlink($filePath); - } - - $folderPath = TESTS_BP . '/generated/' . $relativeFolderPath; - if (!is_dir($folderPath)) { - mkdir($folderPath, 0777, true); - } - - $result = @file_put_contents($filePath, $content); - - if ($result === false) { - $error = error_get_last(); - $this->addError(sprintf('Unable to generate %s class. Error: %s', $class, $error['message'])); - return false; - } - - $this->cnt++; - - return $filePath; - } -} diff --git a/src/Magento/AcceptanceTestFramework/Generate/GenerateBlock.php b/src/Magento/AcceptanceTestFramework/Generate/GenerateBlock.php deleted file mode 100644 index fb07b1d5f..000000000 --- a/src/Magento/AcceptanceTestFramework/Generate/GenerateBlock.php +++ /dev/null @@ -1,337 +0,0 @@ -cnt = 0; - $this->start = microtime(true); - foreach ($this->configData->get('block') as $name => $data) { - $this->generateClass($name, $data); - } - $this->end = microtime(true); - $time = $this->end - $this->start; - - \Magento\AcceptanceTestFramework\Generate\GenerateResult::addResult('Block Classes', $this->cnt, $time); - } - - /** - * Generate single block class. - * - * @param string $className - * @return string|bool - * @throws \InvalidArgumentException - */ - public function generate($className) - { - $classNameParts = explode('\\', $className); - $classDataKey = 'block/' . end($classNameParts); - - if (!$this->configData->get($classDataKey)) { - throw new \InvalidArgumentException('Invalid class name: ' . $className); - } - - return $this->generateClass( - end($classNameParts), $this->configData->get($classDataKey) - ); - } - - /** - * Generate block class from XML source. - * - * @param string $name - * @param array $data - * @return string|bool - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function generateClass($name, array $data) - { - $class = str_replace('/', '\\', $name); - $className = $this->getShortClassName($class); - $parentClass = "Magento\\AcceptanceTestFramework\\Page\\Block\\Block"; - if (isset($data['parent_class'])) { - $parentClass = $data['parent_class']; - } - $parentClassName = $this->getShortClassName($parentClass); - - $content = "getFilePhpDoc(); - $content .= "namespace {$this->getNamespace($class)};\n\n"; - $content .= "use {$parentClass};\n\n"; - $content .= "/**\n"; - $content .= " * Class {$className}\n"; - $content .= " */\n"; - $content .= "class {$className} extends {$parentClassName}\n"; - $content .= "{\n"; - - if (isset($data['element'])) { - $elements = $data['element']; - foreach ($elements as $element => $attributes) { - $attributes['locator'] = str_replace('\'', '"', $attributes['locator']); - /** - * Generate contents: - * public static $productName = '.admin__field[data-index=name] input'; - */ - $content .= " public static $$element = '" . $attributes['locator'] . "';\n"; - } - foreach ($elements as $element => $attributes) { - switch ($attributes['type']) { - case 'input': - $content .= $this->generateCodeForInputAction($element, $attributes); - break; - case 'text': - $content .= $this->generateCodeForTextAction($element, $attributes); - break; - case 'button': - $content .= $this->generateCodeForButtonAction($element, $attributes); - break; - case 'checkbox': - $content .= $this->generateCodeForCheckboxAction($element, $attributes); - break; - case 'radio': - $content .= $this->generateCodeForRadioAction($element, $attributes); - break; - case 'select': - $content .= $this->generateCodeForSelectAction($element, $attributes); - break; - case 'multiselect': - $content .= $this->generateCodeForMultiSelectAction($element, $attributes); - break; - default: - break; - } - } - } - $content .= "}\n"; - - return $this->createClass($class, $content); - } - - /** - * Generate code for input action; and - * generate code for asserting value in input field; and - * generate code for returning text from input field; and - * generate waitForPageLoad() if it's needed. - * - * public function fillFieldProductName($value) - * { - * $this->acceptanceTester->fillField(self::$productName, $value); - * } - * - * public function seeProductName($expectedValue) - * { - * $this->acceptanceTester->seeInField(self::$productName, $expectedValue); - * } - * - * public function grabTextFromProductName($expectedValue) - * { - * $result = $this->acceptanceTester->grabTextFrom(self::$productName); - * return $result; - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForInputAction($element, $attributes) - { - $waitRequired = false; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $waitRequired = true; - } - $content = "\n"; - $content .= " public function fillField" . ucfirst($element). "(\$value)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->fillField(self::$$element, \$value);\n"; - if ($waitRequired) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - $content .= "\n"; - $content .= " public function seeInField" . ucfirst($element). "(\$expectedValue)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->seeInField(self::$$element, \$expectedValue);\n"; - if ($waitRequired) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - $content .= "\n"; - $content .= " public function grabTextFrom" . ucfirst($element). "()\n"; - $content .= " {\n"; - $content .= " \$result = \$this->acceptanceTester->grabTextFrom(self::$$element);\n"; - if ($waitRequired) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " return \$result;\n"; - $content .= " }\n"; - return $content; - } - - /** - * Generate code for returning text from text field; and generate waitForPageLoad() if it's needed. - * - * public function grabTextFromProductName($expectedValue) - * { - * $result = $this->acceptanceTester->grabTextFrom(self::$productName); - * $this->acceptanceTester->waitForPageLoad(); - * return $result - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForTextAction($element, $attributes) - { - $content = "\n"; - $content .= " public function grabTextFrom" . ucfirst($element). "()\n"; - $content .= " {\n"; - $content .= " \$result = \$this->acceptanceTester->grabTextFrom(self::$$element);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " return \$result;\n"; - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing button action; and generate waitForPageLoad() if it's needed. - * - * public function clickButtonMyButton() - * { - * $this->acceptanceTester->click(self::$myButton); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForButtonAction($element, $attributes) - { - $content = "\n"; - $content .= " public function clickButton" . ucfirst($element). "()\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->click(self::$$element);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing checkbox action; and generate waitForPageLoad() if it's needed. - * - * public function clickCheckBoxMyCheckboxButton($optionsArray) - * { - * $this->acceptanceTester->checkOption(self::$myCheckboxButton, $optionsArray); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForCheckboxAction($element, $attributes) - { - $content = "\n"; - $content .= " public function clickCheckBox" . ucfirst($element). "(\$optionsArray)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->checkOption(self::$$element, \$optionsArray);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing radio button action; and generate waitForPageLoad() if it's needed. - * - * public function clickRadioButtonMyRadioButton($option) - * { - * $this->acceptanceTester->selectOption(self::$myRadioButton, $option); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForRadioAction($element, $attributes) - { - $content = "\n"; - $content .= " public function clickRadioButton" . ucfirst($element). "(\$option)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->selectOption(self::$$element, \$option);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing dropdown select action; and generate waitForPageLoad() if it's needed. - * - * public function selectOptionMySelectButton($option) - * { - * $this->acceptanceTester->selectOption(self::$mySelectButton, $option); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForSelectAction($element, $attributes) - { - $content = "\n"; - $content .= " public function selectOption" . ucfirst($element). "(\$option)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->selectOption(self::$$element, \$option);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } - - /** - * Generate code for performing search and multi-select action; and generate waitForPageLoad() if it's needed. - * e.g. Categories multi-select element - * - * public function selectOptionMySelectButton($optionArray, $requireAction = false) - * { - * $this->acceptanceTester->searchAndMultiSelectOption(self::$mySelectButton, $optionArray, $requireAction = false); - * $this->acceptanceTester->waitForPageLoad(); - * } - * - * @param string $element - * @param array $attributes - * @return string - */ - private function generateCodeForMultiSelectAction($element, $attributes) - { - $content = "\n"; - $content .= " public function clickCheckBox" . ucfirst($element). "(\$optionsArray)\n"; - $content .= " {\n"; - $content .= " \$this->acceptanceTester->searchAndMultiSelectOption(self::$$element, \$optionsArray, \$requireAction = false);\n"; - if (isset($attributes['wait_required']) && $attributes['wait_required']) { - $content .= " \$this->acceptanceTester->waitForPageLoad();\n"; - } - $content .= " }\n"; - return $content; - } -} diff --git a/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php b/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php deleted file mode 100644 index 207bfcef8..000000000 --- a/src/Magento/AcceptanceTestFramework/Generate/GeneratePage.php +++ /dev/null @@ -1,149 +0,0 @@ -cnt = 0; - $this->start = microtime(true); - foreach ($this->configData->get('page') as $name => $data) { - $this->generateClass($name, $data); - } - $this->end = microtime(true); - $time = $this->end - $this->start; - - \Magento\AcceptanceTestFramework\Generate\GenerateResult::addResult('Page Classes', $this->cnt, $time); - } - - /** - * Generate single page class. - * - * @param string $className - * @return string|bool - * @throws \InvalidArgumentException - */ - public function generate($className) - { - $classNameParts = explode('\\', $className); - $classDataKey = 'page/' . end($classNameParts); - - if (!$this->configData->get($classDataKey)) { - throw new \InvalidArgumentException('Invalid class name: ' . $className); - } - - return $this->generateClass( - end($classNameParts), $this->configData->get($classDataKey) - ); - } - - /** - * Generate page class from XML source. - * - * @param string $name - * @param array $data - * @return string|bool - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function generateClass($name, array $data) - { - $className = ucfirst($name); - $mca = isset($data['mca']) ? $data['mca'] : ''; - $area = isset($data['area']) ? $data['area'] : ''; - $areaPage = $this->getParentPage($area, $mca); - $folderPath = str_replace('_', '/AcceptanceTest/', $data['module']) . '/Page'; - $folderPath .= (empty($area) ? '' : ('/' . $area)); - $class = str_replace('/', '\\', $folderPath . '/' . $className); - - $content = "getFilePhpDoc(); - $content .= "namespace {$this->getNamespace($class)};\n\n"; - $content .= "use Magento\\AcceptanceTestFramework\\Page\\{$areaPage};\n\n"; - $content .= "/**\n"; - $content .= " * Class {$className}\n"; - $content .= " */\n"; - $content .= "class {$className} extends {$areaPage}\n"; - $content .= "{\n"; - $content .= " const MCA = '{$mca}';\n\n"; - $content .= " /**\n"; - $content .= " * Blocks' config\n"; - $content .= " *\n"; - $content .= " * @var array\n"; - $content .= " */\n"; - $content .= " protected \$blocks = [\n"; - $blocks = isset($data['block']) ? $data['block'] : []; - foreach ($blocks as $blockClass => $block) { - $blockName = lcfirst($this->getShortClassName($blockClass)); - $block['class'] = $blockClass; - $content .= $this->generatePageClassBlock($blockName, $block, ' '); - } - $content .= " ];\n"; - - foreach ($blocks as $blockClass => $block) { - $blockName = lcfirst($this->getShortClassName($blockClass)); - $content .= "\n /**\n"; - $content .= " * @return \\" . $blockClass . "\n"; - $content .= " */\n"; - $content .= ' public function get' . ucfirst($blockName) . '()' . "\n"; - $content .= " {\n"; - $content .= " return \$this->getBlockInstance('{$blockName}');\n"; - $content .= " }\n"; - } - $content .= "}\n"; - - return $this->createClass($class, $content); - } - - /** - * Generate block for page class. - * - * @param string $blockName - * @param array $params - * @param string $indent - * @return string - */ - protected function generatePageClassBlock($blockName, array $params, $indent = '') - { - $content = $indent . "'{$blockName}' => [\n"; - foreach ($params as $key => $value) { - if (is_array($value)) { - $content .= $this->generatePageClassBlock($key, $value, $indent . ' '); - } else { - $escaped = str_replace('\'', '"', $value); - $content .= $indent . " '{$key}' => '{$escaped}',\n"; - } - } - $content .= $indent . "],\n"; - - return $content; - } - - /** - * Determine parent page class. - * - * @param string $area - * @param string $mca - * @return string - */ - protected function getParentPage($area, $mca) - { - if (strpos($area, 'Adminhtml') === false) { - if (strpos($mca, 'http') === false) { - $areaPage = 'FrontendPage'; - } else { - $areaPage = 'ExternalPage'; - } - } else { - $areaPage = 'AdminPage'; - } - return $areaPage; - } -} diff --git a/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php b/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php deleted file mode 100644 index 05564a7ce..000000000 --- a/src/Magento/AcceptanceTestFramework/Generate/GenerateResult.php +++ /dev/null @@ -1,105 +0,0 @@ - $item, - 'count' => $count, - 'time' => $time - ]; - } - - /** - * Get generated results. - * - * @return array - */ - public static function getResults() - { - return self::$results; - } - - /** - * Display results. - * - * @return void - */ - public static function displayResults() - { - global $argv; - - $results = self::getResults(); - if (isset($argv)) { - $lengths = [ - 'item' => strlen('Item'), - 'count' => strlen('Count'), - 'time' => strlen('Time(s)') - ]; - foreach ($results as $result) { - $lengths['item'] = max($lengths['item'], strlen($result['item'])); - $lengths['count'] = max($lengths['count'], strlen($result['count'])); - $lengths['time'] = max($lengths['time'], strlen($result['time'])); - } - echo "|| " . self::prepareForShell('Item', $lengths['item']); - echo " || " . self::prepareForShell('Count', $lengths['count']); - echo " || " . self::prepareForShell('Time(s)', $lengths['time']) . " ||\n"; - foreach ($results as $result) { - echo "|| " . self::prepareForShell($result['item'], $lengths['item']); - echo " || " . self::prepareForShell($result['count'], $lengths['count']); - echo " || " . self::prepareForShell($result['time'], $lengths['time']) . " ||\n"; - } - echo "\n"; - } else { - echo ''; - foreach ($results as $result) { - echo ""; - } - echo "
    ItemCountTime
    {$result['item']}{$result['count']}{$result['time']}
    "; - } - } - - /** - * Prepare results for shell output. - * - * @param string $string - * @param int $length - * @return string - */ - protected static function prepareForShell($string, $length) - { - $suffixLength = $length - strlen($string); - $suffix = ''; - for ($i = 0; $suffixLength > $i; $i++) { - $suffix .= ' '; - } - return $string . $suffix; - } -} diff --git a/src/Magento/AcceptanceTestFramework/Generate/LauncherInterface.php b/src/Magento/AcceptanceTestFramework/Generate/LauncherInterface.php deleted file mode 100644 index d33f0c4b7..000000000 --- a/src/Magento/AcceptanceTestFramework/Generate/LauncherInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -generatorPool = $pool; - } - - /** - * Retrieve generator pool - * - * @return array - */ - public function getGenerators() - { - return $this->generatorPool; - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/AdminPage.php b/src/Magento/AcceptanceTestFramework/Page/AdminPage.php deleted file mode 100644 index 1760bdada..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/AdminPage.php +++ /dev/null @@ -1,178 +0,0 @@ -url = static::ADMIN_BASE_URL . static::MCA; - } - - public function openTabGoToAndVerifyUrl($pageUrl) - { - $I = $this->acceptanceTester; - $I->openNewTab(); - $I->amOnPage($pageUrl); - $I->seeInCurrentUrl($pageUrl); - } - - public function seeInPageTitle($name) - { - $I = $this->acceptanceTester; - $I->see($name, self::$pageTitle); - } - - public function clickOnTheGlobalSearchButton() - { - $I = $this->acceptanceTester; - $I->click(self::$globalSearchButton); - } - - public function enterGlobalSearchValue($searchValue) - { - $I = $this->acceptanceTester; - $I->fillField(self::$globalSearchInput, $searchValue); - } - - public function pressEnterOnTheKeyboard() - { - $I = $this->acceptanceTester; - $I->pressKey(self::$globalSearchInput, \WebDriverKeys::ENTER); - } - - public function performGlobalSearchFor($searchValue) - { - self::clickOnTheGlobalSearchButton(); - self::enterGlobalSearchValue($searchValue); - self::pressEnterOnTheKeyboard(); - } - - public function clickOnUserActionMenuLink() - { - $I = $this->acceptanceTester; - $I->click(self::$userActionsMenuLink); - } - - public function clickOnAdminAccountSetting() - { - $I = $this->acceptanceTester; - $I->click(self::$adminAccountSetting); - } - - public function clickOnCustomerView() - { - $I = $this->acceptanceTester; - $I->click(self::$customerView); - } - - public function clickOnSignOut() - { - $I = $this->acceptanceTester; - $I->click(self::$adminSignOut); - } - - public function clickOnAdminBackButton() - { - $I = $this->acceptanceTester; - $I->click(self::$pageMainActionsBack); - } - - public function clickOnAdminResetButton() - { - $I = $this->acceptanceTester; - $I->click(self::$pageMainActionsReset); - } - - public function clickOnAdminSaveAndContinueEdit() - { - $I = $this->acceptanceTester; - $I->click(self::$pageMainActionsSaveAndContinue); - $I->waitForPageLoad(); - } - - public function clickOnAdminSaveButton() - { - $I = $this->acceptanceTester; - $I->click(self::$pageMainActionsSave); - $I->waitForPageLoad(); - } - - public function clickOnAdminAddButton() - { - $I = $this->acceptanceTester; - $I->click(self::$pageMainActionsAdd); - $I->waitForPageLoad(); - } - - public function clickOnCollapsibleArea($areaName) - { - $I = $this->acceptanceTester; - $I->click('//div[@class="fieldset-wrapper-title"]/strong/span[contains(text(), "' . $areaName . '")]'); - } - - public function expandCollapsibleArea($areaIndex) - { - $I = $this->acceptanceTester; - $context = sprintf('.fieldset-wrapper[data-index=%s]', $areaIndex); - try { - $I->seeElement($context . ' .fieldset-wrapper-title[data-state-collapsible=closed]'); - $I->click($context . ' .admin__collapsible-title>span'); - } catch (\PHPUnit_Framework_AssertionFailedError $e) { - } - } - - public function closeCollapsibleArea($areaIndex) - { - $I = $this->acceptanceTester; - $context = sprintf('.fieldset-wrapper[data-index=%s]', $areaIndex); - try { - $I->seeElement($context . ' .fieldset-wrapper-title[data-state-collapsible=open]'); - $I->click($context . ' .admin__collapsible-title>span'); - } catch (\PHPUnit_Framework_AssertionFailedError $e) { - } - } - - public function seeSuccessMessage() - { - $I = $this->acceptanceTester; - $I->seeElement(self::$successMessage); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Block/AdminGrid.php b/src/Magento/AcceptanceTestFramework/Page/Block/AdminGrid.php deleted file mode 100644 index 20a06431b..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Block/AdminGrid.php +++ /dev/null @@ -1,381 +0,0 @@ -.admin__data-grid-header button[data-action=grid-filter-expand]'; - public static $filtersExpanded = '.admin__data-grid-filters-wrap._show'; - public static $filtersApplyButton = 'button[data-action=grid-filter-apply]'; - public static $filtersCancelButton = 'button[data-action=grid-filter-cancel]'; - //public static $filtersClearAllButton = 'button[data-action=grid-filter-reset]'; - public static $filtersClearAllButton = '.admin__data-grid-header button[data-action=grid-filter-reset]'; - - public static $viewButton = '.admin__data-grid-action-bookmarks .admin__action-dropdown'; - public static $viewDropDownMenu = '.admin__data-grid-action-bookmarks .admin__action-dropdown-menu'; - public static $viewDropDownOption = '.admin__data-grid-action-bookmarks .action-dropdown-menu-link'; - public static $viewSaveViewAsLink = '.admin__data-grid-action-bookmarks .action-dropdown-menu-item-last'; - public static $newViewField = '.admin__data-grid-action-bookmarks .admin__control-text'; - public static $newViewButton = '.admin__data-grid-action-bookmarks .action-submit'; - - public static $columnsButton = '.admin__data-grid-action-columns'; - public static $columnsCurrentCount = '.admin__data-grid-action-columns .admin__action-dropdown-menu-header'; - public static $columnCheckbox = ''; - public static $columnHeaderName = '.admin__data-grid-action-columns .admin__field-label'; - public static $columnsResetButton = '.admin__data-grid-action-columns .admin__action-dropdown-footer-secondary-actions'; - public static $columnsCancelButton = '.admin__data-grid-action-columns .admin__action-dropdown-footer-main-actions'; - - public static $exportButton = '.admin__data-grid-action-export'; - public static $exportDropDownMenu = '.admin__data-grid-action-export-menu'; - public static $exportLinks = '.admin__data-grid-action-export-menu .admin__field-label'; - public static $exportCancelButton = '.admin__data-grid-action-export-menu .action-tertiary'; - public static $exportExportButton = '.admin__data-grid-action-export-menu .action-secondary'; - - public static $actionsButton = '.action-select-wrap'; - public static $actionsDropDownMenu = '.action-menu-items'; - public static $actionsMenuItem = '.action-menu-items .action-menu-item'; - - public static $recordsCount = ''; - - public static $perPageCountButton = '.admin__data-grid-pager-wrap .selectmenu'; - public static $perPageDropDownMenu = '.admin__data-grid-pager-wrap .selectmenu-items'; - public static $perPageMenuItem = '.admin__data-grid-pager-wrap .selectmenu-items .selectmenu-item-action'; - public static $perPageCustomLink = '.admin__data-grid-pager-wrap .selectmenu-items .selectmenu-item-action:last'; - public static $perPageCustomField = '.admin__data-grid-pager-wrap .selectmenu-items .admin__control-text'; - public static $perPageCustomButton = '.admin__data-grid-pager-wrap .selectmenu-items .action-save'; - - public static $backPageButton = '.action-previous'; - public static $pageNumberField = '.admin__data-grid-pager .admin__control-text'; - public static $pageOfPageText = '.admin__data-grid-pager .admin__control-support-text'; - public static $nextPageButton = '.action-next'; - - public static $gridMainArea = '.admin__data-grid-wrap'; - public static $gridHeaderName = '.data-grid-th'; - - public static $loadingMask = '.loading-mask'; - public static $gridLoadingMask = '.admin__data-grid-loading-mask'; - - public static $grid - = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap'; - - public static $gridNthRow - = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s)'; - - public static $checkboxInGridNthRow - = '.admin__data-grid-outer-wrap>.admin__data-grid-wrap tbody tr:nth-child(%s) .admin__control-checkbox'; - - public function enterSearchKeyword($searchKeyboard) - { - $I = $this->acceptanceTester; - $I->fillField(self::$searchByField, $searchKeyboard); - } - - public function clickOnTheSearchButton() - { - $I = $this->acceptanceTester; - $I->click(self::$searchByButton); - } - - public function performSearchByKeyword($searchKeyword) - { - $I = $this->acceptanceTester; - self::enterSearchKeyword($searchKeyword); - $I->waitForPageLoad(); - self::clickOnTheSearchButton(); - $I->waitForPageLoad(); - } - - public function clickOnFiltersButtonToExpand() - { - $I = $this->acceptanceTester; - try { - $I->waitForPageLoad(); - $I->dontSeeElement(self::$filtersExpanded); - $I->click(self::$filtersButton); - $I->waitForPageLoad(); - } catch (ElementNotFound $e) { - } - } - - public function clickOnFiltersButtonToClose() - { - $I = $this->acceptanceTester; - try { - $I->waitForPageLoad(); - $I->seeElement(self::$filtersExpanded); - $I->click(self::$filtersButton); - $I->waitForPageLoad(); - } catch (ElementNotFound $e) { - } - } - - public function clickOnFiltersClearAllButton() - { - $I = $this->acceptanceTester; - try { - $I->waitForPageLoad(); - $I->click(self::$filtersClearAllButton); - } catch (ElementNotFound $e) { - } - } - - /** - * Search and filter by value. - * - * @param string $value - * @param string $selector - * @param string $type - */ - public function searchAndFiltersByValue($value, $selector, $type = 'textfield') - { - $I = $this->acceptanceTester; - $this->clickOnFiltersClearAllButton(); - $this->clickOnFiltersButtonToExpand(); - - switch ($type) { - case 'dropdown': - $I->selectOption($selector, $value); - break; - case 'textfield': - default: - $I->fillField($selector, $value); - } - $I->click(self::$filtersApplyButton); - $I->waitForPageLoad(); - } - - /** - * @see texts in currently visible grid's nth row. - * - * @param int $n - * @param array $texts - */ - public function seeInCurrentGridNthRow(int $n, array $texts) - { - $I = $this->acceptanceTester; - $I->waitForPageLoad(); - foreach ($texts as $text) { - $I->see($text, sprintf(self::$gridNthRow, $n)); - } - } - - /** - * @see texts in currently visible grid. - * - * @param array $texts - */ - public function seeInCurrentGrid(array $texts) - { - $I = $this->acceptanceTester; - $I->waitForPageLoad(); - foreach ($texts as $text) { - $I->see($text, self::$grid); - } - } - - /** - * Check the checkbox in currently visible grid's nth row. - * - * @param int $n - */ - public function checkCheckboxInCurrentNthRow(int $n) - { - $I = $this->acceptanceTester; - $I->waitForPageLoad(); - try { - $I->dontSeeCheckboxIsChecked(sprintf(self::$checkboxInGridNthRow, 1)); - $I->click(sprintf(self::$checkboxInGridNthRow, 1)); - } catch (ElementNotFound $e) { - } - } - - public function clickOnViewButton() - { - $I = $this->acceptanceTester; - $I->click(self::$viewButton); - } - - public function clickOnSpecificView($viewName) - { - $I = $this->acceptanceTester; - $I->click(self::$viewDropDownOption, $viewName); - } - - public function clickOnSaveViewAsLink() - { - $I = $this->acceptanceTester; - $I->click(self::$viewSaveViewAsLink); - } - - public function enterNewViewName($newViewName) - { - $I = $this->acceptanceTester; - $I->fillField(self::$newViewField, $newViewName); - } - - public function clickOnNewViewSaveButton() - { - $I = $this->acceptanceTester; - $I->click(self::$newViewButton); - } - - public function saveTheCurrentView($newViewName) - { - self::clickOnViewButton(); - self::clickOnSaveViewAsLink(); - self::enterNewViewName($newViewName); - self::clickOnNewViewSaveButton(); - } - - public function clickOnColumnsButton() - { - $I = $this->acceptanceTester; - $I->click(self::$columnsButton); - } - - public function clickOnSpecificColumnName($columnName) - { - $I = $this->acceptanceTester; - $I->click($columnName); - } - - public function clickOnColumnReset() - { - $I = $this->acceptanceTester; - $I->click(self::$columnsResetButton); - } - - public function clickOnColumnCancel() - { - $I = $this->acceptanceTester; - $I->click(self::$columnsCancelButton); - } - - public function clickExportButton() - { - $I = $this->acceptanceTester; - $I->click(self::$exportButton); - } - - public function clickOnCsvLink() - { - $I = $this->acceptanceTester; - $I->click(self::$exportLinks, 'CSV'); - } - - public function clickOnExcelXmlLink() - { - $I = $this->acceptanceTester; - $I->click(self::$exportLinks, 'Excel XML'); - } - - public function clickOnExportCancel() - { - $I = $this->acceptanceTester; - $I->click(self::$exportCancelButton); - } - - public function clickOnExportExport() - { - $I = $this->acceptanceTester; - $I->click(self::$exportExportButton); - } - - public function clickOnActionsButton() - { - $I = $this->acceptanceTester; - $I->click(self::$actionsButton); - } - - public function clickOnSpecificActionLink($actionName) - { - $I = $this->acceptanceTester; - $I->click(self::$actionsMenuItem, $actionName); - } - - public function clickOnPerPageButton() - { - $I = $this->acceptanceTester; - $I->click(self::$perPageCountButton); - } - - public function clickOnSpecificPerPageCount($itemsPerPage) - { - $I = $this->acceptanceTester; - $I->click($itemsPerPage); - } - - public function clickOnCustomPerPageCountLink() - { - $I = $this->acceptanceTester; - $I->click(self::$perPageCustomLink); - } - - public function enterCustomerPerPageLink($customPerPageCount) - { - $I = $this->acceptanceTester; - $I->fillField(self::$perPageCustomField, $customPerPageCount); - } - - public function clickOnCustomPerPageSaveLink() - { - $I = $this->acceptanceTester; - $I->click(self::$perPageCustomButton); - } - - public function clickOnPageBackButton() - { - $I = $this->acceptanceTester; - $I->click(self::$backPageButton); - } - - public function enterPageNumber($pageNumber) - { - $I = $this->acceptanceTester; - $I->fillField(self::$pageNumberField, $pageNumber); - } - - public function clickOnPageNextButton() - { - $I = $this->acceptanceTester; - $I->click(self::$nextPageButton); - } - - public function clickOnSpecificGridColumnHeader($columnHeaderName) - { - $I = $this->acceptanceTester; - $I->click(self::$gridHeaderName, $columnHeaderName); - } - - public function determineIndexBasedOnThisText($keyText) - { - $I = $this->acceptanceTester; - $selector = "//div[contains(@class, 'data-grid-cell-content')][contains(., '" . $keyText . "')]/parent::td/parent::tr"; - $number = $I->grabAttributeFrom($selector, 'data-repeat-index'); - return $number; - } - - public function clickOnActionLinkFor($keyText) - { - $I = $this->acceptanceTester; - $actionLinkSelector = '.data-row[data-repeat-index="' . self::determineIndexBasedOnThisText($keyText) . '"] .action-menu-item'; - - $I->click($actionLinkSelector); - $I->waitForPageLoad(); - } - - public function waitForGridLoadingMaskToDisappear() - { - $I = $this->acceptanceTester; - $I->waitForElementNotVisible(self::$gridLoadingMask, 30); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Block/Block.php b/src/Magento/AcceptanceTestFramework/Page/Block/Block.php deleted file mode 100644 index 63da125f5..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Block/Block.php +++ /dev/null @@ -1,97 +0,0 @@ -rootElement = $element; - $this->acceptanceTester = $acceptanceTester; - $this->init(); - } - - /** - * Initialize for children classes - * @return void - */ - protected function init() - { - // - } - - /** - * Check if the root element of the block is visible or not - * - * @return bool - */ - public function isVisible() - { - try { - $this->waitForElementVisible($this->rootElement); - return true; - } catch (\Exception $e) { - return false; - } - } - - /** - * Wait for element is visible in the block - * - * @param string $selector - * @return bool|null - */ - public function waitForElementVisible($selector) - { - return $this->acceptanceTester->waitForElementVisible($selector); - } - - /** - * Wait for element is not visible in the block - * - * @param string $selector - * @return bool|null - */ - public function waitForElementNotVisible($selector) - { - return $this->acceptanceTester->waitForElementVisible($selector); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Block/BlockFactory.php b/src/Magento/AcceptanceTestFramework/Page/Block/BlockFactory.php deleted file mode 100644 index c259783c8..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Block/BlockFactory.php +++ /dev/null @@ -1,41 +0,0 @@ -getConstructor(); - if (is_null($reflectedConstructor)) { - $object = new $class; - } else { - $object = $reflectedClass->newInstanceArgs($arguments); - } - if (!$object instanceof BlockInterface) { - $interfaceClass = '\Magento\AcceptanceTestFramework\Page\Block\BlockInterface'; - throw new \UnexpectedValueException( - sprintf('Block class "%s" has to implement '. $interfaceClass . 'interface.', $class) - ); - } - } else { - throw new \UnexpectedValueException( - sprintf('Class "%s" does not exist.', $class) - ); - } - return $object; - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Block/BlockInterface.php b/src/Magento/AcceptanceTestFramework/Page/Block/BlockInterface.php deleted file mode 100644 index 1f684050c..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Block/BlockInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -url = static::MCA; - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/FrontendPage.php b/src/Magento/AcceptanceTestFramework/Page/FrontendPage.php deleted file mode 100644 index 27291e64b..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/FrontendPage.php +++ /dev/null @@ -1,53 +0,0 @@ -span'; - public static $signInLink = '.authorization-link a'; - public static $createAccountLink = '.header.links>li:nth-child(4)'; - - public static $pageFooterContent = '.footer.content'; - - protected function initUrl() - { - $this->url = static::FRONTEND_BASE_URL . static::MCA; - } - - public function seeInPageTitle($name) - { - $I = $this->acceptanceTester; - $I->see($name, self::$pageTitle); - } - - public function clickSignInLink() - { - $I = $this->acceptanceTester; - $I->click(self::$signInLink); - } - - public function clickCreateAccountLink() - { - $I = $this->acceptanceTester; - $I->click(self::$createAccountLink); - } - - public function seeWelcomeMessage($msg) - { - $I = $this->acceptanceTester; - $I->see($msg, self::$welcomeMessage); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/Page.php b/src/Magento/AcceptanceTestFramework/Page/Page.php deleted file mode 100644 index f5cb5c4c6..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/Page.php +++ /dev/null @@ -1,144 +0,0 @@ -blockFactory = $blockFactory; - $this->acceptanceTester = $acceptanceTester; - $this->pageLoadTimeout = $this->acceptanceTester->getConfiguration('pageload_timeout'); - $this->initUrl(); - } - - /** - * Init page and set page url. - * - * @return void - */ - protected function initUrl() - { - // - } - - /** - * Open page using browser. - * - * @param array $params - * @return $this - */ - public function open(array $params = []) - { - $url = $this->url; - - foreach ($params as $paramName => $paramValue) { - if (strpos($url, '?') !== false) { - $url .= '&'; - } else { - $url .= '?'; - } - $url .= $paramName . '=' . $paramValue; - } - - $this->acceptanceTester->amOnPage($url); - - return $this; - } - - /** - * Retrieve an instance of block. - * - * @param string $blockName - * @return BlockInterface - * @throws \InvalidArgumentException - */ - public function getBlockInstance($blockName) - { - if (!isset($this->blockInstances[$blockName])) { - $blockMeta = isset($this->blocks[$blockName]) ? $this->blocks[$blockName] : []; - $class = isset($blockMeta['class']) ? $blockMeta['class'] : false; - if ($class) { - $element = $this->acceptanceTester->findElement($blockMeta['locator'])[0]; - $block = $this->blockFactory->create( - $class, - [ - 'element' => $element, - $this->acceptanceTester - ] - ); - } else { - throw new \InvalidArgumentException( - sprintf('There is no such block "%s" declared for the page "%s" ', $blockName, $class) - ); - } - - $this->blockInstances[$blockName] = $block; - } - - return $this->blockInstances[$blockName]; - } -} diff --git a/src/Magento/AcceptanceTestFramework/Page/PageInterface.php b/src/Magento/AcceptanceTestFramework/Page/PageInterface.php deleted file mode 100644 index c3a645644..000000000 --- a/src/Magento/AcceptanceTestFramework/Page/PageInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -get(PageParser::class); + self::$pageObjects = $parser->getData(self::TYPE); + } + } +} diff --git a/src/Magento/AcceptanceTestFramework/PageObject/Page/PageInterface.php b/src/Magento/AcceptanceTestFramework/PageObject/Page/PageInterface.php new file mode 100644 index 000000000..694408a03 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/PageObject/Page/PageInterface.php @@ -0,0 +1,42 @@ + self::getSection($sectionName)[self::SUB_TYPE][$elementName]]; + } + + /** + * Get element object data. All sections data is returned if $name is not specified. + * + * @param string $sectionName + * @param string $elementName + * @return mixed + */ + public static function getElementNamesInSection($sectionName, $elementName) + { + return array_keys(self::getSection($sectionName)[self::SUB_TYPE]); + } + + /** + * Get element locator. + * + * @param string $sectionName + * @param string $elementName + * @return string|null + */ + public static function getElementLocator($sectionName, $elementName) + { + $element = self::getSection($sectionName)[self::SUB_TYPE][$elementName]; + $locator = $element[self::LOCATOR_ATTR]; + if (isset($element[self::LOCATOR_VARS_ATTR])) { + $locatorVarsStr = $element[self::LOCATOR_VARS_ATTR]; + $locatorVarsArray = explode(',', $locatorVarsStr); + $newLocatorVarsArray = []; + foreach ($locatorVarsArray as $variable) { + $variable = trim($variable); + if (substr($variable, 0, 1) !== '$') { + $variable = '$' . $variable; + $newLocatorVarsArray[] = $variable; + } + } + $locatorVarsStr = implode(',', $newLocatorVarsArray); + return 'sprintf("' . $locator . '", ' . $locatorVarsStr . ')'; + } else { + return $locator; + } + } + + /** + * Get element type. + * + * @param string $sectionName + * @param string $elementName + * @return string + */ + public static function getElementType($sectionName, $elementName) + { + return self::getSection($sectionName)[self::SUB_TYPE][$elementName][self::TYPE_ATTR]; + } + + /** + * Get element time out value. + * + * @param string $sectionName + * @param string $elementName + * @return integer|null + */ + public static function getElementTimeOut($sectionName, $elementName) + { + if(self::isElementRequireWait($sectionName, $elementName)) { + $timeOut = self::getSection($sectionName)[self::SUB_TYPE][$elementName][self::TIMEOUT_ATTR]; + if ($timeOut === self::DEFAULT_TIMEOUT_SAMBOL) { + return null; + } else { + return (int)$timeOut; + } + } + return null; + } + + /** + * Check if element requires an explicit wait. + * + * @param string $sectionName + * @param string $elementName + * @return bool + */ + public static function isElementRequireWait($sectionName, $elementName) + { + return array_key_exists(self::TIMEOUT_ATTR, self::getSection($sectionName)[self::SUB_TYPE][$elementName]); + } + + /** + * Parse section objects if it's not previously done. + * + * @return void + */ + private static function initSectionObjects() + { + if (empty(self::$sectionObjects)) { + $objectManager = ObjectManagerFactory::getObjectManager(); + /** @var $parser \Magento\AcceptanceTestFramework\XmlParser\SectionParser */ + $parser = $objectManager->get(SectionParser::class); + self::$sectionObjects = $parser->getData(self::TYPE); + } + } +} diff --git a/src/Magento/AcceptanceTestFramework/PageObject/Section/SectionInterface.php b/src/Magento/AcceptanceTestFramework/PageObject/Section/SectionInterface.php new file mode 100644 index 000000000..4d1b53bb8 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/PageObject/Section/SectionInterface.php @@ -0,0 +1,72 @@ + - An element that contains configuration data of a page. + Contains sequence of ui sections in a page. @@ -27,10 +27,10 @@ - + - An element that contains configuration data of a page block. + Contains sequence of ui elements. @@ -38,50 +38,45 @@ - The name of the page. + Unique page name identifier. - + - MCA path for the page. For example: "catalog/product/view". + Url path (excluding the base url) for the page. Use "%s" for placeholders for variables. - + - The name of the module to which the page belongs. For example: "Magento_Catalog". + Optional variable names separated by "," which are used to substitute %s in urlPath attribute. - + - The name of the area to which the page belongs. For example: "Adminhtml". + The name of the module to which the page belongs. For example: "Magento_Catalog". + - + - The fully qualified class name of the block. - - - - - - - Locator of the block. For example, CSS selector "#maincontent". + Unique section name identifier. + diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd b/src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd similarity index 67% rename from src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd rename to src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd index 025370de2..2cd26f9ae 100644 --- a/src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd +++ b/src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd @@ -9,10 +9,10 @@ - + - An element that contains configuration data of a page. + Contains sequence of ui elements in a section of a page. @@ -20,13 +20,13 @@ - + - + - A ui element that contains data for selenium web driver to perform default action on them. + Contains information of an ui element. @@ -34,17 +34,11 @@ - The fully qualified class name of the block. - - - - - - - Parent block class name, if not specified, Magento\AcceptanceTestFramework\Page\Block\Block is used. + Unique section name identifier. + @@ -53,7 +47,7 @@ - The name of the element. + Element name. @@ -67,38 +61,25 @@ - Locator of the element. - - - - - - - If the element is a required field in the ui. + Locator of the element. Use %s for placeholders for variables. - + - The group that the element belongs in the ui. + Optional variable names separated by "," which are used to substitute %s in locator attribute. - + - If the element depends on other element to be enabled. - - - - - - - If waitForPageLoad() is required after default action. + Optional timeout value in second to wait for the operation on the element. use "-" for default value. + @@ -126,6 +107,12 @@ + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Util/PageGenerator.php b/src/Magento/AcceptanceTestFramework/Util/PageGenerator.php deleted file mode 100644 index 386f5af5b..000000000 --- a/src/Magento/AcceptanceTestFramework/Util/PageGenerator.php +++ /dev/null @@ -1,19 +0,0 @@ -get('Magento\AcceptanceTestFramework\Generate\Pool'); -foreach ($generatorPool->getGenerators() as $generator) { - if (!$generator instanceof \Magento\AcceptanceTestFramework\Generate\LauncherInterface) { - throw new \InvalidArgumentException( - 'Generator ' . get_class($generator) . ' should implement LauncherInterface' - ); - } - $generator->launch(); -} - -\Magento\AcceptanceTestFramework\Generate\GenerateResult::displayResults(); diff --git a/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php b/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php new file mode 100644 index 000000000..063662382 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php @@ -0,0 +1,47 @@ +objectManager = $objectManager; + $this->configData = $configData; + } + + /** + * Get parsed xml data. + * + * @param string $type + * @return mixed + */ + public function getData($type) + { + return $this->configData->get($type); + } +} diff --git a/src/Magento/AcceptanceTestFramework/XmlParser/ParserInterface.php b/src/Magento/AcceptanceTestFramework/XmlParser/ParserInterface.php new file mode 100644 index 000000000..10decfc48 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/XmlParser/ParserInterface.php @@ -0,0 +1,16 @@ +objectManager = $objectManager; + $this->configData = $configData; + } + + /** + * Get parsed xml data. + * + * @param string $type + * @return mixed + */ + public function getData($type) + { + return $this->configData->get($type); + } +} From 4e212921ee9847394b26479d85c7c2aff9b11a18 Mon Sep 17 00:00:00 2001 From: KevinBKozan Date: Wed, 19 Jul 2017 15:48:43 -0500 Subject: [PATCH 095/149] MQE-211: Implement exception handling in TestObject. --- entryPoint.php | 4 ++-- .../Exceptions/XmlException.php | 14 ++++++++++++++ .../Test/ActionObject.php | 14 +++++++------- .../Test/CestDataConstants.php | 4 ++-- .../Test/CestDataManager.php | 19 +++++++++++++++---- .../Test/TestObject.php | 11 +++++++++-- .../Test/etc/testSchema.xsd | 4 ++-- 7 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/Exceptions/XmlException.php diff --git a/entryPoint.php b/entryPoint.php index 50bfdc756..864abaf7f 100644 --- a/entryPoint.php +++ b/entryPoint.php @@ -3,5 +3,5 @@ require_once 'bootstrap.php'; /** @var Magento\AcceptanceTestFramework\Dummy $dummy */ -$dummy = $objectManager->create(\Magento\AcceptanceTestFramework\Dummy::class); -$dummy->readPageObjects(); +//$dummy = $objectManager->create(\Magento\AcceptanceTestFramework\Dummy::class); +//$dummy->readPageObjects(); diff --git a/src/Magento/AcceptanceTestFramework/Exceptions/XmlException.php b/src/Magento/AcceptanceTestFramework/Exceptions/XmlException.php new file mode 100644 index 000000000..535e9fd7a --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Exceptions/XmlException.php @@ -0,0 +1,14 @@ +function = $function; $this->selector = $selector; $this->parameter = $parameter; - $this->linkedAction = $linkedAction; $this->returnVariable = $returnVariable; $this->userInput = $userInput; + $this->linkedAction = $linkedAction; if ($order == 'after') { $this->orderOffset = 1; @@ -55,11 +55,6 @@ public function getSelector() return $this->selector; } - public function getLinkedAction() - { - return $this->linkedAction; - } - public function getReturnVariable() { return $this->returnVariable; @@ -70,7 +65,12 @@ public function getUserInput() return $this->userInput; } - public function getOrderOffset() + public function getLinkedAction() + { + return $this->linkedAction; + } + + public function getOrderOffset(): int { return $this->orderOffset; } diff --git a/src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php b/src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php index 631ed0769..355f88065 100644 --- a/src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php +++ b/src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php @@ -23,8 +23,8 @@ class CestDataConstants const TEST_ACTION_ACTOR = 'actor'; const TEST_ACTION_PARAMETER = 'parameter'; const TEST_ACTION_SELECTOR = 'selector'; - const TEST_ACTION_ORDER = 'order'; - const TEST_ACTION_LINK = 'linkedAction'; + const TEST_ACTION_BEFORE = 'before'; + const TEST_ACTION_AFTER = 'after'; const TEST_ACTION_USER_INPUT = 'userInput'; const TEST_ACTION_RETURN_VARIABLE = 'returnVariable'; diff --git a/src/Magento/AcceptanceTestFramework/Test/CestDataManager.php b/src/Magento/AcceptanceTestFramework/Test/CestDataManager.php index dcfa702df..bcee9a276 100644 --- a/src/Magento/AcceptanceTestFramework/Test/CestDataManager.php +++ b/src/Magento/AcceptanceTestFramework/Test/CestDataManager.php @@ -3,9 +3,12 @@ namespace Magento\AcceptanceTestFramework\Test; use Magento\AcceptanceTestFramework\ObjectManagerFactory; +use Magento\AcceptanceTestFramework\Exceptions\XmlException; class CestDataManager { + const BEFORE_AFTER_ERROR_MSG = "Merge Error - Steps cannot have both before and after attributes.\tTestStep='%s'"; + public static function getCestData() { $cestDataParser = ObjectManagerFactory::getObjectManager()->create(TestDataParser::class); @@ -135,9 +138,9 @@ private static function extractTestActions($testActions) $actor = null; $parameter = null; $selector = null; - $linkedAction = null; $userInput = null; $returnVariable = null; + $linkedAction = null; $order = null; if (array_key_exists(CestDataConstants::TEST_ACTION_ACTOR, $actionData)) { @@ -150,9 +153,17 @@ private static function extractTestActions($testActions) $selector = $actionData[CestDataConstants::TEST_ACTION_SELECTOR]; } - if (array_key_exists(CestDataConstants::TEST_ACTION_LINK, $actionData)) { - $linkedAction = $actionData[CestDataConstants::TEST_ACTION_LINK]; - $order = $actionData [CestDataConstants::TEST_ACTION_ORDER]; + if (array_key_exists(CestDataConstants::TEST_ACTION_BEFORE, $actionData) + and array_key_exists(CestDataConstants::TEST_ACTION_AFTER, $actionData)) { + throw new XmlException(sprintf(self::BEFORE_AFTER_ERROR_MSG, $actionName)); + } + + if (array_key_exists(CestDataConstants::TEST_ACTION_BEFORE, $actionData)) { + $linkedAction = $actionData[CestDataConstants::TEST_ACTION_BEFORE]; + $order = "before"; + } elseif (array_key_exists(CestDataConstants::TEST_ACTION_AFTER, $actionData)) { + $linkedAction = $actionData[CestDataConstants::TEST_ACTION_AFTER]; + $order = "after"; } if (array_key_exists(CestDataConstants::TEST_ACTION_USER_INPUT, $actionData)) { diff --git a/src/Magento/AcceptanceTestFramework/Test/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/TestObject.php index 70ad2a647..b74d84af4 100644 --- a/src/Magento/AcceptanceTestFramework/Test/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/TestObject.php @@ -2,6 +2,8 @@ namespace Magento\AcceptanceTestFramework\Test; +use Magento\AcceptanceTestFramework\Exceptions\XmlException; + class TestObject { private $name; @@ -10,6 +12,7 @@ class TestObject private $parsedSteps = []; private $dependencies = []; private $annotations = []; + private const STEP_MISSING_ERROR_MSG = "Merge Error - Step could not be found in either TestXML or DeltaXML.\tTest = '%s'\tTestStep='%s'\tLinkedStep'%s'"; public function __construct($name, $dependencies, $parsedSteps, $annotations) { @@ -47,6 +50,7 @@ public function getOrderedActions() /** * This method takes the steps from the parser and splits steps which need merge from steps that are ordered. * @return void + * @throws XmlException */ private function sortActions() { @@ -79,14 +83,17 @@ private function mergeActions() /** * Recursively merges in each step and its dependencies * @param ActionObject $stepToMerge + * @throws XmlException * @return void */ private function mergeAction($stepToMerge) { $linkedStep = $stepToMerge->getLinkedAction(); - if (!array_key_exists($linkedStep, $this->orderedSteps)) { - $this->mergeAction($this->stepsToMerge[$stepToMerge->getLinkedAction()]); + if (!array_key_exists($linkedStep, $this->orderedSteps) and !array_key_exists($linkedStep, $this->stepsToMerge)) { + throw new XmlException(sprintf(self::STEP_MISSING_ERROR_MSG, $this->getName(), $stepToMerge->getName(), $linkedStep)); + } elseif (!array_key_exists($linkedStep, $this->orderedSteps)) { + $this->mergeAction($this->stepsToMerge[$linkedStep]); } $position = array_search($linkedStep, array_keys($this->orderedSteps)) + $stepToMerge->getOrderOffset(); diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index 9856cf10a..175081655 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -50,8 +50,8 @@ - - + + From a4668d6d172ff0356fc7498c7927893d3fb91c79 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 1 Aug 2017 11:12:31 -0500 Subject: [PATCH 096/149] MQE-216: [Customizability] Update parser to handle new test schema on declarative steps --- etc/di.xml | 24 ++- .../Test/Config/Converter/Dom/Flat.php | 140 ++++++++++++++++++ .../Test/etc/sampleCest.xml | 99 ++++++++++--- 3 files changed, 243 insertions(+), 20 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/Test/Config/Converter/Dom/Flat.php diff --git a/etc/di.xml b/etc/di.xml index e7595cfdc..f62c05dcb 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -49,6 +49,7 @@
    + - + Magento\AcceptanceTestFramework\DataProfile\Config\Data @@ -149,6 +149,7 @@ name key + key name *Data.xml @@ -156,6 +157,38 @@ + + + + + Magento\AcceptanceTestFramework\DataProfile\Config\Metadata + + + + + Magento\AcceptanceTestFramework\Config\Reader\Metadata + + + + + Magento/AcceptanceTestFramework/DataGenerator/etc/EntityMetadata.xsd + + + + + Magento\AcceptanceTestFramework\Config\FileResolver\Module + Magento\AcceptanceTestFramework\Config\Converter + Magento\AcceptanceTestFramework\Config\SchemaLocator\Metadata + + name + key + key + + *-meta.xml + Metadata + + + diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php new file mode 100644 index 000000000..291c42ea2 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -0,0 +1,161 @@ +operation = $operation; + $this->entityObject = $entityObject; + + $this->jsonDefinition = JsonDefinitionManager::getInstance()->getJsonDefinition( + $this->operation, + $this->entityObject->getType() + ); + } + + public function executeRequest() + { + $apiClientUrl = $this->jsonDefinition->getApiUrl(); + + $matchedParams = []; + preg_match_all("/[{](.+?)[}]/", $apiClientUrl, $matchedParams); + + if (!empty($matchedParams)) { + foreach ($matchedParams[0] as $paramKey => $paramValue) { + $param = $this->entityObject->getDataByName($matchedParams[1][$paramKey]); + $apiClientUrl = str_replace($paramValue, $param, $apiClientUrl); + } + } + + $authorization = $this->jsonDefinition->getAuth(); + $headers = $this->jsonDefinition->getHeaders(); + + if ($authorization) { + $headers[] = $this->getAuthorizationHeader($authorization); + } + + $jsonBody = $this->getEncodedJsonString(); + + $apiClientUtil = new ApiClientUtil( + $apiClientUrl, + $headers, + $this->jsonDefinition->getApiMethod(), + empty($jsonBody) ? null : $jsonBody + ); + + return $apiClientUtil->submit(); + } + + /** + * Returns the authorization token needed for some requests via REST call. + * + * @param string $authUrl + * @return string + */ + private function getAuthorizationHeader($authUrl) + { + $headers = ['Content-Type: application/json']; + $authCreds = [ + 'username' => getenv('MAGENTO_ADMIN_USERNAME'), + 'password' => getenv('MAGENTO_ADMIN_PASSWORD') + ]; + + $apiClientUtil = new ApiClientUtil($authUrl, $headers, 'POST', json_encode($authCreds)); + $token = $apiClientUtil->submit(); + $authHeader = 'Authorization: Bearer ' . str_replace('"', "", $token); + + return $authHeader; + } + + /** + * This function returns an array which is structurally equal to the json which is needed by the web api for + * entity creation. The function retrieves an array describing the json metadata and traverses any dependencies + * recursively forming an array which represents the json structure for the api of the desired type. + * + * @param EntityDataObject $entityObject + * @param Array $jsonDefMetadata + * + * @return array + */ + private function getJsonDataArray($entityObject, $jsonDefMetadata = null) + { + $jsonArrayMetadata = !$jsonDefMetadata ? JsonDefinitionManager::getInstance()->getJsonDefinition( + $this->operation, + $entityObject->getType() + )->getJsonMetadata() : $jsonDefMetadata; + + $jsonArray = array(); + + foreach ($jsonArrayMetadata as $jsonElement) { + $jsonElementType = $jsonElement->getValue(); + + if (in_array($jsonElementType, $this->primitives)) { + $jsonArray[$jsonElement->getKey()] = $this->castValue( + $jsonElementType, + $entityObject->getDataByName($jsonElement->getKey()) + ); + } else { + $entityNamesOfType = $entityObject->getLinkedEntitiesOfType($jsonElementType); + + foreach ($entityNamesOfType as $entityName) { + $linkedEntityObj = DataManager::getInstance()->getEntity($entityName); + $jsonDataSubArray = self::getJsonDataArray($linkedEntityObj); + + if ($jsonElement->getType() == 'array') { + $jsonArray[$jsonElement->getKey()][] = $jsonDataSubArray; + } else { + $jsonArray[$jsonElement->getKey()] = $jsonDataSubArray; + } + } + } + } + + return $jsonArray; + } + + private function getEncodedJsonString() + { + $jsonArray = $this->getJsonDataArray($this->entityObject, $this->jsonDefinition->getJsonMetadata()); + + return json_encode([$this->entityObject->getType() => $jsonArray], JSON_PRETTY_PRINT); + } + + private function castValue($type, $value) + { + $newVal = $value; + + switch ($type) { + case 'string': + break; + case 'integer': + $newVal = (integer)$value; + break; + case 'boolean': + $newVal = (boolean)$value; + break; + case 'double': + $newVal = (double)$value; + break; + } + + return $newVal; + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php new file mode 100644 index 000000000..8f1a6262c --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php @@ -0,0 +1,47 @@ +entityObject = $entityObject; + } + + public function createEntity() + { + $apiExecutor = new ApiExecutor('create', $this->entityObject); + $result = $apiExecutor->executeRequest(); + + $this->createdObject = new EntityDataObject( + '__created' . $this->entityObject->getName(), + $this->entityObject->getType(), + json_decode($result, true), + null + ); + } + + public function deleteEntity() + { + $apiExecutor = new ApiExecutor('delete', $this->createdObject); + $result = $apiExecutor->executeRequest(); + + return $result; + } + + // TODO add update function + /* public function updateEntity() + { + + }*/ +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php index b6dff6976..647335629 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php @@ -12,6 +12,10 @@ class DataGeneratorConstants const DATA_ELEMENT_KEY = 'key'; const DATA_ELEMENT_VALUE = 'value'; + const ARRAY_VALUES = 'array'; + const ARRAY_ELEMENT_KEY = 'key'; + const ARRAY_ELEMENT_VALUE = 'item'; + const REQUIRED_ENTITY = 'required-entity'; const REQUIRED_ENTITY_TYPE = 'type'; const REQUIRED_ENTITY_VALUE = 'value'; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataHandler.php deleted file mode 100644 index 670c4c2d5..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/DataHandler.php +++ /dev/null @@ -1,64 +0,0 @@ -moduleName = $moduleName; - } - - public function generateData($mapEntities = false) - { - $entityObjects = array(); - $this->objectManager = ObjectManagerFactory::getObjectManager(); - $entityParser = $this->objectManager->create(DataProfileSchemaParser::class); - $entities = $entityParser->readDataProfiles(); - - foreach ($entities[DataGeneratorConstants::ENTITY_DATA] as $entityName => $entity) { - $entityType = $entity[DataGeneratorConstants::ENTITY_DATA_TYPE]; - - if (strcasecmp($entityType, $type) == 0) { - $entityXmlObject = new EntityDataObject( - $entityName, - $entityType, - $entity[DataGeneratorConstants::DATA_VALUES] ?? null, - $entity[DataGeneratorConstants::REQUIRED_ENTITY] ?? null - ); - $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; - } else { - $entityObjects[] = $entityXmlObject; - } - } - - return $entityObjects; - } - - public function persistData($entityNames, $inputMethod) - { - $entityObjects = $this->generateData(true); - $relevantEntities = array_intersect_key($entityObjects, array_flip($entityNames)); - - foreach ($relevantEntities as $relevantEntity) { - if ($inputMethod == 'API') { - return $this->createApiModel($relevantEntity)->create(); - } - } - } - - private function createApiModel($entity) - { - $apiClass = self::API_CLASS_PATH . "\\" . $entity->getType(); - $apiObject = new $apiClass($entity); - return $apiObject; - } -} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/ApiModel/Address.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/ApiModel/Address.php deleted file mode 100644 index 38c0e6bef..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/ApiModel/Address.php +++ /dev/null @@ -1,14 +0,0 @@ -entityObject = $entityObject; - - if (!self::$entityRESTApiHelper) { - self::$entityRESTApiHelper = new EntityRESTApiHelper(getenv('HOSTNAME'), getenv('PORT')); - } - } - - public function create() - { - $response = self::$entityRESTApiHelper->submitAuthAPiRequest( - 'PUT', - self::CUSTOMER_CREATE_API_PATH, - $this->entityDataToJson(), - EntityRESTApiHelper::APPLICATION_JSON_HEADER - ); - - return $response; - } - - public function delete() - { - // TODO implement delete method via customer web-api; - } - - private function entityDataToJson() - { - $data = $this->entityObject->getData(); - - foreach (self::$specialDefinitions as $specialKey) { - if (array_key_exists($specialKey, $data)) { - // logic to handle special case (new obj?) - } - } - - $entityArray = [ - strtolower($this->entityObject->getType()) => $data, - - // this passwordHash param is necessary to create a new customer. - 'passwordHash' => 'someHash']; - - $json = \GuzzleHttp\json_encode($entityArray); - - return $json; - } -} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/EntityPersistenceInterface.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/EntityPersistenceInterface.php deleted file mode 100644 index 129737523..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/DataModel/EntityPersistenceInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -data = $this->parseDataEntities($type); + if (!self::$dataManager) { + $entityParser = ObjectManagerFactory::getObjectManager()->create(DataProfileSchemaParser::class); + $entityParsedData = $entityParser->readDataProfiles(); + + if (!$entityParsedData) { + throw new Exception(sprintf("No entities could be parsed from xml definitions")); + } + + self::$dataManager = new DataManager($entityParsedData); + } + + return self::$dataManager; } - private function parseDataEntities($type) + private function __construct($arrayData) + { + $this->arrayData = $arrayData; + } + + private function parseDataEntities() { $entityObjects = array(); - $objectManager = ObjectManagerFactory::getObjectManager(); - $entityParser = $objectManager->create(DataProfileSchemaParser::class); - $entities = $entityParser->readDataProfiles(); + $entities = $this->arrayData; foreach ($entities[DataGeneratorConstants::ENTITY_DATA] as $entityName => $entity) { $entityType = $entity[DataGeneratorConstants::ENTITY_DATA_TYPE]; - if (strcasecmp($entityType, $type) == 0) { - $entityXmlObject = new EntityDataObject( - $entityName, - $entityType, - $entity[DataGeneratorConstants::DATA_VALUES] ?? null, - $entity[DataGeneratorConstants::REQUIRED_ENTITY] ?? null - ); + $dataValues = []; + $linkedEntities = []; + $arrayValues = []; + + if (array_key_exists(DataGeneratorConstants::DATA_VALUES, $entity)) { + foreach ($entity[DataGeneratorConstants::DATA_VALUES] as $dataElement) { + $dataElementKey = strtolower($dataElement[DataGeneratorConstants::DATA_ELEMENT_KEY]); + $dataElementValue = $dataElement[DataGeneratorConstants::DATA_ELEMENT_VALUE]; + + $dataValues[$dataElementKey] = $dataElementValue; + } + unset($dataElement); + } + + if (array_key_exists(DataGeneratorConstants::REQUIRED_ENTITY, $entity)) { + foreach ($entity[DataGeneratorConstants::REQUIRED_ENTITY] as $linkedEntity) { + $linkedEntityName = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_VALUE]; + $linkedEntityType = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_TYPE]; + + $linkedEntities[$linkedEntityName] = $linkedEntityType; + } + unset($linkedEntity); + } + + if (array_key_exists(DataGeneratorConstants::ARRAY_VALUES, $entity)) { + foreach ($entity[DataGeneratorConstants::ARRAY_VALUES] as $arrayElement) { + $arrayKey = $arrayElement[DataGeneratorConstants::ARRAY_ELEMENT_KEY]; + foreach ($arrayElement[DataGeneratorConstants::ARRAY_ELEMENT_VALUE] as $arrayValue) { + $arrayValues[] = $arrayValue['value']; + } - $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; + $dataValues[$arrayKey] = $arrayValues; + } } + + $entityXmlObject = new EntityDataObject( + $entityName, + $entityType, + $dataValues, + $linkedEntities + ); + + $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; + } unset($entityName); unset($entity); - return $entityObjects; + $this->data = $entityObjects; } public function getEntity($entityName) { - return $this->data[$entityName]; + return $this->getAllEntities()[$entityName]; } public function getAllEntities() { + if (!$this->data) { + $this->parseDataEntities(); + } + return $this->data; } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php deleted file mode 100644 index 4c126cc6b..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/EntityDataManager.php +++ /dev/null @@ -1,18 +0,0 @@ -create(MetadataParser::class); + foreach ($metadataParser->readMetadata()['metadata'] as $jsonDefName => $jsonDefArray) { + $operation = $jsonDefArray['operation']; + $dataType = $jsonDefArray['dataType']; + $url = $jsonDefArray['url'] ?? null; + $method = $jsonDefArray['method'] ?? null; + $auth = $jsonDefArray['auth'] ?? null; + $headers = []; + $params = []; + $jsonMetadata = []; + + if (array_key_exists('header', $jsonDefArray)) { + foreach ($jsonDefArray['header'] as $headerEntry) { + $headers[] = $headerEntry['param'] . ': ' . $headerEntry['value']; + } + } + + if (array_key_exists('param', $jsonDefArray)) { + foreach ($jsonDefArray['param'] as $paramEntry) { + $params[$paramEntry['type']][$paramEntry['key']] = $paramEntry['value']; + } + } + + if (array_key_exists('entry', $jsonDefArray)) { + foreach ($jsonDefArray['entry'] as $jsonEntryType) { + $jsonMetadata[] = new JsonElement($jsonEntryType['key'], $jsonEntryType['value'], 'entry'); + } + } + + if (array_key_exists('array', $jsonDefArray)) { + foreach ($jsonDefArray['array'] as $jsonEntryType) { + $jsonMetadata[] = new JsonElement($jsonEntryType['key'], $jsonEntryType['value'], 'array'); + } + } + + $this->jsonDefinitions[$operation][$dataType] = new JsonDefinition( + $jsonDefName, + $operation, + $dataType, + $method, + $url, + $auth, + $headers, + $params, + $jsonMetadata + ); + } + } + + /** + * @param $type + * @return JsonDefinition + */ + public function getJsonDefinition($operation, $type) + { + if (!$this->jsonDefinitions) { + $this->getObjects(); + } + + return $this->jsonDefinitions[$operation][$type]; + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index 1745f71ad..2d1e3fdbf 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -12,36 +12,24 @@ class EntityDataObject private $linkedEntities = []; //array of required entity name to corresponding type private $data = []; //array of Data Name to Data Value - + /** + * EntityDataObject constructor. + * @param string $entityName + * @param string $entityType + * @param array $data + * @param array $linkedEntities + */ public function __construct($entityName, $entityType, $data, $linkedEntities) { $this->name = $entityName; $this->type = $entityType; - - if ($data) { - foreach ($data as $dataElement) { - $dataElementKey = $dataElement[DataGeneratorConstants::DATA_ELEMENT_KEY]; - $dataElementValue = $dataElement[DataGeneratorConstants::DATA_ELEMENT_VALUE]; - - $this->data[$dataElementKey] = $dataElementValue; - } - unset($dataElement); - } - - if ($linkedEntities) { - foreach ($linkedEntities as $linkedEntity) { - $linkedEntityName = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_VALUE]; - $linkedEntityType = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_TYPE]; - - $this->linkedEntities[$linkedEntityName] = $linkedEntityType; - } - unset($linkedEntity); - } + $this->data = $data; + $this->linkedEntities = $linkedEntities; } - public function hasLinkedEntity($entityName) + public function getLinkedEntities() { - return array_key_exists($entityName, $this->linkedEntities); + return $this->linkedEntities; } public function getName() @@ -55,42 +43,39 @@ public function getType() } /** - * This function retrieves data from an entity defined in xml. The data can be defined explicitly by the entity or - * within any entity linked to or required by the entity. The function will evaluate in the following order: - * 1) Data declared explicitly by the entity - * 2) Data declared explicitly as a known linked entity - * 3) Data declared by entities linked to linked entities - * @param string $name - * @param string $entityName + * This function retrieves data from an entity defined in xml. + * + * @param string $dataName * @return string */ - public function getDataByName($name, $entityName = null) + public function getDataByName($dataName) { - if ($entityName == null) { - return $this->data[$name]; - } elseif ($this->hasLinkedEntity($entityName)) { - $entityTypeManager = EntityDataManager::getDataManager($this->linkedEntities[$entityName]); - return $entityTypeManager->getEntity($entityName)->getDataByName($name); - } else { - foreach ($this->linkedEntities as $linkedEntityName => $linkedEntityType) { - $result = EntityDataManager::getDataManager($linkedEntityType)->getEntity($linkedEntityName) - ->getDataByName($name, $entityName); + $name = strtolower($dataName); - if ($result) { - return $result; - } - } + if (array_key_exists($name, $this->data)) { + return $this->data[$name]; } - } - public function persistEntity() - { - $this->persistDependencies(); - // TODO fetch json representation and api persistence mechanism + return null; } - private function persistDependencies() + /** + * This function takes an array of entityTypes indexed by name and a string that represents the type of interest. + * The function returns an array of entityNames relevant to the specified type. + * + * @param string $fieldType + * @return array + */ + public function getLinkedEntitiesOfType($fieldType) { - // TODO call method to fetch json representation and api persistence mechanism + $groupedArray = array(); + + foreach ($this->linkedEntities as $entityName => $entityType) { + if ($entityType == $fieldType) { + $groupedArray[] = $entityName; + } + } + + return $groupedArray; } } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php new file mode 100644 index 000000000..8fd9e2555 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php @@ -0,0 +1,115 @@ +name = $name; + $this->operation = $operation; + $this->dataType = $dataType; + $this->apiMethod = $apiMethod; + $this->baseUrl = $apiUrl; + $this->auth = $auth; + $this->headers = $headers; + $this->params = $params; + $this->jsonMetadata = $jsonMetadata; + } + + public function getDataType() + { + return $this->dataType; + } + + public function getOperation() + { + return $this->operation; + } + + public function getApiMethod() + { + return $this->apiMethod; + } + + public function getApiUrl() + { + $this->cleanApiUrl(); + + if (array_key_exists('path', $this->params)) { + $this->addPathParam(); + } + + if (array_key_exists('query', $this->params)) { + $this->addQueryParams(); + } + + return $this->apiUrl; + } + + public function getAuth() + { + return $this->auth; + } + + public function getHeaders() + { + return $this->headers; + } + + public function getJsonMetadata() + { + return $this->jsonMetadata; + } + + private function cleanApiUrl() + { + if (substr($this->baseUrl, -1) == "/") { + $this->apiUrl = rtrim($this->baseUrl, "/"); + } else { + $this->apiUrl = $this->baseUrl; + } + } + + private function addPathParam() + { + foreach ($this->params['path'] as $paramName => $paramValue) { + $this->apiUrl = $this->apiUrl . "/" . $paramValue; + } + } + + private function addQueryParams() + { + + foreach ($this->params['query'] as $paramName => $paramValue) { + if (!stringContains("?", $this->apiUrl)) { + $this->apiUrl = $this->apiUrl . "?"; + } else { + $this->apiUrl = $this->apiUrl . "&"; + } + + $this->apiUrl = $paramName . "=" . $paramValue; + } + } + +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php new file mode 100644 index 000000000..3015031fa --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php @@ -0,0 +1,32 @@ +key = $key; + $this->value = $value; + $this->type = $type; + } + + public function getKey() + { + return $this->key; + } + + public function getValue() + { + return $this->value; + } + + public function getType() + { + return $this->type; + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataProfileSchemaParser.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php similarity index 85% rename from src/Magento/AcceptanceTestFramework/DataProfileSchemaParser.php rename to src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php index e5e1fa13a..4200b12a8 100644 --- a/src/Magento/AcceptanceTestFramework/DataProfileSchemaParser.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php @@ -6,7 +6,7 @@ * Time: 1:53 PM */ -namespace Magento\AcceptanceTestFramework; +namespace Magento\AcceptanceTestFramework\DataGenerator\Parsers; use Magento\AcceptanceTestFramework\Config\DataInterface; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php new file mode 100644 index 000000000..43964a2a8 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php @@ -0,0 +1,18 @@ +metadata = $metadata; + } + + public function readMetadata() + { + return $this->metadata->get(); + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd index cb3104627..4d413dcb6 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd @@ -22,7 +22,7 @@ - + @@ -37,7 +37,14 @@ - + + + + Element that contains a reference to non singular data/values. + + + + @@ -69,6 +76,19 @@ + + + + + + Individual piece of data to be passed in as part of the parrent array type. + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/EntityMetadata.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/EntityMetadata.xsd new file mode 100644 index 000000000..ed308dc71 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/EntityMetadata.xsd @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php new file mode 100644 index 000000000..ffe379760 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php @@ -0,0 +1,43 @@ +apiPath = $apiPath; + $this->headers = $headers; + $this->apiOperation = $apiOperation; + $this->jsonBody = $jsonBody; + + $this->curl = curl_init(); + } + + public function submit($verbose = false) + { + if ($this->jsonBody) { + curl_setopt($this->curl, CURLOPT_POSTFIELDS, $this->jsonBody); + } + + curl_setopt($this->curl, CURLOPT_VERBOSE, $verbose); + + curl_setopt_array($this->curl, array( + CURLOPT_RETURNTRANSFER => 1, + CURLOPT_HTTPHEADER => $this->headers, + CURLOPT_CUSTOMREQUEST => $this->apiOperation, + CURLOPT_URL => HOSTNAME . ':' . PORT . $this->apiPath + )); + + $response = curl_exec($this->curl); + curl_close($this->curl); + + return $response; + } +} From 665005c09cbb1a49e5dce71f732d2da684bea3cc Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Tue, 1 Aug 2017 13:56:46 -0500 Subject: [PATCH 098/149] MQE-224:Update Object Model to reflect updated XML schema - move Cest Objects into Test/Objects dir - change CestDataManager to CestArrayProcessor - update objects to reflect new schema --- entryPoint.php | 4 + etc/di.xml | 45 +- .../Test/ActionObject.php | 77 -- .../Test/CestDataConstants.php | 22 +- .../Test/CestDataManager.php | 192 --- .../Test/CestHookObject.php | 32 - .../Test/Managers/CestArrayProcessor.php | 253 ++++ .../Test/Objects/ActionObject.php | 56 + .../Test/Objects/CestHookObject.php | 25 + .../Test/{ => Objects}/CestObject.php | 13 +- .../Test/{ => Objects}/TestObject.php | 32 +- .../Test/etc/sampleCest.xml | 6 +- .../Test/etc/testSchema.xsd | 1227 +++++++++++++++-- 13 files changed, 1549 insertions(+), 435 deletions(-) delete mode 100644 src/Magento/AcceptanceTestFramework/Test/ActionObject.php delete mode 100644 src/Magento/AcceptanceTestFramework/Test/CestDataManager.php delete mode 100644 src/Magento/AcceptanceTestFramework/Test/CestHookObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Managers/CestArrayProcessor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php rename src/Magento/AcceptanceTestFramework/Test/{ => Objects}/CestObject.php (65%) rename src/Magento/AcceptanceTestFramework/Test/{ => Objects}/TestObject.php (72%) diff --git a/entryPoint.php b/entryPoint.php index 5bf976dfc..864abaf7f 100644 --- a/entryPoint.php +++ b/entryPoint.php @@ -1,3 +1,7 @@ create(\Magento\AcceptanceTestFramework\Dummy::class); +//$dummy->readPageObjects(); diff --git a/etc/di.xml b/etc/di.xml index 64a03c0ae..87d945df8 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -49,7 +49,24 @@ - + + + Magento\AcceptanceTestFramework\Page\Config\Data + + + + + Magento\AcceptanceTestFramework\Block\Config\Data + + + + + + Magento\AcceptanceTestFramework\Generate\GeneratePage + Magento\AcceptanceTestFramework\Generate\GenerateBlock + + + + - - + + diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index 175081655..a012f929e 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -1,105 +1,1172 @@ - + - - - - - - - + + + + + + + - - - - - - + + + + + - - + - - - - - - + + + + + + + + + + + - - + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - + - + - - - + + + + - - - - - - - - - - - - - + + + + + + + + + + - - + - - + + + + + - - - - - - Set to true to remove this element during parsing. - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c20770fb44abca4c14de21ad1ff3c7fc3c0f2093 Mon Sep 17 00:00:00 2001 From: John S Date: Tue, 1 Aug 2017 15:46:49 -0500 Subject: [PATCH 099/149] MQE-220 - Updated the XML-to-PHP generator to consume the declarative XML Test Schema. --- .gitignore | 4 +- etc/di.xml | 4 +- .../Test/etc/testSchema.xsd | 13 +- .../Util/GenerateTestsFromObjects.php | 697 ++++++++++++++++++ .../Util/TestGenerator.php | 431 ----------- 5 files changed, 709 insertions(+), 440 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php delete mode 100644 src/Magento/AcceptanceTestFramework/Util/TestGenerator.php diff --git a/.gitignore b/.gitignore index ed0d4c119..e8d88e61e 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .idea composer.phar -vendor/* \ No newline at end of file +vendor/* +.env +_generated diff --git a/etc/di.xml b/etc/di.xml index 87d945df8..f7bdbdd51 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -221,7 +221,7 @@ name name - mergeKey + mergeKey *Cest.xml Cest @@ -231,7 +231,7 @@ - mergeKey + mergeKey name name diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index a012f929e..2a80571cf 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -10,16 +10,16 @@ - + - + - + @@ -29,7 +29,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -998,6 +998,7 @@ + diff --git a/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php b/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php new file mode 100644 index 000000000..b1e57f6a9 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php @@ -0,0 +1,697 @@ +getCestData(); + return $cestOutput; +} + +function createCestFile($cestPhp, $filename) +{ + $exportDirectory = TESTS_BP . "/tests/acceptance/Magento/AcceptanceTest/_generated"; + $exportFilePath = sprintf("%s/%s.php", $exportDirectory, $filename); + + if (!is_dir($exportDirectory)) + { + mkdir($exportDirectory, 0777, true); + } + + $file = fopen($exportFilePath, 'w') or die('Unable to open file!'); + fwrite($file, $cestPhp); + fclose($file); +} + +function createAllCestFiles() +{ + $cestPhpArray = assembleAllCestPhp(); + + foreach ($cestPhpArray as $cestPhpFile) + { + createCestFile($cestPhpFile[1], $cestPhpFile[0]); + } +} + +function assembleCestPhp($cestObject) +{ + $usePhp = generateUseStatementsPhp(); + $classAnnotationsPhp = generateClassAnnotationsPhp($cestObject->getAnnotations()); + $className = $cestObject->getName(); + $hookPhp = generateHooksPhp($cestObject->getHooks()); + $testsPhp = generateTestsPhp($cestObject->getTests()); + + $cestPhp = "getName(); + $php = assembleCestPhp($cest); + $cestPhpArray[] = [$name, $php]; + } + + return $cestPhpArray; +} + +function generateUseStatementsPhp() +{ + $useStatementsPhp = "use Magento\AcceptanceTestFramework\AcceptanceTester;\n"; + + $allureStatements = ["Yandex\Allure\Adapter\Annotation\Features;", + "Yandex\Allure\Adapter\Annotation\Stories;", + "Yandex\Allure\Adapter\Annotation\Title;", + "Yandex\Allure\Adapter\Annotation\Description;", + "Yandex\Allure\Adapter\Annotation\Parameter;", + "Yandex\Allure\Adapter\Annotation\Severity;", + "Yandex\Allure\Adapter\Model\SeverityLevel;", + "Yandex\Allure\Adapter\Annotation\TestCaseId;\n"]; + + foreach ($allureStatements as $allureUseStatement) + { + $useStatementsPhp .= sprintf("use %s\n", $allureUseStatement); + } + + return $useStatementsPhp; +} + +function generateClassAnnotationsPhp($classAnnotationsObject) +{ + $classAnnotationsPhp = "/**\n"; + + foreach ($classAnnotationsObject as $annotationType => $annotationName) + { + if ($annotationType == "features") + { + $features = ""; + + foreach ($annotationName as $name) + { + $features .= sprintf("\"%s\"", $name); + + if (next($annotationName)) + { + $features .= ", "; + } + } + + $classAnnotationsPhp .= sprintf(" * @Features({%s})\n", $features); + } + + if ($annotationType == "stories") + { + $stories = ""; + + foreach ($annotationName as $name) + { + $stories .= sprintf("\"%s\"", $name); + + if (next($annotationName)) + { + $stories .= ", "; + } + } + + $classAnnotationsPhp .= sprintf(" * @Stories({%s})\n", $stories); + } + + if ($annotationType == "title") + { + $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); + } + + if ($annotationType == "description") + { + $classAnnotationsPhp .= sprintf(" * @Description(\"%s\")\n", $annotationName[0]); + } + + if ($annotationType == "severity") + { + $classAnnotationsPhp .= sprintf(" * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); + } + + if ($annotationType == "testCaseId") + { + $classAnnotationsPhp .= sprintf(" * TestCaseId(\"%s\")", $annotationName[0]); + } + + if ($annotationType == "group") + { + foreach ($annotationName as $group) + { + $classAnnotationsPhp .= sprintf(" * @group %s\n", $group); + } + } + + if ($annotationType == "env") + { + foreach ($annotationName as $env) + { + $classAnnotationsPhp .= sprintf(" * @env %s\n", $env); + } + } + } + + $classAnnotationsPhp .= " */\n"; + + return $classAnnotationsPhp; +} + +function generateStepsPhp($stepsObject) +{ + $testSteps = ""; + + foreach ($stepsObject as $steps) + { + $actor = "I"; + $actionName = $steps->getType(); + $selector = null; + $input = null; + $parameterArray = null; + $returnVariable = null; + $x = null; + $y = null; + $html = null; + $url = null; + $function = null; + $time = null; + + if (isset($steps->getCustomActionAttributes()['returnVariable'])) { + $returnVariable = $steps->getCustomActionAttributes()['returnVariable']; + } + + if (isset($steps->getCustomActionAttributes()['url']) && isset($steps->getCustomActionAttributes()['userInput'])) { + $input = sprintf("\"%s\"", $steps->getCustomActionAttributes()['userInput']); + } else if (isset($steps->getCustomActionAttributes()['userInput'])) { + $input = sprintf("\"%s\"", $steps->getCustomActionAttributes()['userInput']); + } else if (isset($steps->getCustomActionAttributes()['url'])) { + $input = sprintf("\"%s\"", $steps->getCustomActionAttributes()['url']); + } else if (isset($steps->getCustomActionAttributes()['time'])) { + $input = sprintf("\"%s\"", $steps->getCustomActionAttributes()['time']); + } + + if (isset($steps->getCustomActionAttributes()['parameterArray'])) { + $parameterArray = $steps->getCustomActionAttributes()['parameterArray']; + } + + if (isset($steps->getCustomActionAttributes()['selectorArray'])) { + $selector = sprintf("%s", $steps->getCustomActionAttributes()['selectorArray']); + } else if (isset($steps->getCustomActionAttributes()['selector'])) { + $selector = sprintf("\"%s\"", $steps->getCustomActionAttributes()['selector']); + } + + if (isset($steps->getCustomActionAttributes()['x'])) { + $x = $steps->getCustomActionAttributes()['x']; + } + + if (isset($steps->getCustomActionAttributes()['y'])) { + $y = $steps->getCustomActionAttributes()['y']; + } + + if (isset($steps->getCustomActionAttributes()['function'])) { + $function = $steps->getCustomActionAttributes()['function']; + } + + if (isset($steps->getCustomActionAttributes()['html'])) { + $html = $steps->getCustomActionAttributes()['html']; + } + + if (isset($steps->getCustomActionAttributes()['time'])) { + $time = $steps->getCustomActionAttributes()['time']; + } + + switch ($actionName) { + case "amOnPage": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "amOnSubdomain": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "amOnUrl": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "click": + if ($input && $selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); + } else if ($input && !$selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } else if (!$input && $selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "clickWithLeftButton": + if ($selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + } else { + $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); + } + break; + case "clickWithRightButton": + if ($selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + } else { + $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); + } + break; + case "dontSee": + if ($selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "dontSeeCookie": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "dontSeeCurrentUrlEquals": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "dontSeeCurrentUrlMatches": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "dontSeeElement": + if ($parameterArray) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "dontSeeElementInDOM": + if ($parameterArray) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "dontSeeInCurrentUrl": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "dontSeeInField": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; + case "dontSeeInFormFields": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + break; + case "dontSeeInSource": + // TODO: Solve the HTML parsing issue. + $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $html); + break; + case "dontSeeLink": + if (isset($steps->getCustomActionAttributes()['url'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $steps->getCustomActionAttributes()['url']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "dragAndDrop": + $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $steps->getCustomActionAttributes()['selector1'], $steps->getCustomActionAttributes()['selector2']); + break; + case "executeInSelenium": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $function); + break; + case "executeJS": + $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $function); + break; + case "fillField": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; + case "grabCookie": + if (isset($returnVariable)) { + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); + } + } else { + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + } + break; + case "grabFromCurrentUrl": + if (isset($returnVariable)) { + if ($input) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); + } + } else { + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + } + break; + case "grabValueFrom": + if (isset($returnVariable)) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "moveMouseOver": + if ($selector) { + if (isset($step['x']) || isset($step['y'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + } else { + $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); + } + break; + case "performOn": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $function); + break; + case "pressKey": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + } + break; + case "resetCookie": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "resizeWindow": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $steps->getCustomActionAttributes()['width'], $steps->getCustomActionAttributes()['height']); + break; + case "scrollTo": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + break; + case "see": + if (isset($steps->getCustomActionAttributes()['selector'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "seeCookie": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "seeCurrentUrlEquals": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "seeCurrentUrlMatches": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "seeElement": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "seeElementInDOM": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "seeInCurrentUrl": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "seeInField": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; + case "seeInFormFields": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + break; + case "seeInPageSource": + // TODO: Solve the HTML parsing issue. + break; + case "seeInSource": + // TODO: Solve the HTML parsing issue. + break; + case "seeLink": + if (isset($step['url'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $steps->getCustomActionAttributes()['url']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "seeNumberOfElements": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $steps->getCustomActionAttributes()['userInput']); + break; + case "selectOption": + if ($parameterArray) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + } + break; + case "setCookie": + if ($parameterArray) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", %s);\n", $actor, $actionName, $input, $steps->getCustomActionAttributes()['value'], $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $steps->getCustomActionAttributes()['value']); + } + break; + case "submitForm": + if (isset($step['button'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", \"%s\");\n", $actor, $actionName, $selector, $parameterArray, $steps->getCustomActionAttributes()['button']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $parameterArray); + } + break; + case "wait": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); + break; + case "waitForElement": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $time); + break; + case "waitForElementChange": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $function, $time); + break; + case "waitForJS": + $testSteps .= sprintf("\t\t$%s->%s(\"%s\", %s);\n", $actor, $actionName, $function, $time); + break; + case "waitForText": + if ($selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $input, $time, $selector); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $time); + } + break; + default: + if ($returnVariable) { + if ($selector) { + if (isset($steps->getCustomActionAttributes()['userInput'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, \"%s\");\n", $returnVariable, $actor, $actionName, $selector, $steps->getCustomActionAttributes()['userInput']); + } else if (isset($steps->getCustomActionAttributes()['parameter'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $steps->getCustomActionAttributes()['parameter']); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); + } + } else { + if (isset($steps->getCustomActionAttributes()['userInput'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $actionName, $steps->getCustomActionAttributes()['userInput']); + } else if (isset($steps->getCustomActionAttributes()['parameter'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $steps->getCustomActionAttributes()['parameter']); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); + } + } + } else { + if ($selector) { + if (isset($steps->getCustomActionAttributes()['userInput'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $steps->getCustomActionAttributes()['userInput']); + } else if (isset($steps->getCustomActionAttributes()['parameter'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $steps->getCustomActionAttributes()['parameter']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + } else { + if (isset($steps->getCustomActionAttributes()['userInput'])) { + $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $steps->getCustomActionAttributes()['userInput']); + } else if (isset($steps->getCustomActionAttributes()['parameter'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $steps->getCustomActionAttributes()['parameter']); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + } + } + } + } + + return $testSteps; +} + +function generateHooksPhp($hookObjects) +{ + $hooks = ""; + foreach ($hookObjects as $hookObject) + { + $type = $hookObject->getType(); + $dependencies = 'AcceptanceTester $I'; + $steps = generateStepsPhp($hookObject->getActions()); + + if ($type == "after") + { + $hooks .= sprintf("\tpublic function _after(%s)\n", $dependencies); + $hooks .= "\t{\n"; + $hooks .= $steps; + $hooks .= "\t}\n\n"; + } + + if ($type == "before") + { + $hooks .= sprintf("\tpublic function _before(%s)\n", $dependencies); + $hooks .= "\t{\n"; + $hooks .= $steps; + $hooks .= "\t}\n\n"; + } + + $hooks .= ""; + } + + return $hooks; +} + +function generateTestAnnotationsPhp($testAnnotationsObject) +{ + $testAnnotationsPhp = "\t/**\n"; + + foreach ($testAnnotationsObject as $annotationType => $annotationName) + { + if ($annotationType == "features") + { + $features = ""; + + foreach ($annotationName as $name) + { + $features .= sprintf("\"%s\"", $name); + + if (next($annotationName)) + { + $features .= ", "; + } + } + + $testAnnotationsPhp .= sprintf("\t * @Features({%s})\n", $features); + } + + if ($annotationType == "stories") + { + $stories = ""; + + foreach ($annotationName as $name) + { + $stories .= sprintf("\"%s\"", $name); + + if (next($annotationName)) + { + $stories .= ", "; + } + } + + $testAnnotationsPhp .= sprintf("\t * @Stories({%s})\n", $stories); + } + + if ($annotationType == "title") + { + $testAnnotationsPhp .= sprintf("\t * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); + } + + if ($annotationType == "description") + { + $testAnnotationsPhp .= sprintf("\t * @Description(\"%s\")\n", $annotationName[0]); + } + + if ($annotationType == "severity") + { + $testAnnotationsPhp .= sprintf("\t * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); + } + + if ($annotationType == "testCaseId") + { + $testAnnotationsPhp .= sprintf("\t * @TestCaseId(\"%s\")\n", $annotationName[0]); + } + } + + $testAnnotationsPhp .= sprintf("\t * @Parameter(name = \"%s\", value=\"$%s\")\n", "AcceptanceTester", "I"); + + foreach ($testAnnotationsObject as $annotationType => $annotationName) { + if ($annotationType == "group") + { + foreach ($annotationName as $name) + { + $testAnnotationsPhp .= sprintf("\t * @group %s\n", $name); + } + } + + if ($annotationType == "env") + { + foreach ($annotationName as $env) + { + $testAnnotationsPhp .= sprintf("\t * @env %s\n", $env); + } + } + } + + $testAnnotationsPhp .= sprintf("\t * @param %s $%s\n", "AcceptanceTester", "I"); + $testAnnotationsPhp .= "\t * @return void\n"; + $testAnnotationsPhp .= "\t */\n"; + + return $testAnnotationsPhp; +} + +function generateTestsPhp($testsObject) +{ + $testPhp = ""; + + foreach ($testsObject as $test) + { + $testName = $test->getName(); + $testAnnotations = generateTestAnnotationsPhp($test->getAnnotations()); + $dependencies = 'AcceptanceTester $I'; + $steps = generateStepsPhp($test->getOrderedActions()); + + $testPhp .= $testAnnotations; + $testPhp .= sprintf("\tpublic function %s(%s)\n", $testName, $dependencies); + $testPhp .= "\t{\n"; + $testPhp .= $steps; + $testPhp .= "\t}\n"; + + if (sizeof($testsObject) > 1) + { + $testPhp .= "\n"; + } + } + + return $testPhp; +} + +createAllCestFiles(); diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php deleted file mode 100644 index 43f4d2c9a..000000000 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ /dev/null @@ -1,431 +0,0 @@ -getName(); - $php = assembleCestPhp($cest); - $cestPhpArray[] = [$name, $php]; - } - - return $cestPhpArray; -} - -function assembleCestPhp($cestObject) -{ - $namespacePath = "Magento\AcceptanceTest\Backend"; - $usePhp = generateUseStatementsPhp($cestObject->getUseStatements()); - $classAnnotationsPhp = generateClassAnnotationsPhp($cestObject->getAnnotations()); - $className = $cestObject->getName(); - $hookPhp = generateHooksPhp($cestObject->getHooks()); - $testsPhp = generateTestsPhp($cestObject->getTests()); - - $cestPhp = " $annotationName) - { - if ($annotationType == "features") - { - $features = ""; - - foreach ($annotationName as $name) - { - $features .= sprintf("\"%s\"", $name); - - if (next($annotationName)) - { - $features .= ", "; - } - } - - $classAnnotationsPhp .= sprintf(" * @Features({%s})\n", $features); - } - - if ($annotationType == "stories") - { - $stories = ""; - - foreach ($annotationName as $name) - { - $stories .= sprintf("\"%s\"", $name); - - if (next($annotationName)) - { - $stories .= ", "; - } - } - - $classAnnotationsPhp .= sprintf(" * @Stories({%s})\n", $stories); - } - - if ($annotationType == "title") - { - $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); - } - - if ($annotationType == "description") - { - $classAnnotationsPhp .= sprintf(" * @Description(\"%s\")\n", $annotationName[0]); - } - - if ($annotationType == "severity") - { - $classAnnotationsPhp .= sprintf(" * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); - } - - if ($annotationType == "testCaseId") - { - $classAnnotationsPhp .= sprintf(" * TestCaseId(\"%s\")", $annotationName[0]); - } - - if ($annotationType == "group") - { - foreach ($annotationName as $group) - { - $classAnnotationsPhp .= sprintf(" * @group %s\n", $group); - } - } - - if ($annotationType == "env") - { - foreach ($annotationName as $env) - { - $classAnnotationsPhp .= sprintf(" * @env %s\n", $env); - } - } - } - - $classAnnotationsPhp .= " */\n"; - - return $classAnnotationsPhp; -} - -function generateDependencyString($dependenciesObject) -{ - $dependencyString = ""; - - if ($dependenciesObject) - { - foreach ($dependenciesObject as $name => $actor) - { - $dependencyString .= sprintf("%s $%s", $name, $actor); - - if (next($dependenciesObject)) - { - $dependencyString .= ", "; - } - } - } - - return $dependencyString; -} - -function generateStepsPhp($stepsObject) -{ - $stepsPhp = ""; - - foreach ($stepsObject as $steps) - { - $actor = $steps->getActor(); - $returnVariable = $steps->getReturnVariable(); - $function = $steps->getFunction(); - $parameter = $steps->getParameter(); - $userInput = $steps->getUserInput(); - $selector = $steps->getSelector(); - - if (!$actor) - { - $actor = "I"; - } - - if ($returnVariable) - { - if ($userInput) - { - $stepsPhp .= sprintf("\t\t$%s = $%s->%s(\"%s\", \"%s\");\n", $returnVariable, $actor, $function, $selector, $userInput); - } else if ($parameter) - { - $stepsPhp .= sprintf("\t\t$%s = $%s->%s(\"%s\", %s);\n", $returnVariable, $actor, $function, $selector, $parameter); - } else if ($selector) - { - $stepsPhp .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $function, $selector); - } else - { - $stepsPhp .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $function); - } - } else if ($selector) - { - if ($userInput) - { - $stepsPhp .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $function, $selector, $userInput); - } else if ($parameter) - { - $stepsPhp .= sprintf("\t\t$%s->%s(\"%s\", %s);\n", $actor, $function, $selector, $parameter); - } else - { - $stepsPhp .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $function, $selector); - } - } else - { - if ($userInput) - { - $stepsPhp .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $function, $userInput); - } else if ($parameter) - { - $stepsPhp .= sprintf("\t\t$%s->%s(%s);\n", $actor, $function, $parameter); - } else - { - $stepsPhp .= sprintf("\t\t$%s->%s();\n", $actor, $function); - } - } - } - - return $stepsPhp; -} - -function generateHooksPhp($hookObjects) -{ - $hooks = ""; - foreach ($hookObjects as $hookObject) - { - foreach ($hookObject as $hookItem) - { - $type = $hookItem->getType(); - $dependencies = generateDependencyString($hookItem->getDependencies()); - $steps = generateStepsPhp($hookItem->getActions()); - - if ($type == "after") - { - $hooks .= sprintf("\tpublic function _after(%s)\n", $dependencies); - $hooks .= "\t{\n"; - $hooks .= $steps; - $hooks .= "\t}\n\n"; - } - - if ($type == "before") - { - $hooks .= sprintf("\tpublic function _before(%s)\n", $dependencies); - $hooks .= "\t{\n"; - $hooks .= $steps; - $hooks .= "\t}\n\n"; - } - - $hooks .= ""; - } - } - - return $hooks; -} - -function generateTestAnnotationsPhp($testAnnotationsObject, $testDependenciesObject) -{ - $testAnnotationsPhp = "\t/**\n"; - - foreach ($testAnnotationsObject as $annotationType => $annotationName) - { - if ($annotationType == "features") - { - $features = ""; - - foreach ($annotationName as $name) - { - $features .= sprintf("\"%s\"", $name); - - if (next($annotationName)) - { - $features .= ", "; - } - } - - $testAnnotationsPhp .= sprintf("\t * @Features({%s})\n", $features); - } - - if ($annotationType == "stories") - { - $stories = ""; - - foreach ($annotationName as $name) - { - $stories .= sprintf("\"%s\"", $name); - - if (next($annotationName)) - { - $stories .= ", "; - } - } - - $testAnnotationsPhp .= sprintf("\t * @Stories({%s})\n", $stories); - } - - if ($annotationType == "title") - { - $testAnnotationsPhp .= sprintf("\t * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); - } - - if ($annotationType == "description") - { - $testAnnotationsPhp .= sprintf("\t * @Description(\"%s\")\n", $annotationName[0]); - } - - if ($annotationType == "severity") - { - $testAnnotationsPhp .= sprintf("\t * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); - } - - if ($annotationType == "testCaseId") - { - $testAnnotationsPhp .= sprintf("\t * @TestCaseId(\"%s\")\n", $annotationName[0]); - } - } - - foreach ($testDependenciesObject as $name => $actor) - { - if ($name) - { - $testAnnotationsPhp .= sprintf("\t * @Parameter(name = \"%s\", value = \"$%s\")\n", $name, $actor); - } - } - - foreach ($testAnnotationsObject as $annotationType => $annotationName) { - if ($annotationType == "group") - { - foreach ($annotationName as $name) - { - $testAnnotationsPhp .= sprintf("\t * @group %s\n", $name); - } - } - - if ($annotationType == "env") - { - foreach ($annotationName as $env) - { - $testAnnotationsPhp .= sprintf("\t * @env %s\n", $env); - } - } - } - - foreach ($testDependenciesObject as $name => $actor) - { - if ($name) - { - $testAnnotationsPhp .= sprintf("\t * @param %s $%s\n", $name, $actor); - } - } - - $testAnnotationsPhp .= "\t * @return void\n"; - $testAnnotationsPhp .= "\t */\n"; - - return $testAnnotationsPhp; -} - -function generateTestsPhp($testsObject) -{ - $testPhp = ""; - - foreach ($testsObject as $test) - { - $testName = $test->getName(); - $testAnnotations = generateTestAnnotationsPhp($test->getAnnotations(), $test->getDependencies()); - $dependencies = generateDependencyString($test->getDependencies()); - $steps = generateStepsPhp($test->getOrderedActions()); - - $testPhp .= $testAnnotations; - $testPhp .= sprintf("\tpublic function %s(%s)\n", $testName, $dependencies); - $testPhp .= "\t{\n"; - $testPhp .= $steps; - $testPhp .= "\t}\n"; - - if (sizeof($testsObject) > 1) - { - $testPhp .= "\n"; - } - } - - return $testPhp; -} \ No newline at end of file From c285653727565f64b20f26acb05d347e1304b660 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Thu, 3 Aug 2017 15:03:54 -0500 Subject: [PATCH 100/149] MQE-233 [Customizability] Update Object Model to handle special behaviors (#3) * MQE-233 Cleanup Rebranching and re-publish. * MQE-233 Cleanup and Rebranching fixes --- .../Test/Objects/ActionObject.php | 53 ++++++++++++++++++- .../Test/Objects/TestObject.php | 28 ++++++++-- 2 files changed, 76 insertions(+), 5 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 96b9331eb..3af2d3a43 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -2,6 +2,9 @@ namespace Magento\AcceptanceTestFramework\Test\Objects; +use Magento\AcceptanceTestFramework\PageObject\Page\Page; +use Magento\AcceptanceTestFramework\PageObject\Section\Section; + class ActionObject { private $mergeKey; @@ -9,6 +12,8 @@ class ActionObject private $actionAttributes = []; private $linkedAction; private $orderOffset = 0; + private $resolvedCustomAttributes = []; + private $timeout; public function __construct($mergeKey, $type, $actionAttributes, $linkedAction = null, $order = 0) { @@ -37,11 +42,13 @@ public function getType() * the tag has 3 attributes, * only 2 of which are specific to the 'seeNumberOfElements' tag. As a result this function would * return the array would return [selector => value1, expected => value2] + * The returned array is also the merged result of the resolved and normal actions, giving + * priority to the resolved actions (resolved selector instead of section.element, etc). * @return array */ public function getCustomActionAttributes() { - return $this->actionAttributes; + return array_merge($this->actionAttributes, $this->resolvedCustomAttributes); } public function getLinkedAction() @@ -53,4 +60,46 @@ public function getOrderOffset() { return $this->orderOffset; } -} + + public function getTimeout() + { + return $this->timeout; + } + + /** + * Resolves all references + */ + public function resolveReferences() + { + if(empty($this->resolvedCustomAttributes)){ + $this->resolveSelectorReference(); + $this->resolveUrlReference(); + } + } + + /** + * Checks if selector is an attribute, and if the selector refers to a defined section. + * If not, assume selector is CSS/xpath literal and leave it be. + */ + private function resolveSelectorReference() + { + if(array_key_exists('selector', $this->actionAttributes) + and array_key_exists(strtok($this->actionAttributes['selector'], '.'), Section::getSection()) ) { + list($section, $element) = explode('.', $this->actionAttributes['selector']); + $this->resolvedCustomAttributes['selector'] = Section::getElementLocator($section, $element); + $this->timeout = Section::getElementTimeOut($section, $element); + } + } + + /** + * Checks if url is an attribute, and if the url given is a defined page. + * If not, assume url is literal and leave it be. + */ + private function resolveUrlReference() + { + if (array_key_exists('url', $this->actionAttributes) + and array_key_exists($this->actionAttributes['url'], Page::getPage())) { + $this->resolvedCustomAttributes['url'] = $_ENV['MAGENTO_BASE_URL'] . Page::getPageUrl($this->actionAttributes['url']); + } + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index a937e1b32..be0d45153 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -39,6 +39,7 @@ public function getAnnotations() public function getOrderedActions() { $this->mergeActions(); + $this->insertWaits(); return $this->orderedSteps; } @@ -50,6 +51,7 @@ public function getOrderedActions() private function sortActions() { foreach ($this->parsedSteps as $parsedStep) { + $parsedStep->resolveReferences(); if ($parsedStep->getLinkedAction()) { $this->stepsToMerge[$parsedStep->getMergeKey()] = $parsedStep; } else { @@ -98,10 +100,30 @@ private function mergeAction($stepToMerge) $this->mergeAction($this->stepsToMerge[$linkedStep]); } - $position = array_search($linkedStep, array_keys($this->orderedSteps)) + $stepToMerge->getOrderOffset(); + $this->insertStep($stepToMerge); + } + + /** + * Runs through the prepared orderedSteps and calls insertWait if a step requires a wait after it. + * @return void + */ + private function insertWaits() + { + foreach ($this->orderedSteps as $step) { + + if ($step->getTimeout()) { + $waitStepAttributes = array('timeout' => $step->getTimeout()); + $waitStep = new ActionObject($step->getMergeKey() . 'WaitForPageLoad', 'waitForPageLoad', $waitStepAttributes, $step->getMergeKey(), 'after'); + $this->insertStep($waitStep); + } + } + } + + private function insertStep($stepToMerge) + { + $position = array_search($stepToMerge->getLinkedAction(), array_keys($this->orderedSteps)) + $stepToMerge->getOrderOffset(); $previous_items = array_slice($this->orderedSteps, 0, $position, true); $next_items = array_slice($this->orderedSteps, $position, null, true); $this->orderedSteps = $previous_items + [$stepToMerge->getMergeKey() => $stepToMerge] + $next_items; } - -} +} \ No newline at end of file From 4b3c37a1d5dc4754a508d09f8b4dee0dad0317c0 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Wed, 9 Aug 2017 15:18:59 -0500 Subject: [PATCH 101/149] MQE-230: Update test schema and object model to reference data dependencies --- .env.example | 1 + etc/di.xml | 4 +- .../Test/Objects/ActionObject.php | 147 ++++++++++++++++-- .../Test/Objects/TestObject.php | 2 +- .../Test/etc/testSchema.xsd | 24 +++ 5 files changed, 158 insertions(+), 20 deletions(-) diff --git a/.env.example b/.env.example index 7c5a937ea..7481eddb7 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ MAGENTO_ADMIN_USERNAME=admin MAGENTO_ADMIN_PASSWORD=test123 +MAGENTO_BASE_URL=http://127.0.0.1:32769/ TESTS_BP=/Users/dev/somepath/magento2ce-acceptance-tests FW_BP=/Users/dev/somepath/magento2-acceptance-test-framework diff --git a/etc/di.xml b/etc/di.xml index f7bdbdd51..7ab95b928 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -221,7 +221,7 @@ name name - mergeKey + mergeKey *Cest.xml Cest @@ -231,7 +231,7 @@ - mergeKey + mergeKey name name diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 3af2d3a43..2b24cd61e 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -4,6 +4,7 @@ use Magento\AcceptanceTestFramework\PageObject\Page\Page; use Magento\AcceptanceTestFramework\PageObject\Section\Section; +use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager; class ActionObject { @@ -67,39 +68,151 @@ public function getTimeout() } /** - * Resolves all references + * Populate the resolved custom attributes array with lookup values for the following attributes: + * + * selector + * url + * userInput + * + * @return void */ public function resolveReferences() { - if(empty($this->resolvedCustomAttributes)){ - $this->resolveSelectorReference(); + if (empty($this->resolvedCustomAttributes)) { + $this->resolveSelectorReferenceAndTimeout(); $this->resolveUrlReference(); + $this->resolveUserInputReference(); } } /** - * Checks if selector is an attribute, and if the selector refers to a defined section. - * If not, assume selector is CSS/xpath literal and leave it be. + * Look up the selector for SomeSectionName.ElementName and set it as the selector attribute in the + * resolved custom attributes. Also set the timeout value. + * + * e.g. {{SomeSectionName.ElementName}} becomes #login-button + * + * @return void */ - private function resolveSelectorReference() + private function resolveSelectorReferenceAndTimeout() { - if(array_key_exists('selector', $this->actionAttributes) - and array_key_exists(strtok($this->actionAttributes['selector'], '.'), Section::getSection()) ) { - list($section, $element) = explode('.', $this->actionAttributes['selector']); - $this->resolvedCustomAttributes['selector'] = Section::getElementLocator($section, $element); - $this->timeout = Section::getElementTimeOut($section, $element); + if (!array_key_exists('selector', $this->actionAttributes)) { + return; } + $selector = $this->actionAttributes['selector']; + + $reference = $this->findReference($selector); + if ($reference == null) { + // Nothing to replace + return; + } + + list($sectionName, $elementName) = $this->stripAndSplitReference($reference); + $section = Section::getSection($sectionName); + if ($section == null) { + // Bad section reference + return; + } + $replacement = Section::getElementLocator($sectionName, $elementName); + + $this->resolvedCustomAttributes['selector'] = str_replace($reference, $replacement, $selector); + $this->timeout = Section::getElementTimeOut($sectionName, $elementName); } /** - * Checks if url is an attribute, and if the url given is a defined page. - * If not, assume url is literal and leave it be. + * Look up the url for SomePageName and set it, with MAGENTO_BASE_URL prepended, as the url attribute in the + * resolved custom attributes. + * + * e.g. {{SomePageName}} becomes http://localhost:76543/some/url + * + * @return void */ private function resolveUrlReference() { - if (array_key_exists('url', $this->actionAttributes) - and array_key_exists($this->actionAttributes['url'], Page::getPage())) { - $this->resolvedCustomAttributes['url'] = $_ENV['MAGENTO_BASE_URL'] . Page::getPageUrl($this->actionAttributes['url']); + if (!array_key_exists('url', $this->actionAttributes)) { + return; + } + $url = $this->actionAttributes['url']; + + $reference = $this->findReference($url); + if ($reference == null) { + // Nothing to replace + return; + } + + list($pageName) = $this->stripAndSplitReference($reference); + $page = Page::getPage($pageName); + if ($page == null) { + // Bad page reference + return; + } + $replacement = $_ENV['MAGENTO_BASE_URL'] . Page::getPageUrl($pageName); + + $this->resolvedCustomAttributes['url'] = str_replace($reference, $replacement, $url); + } + + + /** + * Look up the value for EntityDataObjectName.Key and set it as the userInput attribute in the resolved custom + * attributes. + * + * e.g. {{CustomerEntityFoo.FirstName}} becomes Jerry + * + * @return void + */ + private function resolveUserInputReference() + { + if (!array_key_exists('userInput', $this->actionAttributes)) { + return; + } + $userInput = $this->actionAttributes['userInput']; + + $reference = $this->findReference($userInput); + if ($reference == null) { + // Nothing to replace + return; + } + + list($entityName, $entityKey) = $this->stripAndSplitReference($userInput); + $entityObj = DataManager::getInstance()->getEntity($entityName); + if ($entityObj == null) { + // Bad entity reference + return; + } + + $replacement = $entityObj->getDataByName($entityKey); + if ($replacement == null) { + // Bad entity.key reference + return; + } + + $this->resolvedCustomAttributes['userInput'] = str_replace($reference, $replacement, $userInput); + } + + /** + * Return an array containing the name (before the period) and key (after the period) in a {{reference.foo}}. + * + * @param string $reference + * @return string[] The name and key that is referenced. + */ + private function stripAndSplitReference($reference) + { + $strippedReference = str_replace('}}', '', str_replace('{{', '', $reference)); + return explode('.', $strippedReference); + } + + /** + * Return a {{reference.foo}} if it exists in the string. + * + * @param string $str + * @return string|null + */ + private function findReference($str) + { + preg_match('/{{[\w.]+}}/', $str, $matches); + if (empty($matches)) { + return null; + } else { + return $matches[0]; } } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index be0d45153..199869777 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -126,4 +126,4 @@ private function insertStep($stepToMerge) $next_items = array_slice($this->orderedSteps, $position, null, true); $this->orderedSteps = $previous_items + [$stepToMerge->getMergeKey() => $stepToMerge] + $next_items; } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index 2a80571cf..a42ef1a9e 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -53,6 +53,8 @@ + + @@ -276,6 +278,28 @@ + + + + + + + + + + + + + + + + + + + + + + From 684bc07fbed2a2c4be3a1837c8b917690ca7376a Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 10 Aug 2017 10:20:47 -0500 Subject: [PATCH 102/149] - MQE-244 - Add Custom Functions to the Test Generator, XLM Schema and DI file. - Merging to Sprint-Develop. --- composer.lock | 161 ++++++----- etc/di.xml | 4 +- .../Module/MagentoWebDriver.php | 88 +++++-- .../Test/etc/testSchema.xsd | 145 ++++++++++ .../Util/GenerateTestsFromObjects.php | 249 +++++++++++++----- 5 files changed, 469 insertions(+), 178 deletions(-) diff --git a/composer.lock b/composer.lock index 33a6a3722..2dca5b611 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,6 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "0f1b9e63e095d2fd8ef798ef2e0d45d6", "content-hash": "914002cc8b4343fa30ba1b75bd356c68", "packages": [ { @@ -64,7 +63,7 @@ "gherkin", "parser" ], - "time": "2016-10-30 11:50:56" + "time": "2016-10-30T11:50:56+00:00" }, { "name": "codeception/codeception", @@ -158,36 +157,36 @@ "functional testing", "unit testing" ], - "time": "2017-05-22 23:47:35" + "time": "2017-05-22T23:47:35+00:00" }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -212,7 +211,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "facebook/webdriver", @@ -264,7 +263,7 @@ "selenium", "webdriver" ], - "time": "2017-04-28 14:54:49" + "time": "2017-04-28T14:54:49+00:00" }, { "name": "flow/jsonpath", @@ -305,7 +304,7 @@ } ], "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2016-09-06 17:43:18" + "time": "2016-09-06T17:43:18+00:00" }, { "name": "fzaninotto/faker", @@ -353,7 +352,7 @@ "faker", "fixtures" ], - "time": "2016-04-29 12:21:54" + "time": "2016-04-29T12:21:54+00:00" }, { "name": "guzzlehttp/guzzle", @@ -418,7 +417,7 @@ "rest", "web service" ], - "time": "2017-06-22 18:50:49" + "time": "2017-06-22T18:50:49+00:00" }, { "name": "guzzlehttp/promises", @@ -469,7 +468,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20 10:07:11" + "time": "2016-12-20T10:07:11+00:00" }, { "name": "guzzlehttp/psr7", @@ -534,7 +533,7 @@ "uri", "url" ], - "time": "2017-03-20 17:10:46" + "time": "2017-03-20T17:10:46+00:00" }, { "name": "myclabs/deep-copy", @@ -576,7 +575,7 @@ "object", "object graph" ], - "time": "2017-04-12 18:52:22" + "time": "2017-04-12T18:52:22+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -630,7 +629,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -675,7 +674,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-07-15 11:38:20" + "time": "2017-07-15T11:38:20+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -722,7 +721,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14 14:27:02" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", @@ -785,7 +784,7 @@ "spy", "stub" ], - "time": "2017-03-02 20:05:34" + "time": "2017-03-02T20:05:34+00:00" }, { "name": "phpunit/php-code-coverage", @@ -848,7 +847,7 @@ "testing", "xunit" ], - "time": "2017-04-02 07:44:40" + "time": "2017-04-02T07:44:40+00:00" }, { "name": "phpunit/php-file-iterator", @@ -895,7 +894,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -936,7 +935,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -985,33 +984,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26 11:10:40" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.11", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "reference": "ecb0b2cdaa0add708fe6f329ef65ae0c5225130b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ecb0b2cdaa0add708fe6f329ef65ae0c5225130b", + "reference": "ecb0b2cdaa0add708fe6f329ef65ae0c5225130b", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1034,7 +1033,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27 10:12:30" + "time": "2017-08-03T14:17:41+00:00" }, { "name": "phpunit/phpunit", @@ -1116,7 +1115,7 @@ "testing", "xunit" ], - "time": "2017-06-21 08:11:54" + "time": "2017-06-21T08:11:54+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -1175,7 +1174,7 @@ "mock", "xunit" ], - "time": "2017-06-30 09:13:00" + "time": "2017-06-30T09:13:00+00:00" }, { "name": "psr/http-message", @@ -1225,7 +1224,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", @@ -1272,7 +1271,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1317,7 +1316,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04 06:30:41" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", @@ -1381,7 +1380,7 @@ "compare", "equality" ], - "time": "2017-01-29 09:50:25" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", @@ -1433,7 +1432,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22 07:24:03" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -1483,7 +1482,7 @@ "environment", "hhvm" ], - "time": "2016-11-26 07:53:53" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", @@ -1550,7 +1549,7 @@ "export", "exporter" ], - "time": "2016-11-19 08:54:04" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", @@ -1601,7 +1600,7 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/object-enumerator", @@ -1647,7 +1646,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18 15:18:39" + "time": "2017-02-18T15:18:39+00:00" }, { "name": "sebastian/recursion-context", @@ -1700,7 +1699,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19 07:33:16" + "time": "2016-11-19T07:33:16+00:00" }, { "name": "sebastian/resource-operations", @@ -1742,7 +1741,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", @@ -1785,7 +1784,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "stecman/symfony-console-completion", @@ -1830,11 +1829,11 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24 05:08:54" + "time": "2016-02-24T05:08:54+00:00" }, { "name": "symfony/browser-kit", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -1887,20 +1886,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-07-12 13:03:20" + "time": "2017-07-12T13:03:20+00:00" }, { "name": "symfony/console", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a97e45d98c59510f085fa05225a1acb74dfe0546" + "reference": "b0878233cb5c4391347e5495089c7af11b8e6201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a97e45d98c59510f085fa05225a1acb74dfe0546", - "reference": "a97e45d98c59510f085fa05225a1acb74dfe0546", + "url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201", + "reference": "b0878233cb5c4391347e5495089c7af11b8e6201", "shasum": "" }, "require": { @@ -1956,11 +1955,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-07-03 13:19:36" + "time": "2017-07-29T21:27:59+00:00" }, { "name": "symfony/css-selector", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2009,20 +2008,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01 15:01:29" + "time": "2017-05-01T15:01:29+00:00" }, { "name": "symfony/debug", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "63b85a968486d95ff9542228dc2e4247f16f9743" + "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/63b85a968486d95ff9542228dc2e4247f16f9743", - "reference": "63b85a968486d95ff9542228dc2e4247f16f9743", + "url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13", + "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13", "shasum": "" }, "require": { @@ -2065,11 +2064,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-07-05 13:02:37" + "time": "2017-07-28T15:27:31+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -2121,11 +2120,11 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-05-25 23:10:31" + "time": "2017-05-25T23:10:31+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2184,11 +2183,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-09 14:53:08" + "time": "2017-06-09T14:53:08+00:00" }, { "name": "symfony/finder", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2233,7 +2232,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-06-01 21:01:25" + "time": "2017-06-01T21:01:25+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2292,11 +2291,11 @@ "portable", "shim" ], - "time": "2017-06-09 14:24:12" + "time": "2017-06-09T14:24:12+00:00" }, { "name": "symfony/process", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2341,20 +2340,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-13 13:05:09" + "time": "2017-07-13T13:05:09+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.5", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "1f93a8d19b8241617f5074a123e282575b821df8" + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/1f93a8d19b8241617f5074a123e282575b821df8", - "reference": "1f93a8d19b8241617f5074a123e282575b821df8", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", "shasum": "" }, "require": { @@ -2396,7 +2395,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-06-15 12:58:50" + "time": "2017-07-23T12:43:26+00:00" }, { "name": "vlucas/phpdotenv", @@ -2446,7 +2445,7 @@ "env", "environment" ], - "time": "2016-09-01 10:05:43" + "time": "2016-09-01T10:05:43+00:00" }, { "name": "webmozart/assert", @@ -2496,7 +2495,7 @@ "check", "validate" ], - "time": "2016-11-23 20:04:58" + "time": "2016-11-23T20:04:58+00:00" } ], "packages-dev": [ @@ -2573,7 +2572,7 @@ "phpcs", "standards" ], - "time": "2014-05-01 03:07:07" + "time": "2014-05-01T03:07:07+00:00" } ], "aliases": [], diff --git a/etc/di.xml b/etc/di.xml index 7ab95b928..e46ba1de2 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -221,7 +221,7 @@ name name - mergeKey + mergeKey *Cest.xml Cest @@ -231,7 +231,7 @@ - mergeKey + mergeKey name name diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php b/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php index 2cac14185..a64b904fd 100644 --- a/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php +++ b/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php @@ -31,7 +31,7 @@ */ class MagentoWebDriver extends WebDriver { - public static $loadingMask = '.loading-mask'; + public static $loadingMask = '.loading-mask'; /** * The module required fields, to be set in the suite .yml configuration file. @@ -47,6 +47,8 @@ class MagentoWebDriver extends WebDriver ]; /** + * Set all Locale variables to NULL. + * * @var array $localeAll */ protected static $localeAll = [ @@ -60,6 +62,7 @@ class MagentoWebDriver extends WebDriver /** * Returns URL of a host. + * * @api * @return mixed * @throws ModuleConfigException @@ -77,6 +80,7 @@ public function _getUrl() /** * Uri of currently opened page. + * * @return string * @api * @throws ModuleException @@ -90,6 +94,17 @@ public function _getCurrentUri() return Uri::retrieveUri($url); } + /** + * Returns an array of Elements. + * + * @param string $locator + * @return array + */ + public function findElement($locator) + { + return $this->_findElements($locator); + } + /** * Login Magento Admin with given username and password. * @@ -123,6 +138,9 @@ public function closeAdminNotification() /** + * Search for and Select multiple options from a Magento Multi-Select drop down menu. + * e.g. The drop down menu you use to assign Products to Categories. + * * @param $select * @param array $options * @param bool $requireAction @@ -152,18 +170,41 @@ public function searchAndMultiSelectOption($select, array $options, $requireActi } } - public function waitAjaxLoad($timeout = 15) + /** + * Wait for all Ajax calls to finish. + * + * @param int $timeout + */ + public function waitForAjaxLoad($timeout = 15) { $this->waitForJS('return !!window.jQuery && window.jQuery.active == 0;', $timeout); $this->wait(1); } + /** + * Wait for all JavaScript to finish executing. + * + * @param int $timeout + */ public function waitForPageLoad($timeout = 15) { $this->waitForJS('return document.readyState == "complete"', $timeout); - $this->waitAjaxLoad($timeout); + $this->waitForAjaxLoad($timeout); + } + + /** + * Wait for the Loading mask to disappear. + */ + public function waitForLoadingMaskToDisappear() + { + $this->waitForElementNotVisible(self::$loadingMask, 30); } + /** + * Verify that there are no JavaScript errors in the console. + * + * @throws ModuleException + */ public function dontSeeJsError() { $logs = $this->webDriver->manage()->getLog('browser'); @@ -189,6 +230,17 @@ public function formatMoney(float $money, $locale = 'en_US.UTF-8') return ['prefix' => $prefix, 'number' => $number]; } + /** + * Parse float number with thousands_sep. + * + * @param $floatString + * @return float + */ + public function parseFloat($floatString){ + $floatString = str_replace(',', '', $floatString); + return floatval($floatString); + } + /** * @param int $category * @param string $locale @@ -204,6 +256,9 @@ public function mSetLocale(int $category, $locale) setlocale($category, $locale); } + /** + * Reset Locale setting. + */ public function mResetLocale() { foreach (self::$localeAll as $c => $l) { @@ -214,32 +269,11 @@ public function mResetLocale() } } - public function waitForLoadingMaskToDisappear() - { - $this->waitForElementNotVisible(self::$loadingMask, 30); - } - - public function scrollToTopOfPage() - { - $this->executeJS('window.scrollTo(0,0);'); - } - /** - * Parse float number with thousands_sep. - * @param $floatString - * @return float + * Scroll to the Top of the Page. */ - public function parseFloat($floatString){ - $floatString = str_replace(',', '', $floatString); - return floatval($floatString); - } - - /** - * @param string $locator - * @return - */ - public function findElement($locator) + public function scrollToTopOfPage() { - return $this->_findElements($locator); + $this->executeJS('window.scrollTo(0,0);'); } } diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index a42ef1a9e..55e23b264 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -52,6 +52,7 @@ + @@ -68,6 +69,7 @@ + @@ -75,6 +77,7 @@ + @@ -83,12 +86,17 @@ + + + + + @@ -97,6 +105,8 @@ + + @@ -125,11 +135,14 @@ + + + @@ -268,6 +281,16 @@ + + + + + + + + + + @@ -452,6 +475,16 @@ + + + + + + + + + + @@ -534,6 +567,18 @@ + + + + + + + + + + + + @@ -632,6 +677,18 @@ + + + + + + + + + + + + @@ -653,6 +710,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -697,6 +776,17 @@ + + + + + + + + + + + @@ -791,6 +881,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -1120,6 +1233,17 @@ + + + + + + + + + + + @@ -1181,6 +1305,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php b/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php index b1e57f6a9..a799d152a 100644 --- a/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php +++ b/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php @@ -3,12 +3,23 @@ use Magento\AcceptanceTestFramework\Test\Managers\CestArrayProcessor; require_once '../../../../bootstrap.php'; +/** + * Load all Cest files as Objects using the Cest Array Processor. + * @return array + */ function loadAllCestObjects() { $cestOutput = CestArrayProcessor::getInstance()->getCestData(); return $cestOutput; } +/** + * Create a single PHP file containing the $cestPhp using the $filename. + * If the _generated directory doesn't exist it will be created. + * @param $cestPhp + * @param $filename + * @throws Exception + */ function createCestFile($cestPhp, $filename) { $exportDirectory = TESTS_BP . "/tests/acceptance/Magento/AcceptanceTest/_generated"; @@ -19,11 +30,19 @@ function createCestFile($cestPhp, $filename) mkdir($exportDirectory, 0777, true); } - $file = fopen($exportFilePath, 'w') or die('Unable to open file!'); + $file = fopen($exportFilePath, 'w'); + + if (! $file) { + throw new Exception("Could not open the file!"); + } + fwrite($file, $cestPhp); fclose($file); } +/** + * Assemble ALL PHP strings using the assembleAllCestPhp function. Loop over and pass each array item to the createCestFile function. + */ function createAllCestFiles() { $cestPhpArray = assembleAllCestPhp(); @@ -34,11 +53,18 @@ function createAllCestFiles() } } +/** + * Assemble the entire PHP string for a single Test based on a Cest Object. + * Create all of the PHP strings for a Test. Concatenate the strings together. + * @param $cestObject + * @return string + */ function assembleCestPhp($cestObject) { $usePhp = generateUseStatementsPhp(); $classAnnotationsPhp = generateClassAnnotationsPhp($cestObject->getAnnotations()); $className = $cestObject->getName(); + $className = str_replace(' ', '', $className); $hookPhp = generateHooksPhp($cestObject->getHooks()); $testsPhp = generateTestsPhp($cestObject->getTests()); @@ -55,6 +81,10 @@ function assembleCestPhp($cestObject) return $cestPhp; } +/** + * Load ALL Cest objects. Loop over and pass each to the assembleCestPhp function. + * @return array + */ function assembleAllCestPhp() { $cestObjects = loadAllCestObjects(); @@ -63,6 +93,7 @@ function assembleAllCestPhp() foreach ($cestObjects as $cest) { $name = $cest->getName(); + $name = $string = str_replace(' ', '', $name); $php = assembleCestPhp($cest); $cestPhpArray[] = [$name, $php]; } @@ -70,6 +101,11 @@ function assembleAllCestPhp() return $cestPhpArray; } +/** + * Creates a PHP string for the necessary Allure and AcceptanceTester use statements. + * Since we don't support other dependencies at this time, this function takes no parameter. + * @return string + */ function generateUseStatementsPhp() { $useStatementsPhp = "use Magento\AcceptanceTestFramework\AcceptanceTester;\n"; @@ -91,6 +127,11 @@ function generateUseStatementsPhp() return $useStatementsPhp; } +/** + * Creates a PHP string for the Class Annotations block if the Cest file contains an block, outside of the blocks. + * @param $classAnnotationsObject + * @return string + */ function generateClassAnnotationsPhp($classAnnotationsObject) { $classAnnotationsPhp = "/**\n"; @@ -133,7 +174,7 @@ function generateClassAnnotationsPhp($classAnnotationsObject) if ($annotationType == "title") { - $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); + $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", $annotationName[0]); } if ($annotationType == "description") @@ -173,67 +214,77 @@ function generateClassAnnotationsPhp($classAnnotationsObject) return $classAnnotationsPhp; } +/** + * Creates a PHP string for the actions contained withing a block. + * Since nearly half of all Codeception methods don't share the same signature I had to setup a massive Case statement to handle each unique action. + * At the bottom of the case statement there is a generic function that can construct the PHP string for nearly half of all Codeception actions. + * @param $stepsObject + * @return string + */ function generateStepsPhp($stepsObject) { $testSteps = ""; foreach ($stepsObject as $steps) { - $actor = "I"; - $actionName = $steps->getType(); - $selector = null; - $input = null; - $parameterArray = null; - $returnVariable = null; - $x = null; - $y = null; - $html = null; - $url = null; - $function = null; - $time = null; - - if (isset($steps->getCustomActionAttributes()['returnVariable'])) { - $returnVariable = $steps->getCustomActionAttributes()['returnVariable']; + $actor = "I"; + $actionName = $steps->getType(); + $customActionAttributes = $steps->getCustomActionAttributes(); + $selector = null; + $input = null; + $parameterArray = null; + $returnVariable = null; + $x = null; + $y = null; + $html = null; + $url = null; + $function = null; + $time = null; + + if (isset($customActionAttributes['returnVariable'])) { + $returnVariable = $customActionAttributes['returnVariable']; } - if (isset($steps->getCustomActionAttributes()['url']) && isset($steps->getCustomActionAttributes()['userInput'])) { - $input = sprintf("\"%s\"", $steps->getCustomActionAttributes()['userInput']); - } else if (isset($steps->getCustomActionAttributes()['userInput'])) { - $input = sprintf("\"%s\"", $steps->getCustomActionAttributes()['userInput']); - } else if (isset($steps->getCustomActionAttributes()['url'])) { - $input = sprintf("\"%s\"", $steps->getCustomActionAttributes()['url']); - } else if (isset($steps->getCustomActionAttributes()['time'])) { - $input = sprintf("\"%s\"", $steps->getCustomActionAttributes()['time']); + if (isset($customActionAttributes['url']) && isset($customActionAttributes['userInput'])) { + $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + } else if (isset($customActionAttributes['userInput'])) { + $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + } else if (isset($customActionAttributes['url'])) { + $input = sprintf("\"%s\"", $customActionAttributes['url']); + } else if (isset($customActionAttributes['time'])) { + $input = sprintf("\"%s\"", $customActionAttributes['time']); } - if (isset($steps->getCustomActionAttributes()['parameterArray'])) { - $parameterArray = $steps->getCustomActionAttributes()['parameterArray']; + if (isset($customActionAttributes['parameterArray'])) { + $parameterArray = $customActionAttributes['parameterArray']; } - if (isset($steps->getCustomActionAttributes()['selectorArray'])) { - $selector = sprintf("%s", $steps->getCustomActionAttributes()['selectorArray']); - } else if (isset($steps->getCustomActionAttributes()['selector'])) { - $selector = sprintf("\"%s\"", $steps->getCustomActionAttributes()['selector']); + if (isset($customActionAttributes['selectorArray'])) { + $selector = sprintf("%s", $customActionAttributes['selectorArray']); + } else if (isset($customActionAttributes['selector'])) { + $selector = sprintf("\"%s\"", $customActionAttributes['selector']); } - if (isset($steps->getCustomActionAttributes()['x'])) { - $x = $steps->getCustomActionAttributes()['x']; + if (isset($customActionAttributes['x'])) { + $x = $customActionAttributes['x']; } - if (isset($steps->getCustomActionAttributes()['y'])) { - $y = $steps->getCustomActionAttributes()['y']; + if (isset($customActionAttributes['y'])) { + $y = $customActionAttributes['y']; } - if (isset($steps->getCustomActionAttributes()['function'])) { - $function = $steps->getCustomActionAttributes()['function']; + if (isset($customActionAttributes['function'])) { + $function = $customActionAttributes['function']; } - if (isset($steps->getCustomActionAttributes()['html'])) { - $html = $steps->getCustomActionAttributes()['html']; + if (isset($customActionAttributes['html'])) { + $html = $customActionAttributes['html']; } - if (isset($steps->getCustomActionAttributes()['time'])) { - $time = $steps->getCustomActionAttributes()['time']; + if (isset($customActionAttributes['time'])) { + $time = $customActionAttributes['time']; + } else if (isset($customActionAttributes['timeout'])) { + $time = $customActionAttributes['timeout']; } switch ($actionName) { @@ -317,14 +368,14 @@ function generateStepsPhp($stepsObject) $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $html); break; case "dontSeeLink": - if (isset($steps->getCustomActionAttributes()['url'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $steps->getCustomActionAttributes()['url']); + if (isset($customActionAttributes['url'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['url']); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } break; case "dragAndDrop": - $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $steps->getCustomActionAttributes()['selector1'], $steps->getCustomActionAttributes()['selector2']); + $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $customActionAttributes['selector1'], $customActionAttributes['selector2']); break; case "executeInSelenium": $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $function); @@ -335,6 +386,13 @@ function generateStepsPhp($stepsObject) case "fillField": $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); break; + case "formatMoney": + if (isset($customActionAttributes['locale'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['locale']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; case "grabCookie": if (isset($returnVariable)) { if (isset($parameterArray)) { @@ -372,6 +430,13 @@ function generateStepsPhp($stepsObject) $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } break; + case "loginAsAdmin": + if (isset($customActionAttributes['username']) && isset($customActionAttributes['password'])) { + $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $customActionAttributes['username'], $customActionAttributes['password']); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; case "moveMouseOver": if ($selector) { if (isset($step['x']) || isset($step['y'])) { @@ -383,6 +448,13 @@ function generateStepsPhp($stepsObject) $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); } break; + case "mSetLocale": + if (isset($customActionAttributes['locale'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['locale']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; case "performOn": $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $function); break; @@ -401,13 +473,20 @@ function generateStepsPhp($stepsObject) } break; case "resizeWindow": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $steps->getCustomActionAttributes()['width'], $steps->getCustomActionAttributes()['height']); + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $customActionAttributes['width'], $customActionAttributes['height']); break; case "scrollTo": $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); break; + case "searchAndMultiSelectOption": + if (isset($customActionAttributes['requiredAction'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray'], $customActionAttributes['requiredAction']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray']); + } + break; case "see": - if (isset($steps->getCustomActionAttributes()['selector'])) { + if (isset($customActionAttributes['selector'])) { $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); @@ -457,13 +536,13 @@ function generateStepsPhp($stepsObject) break; case "seeLink": if (isset($step['url'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $steps->getCustomActionAttributes()['url']); + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['url']); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } break; case "seeNumberOfElements": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $steps->getCustomActionAttributes()['userInput']); + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); break; case "selectOption": if ($parameterArray) { @@ -474,14 +553,14 @@ function generateStepsPhp($stepsObject) break; case "setCookie": if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", %s);\n", $actor, $actionName, $input, $steps->getCustomActionAttributes()['value'], $parameterArray); + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", %s);\n", $actor, $actionName, $input, $customActionAttributes['value'], $parameterArray); } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $steps->getCustomActionAttributes()['value']); + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['value']); } break; case "submitForm": if (isset($step['button'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", \"%s\");\n", $actor, $actionName, $selector, $parameterArray, $steps->getCustomActionAttributes()['button']); + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", \"%s\");\n", $actor, $actionName, $selector, $parameterArray, $customActionAttributes['button']); } else { $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $parameterArray); } @@ -489,6 +568,13 @@ function generateStepsPhp($stepsObject) case "wait": $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); break; + case "waitForAjaxLoad": + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; case "waitForElement": $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $time); break; @@ -498,6 +584,13 @@ function generateStepsPhp($stepsObject) case "waitForJS": $testSteps .= sprintf("\t\t$%s->%s(\"%s\", %s);\n", $actor, $actionName, $function, $time); break; + case "waitForPageLoad": + if ($time) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; case "waitForText": if ($selector) { $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $input, $time, $selector); @@ -508,36 +601,36 @@ function generateStepsPhp($stepsObject) default: if ($returnVariable) { if ($selector) { - if (isset($steps->getCustomActionAttributes()['userInput'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, \"%s\");\n", $returnVariable, $actor, $actionName, $selector, $steps->getCustomActionAttributes()['userInput']); - } else if (isset($steps->getCustomActionAttributes()['parameter'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $steps->getCustomActionAttributes()['parameter']); + if (isset($customActionAttributes['userInput'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, \"%s\");\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['userInput']); + } else if (isset($customActionAttributes['parameter'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['parameter']); } else { $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); } } else { - if (isset($steps->getCustomActionAttributes()['userInput'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $actionName, $steps->getCustomActionAttributes()['userInput']); - } else if (isset($steps->getCustomActionAttributes()['parameter'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $steps->getCustomActionAttributes()['parameter']); + if (isset($customActionAttributes['userInput'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $actionName, $customActionAttributes['userInput']); + } else if (isset($customActionAttributes['parameter'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $customActionAttributes['parameter']); } else { $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); } } } else { if ($selector) { - if (isset($steps->getCustomActionAttributes()['userInput'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $steps->getCustomActionAttributes()['userInput']); - } else if (isset($steps->getCustomActionAttributes()['parameter'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $steps->getCustomActionAttributes()['parameter']); + if (isset($customActionAttributes['userInput'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); + } else if (isset($customActionAttributes['parameter'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameter']); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } } else { - if (isset($steps->getCustomActionAttributes()['userInput'])) { - $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $steps->getCustomActionAttributes()['userInput']); - } else if (isset($steps->getCustomActionAttributes()['parameter'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $steps->getCustomActionAttributes()['parameter']); + if (isset($customActionAttributes['userInput'])) { + $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $customActionAttributes['userInput']); + } else if (isset($customActionAttributes['parameter'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $customActionAttributes['parameter']); } else { $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); } @@ -549,6 +642,11 @@ function generateStepsPhp($stepsObject) return $testSteps; } +/** + * Creates a PHP string for the _before/_after methods if the Test contains an or block. + * @param $hookObjects + * @return string + */ function generateHooksPhp($hookObjects) { $hooks = ""; @@ -580,6 +678,11 @@ function generateHooksPhp($hookObjects) return $hooks; } +/** + * Creates a PHP string for the Test Annotations block if the Test contains an block. + * @param $testAnnotationsObject + * @return string + */ function generateTestAnnotationsPhp($testAnnotationsObject) { $testAnnotationsPhp = "\t/**\n"; @@ -622,7 +725,7 @@ function generateTestAnnotationsPhp($testAnnotationsObject) if ($annotationType == "title") { - $testAnnotationsPhp .= sprintf("\t * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); + $testAnnotationsPhp .= sprintf("\t * @Title(\"%s\")\n", $annotationName[0]); } if ($annotationType == "description") @@ -668,6 +771,12 @@ function generateTestAnnotationsPhp($testAnnotationsObject) return $testAnnotationsPhp; } +/** + * Creates a PHP string based on a block. + * Concatenates the Test Annotations PHP and Test PHP for a single Test. + * @param $testsObject + * @return string + */ function generateTestsPhp($testsObject) { $testPhp = ""; @@ -675,6 +784,7 @@ function generateTestsPhp($testsObject) foreach ($testsObject as $test) { $testName = $test->getName(); + $testName = str_replace(' ', '', $testName); $testAnnotations = generateTestAnnotationsPhp($test->getAnnotations()); $dependencies = 'AcceptanceTester $I'; $steps = generateStepsPhp($test->getOrderedActions()); @@ -694,4 +804,7 @@ function generateTestsPhp($testsObject) return $testPhp; } +/** + * Create ALL Cest files. + */ createAllCestFiles(); From 8c0ebee11df95833801eaeb682863bad8ceb2ef2 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Thu, 10 Aug 2017 11:16:12 -0500 Subject: [PATCH 103/149] MQE-62:[Spike] Screenshots in Allure - update MagentoWebDriver to include png and html attachments in allure report --- .../Module/MagentoWebDriver.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php b/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php index a64b904fd..1c8bcf31a 100644 --- a/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php +++ b/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php @@ -2,6 +2,8 @@ namespace Magento\AcceptanceTestFramework\Module; use Codeception\Module\WebDriver; +use Codeception\Test\Descriptor; +use Codeception\TestInterface; use Facebook\WebDriver\WebDriverSelect; use Facebook\WebDriver\WebDriverBy; use Facebook\WebDriver\Exception\NoSuchElementException; @@ -10,6 +12,7 @@ use Codeception\Exception\ModuleException; use Codeception\Util\Uri; use Codeception\Util\ActionSequence; +use Yandex\Allure\Adapter\Support\AttachmentSupport; /** * MagentoWebDriver module provides common Magento web actions through Selenium WebDriver. @@ -31,6 +34,7 @@ */ class MagentoWebDriver extends WebDriver { + use AttachmentSupport; public static $loadingMask = '.loading-mask'; /** @@ -276,4 +280,23 @@ public function scrollToTopOfPage() { $this->executeJS('window.scrollTo(0,0);'); } + + /** + * Override for _failed method in Codeception method. Adds png and html attachments to allure report + * following parent execution of test failure processing. + * @param TestInterface $test + * @param \Exception $fail + */ + public function _failed(TestInterface $test, $fail) + { + parent::_failed($test, $fail); + + // Reconstruct file naming from codeception method + $filename = preg_replace('~\W~', '.', Descriptor::getTestSignature($test)); + $outputDir = codecept_output_dir(); + $pngReport = $outputDir . mb_strcut($filename, 0, 245, 'utf-8') . '.fail.png'; + $htmlReport = $outputDir . mb_strcut($filename, 0, 244, 'utf-8') . '.fail.html'; + $this->addAttachment($pngReport, $test->getMetadata()->getName() . '.png', 'image/png'); + $this->addAttachment($htmlReport, $test->getMetadata()->getName() . '.html', 'text/html'); + } } From 2b9387227396d8f4d9dff54afca38b869e9a2103 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 10 Aug 2017 16:15:34 -0500 Subject: [PATCH 104/149] MQE-232 - Updating generator with Data Create/Delete methods. --- .../Util/GenerateTestsFromObjects.php | 147 +++++++++++------- 1 file changed, 93 insertions(+), 54 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php b/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php index a799d152a..033ec994a 100644 --- a/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php +++ b/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php @@ -25,8 +25,7 @@ function createCestFile($cestPhp, $filename) $exportDirectory = TESTS_BP . "/tests/acceptance/Magento/AcceptanceTest/_generated"; $exportFilePath = sprintf("%s/%s.php", $exportDirectory, $filename); - if (!is_dir($exportDirectory)) - { + if (!is_dir($exportDirectory)) { mkdir($exportDirectory, 0777, true); } @@ -61,7 +60,7 @@ function createAllCestFiles() */ function assembleCestPhp($cestObject) { - $usePhp = generateUseStatementsPhp(); + $usePhp = generateUseStatementsPhp($cestObject); $classAnnotationsPhp = generateClassAnnotationsPhp($cestObject->getAnnotations()); $className = $cestObject->getName(); $className = str_replace(' ', '', $className); @@ -104,12 +103,38 @@ function assembleAllCestPhp() /** * Creates a PHP string for the necessary Allure and AcceptanceTester use statements. * Since we don't support other dependencies at this time, this function takes no parameter. + * @param $cestObject * @return string */ -function generateUseStatementsPhp() +function generateUseStatementsPhp($cestObject) { + $hooks = $cestObject->getHooks(); + $data = false; + + /** + * Loop over each Hook object, loop over each Step in the Hook object looking for a createData or deleteData. + * If they are present set a variable to True so the PHP generator uses $this->_____->createData() instead of $______->createData(). + */ + foreach ($hooks as $hook) { + if (!$data) { + $steps = $hook->getActions(); + + foreach ($steps as $step) { + if ($step->getType() === "createData" || $step->getType() === "deleteData") { + $data = true; + break; + } + } + } + } + $useStatementsPhp = "use Magento\AcceptanceTestFramework\AcceptanceTester;\n"; + if ($data) { + $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager;\n"; + $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Api\EntityApiHandler;\n"; + } + $allureStatements = ["Yandex\Allure\Adapter\Annotation\Features;", "Yandex\Allure\Adapter\Annotation\Stories;", "Yandex\Allure\Adapter\Annotation\Title;", @@ -138,16 +163,14 @@ function generateClassAnnotationsPhp($classAnnotationsObject) foreach ($classAnnotationsObject as $annotationType => $annotationName) { - if ($annotationType == "features") - { + if ($annotationType == "features") { $features = ""; foreach ($annotationName as $name) { $features .= sprintf("\"%s\"", $name); - if (next($annotationName)) - { + if (next($annotationName)) { $features .= ", "; } } @@ -155,16 +178,14 @@ function generateClassAnnotationsPhp($classAnnotationsObject) $classAnnotationsPhp .= sprintf(" * @Features({%s})\n", $features); } - if ($annotationType == "stories") - { + if ($annotationType == "stories") { $stories = ""; foreach ($annotationName as $name) { $stories .= sprintf("\"%s\"", $name); - if (next($annotationName)) - { + if (next($annotationName)) { $stories .= ", "; } } @@ -172,36 +193,30 @@ function generateClassAnnotationsPhp($classAnnotationsObject) $classAnnotationsPhp .= sprintf(" * @Stories({%s})\n", $stories); } - if ($annotationType == "title") - { - $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", $annotationName[0]); + if ($annotationType == "title") { + $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); } - if ($annotationType == "description") - { + if ($annotationType == "description") { $classAnnotationsPhp .= sprintf(" * @Description(\"%s\")\n", $annotationName[0]); } - if ($annotationType == "severity") - { + if ($annotationType == "severity") { $classAnnotationsPhp .= sprintf(" * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); } - if ($annotationType == "testCaseId") - { + if ($annotationType == "testCaseId") { $classAnnotationsPhp .= sprintf(" * TestCaseId(\"%s\")", $annotationName[0]); } - if ($annotationType == "group") - { + if ($annotationType == "group") { foreach ($annotationName as $group) { $classAnnotationsPhp .= sprintf(" * @group %s\n", $group); } } - if ($annotationType == "env") - { + if ($annotationType == "env") { foreach ($annotationName as $env) { $classAnnotationsPhp .= sprintf(" * @env %s\n", $env); @@ -219,9 +234,10 @@ function generateClassAnnotationsPhp($classAnnotationsObject) * Since nearly half of all Codeception methods don't share the same signature I had to setup a massive Case statement to handle each unique action. * At the bottom of the case statement there is a generic function that can construct the PHP string for nearly half of all Codeception actions. * @param $stepsObject + * @param $hookObject * @return string */ -function generateStepsPhp($stepsObject) +function generateStepsPhp($stepsObject, $hookObject = false) { $testSteps = ""; @@ -320,6 +336,29 @@ function generateStepsPhp($stepsObject) $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); } break; + case "createData": + $entity = $customActionAttributes['entity']; + $key = $steps->getMergeKey(); + + if ($hookObject) { + $testSteps .= sprintf("\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, $entity); + $testSteps .= sprintf("\t\t\$this->%s = new EntityApiHandler($%s);\n", $key, $entity); + $testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key); + } else { + $testSteps .= sprintf("\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, $entity); + $testSteps .= sprintf("\t\t$%s = new EntityApiHandler($%s);\n", $key, $entity); + $testSteps .= sprintf("\t\t$%s->createEntity();\n", $key); + } + break; + case "deleteData": + $key = $customActionAttributes['createDataKey']; + + if ($hookObject) { + $testSteps .= sprintf("\t\t\$this->%s->deleteEntity();\n", $key); + } else { + $testSteps .= sprintf("\t\t$%s->deleteEntity();\n", $key); + } + break; case "dontSee": if ($selector) { $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); @@ -649,23 +688,34 @@ function generateStepsPhp($stepsObject) */ function generateHooksPhp($hookObjects) { - $hooks = ""; + $hooks = ""; + $createData = false; foreach ($hookObjects as $hookObject) { $type = $hookObject->getType(); $dependencies = 'AcceptanceTester $I'; - $steps = generateStepsPhp($hookObject->getActions()); - if ($type == "after") + foreach ($hookObject->getActions() as $step) { + if ($step->getType() == "createData") { + $hooks .= "\t/**\n"; + $hooks .= sprintf("\t * @var EntityApiHandler $%s;\n", $step->getMergeKey()); + $hooks .= "\t */\n"; + $hooks .= sprintf("\tprotected $%s;\n\n", $step->getMergeKey()); + $createData = true; + } + } + + $steps = generateStepsPhp($hookObject->getActions(), $createData); + + if ($type == "after") { $hooks .= sprintf("\tpublic function _after(%s)\n", $dependencies); $hooks .= "\t{\n"; $hooks .= $steps; $hooks .= "\t}\n\n"; } - if ($type == "before") - { + if ($type == "before") { $hooks .= sprintf("\tpublic function _before(%s)\n", $dependencies); $hooks .= "\t{\n"; $hooks .= $steps; @@ -689,16 +739,14 @@ function generateTestAnnotationsPhp($testAnnotationsObject) foreach ($testAnnotationsObject as $annotationType => $annotationName) { - if ($annotationType == "features") - { + if ($annotationType == "features") { $features = ""; foreach ($annotationName as $name) { $features .= sprintf("\"%s\"", $name); - if (next($annotationName)) - { + if (next($annotationName)) { $features .= ", "; } } @@ -706,16 +754,14 @@ function generateTestAnnotationsPhp($testAnnotationsObject) $testAnnotationsPhp .= sprintf("\t * @Features({%s})\n", $features); } - if ($annotationType == "stories") - { + if ($annotationType == "stories") { $stories = ""; foreach ($annotationName as $name) { $stories .= sprintf("\"%s\"", $name); - if (next($annotationName)) - { + if (next($annotationName)) { $stories .= ", "; } } @@ -723,23 +769,19 @@ function generateTestAnnotationsPhp($testAnnotationsObject) $testAnnotationsPhp .= sprintf("\t * @Stories({%s})\n", $stories); } - if ($annotationType == "title") - { + if ($annotationType == "title") { $testAnnotationsPhp .= sprintf("\t * @Title(\"%s\")\n", $annotationName[0]); } - if ($annotationType == "description") - { + if ($annotationType == "description") { $testAnnotationsPhp .= sprintf("\t * @Description(\"%s\")\n", $annotationName[0]); } - if ($annotationType == "severity") - { + if ($annotationType == "severity") { $testAnnotationsPhp .= sprintf("\t * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); } - if ($annotationType == "testCaseId") - { + if ($annotationType == "testCaseId") { $testAnnotationsPhp .= sprintf("\t * @TestCaseId(\"%s\")\n", $annotationName[0]); } } @@ -747,16 +789,14 @@ function generateTestAnnotationsPhp($testAnnotationsObject) $testAnnotationsPhp .= sprintf("\t * @Parameter(name = \"%s\", value=\"$%s\")\n", "AcceptanceTester", "I"); foreach ($testAnnotationsObject as $annotationType => $annotationName) { - if ($annotationType == "group") - { + if ($annotationType == "group") { foreach ($annotationName as $name) { $testAnnotationsPhp .= sprintf("\t * @group %s\n", $name); } } - if ($annotationType == "env") - { + if ($annotationType == "env") { foreach ($annotationName as $env) { $testAnnotationsPhp .= sprintf("\t * @env %s\n", $env); @@ -795,8 +835,7 @@ function generateTestsPhp($testsObject) $testPhp .= $steps; $testPhp .= "\t}\n"; - if (sizeof($testsObject) > 1) - { + if (sizeof($testsObject) > 1) { $testPhp .= "\n"; } } @@ -807,4 +846,4 @@ function generateTestsPhp($testsObject) /** * Create ALL Cest files. */ -createAllCestFiles(); +createAllCestFiles(); \ No newline at end of file From deb4bf1d545c3d9718b30fc3d728a90433894609 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Thu, 10 Aug 2017 17:44:51 -0500 Subject: [PATCH 105/149] MQE-228:Resolve bootstrap.php in Acceptance Test Framework - split bootstrap file between global and test specific area - add .env example file for optional parameters during dev - ref new object oriented Test Generator in Robofile --- .../Util/GenerateTestsFromObjects.php | 849 ----------------- .../Util/TestGenerator.php | 854 ++++++++++++++++++ 2 files changed, 854 insertions(+), 849 deletions(-) delete mode 100644 src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php create mode 100644 src/Magento/AcceptanceTestFramework/Util/TestGenerator.php diff --git a/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php b/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php deleted file mode 100644 index 033ec994a..000000000 --- a/src/Magento/AcceptanceTestFramework/Util/GenerateTestsFromObjects.php +++ /dev/null @@ -1,849 +0,0 @@ -getCestData(); - return $cestOutput; -} - -/** - * Create a single PHP file containing the $cestPhp using the $filename. - * If the _generated directory doesn't exist it will be created. - * @param $cestPhp - * @param $filename - * @throws Exception - */ -function createCestFile($cestPhp, $filename) -{ - $exportDirectory = TESTS_BP . "/tests/acceptance/Magento/AcceptanceTest/_generated"; - $exportFilePath = sprintf("%s/%s.php", $exportDirectory, $filename); - - if (!is_dir($exportDirectory)) { - mkdir($exportDirectory, 0777, true); - } - - $file = fopen($exportFilePath, 'w'); - - if (! $file) { - throw new Exception("Could not open the file!"); - } - - fwrite($file, $cestPhp); - fclose($file); -} - -/** - * Assemble ALL PHP strings using the assembleAllCestPhp function. Loop over and pass each array item to the createCestFile function. - */ -function createAllCestFiles() -{ - $cestPhpArray = assembleAllCestPhp(); - - foreach ($cestPhpArray as $cestPhpFile) - { - createCestFile($cestPhpFile[1], $cestPhpFile[0]); - } -} - -/** - * Assemble the entire PHP string for a single Test based on a Cest Object. - * Create all of the PHP strings for a Test. Concatenate the strings together. - * @param $cestObject - * @return string - */ -function assembleCestPhp($cestObject) -{ - $usePhp = generateUseStatementsPhp($cestObject); - $classAnnotationsPhp = generateClassAnnotationsPhp($cestObject->getAnnotations()); - $className = $cestObject->getName(); - $className = str_replace(' ', '', $className); - $hookPhp = generateHooksPhp($cestObject->getHooks()); - $testsPhp = generateTestsPhp($cestObject->getTests()); - - $cestPhp = "getName(); - $name = $string = str_replace(' ', '', $name); - $php = assembleCestPhp($cest); - $cestPhpArray[] = [$name, $php]; - } - - return $cestPhpArray; -} - -/** - * Creates a PHP string for the necessary Allure and AcceptanceTester use statements. - * Since we don't support other dependencies at this time, this function takes no parameter. - * @param $cestObject - * @return string - */ -function generateUseStatementsPhp($cestObject) -{ - $hooks = $cestObject->getHooks(); - $data = false; - - /** - * Loop over each Hook object, loop over each Step in the Hook object looking for a createData or deleteData. - * If they are present set a variable to True so the PHP generator uses $this->_____->createData() instead of $______->createData(). - */ - foreach ($hooks as $hook) { - if (!$data) { - $steps = $hook->getActions(); - - foreach ($steps as $step) { - if ($step->getType() === "createData" || $step->getType() === "deleteData") { - $data = true; - break; - } - } - } - } - - $useStatementsPhp = "use Magento\AcceptanceTestFramework\AcceptanceTester;\n"; - - if ($data) { - $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager;\n"; - $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Api\EntityApiHandler;\n"; - } - - $allureStatements = ["Yandex\Allure\Adapter\Annotation\Features;", - "Yandex\Allure\Adapter\Annotation\Stories;", - "Yandex\Allure\Adapter\Annotation\Title;", - "Yandex\Allure\Adapter\Annotation\Description;", - "Yandex\Allure\Adapter\Annotation\Parameter;", - "Yandex\Allure\Adapter\Annotation\Severity;", - "Yandex\Allure\Adapter\Model\SeverityLevel;", - "Yandex\Allure\Adapter\Annotation\TestCaseId;\n"]; - - foreach ($allureStatements as $allureUseStatement) - { - $useStatementsPhp .= sprintf("use %s\n", $allureUseStatement); - } - - return $useStatementsPhp; -} - -/** - * Creates a PHP string for the Class Annotations block if the Cest file contains an block, outside of the blocks. - * @param $classAnnotationsObject - * @return string - */ -function generateClassAnnotationsPhp($classAnnotationsObject) -{ - $classAnnotationsPhp = "/**\n"; - - foreach ($classAnnotationsObject as $annotationType => $annotationName) - { - if ($annotationType == "features") { - $features = ""; - - foreach ($annotationName as $name) - { - $features .= sprintf("\"%s\"", $name); - - if (next($annotationName)) { - $features .= ", "; - } - } - - $classAnnotationsPhp .= sprintf(" * @Features({%s})\n", $features); - } - - if ($annotationType == "stories") { - $stories = ""; - - foreach ($annotationName as $name) - { - $stories .= sprintf("\"%s\"", $name); - - if (next($annotationName)) { - $stories .= ", "; - } - } - - $classAnnotationsPhp .= sprintf(" * @Stories({%s})\n", $stories); - } - - if ($annotationType == "title") { - $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); - } - - if ($annotationType == "description") { - $classAnnotationsPhp .= sprintf(" * @Description(\"%s\")\n", $annotationName[0]); - } - - if ($annotationType == "severity") { - $classAnnotationsPhp .= sprintf(" * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); - } - - if ($annotationType == "testCaseId") { - $classAnnotationsPhp .= sprintf(" * TestCaseId(\"%s\")", $annotationName[0]); - } - - if ($annotationType == "group") { - foreach ($annotationName as $group) - { - $classAnnotationsPhp .= sprintf(" * @group %s\n", $group); - } - } - - if ($annotationType == "env") { - foreach ($annotationName as $env) - { - $classAnnotationsPhp .= sprintf(" * @env %s\n", $env); - } - } - } - - $classAnnotationsPhp .= " */\n"; - - return $classAnnotationsPhp; -} - -/** - * Creates a PHP string for the actions contained withing a block. - * Since nearly half of all Codeception methods don't share the same signature I had to setup a massive Case statement to handle each unique action. - * At the bottom of the case statement there is a generic function that can construct the PHP string for nearly half of all Codeception actions. - * @param $stepsObject - * @param $hookObject - * @return string - */ -function generateStepsPhp($stepsObject, $hookObject = false) -{ - $testSteps = ""; - - foreach ($stepsObject as $steps) - { - $actor = "I"; - $actionName = $steps->getType(); - $customActionAttributes = $steps->getCustomActionAttributes(); - $selector = null; - $input = null; - $parameterArray = null; - $returnVariable = null; - $x = null; - $y = null; - $html = null; - $url = null; - $function = null; - $time = null; - - if (isset($customActionAttributes['returnVariable'])) { - $returnVariable = $customActionAttributes['returnVariable']; - } - - if (isset($customActionAttributes['url']) && isset($customActionAttributes['userInput'])) { - $input = sprintf("\"%s\"", $customActionAttributes['userInput']); - } else if (isset($customActionAttributes['userInput'])) { - $input = sprintf("\"%s\"", $customActionAttributes['userInput']); - } else if (isset($customActionAttributes['url'])) { - $input = sprintf("\"%s\"", $customActionAttributes['url']); - } else if (isset($customActionAttributes['time'])) { - $input = sprintf("\"%s\"", $customActionAttributes['time']); - } - - if (isset($customActionAttributes['parameterArray'])) { - $parameterArray = $customActionAttributes['parameterArray']; - } - - if (isset($customActionAttributes['selectorArray'])) { - $selector = sprintf("%s", $customActionAttributes['selectorArray']); - } else if (isset($customActionAttributes['selector'])) { - $selector = sprintf("\"%s\"", $customActionAttributes['selector']); - } - - if (isset($customActionAttributes['x'])) { - $x = $customActionAttributes['x']; - } - - if (isset($customActionAttributes['y'])) { - $y = $customActionAttributes['y']; - } - - if (isset($customActionAttributes['function'])) { - $function = $customActionAttributes['function']; - } - - if (isset($customActionAttributes['html'])) { - $html = $customActionAttributes['html']; - } - - if (isset($customActionAttributes['time'])) { - $time = $customActionAttributes['time']; - } else if (isset($customActionAttributes['timeout'])) { - $time = $customActionAttributes['timeout']; - } - - switch ($actionName) { - case "amOnPage": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "amOnSubdomain": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "amOnUrl": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "click": - if ($input && $selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); - } else if ($input && !$selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } else if (!$input && $selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "clickWithLeftButton": - if ($selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); - } else { - $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); - } - break; - case "clickWithRightButton": - if ($selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); - } else { - $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); - } - break; - case "createData": - $entity = $customActionAttributes['entity']; - $key = $steps->getMergeKey(); - - if ($hookObject) { - $testSteps .= sprintf("\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, $entity); - $testSteps .= sprintf("\t\t\$this->%s = new EntityApiHandler($%s);\n", $key, $entity); - $testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key); - } else { - $testSteps .= sprintf("\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, $entity); - $testSteps .= sprintf("\t\t$%s = new EntityApiHandler($%s);\n", $key, $entity); - $testSteps .= sprintf("\t\t$%s->createEntity();\n", $key); - } - break; - case "deleteData": - $key = $customActionAttributes['createDataKey']; - - if ($hookObject) { - $testSteps .= sprintf("\t\t\$this->%s->deleteEntity();\n", $key); - } else { - $testSteps .= sprintf("\t\t$%s->deleteEntity();\n", $key); - } - break; - case "dontSee": - if ($selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "dontSeeCookie": - if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "dontSeeCurrentUrlEquals": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "dontSeeCurrentUrlMatches": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "dontSeeElement": - if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "dontSeeElementInDOM": - if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "dontSeeInCurrentUrl": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "dontSeeInField": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "dontSeeInFormFields": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); - break; - case "dontSeeInSource": - // TODO: Solve the HTML parsing issue. - $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $html); - break; - case "dontSeeLink": - if (isset($customActionAttributes['url'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['url']); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "dragAndDrop": - $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $customActionAttributes['selector1'], $customActionAttributes['selector2']); - break; - case "executeInSelenium": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $function); - break; - case "executeJS": - $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $function); - break; - case "fillField": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "formatMoney": - if (isset($customActionAttributes['locale'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['locale']); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "grabCookie": - if (isset($returnVariable)) { - if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $input, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); - } - } else { - if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - } - break; - case "grabFromCurrentUrl": - if (isset($returnVariable)) { - if ($input) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); - } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); - } - } else { - if ($input) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } - } - break; - case "grabValueFrom": - if (isset($returnVariable)) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "loginAsAdmin": - if (isset($customActionAttributes['username']) && isset($customActionAttributes['password'])) { - $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $customActionAttributes['username'], $customActionAttributes['password']); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } - break; - case "moveMouseOver": - if ($selector) { - if (isset($step['x']) || isset($step['y'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - } else { - $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); - } - break; - case "mSetLocale": - if (isset($customActionAttributes['locale'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['locale']); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "performOn": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $function); - break; - case "pressKey": - if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - } - break; - case "resetCookie": - if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "resizeWindow": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $customActionAttributes['width'], $customActionAttributes['height']); - break; - case "scrollTo": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); - break; - case "searchAndMultiSelectOption": - if (isset($customActionAttributes['requiredAction'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray'], $customActionAttributes['requiredAction']); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray']); - } - break; - case "see": - if (isset($customActionAttributes['selector'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "seeCookie": - if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "seeCurrentUrlEquals": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "seeCurrentUrlMatches": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "seeElement": - if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "seeElementInDOM": - if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "seeInCurrentUrl": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "seeInField": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "seeInFormFields": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); - break; - case "seeInPageSource": - // TODO: Solve the HTML parsing issue. - break; - case "seeInSource": - // TODO: Solve the HTML parsing issue. - break; - case "seeLink": - if (isset($step['url'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['url']); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "seeNumberOfElements": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); - break; - case "selectOption": - if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - } - break; - case "setCookie": - if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", %s);\n", $actor, $actionName, $input, $customActionAttributes['value'], $parameterArray); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['value']); - } - break; - case "submitForm": - if (isset($step['button'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", \"%s\");\n", $actor, $actionName, $selector, $parameterArray, $customActionAttributes['button']); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $parameterArray); - } - break; - case "wait": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); - break; - case "waitForAjaxLoad": - if ($input) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } - break; - case "waitForElement": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $time); - break; - case "waitForElementChange": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $function, $time); - break; - case "waitForJS": - $testSteps .= sprintf("\t\t$%s->%s(\"%s\", %s);\n", $actor, $actionName, $function, $time); - break; - case "waitForPageLoad": - if ($time) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } - break; - case "waitForText": - if ($selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $input, $time, $selector); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $time); - } - break; - default: - if ($returnVariable) { - if ($selector) { - if (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, \"%s\");\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['userInput']); - } else if (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['parameter']); - } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); - } - } else { - if (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $actionName, $customActionAttributes['userInput']); - } else if (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $customActionAttributes['parameter']); - } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); - } - } - } else { - if ($selector) { - if (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); - } else if (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameter']); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - } else { - if (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $customActionAttributes['userInput']); - } else if (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $customActionAttributes['parameter']); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } - } - } - } - } - - return $testSteps; -} - -/** - * Creates a PHP string for the _before/_after methods if the Test contains an or block. - * @param $hookObjects - * @return string - */ -function generateHooksPhp($hookObjects) -{ - $hooks = ""; - $createData = false; - foreach ($hookObjects as $hookObject) - { - $type = $hookObject->getType(); - $dependencies = 'AcceptanceTester $I'; - - foreach ($hookObject->getActions() as $step) - { - if ($step->getType() == "createData") { - $hooks .= "\t/**\n"; - $hooks .= sprintf("\t * @var EntityApiHandler $%s;\n", $step->getMergeKey()); - $hooks .= "\t */\n"; - $hooks .= sprintf("\tprotected $%s;\n\n", $step->getMergeKey()); - $createData = true; - } - } - - $steps = generateStepsPhp($hookObject->getActions(), $createData); - - if ($type == "after") { - $hooks .= sprintf("\tpublic function _after(%s)\n", $dependencies); - $hooks .= "\t{\n"; - $hooks .= $steps; - $hooks .= "\t}\n\n"; - } - - if ($type == "before") { - $hooks .= sprintf("\tpublic function _before(%s)\n", $dependencies); - $hooks .= "\t{\n"; - $hooks .= $steps; - $hooks .= "\t}\n\n"; - } - - $hooks .= ""; - } - - return $hooks; -} - -/** - * Creates a PHP string for the Test Annotations block if the Test contains an block. - * @param $testAnnotationsObject - * @return string - */ -function generateTestAnnotationsPhp($testAnnotationsObject) -{ - $testAnnotationsPhp = "\t/**\n"; - - foreach ($testAnnotationsObject as $annotationType => $annotationName) - { - if ($annotationType == "features") { - $features = ""; - - foreach ($annotationName as $name) - { - $features .= sprintf("\"%s\"", $name); - - if (next($annotationName)) { - $features .= ", "; - } - } - - $testAnnotationsPhp .= sprintf("\t * @Features({%s})\n", $features); - } - - if ($annotationType == "stories") { - $stories = ""; - - foreach ($annotationName as $name) - { - $stories .= sprintf("\"%s\"", $name); - - if (next($annotationName)) { - $stories .= ", "; - } - } - - $testAnnotationsPhp .= sprintf("\t * @Stories({%s})\n", $stories); - } - - if ($annotationType == "title") { - $testAnnotationsPhp .= sprintf("\t * @Title(\"%s\")\n", $annotationName[0]); - } - - if ($annotationType == "description") { - $testAnnotationsPhp .= sprintf("\t * @Description(\"%s\")\n", $annotationName[0]); - } - - if ($annotationType == "severity") { - $testAnnotationsPhp .= sprintf("\t * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); - } - - if ($annotationType == "testCaseId") { - $testAnnotationsPhp .= sprintf("\t * @TestCaseId(\"%s\")\n", $annotationName[0]); - } - } - - $testAnnotationsPhp .= sprintf("\t * @Parameter(name = \"%s\", value=\"$%s\")\n", "AcceptanceTester", "I"); - - foreach ($testAnnotationsObject as $annotationType => $annotationName) { - if ($annotationType == "group") { - foreach ($annotationName as $name) - { - $testAnnotationsPhp .= sprintf("\t * @group %s\n", $name); - } - } - - if ($annotationType == "env") { - foreach ($annotationName as $env) - { - $testAnnotationsPhp .= sprintf("\t * @env %s\n", $env); - } - } - } - - $testAnnotationsPhp .= sprintf("\t * @param %s $%s\n", "AcceptanceTester", "I"); - $testAnnotationsPhp .= "\t * @return void\n"; - $testAnnotationsPhp .= "\t */\n"; - - return $testAnnotationsPhp; -} - -/** - * Creates a PHP string based on a block. - * Concatenates the Test Annotations PHP and Test PHP for a single Test. - * @param $testsObject - * @return string - */ -function generateTestsPhp($testsObject) -{ - $testPhp = ""; - - foreach ($testsObject as $test) - { - $testName = $test->getName(); - $testName = str_replace(' ', '', $testName); - $testAnnotations = generateTestAnnotationsPhp($test->getAnnotations()); - $dependencies = 'AcceptanceTester $I'; - $steps = generateStepsPhp($test->getOrderedActions()); - - $testPhp .= $testAnnotations; - $testPhp .= sprintf("\tpublic function %s(%s)\n", $testName, $dependencies); - $testPhp .= "\t{\n"; - $testPhp .= $steps; - $testPhp .= "\t}\n"; - - if (sizeof($testsObject) > 1) { - $testPhp .= "\n"; - } - } - - return $testPhp; -} - -/** - * Create ALL Cest files. - */ -createAllCestFiles(); \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php new file mode 100644 index 000000000..da146b851 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -0,0 +1,854 @@ +getCestData(); + return $cestOutput; + } + + /** + * Create a single PHP file containing the $cestPhp using the $filename. + * If the _generated directory doesn't exist it will be created. + * @param $cestPhp + * @param $filename + * @throws Exception + */ + private function createCestFile($cestPhp, $filename) + { + $exportDirectory = TESTS_MODULE_PATH . "/_generated"; + $exportFilePath = sprintf("%s/%s.php", $exportDirectory, $filename); + + if (!is_dir($exportDirectory)) { + mkdir($exportDirectory, 0777, true); + } + + $file = fopen($exportFilePath, 'w'); + + if (!$file) { + throw new Exception("Could not open the file!"); + } + + fwrite($file, $cestPhp); + fclose($file); + } + + /** + * Assemble ALL PHP strings using the assembleAllCestPhp function. Loop over and pass each array item to the createCestFile function. + */ + public function createAllCestFiles() + { + $cestPhpArray = $this->assembleAllCestPhp(); + + foreach ($cestPhpArray as $cestPhpFile) { + $this->createCestFile($cestPhpFile[1], $cestPhpFile[0]); + } + } + + /** + * Assemble the entire PHP string for a single Test based on a Cest Object. + * Create all of the PHP strings for a Test. Concatenate the strings together. + * @param $cestObject + * @return string + */ + private function assembleCestPhp($cestObject) + { + $usePhp = $this->generateUseStatementsPhp($cestObject); + $classAnnotationsPhp = $this->generateClassAnnotationsPhp($cestObject->getAnnotations()); + $className = $cestObject->getName(); + $className = str_replace(' ', '', $className); + $hookPhp = $this->generateHooksPhp($cestObject->getHooks()); + $testsPhp = $this->generateTestsPhp($cestObject->getTests()); + + $cestPhp = "loadAllCestObjects(); + $cestPhpArray = []; + + foreach ($cestObjects as $cest) { + $name = $cest->getName(); + $name = $string = str_replace(' ', '', $name); + $php = $this->assembleCestPhp($cest); + $cestPhpArray[] = [$name, $php]; + } + + return $cestPhpArray; + } + + /** + * Creates a PHP string for the necessary Allure and AcceptanceTester use statements. + * Since we don't support other dependencies at this time, this function takes no parameter. + * @param $cestObject + * @return string + */ + private function generateUseStatementsPhp($cestObject) + { + $hooks = $cestObject->getHooks(); + $data = false; + + /** + * Loop over each Hook object, loop over each Step in the Hook object looking for a createData or deleteData. + * If they are present set a variable to True so the PHP generator uses $this->_____->createData() instead of + * $______->createData(). + */ + foreach ($hooks as $hook) { + if (!$data) { + $steps = $hook->getActions(); + + foreach ($steps as $step) { + if ($step->getType() === "createData" || $step->getType() === "deleteData") { + $data = true; + break; + } + } + } + } + + $useStatementsPhp = "use Magento\AcceptanceTestFramework\AcceptanceTester;\n"; + + if ($data) { + $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager;\n"; + $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Api\EntityApiHandler;\n"; + } + + $allureStatements = ["Yandex\Allure\Adapter\Annotation\Features;", + "Yandex\Allure\Adapter\Annotation\Stories;", + "Yandex\Allure\Adapter\Annotation\Title;", + "Yandex\Allure\Adapter\Annotation\Description;", + "Yandex\Allure\Adapter\Annotation\Parameter;", + "Yandex\Allure\Adapter\Annotation\Severity;", + "Yandex\Allure\Adapter\Model\SeverityLevel;", + "Yandex\Allure\Adapter\Annotation\TestCaseId;\n"]; + + foreach ($allureStatements as $allureUseStatement) { + $useStatementsPhp .= sprintf("use %s\n", $allureUseStatement); + } + + return $useStatementsPhp; + } + + /** + * Creates a PHP string for the Class Annotations block if the Cest file contains an block, outside + * of the blocks. + * @param $classAnnotationsObject + * @return string + */ + private function generateClassAnnotationsPhp($classAnnotationsObject) + { + $classAnnotationsPhp = "/**\n"; + + foreach ($classAnnotationsObject as $annotationType => $annotationName) { + if ($annotationType == "features") { + $features = ""; + + foreach ($annotationName as $name) { + $features .= sprintf("\"%s\"", $name); + + if (next($annotationName)) { + $features .= ", "; + } + } + + $classAnnotationsPhp .= sprintf(" * @Features({%s})\n", $features); + } + + if ($annotationType == "stories") { + $stories = ""; + + foreach ($annotationName as $name) { + $stories .= sprintf("\"%s\"", $name); + + if (next($annotationName)) { + $stories .= ", "; + } + } + + $classAnnotationsPhp .= sprintf(" * @Stories({%s})\n", $stories); + } + + if ($annotationType == "title") { + $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); + } + + if ($annotationType == "description") { + $classAnnotationsPhp .= sprintf(" * @Description(\"%s\")\n", $annotationName[0]); + } + + if ($annotationType == "severity") { + $classAnnotationsPhp .= sprintf(" * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); + } + + if ($annotationType == "testCaseId") { + $classAnnotationsPhp .= sprintf(" * TestCaseId(\"%s\")", $annotationName[0]); + } + + if ($annotationType == "group") { + foreach ($annotationName as $group) { + $classAnnotationsPhp .= sprintf(" * @group %s\n", $group); + } + } + + if ($annotationType == "env") { + foreach ($annotationName as $env) { + $classAnnotationsPhp .= sprintf(" * @env %s\n", $env); + } + } + } + + $classAnnotationsPhp .= " */\n"; + + return $classAnnotationsPhp; + } + + /** + * Creates a PHP string for the actions contained withing a block. + * Since nearly half of all Codeception methods don't share the same signature I had to setup a massive Case + * statement to handle each unique action. At the bottom of the case statement there is a generic function that can + * construct the PHP string for nearly half of all Codeception actions. + * @param $stepsObject + * @param $hookObject + * @return string + */ + private function generateStepsPhp($stepsObject, $hookObject = false) + { + $testSteps = ""; + + foreach ($stepsObject as $steps) { + $actor = "I"; + $actionName = $steps->getType(); + $customActionAttributes = $steps->getCustomActionAttributes(); + $selector = null; + $input = null; + $parameterArray = null; + $returnVariable = null; + $x = null; + $y = null; + $html = null; + $url = null; + $function = null; + $time = null; + + if (isset($customActionAttributes['returnVariable'])) { + $returnVariable = $customActionAttributes['returnVariable']; + } + + if (isset($customActionAttributes['url']) && isset($customActionAttributes['userInput'])) { + $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + } elseif (isset($customActionAttributes['userInput'])) { + $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + } elseif (isset($customActionAttributes['url'])) { + $input = sprintf("\"%s\"", $customActionAttributes['url']); + } elseif (isset($customActionAttributes['time'])) { + $input = sprintf("\"%s\"", $customActionAttributes['time']); + } + + if (isset($customActionAttributes['parameterArray'])) { + $parameterArray = $customActionAttributes['parameterArray']; + } + + if (isset($customActionAttributes['selectorArray'])) { + $selector = sprintf("%s", $customActionAttributes['selectorArray']); + } elseif (isset($customActionAttributes['selector'])) { + $selector = sprintf("\"%s\"", $customActionAttributes['selector']); + } + + if (isset($customActionAttributes['x'])) { + $x = $customActionAttributes['x']; + } + + if (isset($customActionAttributes['y'])) { + $y = $customActionAttributes['y']; + } + + if (isset($customActionAttributes['function'])) { + $function = $customActionAttributes['function']; + } + + if (isset($customActionAttributes['html'])) { + $html = $customActionAttributes['html']; + } + + if (isset($customActionAttributes['time'])) { + $time = $customActionAttributes['time']; + } elseif (isset($customActionAttributes['timeout'])) { + $time = $customActionAttributes['timeout']; + } + + switch ($actionName) { + case "amOnPage": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "amOnSubdomain": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "amOnUrl": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "click": + if ($input && $selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); + } elseif ($input && !$selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } elseif (!$input && $selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "clickWithLeftButton": + if ($selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + } else { + $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); + } + break; + case "clickWithRightButton": + if ($selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + } else { + $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); + } + break; + case "createData": + $entity = $customActionAttributes['entity']; + $key = $steps->getMergeKey(); + + if ($hookObject) { + $testSteps .= sprintf("\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, $entity); + $testSteps .= sprintf("\t\t\$this->%s = new EntityApiHandler($%s);\n", $key, $entity); + $testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key); + } else { + $testSteps .= sprintf("\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, $entity); + $testSteps .= sprintf("\t\t$%s = new EntityApiHandler($%s);\n", $key, $entity); + $testSteps .= sprintf("\t\t$%s->createEntity();\n", $key); + } + break; + case "deleteData": + $key = $customActionAttributes['createDataKey']; + + if ($hookObject) { + $testSteps .= sprintf("\t\t\$this->%s->deleteEntity();\n", $key); + } else { + $testSteps .= sprintf("\t\t$%s->deleteEntity();\n", $key); + } + break; + case "dontSee": + if ($selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "dontSeeCookie": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "dontSeeCurrentUrlEquals": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "dontSeeCurrentUrlMatches": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "dontSeeElement": + if ($parameterArray) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "dontSeeElementInDOM": + if ($parameterArray) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "dontSeeInCurrentUrl": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "dontSeeInField": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; + case "dontSeeInFormFields": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + break; + case "dontSeeInSource": + // TODO: Solve the HTML parsing issue. + $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $html); + break; + case "dontSeeLink": + if (isset($customActionAttributes['url'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['url']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "dragAndDrop": + $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $customActionAttributes['selector1'], $customActionAttributes['selector2']); + break; + case "executeInSelenium": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $function); + break; + case "executeJS": + $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $function); + break; + case "fillField": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; + case "formatMoney": + if (isset($customActionAttributes['locale'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['locale']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "grabCookie": + if (isset($returnVariable)) { + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); + } + } else { + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + } + break; + case "grabFromCurrentUrl": + if (isset($returnVariable)) { + if ($input) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); + } + } else { + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + } + break; + case "grabValueFrom": + if (isset($returnVariable)) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "loginAsAdmin": + if (isset($customActionAttributes['username']) && isset($customActionAttributes['password'])) { + $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $customActionAttributes['username'], $customActionAttributes['password']); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; + case "moveMouseOver": + if ($selector) { + if (isset($step['x']) || isset($step['y'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + } else { + $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); + } + break; + case "mSetLocale": + if (isset($customActionAttributes['locale'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['locale']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "performOn": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $function); + break; + case "pressKey": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + } + break; + case "resetCookie": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "resizeWindow": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $customActionAttributes['width'], $customActionAttributes['height']); + break; + case "scrollTo": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + break; + case "searchAndMultiSelectOption": + if (isset($customActionAttributes['requiredAction'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray'], $customActionAttributes['requiredAction']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray']); + } + break; + case "see": + if (isset($customActionAttributes['selector'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "seeCookie": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "seeCurrentUrlEquals": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "seeCurrentUrlMatches": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "seeElement": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "seeElementInDOM": + if (isset($parameterArray)) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + break; + case "seeInCurrentUrl": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "seeInField": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; + case "seeInFormFields": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + break; + case "seeInPageSource": + // TODO: Solve the HTML parsing issue. + break; + case "seeInSource": + // TODO: Solve the HTML parsing issue. + break; + case "seeLink": + if (isset($step['url'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['url']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } + break; + case "seeNumberOfElements": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); + break; + case "selectOption": + if ($parameterArray) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + } + break; + case "setCookie": + if ($parameterArray) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", %s);\n", $actor, $actionName, $input, $customActionAttributes['value'], $parameterArray); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['value']); + } + break; + case "submitForm": + if (isset($step['button'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", \"%s\");\n", $actor, $actionName, $selector, $parameterArray, $customActionAttributes['button']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $parameterArray); + } + break; + case "wait": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); + break; + case "waitForAjaxLoad": + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; + case "waitForElement": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $time); + break; + case "waitForElementChange": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $function, $time); + break; + case "waitForJS": + $testSteps .= sprintf("\t\t$%s->%s(\"%s\", %s);\n", $actor, $actionName, $function, $time); + break; + case "waitForPageLoad": + if ($time) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; + case "waitForText": + if ($selector) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $input, $time, $selector); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $time); + } + break; + default: + if ($returnVariable) { + if ($selector) { + if (isset($customActionAttributes['userInput'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, \"%s\");\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['userInput']); + } elseif (isset($customActionAttributes['parameter'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['parameter']); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); + } + } else { + if (isset($customActionAttributes['userInput'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $actionName, $customActionAttributes['userInput']); + } elseif (isset($customActionAttributes['parameter'])) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $customActionAttributes['parameter']); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); + } + } + } else { + if ($selector) { + if (isset($customActionAttributes['userInput'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); + } elseif (isset($customActionAttributes['parameter'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameter']); + } else { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + } + } else { + if (isset($customActionAttributes['userInput'])) { + $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $customActionAttributes['userInput']); + } elseif (isset($customActionAttributes['parameter'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $customActionAttributes['parameter']); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + } + } + } + } + + return $testSteps; + } + + /** + * Creates a PHP string for the _before/_after methods if the Test contains an or block. + * @param $hookObjects + * @return string + */ + private function generateHooksPhp($hookObjects) + { + $hooks = ""; + $createData = false; + foreach ($hookObjects as $hookObject) { + $type = $hookObject->getType(); + $dependencies = 'AcceptanceTester $I'; + + foreach ($hookObject->getActions() as $step) { + if ($step->getType() == "createData") { + $hooks .= "\t/**\n"; + $hooks .= sprintf("\t * @var EntityApiHandler $%s;\n", $step->getMergeKey()); + $hooks .= "\t */\n"; + $hooks .= sprintf("\tprotected $%s;\n\n", $step->getMergeKey()); + $createData = true; + } + } + + $steps = $this->generateStepsPhp($hookObject->getActions(), $createData); + + if ($type == "after") { + $hooks .= sprintf("\tpublic function _after(%s)\n", $dependencies); + $hooks .= "\t{\n"; + $hooks .= $steps; + $hooks .= "\t}\n\n"; + } + + if ($type == "before") { + $hooks .= sprintf("\tpublic function _before(%s)\n", $dependencies); + $hooks .= "\t{\n"; + $hooks .= $steps; + $hooks .= "\t}\n\n"; + } + + $hooks .= ""; + } + + return $hooks; + } + + /** + * Creates a PHP string for the Test Annotations block if the Test contains an block. + * @param $testAnnotationsObject + * @return string + */ + private function generateTestAnnotationsPhp($testAnnotationsObject) + { + $testAnnotationsPhp = "\t/**\n"; + + foreach ($testAnnotationsObject as $annotationType => $annotationName) { + if ($annotationType == "features") { + $features = ""; + + foreach ($annotationName as $name) { + $features .= sprintf("\"%s\"", $name); + + if (next($annotationName)) { + $features .= ", "; + } + } + + $testAnnotationsPhp .= sprintf("\t * @Features({%s})\n", $features); + } + + if ($annotationType == "stories") { + $stories = ""; + + foreach ($annotationName as $name) { + $stories .= sprintf("\"%s\"", $name); + + if (next($annotationName)) { + $stories .= ", "; + } + } + + $testAnnotationsPhp .= sprintf("\t * @Stories({%s})\n", $stories); + } + + if ($annotationType == "title") { + $testAnnotationsPhp .= sprintf("\t * @Title(\"%s\")\n", $annotationName[0]); + } + + if ($annotationType == "description") { + $testAnnotationsPhp .= sprintf("\t * @Description(\"%s\")\n", $annotationName[0]); + } + + if ($annotationType == "severity") { + $testAnnotationsPhp .= sprintf("\t * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); + } + + if ($annotationType == "testCaseId") { + $testAnnotationsPhp .= sprintf("\t * @TestCaseId(\"%s\")\n", $annotationName[0]); + } + } + + $testAnnotationsPhp .= sprintf("\t * @Parameter(name = \"%s\", value=\"$%s\")\n", "AcceptanceTester", "I"); + + foreach ($testAnnotationsObject as $annotationType => $annotationName) { + if ($annotationType == "group") { + foreach ($annotationName as $name) { + $testAnnotationsPhp .= sprintf("\t * @group %s\n", $name); + } + } + + if ($annotationType == "env") { + foreach ($annotationName as $env) { + $testAnnotationsPhp .= sprintf("\t * @env %s\n", $env); + } + } + } + + $testAnnotationsPhp .= sprintf("\t * @param %s $%s\n", "AcceptanceTester", "I"); + $testAnnotationsPhp .= "\t * @return void\n"; + $testAnnotationsPhp .= "\t */\n"; + + return $testAnnotationsPhp; + } + + /** + * Creates a PHP string based on a block. + * Concatenates the Test Annotations PHP and Test PHP for a single Test. + * @param $testsObject + * @return string + */ + private function generateTestsPhp($testsObject) + { + $testPhp = ""; + + foreach ($testsObject as $test) { + $testName = $test->getName(); + $testName = str_replace(' ', '', $testName); + $testAnnotations = $this->generateTestAnnotationsPhp($test->getAnnotations()); + $dependencies = 'AcceptanceTester $I'; + $steps = $this->generateStepsPhp($test->getOrderedActions()); + + $testPhp .= $testAnnotations; + $testPhp .= sprintf("\tpublic function %s(%s)\n", $testName, $dependencies); + $testPhp .= "\t{\n"; + $testPhp .= $steps; + $testPhp .= "\t}\n"; + + if (sizeof($testsObject) > 1) { + $testPhp .= "\n"; + } + } + + return $testPhp; + } +} \ No newline at end of file From 39808529762d1c552ae4151fb4d058f7c628b17b Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Fri, 11 Aug 2017 11:15:16 -0500 Subject: [PATCH 106/149] MQE-241:[CAP] Add .env parameter support - add logic for creating _ENV EntityDataObject - add logic for populating _ENV EntityDataObject with env var from .env file - change Action Object resolution so multiple params can be deind in url and userInput. - change Action Object resolution so url will resolve both Page and Env references. - remove explicit url reference appending from action object - support data inputs from types such as parameterArray --- .../DataGenerator/Managers/DataManager.php | 57 ++++++- .../PageObject/Page/Page.php | 10 +- .../Test/Objects/ActionObject.php | 144 ++++++++++++------ 3 files changed, 162 insertions(+), 49 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php index 7b95eea55..06600643e 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php @@ -13,7 +13,13 @@ class DataManager private $data = []; // an array of entity names to the entity data objects themselves private $arrayData; private static $dataManager; + const ENV_DATA_OBJECT_NAME = '_ENV'; + /** + * Singleton method to access instance of DataManager. + * @return DataManager + * @throws Exception + */ public static function getInstance() { if (!self::$dataManager) { @@ -21,7 +27,7 @@ public static function getInstance() $entityParsedData = $entityParser->readDataProfiles(); if (!$entityParsedData) { - throw new Exception(sprintf("No entities could be parsed from xml definitions")); + throw new Exception("No entities could be parsed from xml definitions"); } self::$dataManager = new DataManager($entityParsedData); @@ -30,14 +36,47 @@ public static function getInstance() return self::$dataManager; } + /** + * DataManager constructor. + * @param array $arrayData + */ private function __construct($arrayData) { $this->arrayData = $arrayData; } + /** + * Adds all .env variables defined in the PROJECT_ROOT as EntityDataObjects. This is to allow resolution + * of these variables when referenced in a cest. + */ + private function parseEnvVariables() + { + $envFilename = PROJECT_ROOT . '/.env'; + + if (file_exists($envFilename)) { + $envData = []; + + $envFile = file($envFilename); + + foreach ($envFile as $entry) { + $params = explode("=", $entry); + if (count($params) != 2) { + continue; + } + $envData[strtolower(trim($params[0]))] = trim($params[1]); + } + + + $envDataObject = new EntityDataObject(self::ENV_DATA_OBJECT_NAME, 'environment', $envData, null); + $this->data[$envDataObject->getName()] = $envDataObject; + } + } + + /** + * Parses data xml and extracts all information into EntityDataObject. + */ private function parseDataEntities() { - $entityObjects = array(); $entities = $this->arrayData; foreach ($entities[DataGeneratorConstants::ENTITY_DATA] as $entityName => $entity) { @@ -85,24 +124,32 @@ private function parseDataEntities() $linkedEntities ); - $entityObjects[$entityXmlObject->getName()] = $entityXmlObject; + $this->data[$entityXmlObject->getName()] = $entityXmlObject; } unset($entityName); unset($entity); - - $this->data = $entityObjects; } + /** + * Method returns a single data entity by name based on what is defined in data.xml. + * @param $entityName + * @return EntityDataObject + */ public function getEntity($entityName) { return $this->getAllEntities()[$entityName]; } + /** + * Method returns all data entities read from data.xml into objects. + * @return array + */ public function getAllEntities() { if (!$this->data) { $this->parseDataEntities(); + $this->parseEnvVariables(); } return $this->data; diff --git a/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php b/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php index 07aa8a891..fc5c67b23 100644 --- a/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php +++ b/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php @@ -25,7 +25,15 @@ class Page implements PageInterface public static function getPage($pageName = null) { self::initPageObjects(); - return !$pageName ? self::$pageObjects : self::$pageObjects[$pageName]; + if (!$pageName) { + return self::$pageObjects; + } + + if (array_key_exists($pageName, self::$pageObjects)) { + return self::$pageObjects[$pageName]; + } + + return null; } /** diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 2b24cd61e..91be5c220 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -8,6 +8,15 @@ class ActionObject { + /** + * @var string $mergeKey + * @var string $type + * @var array $actionAttributes + * @var string $linkedAction + * @var int $orderOffset + * @var array $resolvedCustomAttributes + * @var int timeout + */ private $mergeKey; private $type; private $actionAttributes = []; @@ -16,6 +25,16 @@ class ActionObject private $resolvedCustomAttributes = []; private $timeout; + const DATA_ENABLED_ATTRIBUTES = ["userInput", "parameterArray"]; + + /** + * ActionObject constructor. + * @param string $mergeKey + * @param string $type + * @param array $actionAttributes + * @param string|null $linkedAction + * @param int $order + */ public function __construct($mergeKey, $type, $actionAttributes, $linkedAction = null, $order = 0) { $this->mergeKey = $mergeKey; @@ -28,11 +47,19 @@ public function __construct($mergeKey, $type, $actionAttributes, $linkedAction = } } + /** + * This function returns the string property mergeKey. + * @return string + */ public function getMergeKey() { return $this->mergeKey; } + /** + * This function returns the string property type. + * @return string + */ public function getType() { return $this->type; @@ -52,16 +79,29 @@ public function getCustomActionAttributes() return array_merge($this->actionAttributes, $this->resolvedCustomAttributes); } + /** + * This function returns the string property linkedAction, describing a step to reference for a merge. + * @return string + */ public function getLinkedAction() { return $this->linkedAction; } + /** + * This function returns the int property orderOffset, describing before or after for a merge. + * @return int + */ public function getOrderOffset() { return $this->orderOffset; } + /** + * This function returns the int property timeout, this can be set as a result of the use of a section element + * requiring a wait. + * @return int + */ public function getTimeout() { return $this->timeout; @@ -81,7 +121,7 @@ public function resolveReferences() if (empty($this->resolvedCustomAttributes)) { $this->resolveSelectorReferenceAndTimeout(); $this->resolveUrlReference(); - $this->resolveUserInputReference(); + $this->resolveDataInputReferences(); } } @@ -100,9 +140,11 @@ private function resolveSelectorReferenceAndTimeout() } $selector = $this->actionAttributes['selector']; - $reference = $this->findReference($selector); - if ($reference == null) { - // Nothing to replace + $reference = $this->findAllReferences($selector); + if (count($reference) == 1) { + $reference = $reference[0]; + } else { + // Selectors can only handle a single var reference return; } @@ -112,8 +154,13 @@ private function resolveSelectorReferenceAndTimeout() // Bad section reference return; } + $replacement = Section::getElementLocator($sectionName, $elementName); + if ($replacement == null) { + // Bad section reference + return; + } $this->resolvedCustomAttributes['selector'] = str_replace($reference, $replacement, $selector); $this->timeout = Section::getElementTimeOut($sectionName, $elementName); } @@ -133,59 +180,70 @@ private function resolveUrlReference() } $url = $this->actionAttributes['url']; - $reference = $this->findReference($url); - if ($reference == null) { - // Nothing to replace - return; - } + foreach ($this->findAllReferences($url) as $reference) { + $replacement = null; - list($pageName) = $this->stripAndSplitReference($reference); - $page = Page::getPage($pageName); - if ($page == null) { - // Bad page reference - return; + // assume this is a page + list($pageName) = $this->stripAndSplitReference($reference); + $page = Page::getPage($pageName); + + if ($page != null) { + $replacement = Page::getPageUrl($pageName); + } else { + // try to resolve as data + list($entityName, $entityField) = $this->stripAndSplitReference($reference); + $replacement = DataManager::getInstance()->getEntity($entityName)->getDataByName($entityField); + } + + if ($replacement == null) { + continue; + // Bad var ref + } + $url = str_replace($reference, $replacement, $url); } - $replacement = $_ENV['MAGENTO_BASE_URL'] . Page::getPageUrl($pageName); - $this->resolvedCustomAttributes['url'] = str_replace($reference, $replacement, $url); + $this->resolvedCustomAttributes['url'] = $url; } - /** - * Look up the value for EntityDataObjectName.Key and set it as the userInput attribute in the resolved custom + * Look up the value for EntityDataObjectName.Key and set it as the corresponding attribute in the resolved custom * attributes. * * e.g. {{CustomerEntityFoo.FirstName}} becomes Jerry * * @return void */ - private function resolveUserInputReference() + private function resolveDataInputReferences() { - if (!array_key_exists('userInput', $this->actionAttributes)) { - return; - } - $userInput = $this->actionAttributes['userInput']; + $actionAttributeKeys = array_keys($this->actionAttributes); + $relevantDataAttributes = array_intersect($actionAttributeKeys, ActionObject::DATA_ENABLED_ATTRIBUTES); - $reference = $this->findReference($userInput); - if ($reference == null) { - // Nothing to replace + if (empty($relevantDataAttributes)) { return; } - list($entityName, $entityKey) = $this->stripAndSplitReference($userInput); - $entityObj = DataManager::getInstance()->getEntity($entityName); - if ($entityObj == null) { - // Bad entity reference - return; - } + foreach ($relevantDataAttributes as $dataAttribute) { + $varInput = $this->actionAttributes[$dataAttribute]; - $replacement = $entityObj->getDataByName($entityKey); - if ($replacement == null) { - // Bad entity.key reference - return; - } + foreach ($this->findAllReferences($varInput) as $reference) { + list($entityName, $entityKey) = $this->stripAndSplitReference($reference); + $entityObj = DataManager::getInstance()->getEntity($entityName); + if ($entityObj == null) { + // Bad entity reference + continue; + } - $this->resolvedCustomAttributes['userInput'] = str_replace($reference, $replacement, $userInput); + $replacement = $entityObj->getDataByName($entityKey) ?? null; + if ($replacement == null) { + // Bad entity.key reference + return; + } + + $varInput = str_replace($reference, $replacement, $varInput); + } + + $this->resolvedCustomAttributes[$dataAttribute] = $varInput; + } } /** @@ -201,16 +259,16 @@ private function stripAndSplitReference($reference) } /** - * Return a {{reference.foo}} if it exists in the string. + * Return an array of {{reference.foo}} if any exist in the string, otherwise returns an empty array. * * @param string $str - * @return string|null + * @return array */ - private function findReference($str) + private function findAllReferences($str) { - preg_match('/{{[\w.]+}}/', $str, $matches); + preg_match_all('/{{[\w.]+}}/', $str, $matches); if (empty($matches)) { - return null; + return []; } else { return $matches[0]; } From 34f827da54e406bc65dcb6a9ab12cef07aa1564a Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Fri, 11 Aug 2017 15:54:22 -0500 Subject: [PATCH 107/149] MQE:171 Update xml schema and references for data operations --- etc/di.xml | 6 +- .../Managers/JsonDefinitionManager.php | 69 ++++++++++++++----- .../{EntityMetadata.xsd => dataOperation.xsd} | 4 +- ...rofileSchema.xsd => dataProfileSchema.xsd} | 0 4 files changed, 56 insertions(+), 23 deletions(-) rename src/Magento/AcceptanceTestFramework/DataGenerator/etc/{EntityMetadata.xsd => dataOperation.xsd} (97%) rename src/Magento/AcceptanceTestFramework/DataGenerator/etc/{DataProfileSchema.xsd => dataProfileSchema.xsd} (100%) diff --git a/etc/di.xml b/etc/di.xml index e46ba1de2..b530480e7 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -155,7 +155,7 @@ - Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd + Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd @@ -174,7 +174,7 @@ - + @@ -188,7 +188,7 @@ - Magento/AcceptanceTestFramework/DataGenerator/etc/EntityMetadata.xsd + Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php index 19c232d4f..1b7c1cba4 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php @@ -12,6 +12,27 @@ class JsonDefinitionManager private static $jsonDefinitionManager; private $jsonDefinitions; + const ENTITY_OPERATION_ROOT_TAG = 'operation'; + const ENTITY_OPERATION_TYPE = 'type'; + const ENTITY_OPERATION_DATA_TYPE = 'dataType'; + const ENTITY_OPERATION_URL = 'url'; + const ENTITY_OPERATION_METHOD = 'method'; + const ENTITY_OPERATION_AUTH = 'auth'; + const ENTITY_OPERATION_HEADER = 'header'; + const ENTITY_OPERATION_HEADER_PARAM = 'param'; + const ENTITY_OPERATION_HEADER_VALUE = 'value'; + const ENTITY_OPERATION_URL_PARAM = 'param'; + const ENTITY_OPERATION_URL_PARAM_TYPE = 'type'; + const ENTITY_OPERATION_URL_PARAM_KEY = 'key'; + const ENTITY_OPERATION_URL_PARAM_VALUE = 'value'; + const ENTITY_OPERATION_ENTRY = 'entry'; + const ENTITY_OPERATION_ENTRY_KEY = 'key'; + const ENTITY_OPERATION_ENTRY_VALUE = 'value'; + const ENTITY_OPERATION_ARRAY = 'array'; + const ENTITY_OPERATION_ARRAY_KEY = 'key'; + const ENTITY_OPERATION_ARRAY_VALUE = 'value'; + + public static function getInstance() { if (!self::$jsonDefinitionManager) { @@ -30,37 +51,49 @@ private function getObjects() { $objectManager = ObjectManagerFactory::getObjectManager(); $metadataParser = $objectManager->create(MetadataParser::class); - foreach ($metadataParser->readMetadata()['metadata'] as $jsonDefName => $jsonDefArray) { - $operation = $jsonDefArray['operation']; - $dataType = $jsonDefArray['dataType']; - $url = $jsonDefArray['url'] ?? null; - $method = $jsonDefArray['method'] ?? null; - $auth = $jsonDefArray['auth'] ?? null; + foreach ($metadataParser->readMetadata()[JsonDefinitionManager::ENTITY_OPERATION_ROOT_TAG] as + $jsonDefName => $jsonDefArray) { + $operation = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_TYPE]; + $dataType = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_DATA_TYPE]; + $url = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_URL] ?? null; + $method = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_METHOD] ?? null; + $auth = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_AUTH] ?? null; $headers = []; $params = []; $jsonMetadata = []; - if (array_key_exists('header', $jsonDefArray)) { - foreach ($jsonDefArray['header'] as $headerEntry) { - $headers[] = $headerEntry['param'] . ': ' . $headerEntry['value']; + if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_HEADER, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_HEADER] as $headerEntry) { + $headers[] = $headerEntry[JsonDefinitionManager::ENTITY_OPERATION_HEADER_PARAM] . ': ' . + $headerEntry[JsonDefinitionManager::ENTITY_OPERATION_HEADER_VALUE]; } } - if (array_key_exists('param', $jsonDefArray)) { - foreach ($jsonDefArray['param'] as $paramEntry) { - $params[$paramEntry['type']][$paramEntry['key']] = $paramEntry['value']; + if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM] as $paramEntry) { + $params[$paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_TYPE]] + [$paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_KEY]] = + $paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_VALUE]; } } - if (array_key_exists('entry', $jsonDefArray)) { - foreach ($jsonDefArray['entry'] as $jsonEntryType) { - $jsonMetadata[] = new JsonElement($jsonEntryType['key'], $jsonEntryType['value'], 'entry'); + if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_ENTRY, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_ENTRY] as $jsonEntryType) { + $jsonMetadata[] = new JsonElement( + $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ENTRY_KEY], + $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ENTRY_VALUE], + JsonDefinitionManager::ENTITY_OPERATION_ENTRY + ); } } - if (array_key_exists('array', $jsonDefArray)) { - foreach ($jsonDefArray['array'] as $jsonEntryType) { - $jsonMetadata[] = new JsonElement($jsonEntryType['key'], $jsonEntryType['value'], 'array'); + if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_ARRAY, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_ARRAY] as $jsonEntryType) { + $jsonMetadata[] = new JsonElement( + $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ARRAY_KEY], + $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ARRAY_VALUE], + JsonDefinitionManager::ENTITY_OPERATION_ARRAY + ); } } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/EntityMetadata.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd similarity index 97% rename from src/Magento/AcceptanceTestFramework/DataGenerator/etc/EntityMetadata.xsd rename to src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd index ed308dc71..7bf8aae5a 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/EntityMetadata.xsd +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd @@ -3,7 +3,7 @@ - + @@ -48,7 +48,7 @@ - + diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd similarity index 100% rename from src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd rename to src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd From c76fb3669be9b93ee9d849b2ac8c3f396f02b631 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 14 Aug 2017 16:01:16 -0500 Subject: [PATCH 108/149] MQE-19: Implemented test modules composer packaging. --- .env.example | 5 ----- bootstrap.php | 17 ----------------- composer.json | 3 +-- .../Test/Objects/TestObject.php | 2 +- 4 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 .env.example delete mode 100755 bootstrap.php diff --git a/.env.example b/.env.example deleted file mode 100644 index 7481eddb7..000000000 --- a/.env.example +++ /dev/null @@ -1,5 +0,0 @@ -MAGENTO_ADMIN_USERNAME=admin -MAGENTO_ADMIN_PASSWORD=test123 -MAGENTO_BASE_URL=http://127.0.0.1:32769/ -TESTS_BP=/Users/dev/somepath/magento2ce-acceptance-tests -FW_BP=/Users/dev/somepath/magento2-acceptance-test-framework diff --git a/bootstrap.php b/bootstrap.php deleted file mode 100755 index df9796d94..000000000 --- a/bootstrap.php +++ /dev/null @@ -1,17 +0,0 @@ -load(); - -foreach ($_ENV as $key => $var) { - defined($key) || define($key, $var); -} - -defined('FW_BP') || define('FW_BP', str_replace('\\', '/', (__DIR__))); -defined('TESTS_BP') || define('TESTS_BP', dirname(dirname(dirname(FW_BP)))); -define('TESTS_MODULE_PATH', TESTS_BP . '/tests/acceptance/Magento/AcceptanceTest'); - -$objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); diff --git a/composer.json b/composer.json index 090aea1c1..fc229da31 100755 --- a/composer.json +++ b/composer.json @@ -7,8 +7,7 @@ "php": "~7.0", "codeception/codeception": "2.2|2.3", "flow/jsonpath": ">0.2", - "fzaninotto/faker": "^1.6", - "vlucas/phpdotenv": "~2.4" + "fzaninotto/faker": "^1.6" }, "require-dev": { "squizlabs/php_codesniffer": "1.5.3" diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index 199869777..cc156e37b 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -11,7 +11,7 @@ class TestObject private $stepsToMerge = []; private $parsedSteps = []; private $annotations = []; - private const STEP_MISSING_ERROR_MSG = + const STEP_MISSING_ERROR_MSG = "Merge Error - Step could not be found in either TestXML or DeltaXML. \tTest = '%s'\tTestStep='%s'\tLinkedStep'%s'"; From 28a3065ca8587d69431b8241d0fdf4a2dec5758a Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 14 Aug 2017 16:08:58 -0500 Subject: [PATCH 109/149] MQE-19: Implemented test modules composer packaging. --- .env.example | 5 ----- bootstrap.php | 17 ----------------- composer.json | 3 +-- .../Test/Objects/TestObject.php | 2 +- 4 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 .env.example delete mode 100755 bootstrap.php diff --git a/.env.example b/.env.example deleted file mode 100644 index 7481eddb7..000000000 --- a/.env.example +++ /dev/null @@ -1,5 +0,0 @@ -MAGENTO_ADMIN_USERNAME=admin -MAGENTO_ADMIN_PASSWORD=test123 -MAGENTO_BASE_URL=http://127.0.0.1:32769/ -TESTS_BP=/Users/dev/somepath/magento2ce-acceptance-tests -FW_BP=/Users/dev/somepath/magento2-acceptance-test-framework diff --git a/bootstrap.php b/bootstrap.php deleted file mode 100755 index df9796d94..000000000 --- a/bootstrap.php +++ /dev/null @@ -1,17 +0,0 @@ -load(); - -foreach ($_ENV as $key => $var) { - defined($key) || define($key, $var); -} - -defined('FW_BP') || define('FW_BP', str_replace('\\', '/', (__DIR__))); -defined('TESTS_BP') || define('TESTS_BP', dirname(dirname(dirname(FW_BP)))); -define('TESTS_MODULE_PATH', TESTS_BP . '/tests/acceptance/Magento/AcceptanceTest'); - -$objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); diff --git a/composer.json b/composer.json index 090aea1c1..fc229da31 100755 --- a/composer.json +++ b/composer.json @@ -7,8 +7,7 @@ "php": "~7.0", "codeception/codeception": "2.2|2.3", "flow/jsonpath": ">0.2", - "fzaninotto/faker": "^1.6", - "vlucas/phpdotenv": "~2.4" + "fzaninotto/faker": "^1.6" }, "require-dev": { "squizlabs/php_codesniffer": "1.5.3" diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index 199869777..cc156e37b 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -11,7 +11,7 @@ class TestObject private $stepsToMerge = []; private $parsedSteps = []; private $annotations = []; - private const STEP_MISSING_ERROR_MSG = + const STEP_MISSING_ERROR_MSG = "Merge Error - Step could not be found in either TestXML or DeltaXML. \tTest = '%s'\tTestStep='%s'\tLinkedStep'%s'"; From 7a982f0cbf2323e3bf2ae2787b72c7ca56da5abf Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 15 Aug 2017 10:39:40 -0500 Subject: [PATCH 110/149] - Adding amOnUrl to di.xml so it can be called multiple times in a single test. --- etc/di.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/di.xml b/etc/di.xml index b530480e7..7adb44ffa 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -221,7 +221,7 @@ name name - mergeKey + mergeKey *Cest.xml Cest @@ -231,7 +231,7 @@ - mergeKey + mergeKey name name From 8a812301cafc5e891cef172d09ebaa2be74c17ac Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 15 Aug 2017 16:20:03 -0500 Subject: [PATCH 111/149] Add variable attribute to any tag with url or userInput --- .../Test/etc/testSchema.xsd | 127 ++++++++++++------ 1 file changed, 88 insertions(+), 39 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index 55e23b264..7c229e142 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -165,7 +165,8 @@ - + + @@ -176,7 +177,8 @@ - + + @@ -187,7 +189,8 @@ - + + @@ -199,7 +202,8 @@ - + + @@ -211,7 +215,8 @@ - + + @@ -246,6 +251,7 @@ + @@ -326,9 +332,10 @@ - + + @@ -350,8 +357,9 @@ - + + @@ -362,7 +370,8 @@ - + + @@ -373,7 +382,8 @@ - + + @@ -409,7 +419,8 @@ - + + @@ -422,7 +433,8 @@ - + + @@ -445,7 +457,8 @@ - + + @@ -467,7 +480,8 @@ - + + @@ -488,8 +502,9 @@ - + + @@ -501,7 +516,8 @@ - + + @@ -559,7 +575,8 @@ - + + @@ -570,8 +587,9 @@ - + + @@ -583,7 +601,8 @@ - + + @@ -594,9 +613,10 @@ - + + @@ -609,6 +629,7 @@ + @@ -622,6 +643,7 @@ + @@ -670,6 +692,7 @@ + @@ -692,7 +715,8 @@ - + + @@ -713,8 +737,9 @@ - + + @@ -779,7 +804,8 @@ - + + @@ -815,6 +841,7 @@ + @@ -835,8 +862,9 @@ - + + @@ -859,7 +887,8 @@ - + + @@ -895,7 +924,7 @@ - + @@ -907,9 +936,10 @@ - + + @@ -931,8 +961,9 @@ - + + @@ -943,7 +974,8 @@ - + + @@ -954,7 +986,8 @@ - + + @@ -990,7 +1023,8 @@ - + + @@ -1003,7 +1037,8 @@ - + + @@ -1037,7 +1072,8 @@ - + + @@ -1059,7 +1095,8 @@ - + + @@ -1070,8 +1107,9 @@ - + + @@ -1085,6 +1123,7 @@ + @@ -1096,7 +1135,8 @@ - + + @@ -1110,6 +1150,7 @@ + @@ -1120,8 +1161,9 @@ - + + @@ -1147,6 +1189,7 @@ + @@ -1158,6 +1201,7 @@ + @@ -1169,6 +1213,7 @@ + @@ -1180,6 +1225,7 @@ + @@ -1190,7 +1236,8 @@ - + + @@ -1213,8 +1260,9 @@ - + + @@ -1329,9 +1377,10 @@ - + + From 918b2f9ce620483855a16bda2980b33818f450b9 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Wed, 16 Aug 2017 14:24:40 -0500 Subject: [PATCH 112/149] MQE-251:[Data Input] Change Data Accessor classes to implement interface - change classes to be defined implementations of DataHandler Interface - change references to DataHandler interfaces to reference new classes - change logic in ActionObject to consolidate parameter resolution. --- etc/di.xml | 12 +- .../DataGenerator/Api/ApiExecutor.php | 53 ++++- .../DataGenerator/Api/EntityApiHandler.php | 20 ++ .../DataGenerator/DataGeneratorConstants.php | 22 -- .../Handlers/DataObjectHandler.php | 186 +++++++++++++++++ .../Handlers/JsonDefinitionObjectHandler.php | 165 +++++++++++++++ .../DataGenerator/Managers/DataManager.php | 157 -------------- .../Managers/JsonDefinitionManager.php | 126 ----------- .../Objects/EntityDataObject.php | 40 +++- .../DataGenerator/Objects/JsonDefinition.php | 101 +++++++++ .../DataGenerator/Objects/JsonElement.php | 34 ++- .../Parsers/DataProfileSchemaParser.php | 16 +- ...Parser.php => OperationMetadataParser.php} | 12 +- .../ObjectManager/ObjectHandlerInterface.php | 25 +++ .../Page/Handlers/PageObjectHandler.php | 92 +++++++++ .../Page/Handlers/SectionObjectHandler.php | 105 ++++++++++ .../Page/Objects/ElementObject.php | 88 ++++++++ .../Page/Objects/PageObject.php | 109 ++++++++++ .../Page/Objects/SectionObject.php | 52 +++++ .../{PageObject => Page}/etc/PageObject.xsd | 0 .../etc/SectionObject.xsd | 0 .../PageObject/Page/Page.php | 103 --------- .../PageObject/Page/PageInterface.php | 42 ---- .../PageObject/Section/Section.php | 144 ------------- .../PageObject/Section/SectionInterface.php | 72 ------- .../Test/CestDataConstants.php | 25 --- .../CestObjectHandler.php} | 159 ++++++++------ .../Test/Objects/ActionObject.php | 195 +++++++++--------- .../Test/Objects/CestHookObject.php | 23 +++ .../Test/Objects/TestObject.php | 59 +++++- .../Test/TestDataParser.php | 11 +- .../Util/ApiClientUtil.php | 38 ++++ .../Util/TestGenerator.php | 4 +- .../XmlParser/PageParser.php | 4 +- 34 files changed, 1410 insertions(+), 884 deletions(-) delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/JsonDefinitionObjectHandler.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php delete mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php rename src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/{MetadataParser.php => OperationMetadataParser.php} (51%) create mode 100644 src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Page/Objects/SectionObject.php rename src/Magento/AcceptanceTestFramework/{PageObject => Page}/etc/PageObject.xsd (100%) rename src/Magento/AcceptanceTestFramework/{PageObject => Page}/etc/SectionObject.xsd (100%) delete mode 100644 src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php delete mode 100644 src/Magento/AcceptanceTestFramework/PageObject/Page/PageInterface.php delete mode 100644 src/Magento/AcceptanceTestFramework/PageObject/Section/Section.php delete mode 100644 src/Magento/AcceptanceTestFramework/PageObject/Section/SectionInterface.php delete mode 100644 src/Magento/AcceptanceTestFramework/Test/CestDataConstants.php rename src/Magento/AcceptanceTestFramework/Test/{Managers/CestArrayProcessor.php => Handlers/CestObjectHandler.php} (58%) diff --git a/etc/di.xml b/etc/di.xml index b530480e7..8ea5baf39 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -82,12 +82,12 @@ - Magento/AcceptanceTestFramework/PageObject/etc/PageObject.xsd + Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd - Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd + Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd @@ -176,7 +176,7 @@ - + Magento\AcceptanceTestFramework\DataProfile\Config\Metadata @@ -197,9 +197,9 @@ Magento\AcceptanceTestFramework\Config\Converter Magento\AcceptanceTestFramework\Config\SchemaLocator\Metadata - name - key - key + name + key + key *-meta.xml Metadata diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index 291c42ea2..e7dd76cef 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -2,21 +2,37 @@ namespace Magento\AcceptanceTestFramework\DataGenerator\Api; -use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager; -use Magento\AcceptanceTestFramework\DataGenerator\Managers\JsonDefinitionManager; +use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; +use Magento\AcceptanceTestFramework\DataGenerator\Handlers\JsonDefinitionObjectHandler; use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; +use Magento\AcceptanceTestFramework\DataGenerator\Objects\JsonDefinition; use Magento\AcceptanceTestFramework\Util\ApiClientUtil; class ApiExecutor { + /** + * Describes the operation for the executor ('create','update','delete') + * @var string $operation + **/ private $operation; + + /** + * The entity object data being created, updated, or deleted. + * @var EntityDataObject $entityObject + */ private $entityObject; + + /** + * The json definitions used to map the operation. + * @var JsonDefinition $jsonDefinition + */ private $jsonDefinition; - private $primitives = ['string', 'boolean', 'integer', 'double', 'array']; + const PRIMITIVE_TYPES = ['string', 'boolean', 'integer', 'double', 'array']; /** * ApiSubObject constructor. + * @constructor * @param string $operation * @param EntityDataObject $entityObject */ @@ -25,12 +41,16 @@ public function __construct($operation, $entityObject) $this->operation = $operation; $this->entityObject = $entityObject; - $this->jsonDefinition = JsonDefinitionManager::getInstance()->getJsonDefinition( + $this->jsonDefinition = JsonDefinitionObjectHandler::getInstance()->getJsonDefinition( $this->operation, $this->entityObject->getType() ); } + /** + * Executes an api request based on parameters given by constructor. + * @return string | null + */ public function executeRequest() { $apiClientUrl = $this->jsonDefinition->getApiUrl(); @@ -91,23 +111,23 @@ private function getAuthorizationHeader($authUrl) * recursively forming an array which represents the json structure for the api of the desired type. * * @param EntityDataObject $entityObject - * @param Array $jsonDefMetadata + * @param array $jsonDefMetadata * * @return array */ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) { - $jsonArrayMetadata = !$jsonDefMetadata ? JsonDefinitionManager::getInstance()->getJsonDefinition( + $jsonArrayMetadata = !$jsonDefMetadata ? JsonDefinitionObjectHandler::getInstance()->getJsonDefinition( $this->operation, $entityObject->getType() )->getJsonMetadata() : $jsonDefMetadata; - $jsonArray = array(); + $jsonArray = []; foreach ($jsonArrayMetadata as $jsonElement) { $jsonElementType = $jsonElement->getValue(); - if (in_array($jsonElementType, $this->primitives)) { + if (in_array($jsonElementType, ApiExecutor::PRIMITIVE_TYPES)) { $jsonArray[$jsonElement->getKey()] = $this->castValue( $jsonElementType, $entityObject->getDataByName($jsonElement->getKey()) @@ -116,7 +136,7 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) $entityNamesOfType = $entityObject->getLinkedEntitiesOfType($jsonElementType); foreach ($entityNamesOfType as $entityName) { - $linkedEntityObj = DataManager::getInstance()->getEntity($entityName); + $linkedEntityObj = DataObjectHandler::getInstance()->getObject($entityName); $jsonDataSubArray = self::getJsonDataArray($linkedEntityObj); if ($jsonElement->getType() == 'array') { @@ -131,13 +151,24 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) return $jsonArray; } - private function getEncodedJsonString() + /** + * This function retrieves an array representative of json body for a request and returns it encoded as a string. + * @return string + */ + public function getEncodedJsonString() { $jsonArray = $this->getJsonDataArray($this->entityObject, $this->jsonDefinition->getJsonMetadata()); return json_encode([$this->entityObject->getType() => $jsonArray], JSON_PRETTY_PRINT); } + /** + * This function takes a string value and its corresponding type and returns the string cast + * into its the type passed. + * @param string $type + * @param string $value + * @return bool|float|int|string + */ private function castValue($type, $value) { $newVal = $value; @@ -158,4 +189,4 @@ private function castValue($type, $value) return $newVal; } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php index 8f1a6262c..05bb6f099 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php @@ -6,11 +6,21 @@ class EntityApiHandler { + /** + * Entity object data to use for create, delete, or update. + * @var EntityDataObject $entityObject + */ private $entityObject; + + /** + * Resulting created object from create or update. + * @var EntityDataObject $createdObject + */ private $createdObject; /** * ApiPersistenceHandler constructor. + * @constructor * @param EntityDataObject $entityObject */ public function __construct($entityObject) @@ -18,6 +28,10 @@ public function __construct($entityObject) $this->entityObject = $entityObject; } + /** + * Function which executes a create request based on specific operation metadata + * @return string | false + */ public function createEntity() { $apiExecutor = new ApiExecutor('create', $this->entityObject); @@ -29,8 +43,14 @@ public function createEntity() json_decode($result, true), null ); + + return $result; } + /** + * Function which executes a delete request based on specific operation metadata + * @return string | false + */ public function deleteEntity() { $apiExecutor = new ApiExecutor('delete', $this->createdObject); diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php deleted file mode 100644 index 647335629..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php +++ /dev/null @@ -1,22 +0,0 @@ -create(DataProfileSchemaParser::class); + $entityParsedData = $entityParser->readDataProfiles(); + + if (!$entityParsedData) { + throw new \Exception("No entities could be parsed from xml definitions"); + } + + self::$DATA_OBJECT_HANDLER = new DataObjectHandler($entityParsedData); + } + + return self::$DATA_OBJECT_HANDLER; + } + + /** + * DataArrayProcessor constructor. + * @constructor + * @param array $arrayData + */ + private function __construct($arrayData) + { + $this->arrayData = $arrayData; + } + + /** + * Retrieves the object representation of data represented in data.xml + * @param string $entityName + * @return EntityDataObject | null + */ + public function getObject($entityName) + { + if (array_key_exists($entityName, $this->getAllObjects())) { + return $this->getAllObjects()[$entityName]; + } + + return null; + } + + /** + * Retrieves all object representations of all data represented in data.xml + * @return array + */ + public function getAllObjects() + { + if (!$this->data) { + $this->parseEnvVariables(); + $this->parseDataEntities(); + } + + return $this->data; + } + + /** + * Adds all .env variables defined in the PROJECT_ROOT as EntityDataObjects. This is to allow resolution + * of these variables when referenced in a cest. + * @return void + */ + private function parseEnvVariables() + { + $envFilename = PROJECT_ROOT . '/.env'; + if (file_exists($envFilename)) { + $envData = []; + $envFile = file($envFilename); + foreach ($envFile as $entry) { + $params = explode("=", $entry); + if (count($params) != 2) { + continue; + } + $envData[strtolower(trim($params[0]))] = trim($params[1]); + } + $envDataObject = new EntityDataObject(self::ENV_DATA_OBJECT_NAME, 'environment', $envData, null); + $this->data[$envDataObject->getName()] = $envDataObject; + } + } + + /** + * Parses array output of parses into EntityDataObjects. + * @return void + */ + private function parseDataEntities() + { + $entities = $this->arrayData; + + foreach ($entities[DataObjectHandler::ENTITY_DATA] as $entityName => $entity) { + $entityType = $entity[DataObjectHandler::ENTITY_DATA_TYPE]; + + $dataValues = []; + $linkedEntities = []; + $arrayValues = []; + + if (array_key_exists(DataObjectHandler::DATA_VALUES, $entity)) { + foreach ($entity[DataObjectHandler::DATA_VALUES] as $dataElement) { + $dataElementKey = strtolower($dataElement[DataObjectHandler::DATA_ELEMENT_KEY]); + $dataElementValue = $dataElement[DataObjectHandler::DATA_ELEMENT_VALUE]; + + $dataValues[$dataElementKey] = $dataElementValue; + } + unset($dataElement); + } + + if (array_key_exists(DataObjectHandler::REQUIRED_ENTITY, $entity)) { + foreach ($entity[DataObjectHandler::REQUIRED_ENTITY] as $linkedEntity) { + $linkedEntityName = $linkedEntity[DataObjectHandler::REQUIRED_ENTITY_VALUE]; + $linkedEntityType = $linkedEntity[DataObjectHandler::REQUIRED_ENTITY_TYPE]; + + $linkedEntities[$linkedEntityName] = $linkedEntityType; + } + unset($linkedEntity); + } + + if (array_key_exists(DataObjectHandler::ARRAY_VALUES, $entity)) { + foreach ($entity[DataObjectHandler::ARRAY_VALUES] as $arrayElement) { + $arrayKey = $arrayElement[DataObjectHandler::ARRAY_ELEMENT_KEY]; + foreach ($arrayElement[DataObjectHandler::ARRAY_ELEMENT_ITEM] as $arrayValue) { + $arrayValues[] = $arrayValue[DataObjectHandler::ARRAY_ELEMENT_ITEM_VALUE]; + } + + $dataValues[$arrayKey] = $arrayValues; + } + } + + $entityDataObject = new EntityDataObject( + $entityName, + $entityType, + $dataValues, + $linkedEntities + ); + + $this->data[$entityDataObject->getName()] = $entityDataObject; + + } + unset($entityName); + unset($entity); + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/JsonDefinitionObjectHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/JsonDefinitionObjectHandler.php new file mode 100644 index 000000000..8b3437306 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/JsonDefinitionObjectHandler.php @@ -0,0 +1,165 @@ +initJsonDefinitions(); + } + + return self::$JSON_DEFINITION_OBJECT_HANDLER; + } + + /** + * Returns a JsonDefinition object based on name + * @param string $jsonDefitionName + * @return JsonDefinition + */ + public function getObject($jsonDefinitionName) + { + return $this->jsonDefinitions[$jsonDefinitionName]; + } + + /** + * Returns all Json Definition objects + * @return array + */ + public function getAllObjects() + { + return $this->jsonDefinitions; + } + + /** + * JsonDefintionArrayProcessor constructor. + * @constructor + */ + private function __construct() + { + // private constructor + } + + /** + * This method takes an operation such as create and a data type such as 'customer' and returns the corresponding + * json definition defined in metadata.xml + * @param string $operation + * @param string $dataType + * @return JsonDefinition + */ + public function getJsonDefinition($operation, $dataType) + { + return $this->getObject($operation . $dataType); + } + + /** + * This method reads all jsonDefinitions from metadata xml into memory. + */ + private function initJsonDefinitions() + { + $objectManager = ObjectManagerFactory::getObjectManager(); + $metadataParser = $objectManager->create(OperationMetadataParser::class); + foreach ($metadataParser->readOperationMetadata()[JsonDefinitionObjectHandler::ENTITY_OPERATION_ROOT_TAG] as + $jsonDefName => $jsonDefArray) { + $operation = $jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_TYPE]; + $dataType = $jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_DATA_TYPE]; + $url = $jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_URL] ?? null; + $method = $jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_METHOD] ?? null; + $auth = $jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_AUTH] ?? null; + $headers = []; + $params = []; + $jsonMetadata = []; + + if (array_key_exists(JsonDefinitionObjectHandler::ENTITY_OPERATION_HEADER, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_HEADER] as $headerEntry) { + $headers[] = $headerEntry[JsonDefinitionObjectHandler::ENTITY_OPERATION_HEADER_PARAM] . ': ' . + $headerEntry[JsonDefinitionObjectHandler::ENTITY_OPERATION_HEADER_VALUE]; + } + } + + if (array_key_exists(JsonDefinitionObjectHandler::ENTITY_OPERATION_URL_PARAM, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_URL_PARAM] as $paramEntry) { + $params[$paramEntry[JsonDefinitionObjectHandler::ENTITY_OPERATION_URL_PARAM_TYPE]] + [$paramEntry[JsonDefinitionObjectHandler::ENTITY_OPERATION_URL_PARAM_KEY]] = + $paramEntry[JsonDefinitionObjectHandler::ENTITY_OPERATION_URL_PARAM_VALUE]; + } + } + + if (array_key_exists(JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY] as $jsonEntryType) { + $jsonMetadata[] = new JsonElement( + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY_KEY], + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY_VALUE], + JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY + ); + } + } + + if (array_key_exists(JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY] as $jsonEntryType) { + $jsonMetadata[] = new JsonElement( + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_KEY], + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_VALUE], + JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY + ); + } + } + + $this->jsonDefinitions[$operation . $dataType] = new JsonDefinition( + $jsonDefName, + $operation, + $dataType, + $method, + $url, + $auth, + $headers, + $params, + $jsonMetadata + ); + } + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php deleted file mode 100644 index 06600643e..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php +++ /dev/null @@ -1,157 +0,0 @@ -create(DataProfileSchemaParser::class); - $entityParsedData = $entityParser->readDataProfiles(); - - if (!$entityParsedData) { - throw new Exception("No entities could be parsed from xml definitions"); - } - - self::$dataManager = new DataManager($entityParsedData); - } - - return self::$dataManager; - } - - /** - * DataManager constructor. - * @param array $arrayData - */ - private function __construct($arrayData) - { - $this->arrayData = $arrayData; - } - - /** - * Adds all .env variables defined in the PROJECT_ROOT as EntityDataObjects. This is to allow resolution - * of these variables when referenced in a cest. - */ - private function parseEnvVariables() - { - $envFilename = PROJECT_ROOT . '/.env'; - - if (file_exists($envFilename)) { - $envData = []; - - $envFile = file($envFilename); - - foreach ($envFile as $entry) { - $params = explode("=", $entry); - if (count($params) != 2) { - continue; - } - $envData[strtolower(trim($params[0]))] = trim($params[1]); - } - - - $envDataObject = new EntityDataObject(self::ENV_DATA_OBJECT_NAME, 'environment', $envData, null); - $this->data[$envDataObject->getName()] = $envDataObject; - } - } - - /** - * Parses data xml and extracts all information into EntityDataObject. - */ - private function parseDataEntities() - { - $entities = $this->arrayData; - - foreach ($entities[DataGeneratorConstants::ENTITY_DATA] as $entityName => $entity) { - $entityType = $entity[DataGeneratorConstants::ENTITY_DATA_TYPE]; - - $dataValues = []; - $linkedEntities = []; - $arrayValues = []; - - if (array_key_exists(DataGeneratorConstants::DATA_VALUES, $entity)) { - foreach ($entity[DataGeneratorConstants::DATA_VALUES] as $dataElement) { - $dataElementKey = strtolower($dataElement[DataGeneratorConstants::DATA_ELEMENT_KEY]); - $dataElementValue = $dataElement[DataGeneratorConstants::DATA_ELEMENT_VALUE]; - - $dataValues[$dataElementKey] = $dataElementValue; - } - unset($dataElement); - } - - if (array_key_exists(DataGeneratorConstants::REQUIRED_ENTITY, $entity)) { - foreach ($entity[DataGeneratorConstants::REQUIRED_ENTITY] as $linkedEntity) { - $linkedEntityName = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_VALUE]; - $linkedEntityType = $linkedEntity[DataGeneratorConstants::REQUIRED_ENTITY_TYPE]; - - $linkedEntities[$linkedEntityName] = $linkedEntityType; - } - unset($linkedEntity); - } - - if (array_key_exists(DataGeneratorConstants::ARRAY_VALUES, $entity)) { - foreach ($entity[DataGeneratorConstants::ARRAY_VALUES] as $arrayElement) { - $arrayKey = $arrayElement[DataGeneratorConstants::ARRAY_ELEMENT_KEY]; - foreach ($arrayElement[DataGeneratorConstants::ARRAY_ELEMENT_VALUE] as $arrayValue) { - $arrayValues[] = $arrayValue['value']; - } - - $dataValues[$arrayKey] = $arrayValues; - } - } - - $entityXmlObject = new EntityDataObject( - $entityName, - $entityType, - $dataValues, - $linkedEntities - ); - - $this->data[$entityXmlObject->getName()] = $entityXmlObject; - - } - unset($entityName); - unset($entity); - } - - /** - * Method returns a single data entity by name based on what is defined in data.xml. - * @param $entityName - * @return EntityDataObject - */ - public function getEntity($entityName) - { - return $this->getAllEntities()[$entityName]; - } - - /** - * Method returns all data entities read from data.xml into objects. - * @return array - */ - public function getAllEntities() - { - if (!$this->data) { - $this->parseDataEntities(); - $this->parseEnvVariables(); - } - - return $this->data; - } -} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php deleted file mode 100644 index 1b7c1cba4..000000000 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php +++ /dev/null @@ -1,126 +0,0 @@ -create(MetadataParser::class); - foreach ($metadataParser->readMetadata()[JsonDefinitionManager::ENTITY_OPERATION_ROOT_TAG] as - $jsonDefName => $jsonDefArray) { - $operation = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_TYPE]; - $dataType = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_DATA_TYPE]; - $url = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_URL] ?? null; - $method = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_METHOD] ?? null; - $auth = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_AUTH] ?? null; - $headers = []; - $params = []; - $jsonMetadata = []; - - if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_HEADER, $jsonDefArray)) { - foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_HEADER] as $headerEntry) { - $headers[] = $headerEntry[JsonDefinitionManager::ENTITY_OPERATION_HEADER_PARAM] . ': ' . - $headerEntry[JsonDefinitionManager::ENTITY_OPERATION_HEADER_VALUE]; - } - } - - if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM, $jsonDefArray)) { - foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM] as $paramEntry) { - $params[$paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_TYPE]] - [$paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_KEY]] = - $paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_VALUE]; - } - } - - if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_ENTRY, $jsonDefArray)) { - foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_ENTRY] as $jsonEntryType) { - $jsonMetadata[] = new JsonElement( - $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ENTRY_KEY], - $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ENTRY_VALUE], - JsonDefinitionManager::ENTITY_OPERATION_ENTRY - ); - } - } - - if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_ARRAY, $jsonDefArray)) { - foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_ARRAY] as $jsonEntryType) { - $jsonMetadata[] = new JsonElement( - $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ARRAY_KEY], - $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ARRAY_VALUE], - JsonDefinitionManager::ENTITY_OPERATION_ARRAY - ); - } - } - - $this->jsonDefinitions[$operation][$dataType] = new JsonDefinition( - $jsonDefName, - $operation, - $dataType, - $method, - $url, - $auth, - $headers, - $params, - $jsonMetadata - ); - } - } - - /** - * @param $type - * @return JsonDefinition - */ - public function getJsonDefinition($operation, $type) - { - if (!$this->jsonDefinitions) { - $this->getObjects(); - } - - return $this->jsonDefinitions[$operation][$type]; - } -} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index 2d1e3fdbf..cfd6bf95b 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -2,15 +2,31 @@ namespace Magento\AcceptanceTestFramework\DataGenerator\Objects; -use Magento\AcceptanceTestFramework\DataGenerator\DataGeneratorConstants; -use Magento\AcceptanceTestFramework\DataGenerator\Managers\EntityDataManager; - class EntityDataObject { + /** + * Name of the entity + * @var string $name + */ private $name; + + /** + * Type of the entity + * @var string $type + */ private $type; - private $linkedEntities = []; //array of required entity name to corresponding type - private $data = []; //array of Data Name to Data Value + + /** + * An array of required entity name to corresponding type + * @var array $linkedEntities + */ + private $linkedEntities = []; + + /** + * An array of Data Name to Data Value + * @var array $data + */ + private $data = []; /** * EntityDataObject constructor. @@ -27,16 +43,28 @@ public function __construct($entityName, $entityType, $data, $linkedEntities) $this->linkedEntities = $linkedEntities; } + /** + * Getter for linked entity names + * @return array + */ public function getLinkedEntities() { return $this->linkedEntities; } + /** + * Getter for entity name + * @return string + */ public function getName() { return $this->name; } + /** + * Getter for entity type + * @return string + */ public function getType() { return $this->type; @@ -68,7 +96,7 @@ public function getDataByName($dataName) */ public function getLinkedEntitiesOfType($fieldType) { - $groupedArray = array(); + $groupedArray = []; foreach ($this->linkedEntities as $entityName => $entityType) { if ($entityType == $fieldType) { diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php index 8fd9e2555..60f08cc95 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php @@ -4,17 +4,78 @@ class JsonDefinition { + /** + * Json Definitions Name + * @var string $name + */ private $name; + + /** + * Operation which the json defintion describes + * @var string $operation + */ private $operation; + + /** + * Data type for which the json defintiion is used + * @var string $dataType + */ private $dataType; + + /** + * Api method such as ('POST', 'PUT', 'GET', DELETE', etc.) + * @var string $apiMethod + */ private $apiMethod; + + /** + * Base URL for the request + * @var string $baseUrl + */ private $baseUrl; + + /** + * Resource specific URI for the request + * @var string $apiUrl + */ private $apiUrl; + + /** + * Authorization path for retrieving a token + * @var string $auth + */ private $auth; + + /** + * Relevant headers for the request + * @var array $headers + */ private $headers = []; + + /** + * Relevant params for the request (e.g. query, path) + * @var array $params + */ private $params = []; + + /** + * The metadata describing the json fields and values themselves + * @var array $jsonMetadata + */ private $jsonMetadata = []; + /** + * JsonDefinition constructor. + * @param string $name + * @param string $operation + * @param string $dataType + * @param string $apiMethod + * @param string $apiUrl + * @param string $auth + * @param array $headers + * @param array $params + * @param array $jsonMetadata + */ public function __construct( $name, $operation, @@ -37,21 +98,37 @@ public function __construct( $this->jsonMetadata = $jsonMetadata; } + /** + * Getter for json data type + * @return string + */ public function getDataType() { return $this->dataType; } + /** + * Getter for json operation + * @return string + */ public function getOperation() { return $this->operation; } + /** + * Getter for api method + * @return string + */ public function getApiMethod() { return $this->apiMethod; } + /** + * Getter for api url + * @return string + */ public function getApiUrl() { $this->cleanApiUrl(); @@ -67,21 +144,37 @@ public function getApiUrl() return $this->apiUrl; } + /** + * Getter for auth path + * @return string + */ public function getAuth() { return $this->auth; } + /** + * Getter for request headers + * @return array + */ public function getHeaders() { return $this->headers; } + /** + * Getter for json metadata + * @return array + */ public function getJsonMetadata() { return $this->jsonMetadata; } + /** + * Function to validate api format and add "/" char where necessary + * @return void + */ private function cleanApiUrl() { if (substr($this->baseUrl, -1) == "/") { @@ -91,6 +184,10 @@ private function cleanApiUrl() } } + /** + * Function to append path params where necessary + * @return void + */ private function addPathParam() { foreach ($this->params['path'] as $paramName => $paramValue) { @@ -98,6 +195,10 @@ private function addPathParam() } } + /** + * Function to append query params where necessary + * @return void + */ private function addQueryParams() { diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php index 3015031fa..baed7ed38 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php @@ -4,10 +4,30 @@ class JsonElement { + /** + * Json parameter name + * @var string $key + */ private $key; + + /** + * Json parameter metadata value (e.g. string, bool) + * @var string $value + */ private $value; + + /** + * Json type such as array or entry + * @var string $type + */ private $type; + /** + * JsonElement constructor. + * @param string $key + * @param string $value + * @param string $type + */ public function __construct($key, $value, $type) { $this->key = $key; @@ -15,18 +35,30 @@ public function __construct($key, $value, $type) $this->type = $type; } + /** + * Getter for json parameter name + * @return string + */ public function getKey() { return $this->key; } + /** + * Getter for parameter metadata value + * @return string + */ public function getValue() { return $this->value; } + /** + * Getter for parameter value type + * @return string + */ public function getType() { return $this->type; } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php index 4200b12a8..078e7225a 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php @@ -1,10 +1,4 @@ dataProfiles = $dataProfiles; } + /** + * Function to return data as array from data.xml files + * @return array + */ public function readDataProfiles() { return $this->dataProfiles->get(); } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/OperationMetadataParser.php similarity index 51% rename from src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php rename to src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/OperationMetadataParser.php index 43964a2a8..9e3bcf346 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/OperationMetadataParser.php @@ -4,14 +4,22 @@ use Magento\AcceptanceTestFramework\Config\DataInterface; -class MetadataParser +class OperationMetadataParser { + /** + * MetadataParser constructor. + * @param DataInterface $metadata + */ public function __construct(DataInterface $metadata) { $this->metadata = $metadata; } - public function readMetadata() + /** + * Returns an array containing all data read from operations.xml files. + * @return array + */ + public function readOperationMetadata() { return $this->metadata->get(); } diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php new file mode 100644 index 000000000..972cb0bdc --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php @@ -0,0 +1,25 @@ +initPageObjects(); + } + + return self::$PAGE_DATA_PROCESSOR; + } + + /** + * PageObjectHandler constructor. + * @constructor + */ + private function __construct() + { + //private constructor + } + + /** + * Takes a page name and returns an array parsed from xml. + * @param string $pageName + * @return PageObject | null + */ + public function getObject($pageName) + { + if (array_key_exists($pageName, $this->pages)) { + return $this->getAllObjects()[$pageName]; + } + + return null; + } + + /** + * Return an array containing all pages parsed from xml. + * @return array + */ + public function getAllObjects() + { + return $this->pages; + } + + /** + * Executes parser code to read in page xml data. + * @return void + */ + private function initPageObjects() + { + $objectManager = ObjectManagerFactory::getObjectManager(); + /** @var $parser \Magento\AcceptanceTestFramework\XmlParser\PageParser */ + $parser = $objectManager->get(PageParser::class); + foreach ($parser->getData(self::TYPE) as $pageName => $pageData) { + $urlPath = $pageData[PageObjectHandler::URL_PATH_ATTR]; + $module = $pageData[PageObjectHandler::MODULE_ATTR]; + $sections = array_keys($pageData[PageObjectHandler::SUB_TYPE]); + + $this->pages[$pageName] = new PageObject($pageName, $urlPath, $module, $sections); + } + } +} diff --git a/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php b/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php new file mode 100644 index 000000000..5343b7450 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php @@ -0,0 +1,105 @@ +initSectionObjects(); + } + + return self::$SECTION_DATA_PROCESSOR; + } + + /** + * SectionObjectHandler constructor. + * @constructor + */ + private function __construct() + { + // private constructor + } + + /** + * Returns the corresponding section array parsed from xml. + * @param string $sectionName + * @return SectionObject | null + */ + public function getObject($sectionName) + { + if (array_key_exists($sectionName, $this->getAllObjects())) { + return $this->getAllObjects()[$sectionName]; + } + + return null; + } + + /** + * Returns all section arrays parsed from section xml. + * @return array + */ + public function getAllObjects() + { + return $this->sectionData; + } + + /** + * Parse section objects if it's not previously done. + * @return void + */ + private function initSectionObjects() + { + $objectManager = ObjectManagerFactory::getObjectManager(); + /** @var $parser \Magento\AcceptanceTestFramework\XmlParser\SectionParser */ + $parser = $objectManager->get(SectionParser::class); + foreach ($parser->getData(self::TYPE) as $sectionName => $sectionData) { + // create elements + $elements = []; + foreach ($sectionData[SectionObjectHandler::SUB_TYPE] as $elementName => $elementData) { + $elementType = $elementData[SectionObjectHandler::ELEMENT_TYPE_ATTR]; + $elementLocator = $elementData[SectionObjectHandler::ELEMENT_LOCATOR_ATTR]; + $elementTimeout = $elementData[SectionObjectHandler::ELEMENT_TIMEOUT_ATTR] ?? null; + + $elements[$elementName] = new ElementObject( + $elementName, + $elementType, + $elementLocator, + $elementTimeout + ); + } + + $this->sectionData[$sectionName] = new SectionObject($sectionName, $elements); + } + } +} diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php b/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php new file mode 100644 index 000000000..005b33d76 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php @@ -0,0 +1,88 @@ +name = $name; + $this->type = $type; + $this->locator = $locator; + $this->timeout = $timeout; + } + + /** + * Getter for the name of the element + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Getter for the name of the element type + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Getter for the locator of an element + * @return string + */ + public function getLocator() + { + return $this->locator; + } + + /** + * Returns an integer representing an element's timeout + * @return int|null + */ + public function getTimeout() + { + if ($this->timeout == ElementObject::DEFAULT_TIMEOUT_SYMBOL) { + return null; + } + + return (int)$this->timeout; + } + +} diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php b/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php new file mode 100644 index 000000000..683cd9663 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php @@ -0,0 +1,109 @@ +name = $name; + $this->url = $urlPath; + $this->module = $module; + $this->sectionNames = $sections; + } + + /** + * Getter for Page Name + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Getter for Page URL + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Getter for Page Module + * @return string + */ + public function getModule() + { + return $this->module; + } + + /** + * Getter for Section Names + * @return array + */ + public function getSectionNames() + { + return $this->sectionNames; + } + + /** + * Checks the section names in the page for existence of the section name passed into the method. + * @param string $sectionName + * @return boolean + */ + public function hasSection($sectionName) + { + return in_array($sectionName, $this->sectionNames); + } + + /** + * Given a section name referenced by the page, returns the section object + * @param $sectionName + * @return SectionObject | null + */ + public function getSection($sectionName) + { + if ($this->hasSection($sectionName)) { + return SectionObjectHandler::getInstance()->getObject($sectionName); + } + + return null; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/SectionObject.php b/src/Magento/AcceptanceTestFramework/Page/Objects/SectionObject.php new file mode 100644 index 000000000..7b157b056 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Page/Objects/SectionObject.php @@ -0,0 +1,52 @@ +name = $name; + $this->elements = $elements; + } + + /** + * Getter for the name of the section + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Getter for an array containing all of a section's elements. + * @return array + */ + public function getElements() + { + return $this->elements; + } + + /** + * Given the name of an element, returns the element object + * @param $elementName + * @return ElementObject + */ + public function getElement($elementName) + { + return $this->elements[$elementName]; + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/PageObject/etc/PageObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd similarity index 100% rename from src/Magento/AcceptanceTestFramework/PageObject/etc/PageObject.xsd rename to src/Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd diff --git a/src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd similarity index 100% rename from src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd rename to src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd diff --git a/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php b/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php deleted file mode 100644 index fc5c67b23..000000000 --- a/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php +++ /dev/null @@ -1,103 +0,0 @@ -get(PageParser::class); - self::$pageObjects = $parser->getData(self::TYPE); - } - } -} diff --git a/src/Magento/AcceptanceTestFramework/PageObject/Page/PageInterface.php b/src/Magento/AcceptanceTestFramework/PageObject/Page/PageInterface.php deleted file mode 100644 index 694408a03..000000000 --- a/src/Magento/AcceptanceTestFramework/PageObject/Page/PageInterface.php +++ /dev/null @@ -1,42 +0,0 @@ - self::getSection($sectionName)[self::SUB_TYPE][$elementName]]; - } - - /** - * Get element object data. All sections data is returned if $name is not specified. - * - * @param string $sectionName - * @param string $elementName - * @return mixed - */ - public static function getElementNamesInSection($sectionName, $elementName) - { - return array_keys(self::getSection($sectionName)[self::SUB_TYPE]); - } - - /** - * Get element locator. - * - * @param string $sectionName - * @param string $elementName - * @return string|null - */ - public static function getElementLocator($sectionName, $elementName) - { - $element = self::getSection($sectionName)[self::SUB_TYPE][$elementName]; - $locator = $element[self::LOCATOR_ATTR]; - if (isset($element[self::LOCATOR_VARS_ATTR])) { - $locatorVarsStr = $element[self::LOCATOR_VARS_ATTR]; - $locatorVarsArray = explode(',', $locatorVarsStr); - $newLocatorVarsArray = []; - foreach ($locatorVarsArray as $variable) { - $variable = trim($variable); - if (substr($variable, 0, 1) !== '$') { - $variable = '$' . $variable; - $newLocatorVarsArray[] = $variable; - } - } - $locatorVarsStr = implode(',', $newLocatorVarsArray); - return 'sprintf("' . $locator . '", ' . $locatorVarsStr . ')'; - } else { - return $locator; - } - } - - /** - * Get element type. - * - * @param string $sectionName - * @param string $elementName - * @return string - */ - public static function getElementType($sectionName, $elementName) - { - return self::getSection($sectionName)[self::SUB_TYPE][$elementName][self::TYPE_ATTR]; - } - - /** - * Get element time out value. - * - * @param string $sectionName - * @param string $elementName - * @return integer|null - */ - public static function getElementTimeOut($sectionName, $elementName) - { - if(self::isElementRequireWait($sectionName, $elementName)) { - $timeOut = self::getSection($sectionName)[self::SUB_TYPE][$elementName][self::TIMEOUT_ATTR]; - if ($timeOut === self::DEFAULT_TIMEOUT_SAMBOL) { - return null; - } else { - return (int)$timeOut; - } - } - return null; - } - - /** - * Check if element requires an explicit wait. - * - * @param string $sectionName - * @param string $elementName - * @return bool - */ - public static function isElementRequireWait($sectionName, $elementName) - { - return array_key_exists(self::TIMEOUT_ATTR, self::getSection($sectionName)[self::SUB_TYPE][$elementName]); - } - - /** - * Parse section objects if it's not previously done. - * - * @return void - */ - private static function initSectionObjects() - { - if (empty(self::$sectionObjects)) { - $objectManager = ObjectManagerFactory::getObjectManager(); - /** @var $parser \Magento\AcceptanceTestFramework\XmlParser\SectionParser */ - $parser = $objectManager->get(SectionParser::class); - self::$sectionObjects = $parser->getData(self::TYPE); - } - } -} diff --git a/src/Magento/AcceptanceTestFramework/PageObject/Section/SectionInterface.php b/src/Magento/AcceptanceTestFramework/PageObject/Section/SectionInterface.php deleted file mode 100644 index 4d1b53bb8..000000000 --- a/src/Magento/AcceptanceTestFramework/PageObject/Section/SectionInterface.php +++ /dev/null @@ -1,72 +0,0 @@ -create(TestDataParser::class); $parsedCestArray = $testDataParser->readTestData(); - self::$cestDataManager = new CestArrayProcessor($parsedCestArray); + self::$cestObjectHandler = new CestObjectHandler(); + self::$cestObjectHandler->initCestData($parsedCestArray); } - return self::$cestDataManager; + return self::$cestObjectHandler; } - private function __construct($parsedCestArray) + /** + * CestObjectHandler constructor. + * @constructor + */ + private function __construct() { - $this->parsedArray = $parsedCestArray; + // private constructor } /** - * This method takes no arguments and returns CestObjects parsed from defined *Cest.xml files. - * + * Takes a cest name and returns the corresponding cest. + * @param string $cestName + * @return CestObject + */ + public function getObject($cestName) + { + return $this->cests[$cestName]; + } + + /** + * Returns all cests parsed from xml indexed by cestName. * @return array */ - public function getCestData() + public function getAllObjects() { - $cests = []; + return $this->cests; + } - foreach ($this->parsedArray[CestDataConstants::CEST_ROOT] as $cestName => $cestData) { + /** + * This method takes the parsed cest array and returns CestObjects parsed from defined *Cest.xml files + * @param array $parsedArray + * @return array + */ + private function initCestData($parsedArray) + { + foreach ($parsedArray[CestObjectHandler::CEST_ROOT] as $cestName => $cestData) { $hooks = []; $annotations = []; @@ -52,44 +99,41 @@ public function getCestData() $tests = $this->stripDescriptorTags( $cestData, - CestDataConstants::NODE_NAME, - CestDataConstants::NAME + CestObjectHandler::NODE_NAME, + CestObjectHandler::NAME ); - if (array_key_exists(CestDataConstants::CEST_BEFORE_HOOK, $cestData)) { - $hooks[CestDataConstants::CEST_BEFORE_HOOK] = $this->extractHook( - CestDataConstants::CEST_BEFORE_HOOK, - $cestData[CestDataConstants::CEST_BEFORE_HOOK] + if (array_key_exists(CestObjectHandler::CEST_BEFORE_HOOK, $cestData)) { + $hooks[CestObjectHandler::CEST_BEFORE_HOOK] = $this->extractHook( + CestObjectHandler::CEST_BEFORE_HOOK, + $cestData[CestObjectHandler::CEST_BEFORE_HOOK] ); - $tests = $this->stripDescriptorTags($tests, CestDataConstants::CEST_BEFORE_HOOK); + $tests = $this->stripDescriptorTags($tests, CestObjectHandler::CEST_BEFORE_HOOK); } - if (array_key_exists(CestDataConstants::CEST_AFTER_HOOK, $cestData)) { - $hooks[CestDataConstants::CEST_AFTER_HOOK] = $this->extractHook( - CestDataConstants::CEST_AFTER_HOOK, - $cestData[CestDataConstants::CEST_AFTER_HOOK] + if (array_key_exists(CestObjectHandler::CEST_AFTER_HOOK, $cestData)) { + $hooks[CestObjectHandler::CEST_AFTER_HOOK] = $this->extractHook( + CestObjectHandler::CEST_AFTER_HOOK, + $cestData[CestObjectHandler::CEST_AFTER_HOOK] ); - $tests = $this->stripDescriptorTags($tests, CestDataConstants::CEST_AFTER_HOOK); + $tests = $this->stripDescriptorTags($tests, CestObjectHandler::CEST_AFTER_HOOK); } - if (array_key_exists(CestDataConstants::CEST_ANNOTATIONS, $cestData)) { - $annotations = $this->extractAnnotations($cestData[CestDataConstants::CEST_ANNOTATIONS]); + if (array_key_exists(CestObjectHandler::CEST_ANNOTATIONS, $cestData)) { + $annotations = $this->extractAnnotations($cestData[CestObjectHandler::CEST_ANNOTATIONS]); - $tests = $this->stripDescriptorTags($tests, CestDataConstants::CEST_ANNOTATIONS); + $tests = $this->stripDescriptorTags($tests, CestObjectHandler::CEST_ANNOTATIONS); } - - $cests[] = new CestObject( + $this->cests[$cestName] = new CestObject( $cestName, $annotations, $this->extractTestData($tests), $hooks ); } - - return $cests; } /** @@ -98,13 +142,13 @@ public function getCestData() * * @param string $hookType * @param array $cestHook - * @return array + * @return CestHookObject */ private function extractHook($hookType, $cestHook) { $hookActions = $this->stripDescriptorTags( $cestHook, - CestDataConstants::NODE_NAME + CestObjectHandler::NODE_NAME ); $hook = new CestHookObject( @@ -126,13 +170,13 @@ private function extractHook($hookType, $cestHook) private function extractAnnotations($cestAnnotations) { $annotationObjects = []; - $annotations = $this->stripDescriptorTags($cestAnnotations, CestDataConstants::NODE_NAME); + $annotations = $this->stripDescriptorTags($cestAnnotations, CestObjectHandler::NODE_NAME); // parse the Cest annotations foreach ($annotations as $annotationKey => $annotationData) { $annotationValues = []; foreach ($annotationData as $annotationValue) { - $annotationValues[] = $annotationValue[CestDataConstants::ANNOTATION_VALUE]; + $annotationValues[] = $annotationValue[CestObjectHandler::ANNOTATION_VALUE]; } $annotationObjects[$annotationKey] = $annotationValues; @@ -161,13 +205,13 @@ private function extractTestData($cestTestData) $testAnnotations = []; $testActions = $this->stripDescriptorTags( $testData, - CestDataConstants::NODE_NAME, - CestDataConstants::NAME, - CestDataConstants::TEST_ANNOTATIONS + CestObjectHandler::NODE_NAME, + CestObjectHandler::NAME, + CestObjectHandler::TEST_ANNOTATIONS ); - if (array_key_exists(CestDataConstants::TEST_ANNOTATIONS, $testData)) { - $testAnnotations = $this->extractAnnotations($testData[CestDataConstants::TEST_ANNOTATIONS]); + if (array_key_exists(CestObjectHandler::TEST_ANNOTATIONS, $testData)) { + $testAnnotations = $this->extractAnnotations($testData[CestObjectHandler::TEST_ANNOTATIONS]); } $testObjects[] = new TestObject( @@ -193,36 +237,35 @@ private function extractTestActions($testActions) $actions = []; foreach ($testActions as $actionName => $actionData) { - $mergeKey = $actionData[CestDataConstants::TEST_STEP_MERGE_KEY]; + $mergeKey = $actionData[CestObjectHandler::TEST_STEP_MERGE_KEY]; $actionAttributes = $this->stripDescriptorTags( $actionData, - CestDataConstants::TEST_STEP_MERGE_KEY, - CestDataConstants::NODE_NAME + CestObjectHandler::TEST_STEP_MERGE_KEY, + CestObjectHandler::NODE_NAME ); $linkedAction = null; $order = null; - if (array_key_exists(CestDataConstants::TEST_ACTION_BEFORE, $actionData) - and array_key_exists(CestDataConstants::TEST_ACTION_AFTER, $actionData)) { + if (array_key_exists(CestObjectHandler::TEST_ACTION_BEFORE, $actionData) + and array_key_exists(CestObjectHandler::TEST_ACTION_AFTER, $actionData)) { throw new XmlException(sprintf(self::BEFORE_AFTER_ERROR_MSG, $actionName)); } - if (array_key_exists(CestDataConstants::TEST_ACTION_BEFORE, $actionData)) { - $linkedAction = $actionData[CestDataConstants::TEST_ACTION_BEFORE]; + if (array_key_exists(CestObjectHandler::TEST_ACTION_BEFORE, $actionData)) { + $linkedAction = $actionData[CestObjectHandler::TEST_ACTION_BEFORE]; $order = "before"; - } elseif (array_key_exists(CestDataConstants::TEST_ACTION_AFTER, $actionData)) { - $linkedAction = $actionData[CestDataConstants::TEST_ACTION_AFTER]; + } elseif (array_key_exists(CestObjectHandler::TEST_ACTION_AFTER, $actionData)) { + $linkedAction = $actionData[CestObjectHandler::TEST_ACTION_AFTER]; $order = "after"; } - // TODO this is to be implemented later. Currently the schema does not use or need return var. - /*if (array_key_exists(CestDataConstants::TEST_ACTION_RETURN_VARIABLE, $actionData)) { - $returnVariable = $actionData[CestDataConstants::TEST_ACTION_RETURN_VARIABLE]; + /*if (array_key_exists(CestObjectHandler::TEST_ACTION_RETURN_VARIABLE, $actionData)) { + $returnVariable = $actionData[CestObjectHandler::TEST_ACTION_RETURN_VARIABLE]; }*/ $actions[] = new ActionObject( $mergeKey, - $actionData[CestDataConstants::NODE_NAME], + $actionData[CestObjectHandler::NODE_NAME], $actionAttributes, $linkedAction, $order @@ -238,8 +281,8 @@ private function extractTestActions($testActions) * the data passed in of the irrelevant tags and returns the result. * * @param array $data - * @param array ...$tags - * @return mixed + * @param array $tags + * @return array */ private function stripDescriptorTags($data, ...$tags) { diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 91be5c220..a7a9e8fad 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -2,33 +2,68 @@ namespace Magento\AcceptanceTestFramework\Test\Objects; -use Magento\AcceptanceTestFramework\PageObject\Page\Page; -use Magento\AcceptanceTestFramework\PageObject\Section\Section; -use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager; +use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; +use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; +use Magento\AcceptanceTestFramework\ObjectManager\ObjectHandlerInterface; +use Magento\AcceptanceTestFramework\Page\Objects\PageObject; +use Magento\AcceptanceTestFramework\Page\Objects\SectionObject; +use Magento\AcceptanceTestFramework\Page\Handlers\PageObjectHandler; +use Magento\AcceptanceTestFramework\Page\Handlers\SectionObjectHandler; class ActionObject { /** + * The unique identifier for the action * @var string $mergeKey - * @var string $type - * @var array $actionAttributes - * @var string $linkedAction - * @var int $orderOffset - * @var array $resolvedCustomAttributes - * @var int timeout */ private $mergeKey; + + /** + * The type of action (e.g. fillField, createData, etc) + * @var string $type + */ private $type; + + /** + * THe attributes which describe the action (e.g. selector, + * @var array $actionAttributes + */ private $actionAttributes = []; + + /** + * The name of the action to reference when merging this action into existing test steps + * @var null|string $linkedAction + */ private $linkedAction; + + /** + * A value used to describe position during merge + * @var int $orderOffset + */ private $orderOffset = 0; + + /** + * An array which contains variable resolution of all specified parameters in an action + * @var array $resolvedCustomAttributes + */ private $resolvedCustomAttributes = []; + + /** + * A string which represents a needed timeout whenever the action is referenced + * @var string timeout + */ private $timeout; const DATA_ENABLED_ATTRIBUTES = ["userInput", "parameterArray"]; + const MERGE_ACTION_ORDER_AFTER = 'after'; + const ACTION_ATTRIBUTE_URL = 'url'; + const ACTION_ATTRIBUTE_SELECTOR = 'selector'; + const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w.]+}}/'; + /** * ActionObject constructor. + * @constructor * @param string $mergeKey * @param string $type * @param array $actionAttributes @@ -42,7 +77,7 @@ public function __construct($mergeKey, $type, $actionAttributes, $linkedAction = $this->actionAttributes = $actionAttributes; $this->linkedAction = $linkedAction; - if ($order == 'after') { + if ($order == ActionObject::MERGE_ACTION_ORDER_AFTER) { $this->orderOffset = 1; } } @@ -109,11 +144,9 @@ public function getTimeout() /** * Populate the resolved custom attributes array with lookup values for the following attributes: - * * selector * url * userInput - * * @return void */ public function resolveReferences() @@ -128,89 +161,47 @@ public function resolveReferences() /** * Look up the selector for SomeSectionName.ElementName and set it as the selector attribute in the * resolved custom attributes. Also set the timeout value. - * * e.g. {{SomeSectionName.ElementName}} becomes #login-button - * * @return void */ private function resolveSelectorReferenceAndTimeout() { - if (!array_key_exists('selector', $this->actionAttributes)) { + if (!array_key_exists(ActionObject::ACTION_ATTRIBUTE_SELECTOR, $this->actionAttributes)) { return; } - $selector = $this->actionAttributes['selector']; - $reference = $this->findAllReferences($selector); - if (count($reference) == 1) { - $reference = $reference[0]; - } else { - // Selectors can only handle a single var reference - return; - } + $selector = $this->actionAttributes[ActionObject::ACTION_ATTRIBUTE_SELECTOR]; - list($sectionName, $elementName) = $this->stripAndSplitReference($reference); - $section = Section::getSection($sectionName); - if ($section == null) { - // Bad section reference - return; - } - - $replacement = Section::getElementLocator($sectionName, $elementName); - - if ($replacement == null) { - // Bad section reference - return; + $replacement = $this->findAndReplaceReferences(SectionObjectHandler::getInstance(), $selector); + if ($replacement) { + $this->resolvedCustomAttributes[ActionObject::ACTION_ATTRIBUTE_SELECTOR] = $replacement; } - $this->resolvedCustomAttributes['selector'] = str_replace($reference, $replacement, $selector); - $this->timeout = Section::getElementTimeOut($sectionName, $elementName); } /** * Look up the url for SomePageName and set it, with MAGENTO_BASE_URL prepended, as the url attribute in the * resolved custom attributes. - * * e.g. {{SomePageName}} becomes http://localhost:76543/some/url - * * @return void */ private function resolveUrlReference() { - if (!array_key_exists('url', $this->actionAttributes)) { + if (!array_key_exists(ActionObject::ACTION_ATTRIBUTE_URL, $this->actionAttributes)) { return; } - $url = $this->actionAttributes['url']; - foreach ($this->findAllReferences($url) as $reference) { - $replacement = null; - - // assume this is a page - list($pageName) = $this->stripAndSplitReference($reference); - $page = Page::getPage($pageName); - - if ($page != null) { - $replacement = Page::getPageUrl($pageName); - } else { - // try to resolve as data - list($entityName, $entityField) = $this->stripAndSplitReference($reference); - $replacement = DataManager::getInstance()->getEntity($entityName)->getDataByName($entityField); - } + $url = $this->actionAttributes[ActionObject::ACTION_ATTRIBUTE_URL]; - if ($replacement == null) { - continue; - // Bad var ref - } - $url = str_replace($reference, $replacement, $url); + $replacement = $this->findAndReplaceReferences(PageObjectHandler::getInstance(), $url); + if ($replacement) { + $this->resolvedCustomAttributes[ActionObject::ACTION_ATTRIBUTE_URL] = $replacement; } - - $this->resolvedCustomAttributes['url'] = $url; } /** * Look up the value for EntityDataObjectName.Key and set it as the corresponding attribute in the resolved custom * attributes. - * * e.g. {{CustomerEntityFoo.FirstName}} becomes Jerry - * * @return void */ private function resolveDataInputReferences() @@ -224,31 +215,15 @@ private function resolveDataInputReferences() foreach ($relevantDataAttributes as $dataAttribute) { $varInput = $this->actionAttributes[$dataAttribute]; - - foreach ($this->findAllReferences($varInput) as $reference) { - list($entityName, $entityKey) = $this->stripAndSplitReference($reference); - $entityObj = DataManager::getInstance()->getEntity($entityName); - if ($entityObj == null) { - // Bad entity reference - continue; - } - - $replacement = $entityObj->getDataByName($entityKey) ?? null; - if ($replacement == null) { - // Bad entity.key reference - return; - } - - $varInput = str_replace($reference, $replacement, $varInput); + $replacement = $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $varInput); + if ($replacement) { + $this->resolvedCustomAttributes[$dataAttribute] = $replacement; } - - $this->resolvedCustomAttributes[$dataAttribute] = $varInput; } } /** * Return an array containing the name (before the period) and key (after the period) in a {{reference.foo}}. - * * @param string $reference * @return string[] The name and key that is referenced. */ @@ -259,18 +234,52 @@ private function stripAndSplitReference($reference) } /** - * Return an array of {{reference.foo}} if any exist in the string, otherwise returns an empty array. - * - * @param string $str - * @return array + * Return a string based on a reference to a page, section, or data field (e.g. {{foo.ref}} resolves to 'data') + * @param ObjectHandlerInterface $objectHandler + * @param string $inputString + * @return string | null */ - private function findAllReferences($str) + private function findAndReplaceReferences($objectHandler, $inputString) { - preg_match_all('/{{[\w.]+}}/', $str, $matches); - if (empty($matches)) { - return []; - } else { - return $matches[0]; + preg_match_all(ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN, $inputString, $matches); + + if (empty($matches[0])) { + return null; } + + $outputString = $inputString; + + foreach ($matches[0] as $match) { + $replacement = null; + list($objName) = $this->stripAndSplitReference($match); + + $obj = $objectHandler->getObject($objName); + + // sepcify behavior depending on field + switch (get_class($obj)) { + case PageObject::class: + $replacement = $obj->getUrl(); + break; + case SectionObject::class: + list(,$objField) = $this->stripAndSplitReference($match); + $replacement = $obj->getElement($objField)->getLocator(); + $this->timeout = $obj->getElement($objField)->getTimeout(); + break; + case (get_class($obj) == EntityDataObject::class): + list(,$objField) = $this->stripAndSplitReference($match); + $replacement = $obj->getDataByName($objField); + break; + } + + //Check to see if field is defined as data if cannot be found in a different interface + if ($replacement == null && get_class($obj) != EntityDataObject::class) { + $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $inputString); + } + + $outputString = str_replace($match, $replacement, $outputString); + + } + + return $outputString; } } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php index 03768fbaa..ffd169f5f 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php @@ -4,20 +4,43 @@ class CestHookObject { + /** + * Type of Hook (i.e. before or after). + * @var string $type + */ private $type; + + /** + * Array which contains the action objects to be executed in a hook. + * @var array $actions + */ private $actions = []; + /** + * CestHookObject constructor. + * @constructor + * @param string $type + * @param array $actions + */ public function __construct($type, $actions) { $this->type = $type; $this->actions = $actions; } + /** + * Getter for hook type + * @return string + */ public function getType() { return $this->type; } + /** + * Returns an array of action objects to be executed within the hook. + * @return array + */ public function getActions() { return $this->actions; diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index cc156e37b..4c8f68a68 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -6,15 +6,47 @@ class TestObject { + /** + * Name of the test + * @var string $name + */ private $name; + + /** + * Array which contains the final set of test steps in order after merge + * @var array $orderedSteps + */ private $orderedSteps = []; + + /** + * Array which contains steps to be merged into test flow + * @var array $stepsToMerge + */ private $stepsToMerge = []; + + /** + * Array which contains steps parsed in and are the default set + * @var array $parsedSteps + */ private $parsedSteps = []; + + /** + * Array which contains annotations indexed by name + * @var array $annotations + */ private $annotations = []; + const STEP_MISSING_ERROR_MSG = "Merge Error - Step could not be found in either TestXML or DeltaXML. \tTest = '%s'\tTestStep='%s'\tLinkedStep'%s'"; + /** + * TestObject constructor. + * @constructor + * @param string $name + * @param array $parsedSteps + * @param array $annotations + */ public function __construct($name, $parsedSteps, $annotations) { $this->name = $name; @@ -22,11 +54,19 @@ public function __construct($name, $parsedSteps, $annotations) $this->annotations = $annotations; } + /** + * Getter for the Test Name + * @return string + */ public function getName() { return $this->name; } + /** + * Getter for the Test Annotations + * @return array + */ public function getAnnotations() { return $this->annotations; @@ -110,18 +150,31 @@ private function mergeAction($stepToMerge) private function insertWaits() { foreach ($this->orderedSteps as $step) { - if ($step->getTimeout()) { $waitStepAttributes = array('timeout' => $step->getTimeout()); - $waitStep = new ActionObject($step->getMergeKey() . 'WaitForPageLoad', 'waitForPageLoad', $waitStepAttributes, $step->getMergeKey(), 'after'); + $waitStep = new ActionObject( + $step->getMergeKey() . 'WaitForPageLoad', + 'waitForPageLoad', + $waitStepAttributes, + $step->getMergeKey(), + 'after' + ); $this->insertStep($waitStep); } } } + /** + * Inserts a step into the ordered steps array based on position and step referenced. + * @param $stepToMerge + * @return void + */ private function insertStep($stepToMerge) { - $position = array_search($stepToMerge->getLinkedAction(), array_keys($this->orderedSteps)) + $stepToMerge->getOrderOffset(); + $position = array_search( + $stepToMerge->getLinkedAction(), + array_keys($this->orderedSteps) + ) + $stepToMerge->getOrderOffset(); $previous_items = array_slice($this->orderedSteps, 0, $position, true); $next_items = array_slice($this->orderedSteps, $position, null, true); $this->orderedSteps = $previous_items + [$stepToMerge->getMergeKey() => $stepToMerge] + $next_items; diff --git a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php b/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php index 2655dfecc..91c2ba0e8 100644 --- a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php +++ b/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php @@ -6,13 +6,22 @@ class TestDataParser { + /** + * TestDataParser constructor. + * @constructor + * @param DataInterface $testData + */ public function __construct(DataInterface $testData) { $this->testData = $testData; } + /** + * Returns an array of data based on *Cest.xml files + * @return array + */ public function readTestData() { return $this->testData->get(); } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php index ffe379760..9d5238cea 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php +++ b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php @@ -4,12 +4,45 @@ class ApiClientUtil { + /** + * curl resource for request execution + * @var resource $curl + */ private $curl; + + /** + * Api Path for the request + * @var string $apiPath + */ private $apiPath; + + /** + * Headers to be included in the request + * @var array $headers + */ private $headers; + + /** + * An HTTP Request Type (e.g. CREATE, GET, POST, DELETE) + * @var string $apiOperation + */ private $apiOperation; + + /** + * The json body to be submitted in the request + * @var string $jsonBody + */ private $jsonBody; + + /** + * ApiClientUtil constructor. + * @constructor + * @param string $apiPath + * @param array $headers + * @param string $apiOperation + * @param string $jsonBody + */ public function __construct($apiPath, $headers, $apiOperation, $jsonBody) { $this->apiPath = $apiPath; @@ -20,6 +53,11 @@ public function __construct($apiPath, $headers, $apiOperation, $jsonBody) $this->curl = curl_init(); } + /** + * Submits the request based on object properties + * @param bool $verbose + * @return string | false + */ public function submit($verbose = false) { if ($this->jsonBody) { diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index da146b851..b01377ece 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -2,7 +2,7 @@ namespace Magento\AcceptanceTestFramework\Util; -use Magento\AcceptanceTestFramework\Test\Managers\CestArrayProcessor; +use Magento\AcceptanceTestFramework\Test\Handlers\CestObjectHandler; class TestGenerator { @@ -32,7 +32,7 @@ public static function getInstance() */ private function loadAllCestObjects() { - $cestOutput = CestArrayProcessor::getInstance()->getCestData(); + $cestOutput = CestObjectHandler::getInstance()->getAllObjects(); return $cestOutput; } diff --git a/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php b/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php index 063662382..f65985cd2 100644 --- a/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php +++ b/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php @@ -11,19 +11,18 @@ class PageParser implements ParserInterface { /** * Object manager. - * * @var \Magento\AcceptanceTestFramework\ObjectManager */ protected $objectManager; /** * Configuration data. - * * @var DataInterface */ protected $configData; /** + * PageParser Constructor * @constructor * @param ObjectManagerInterface $objectManager * @param DataInterface $configData @@ -36,7 +35,6 @@ public function __construct(ObjectManagerInterface $objectManager, DataInterface /** * Get parsed xml data. - * * @param string $type * @return mixed */ From 46ce94cc7bd1dda502a2891ddf6ab4ac633f9ee2 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 16 Aug 2017 19:18:45 -0500 Subject: [PATCH 113/149] MQE-275: Implemented data uniqueness for input fields. --- .../DataGenerator/DataGeneratorConstants.php | 3 + .../DataGenerator/Managers/DataManager.php | 9 ++- .../Objects/EntityDataObject.php | 61 +++++++++++++++++-- .../DataGenerator/etc/dataProfileSchema.xsd | 14 +++++ .../Module/MagentoRestDriver.php | 4 +- .../Module/MagentoSequence.php | 19 ++++++ .../Test/Objects/ActionObject.php | 10 +++ .../Util/TestGenerator.php | 29 ++++++++- .../AcceptanceTestFramework/Util/msq.php | 32 ++++++++++ 9 files changed, 172 insertions(+), 9 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php create mode 100644 src/Magento/AcceptanceTestFramework/Util/msq.php diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php index 647335629..4ec90109c 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/DataGeneratorConstants.php @@ -11,6 +11,9 @@ class DataGeneratorConstants const DATA_VALUES = 'data'; const DATA_ELEMENT_KEY = 'key'; const DATA_ELEMENT_VALUE = 'value'; + const DATA_ELEMENT_UNIQUENESS_ATTR = 'unique'; + const DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX = 'prefix'; + const DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX = 'suffix'; const ARRAY_VALUES = 'array'; const ARRAY_ELEMENT_KEY = 'key'; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php index 06600643e..107aff42d 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php @@ -85,11 +85,17 @@ private function parseDataEntities() $dataValues = []; $linkedEntities = []; $arrayValues = []; + $uniquenessValues = []; if (array_key_exists(DataGeneratorConstants::DATA_VALUES, $entity)) { foreach ($entity[DataGeneratorConstants::DATA_VALUES] as $dataElement) { $dataElementKey = strtolower($dataElement[DataGeneratorConstants::DATA_ELEMENT_KEY]); $dataElementValue = $dataElement[DataGeneratorConstants::DATA_ELEMENT_VALUE]; + if (array_key_exists(DataGeneratorConstants::DATA_ELEMENT_UNIQUENESS_ATTR, $dataElement)) { + $uniquenessValues[$dataElementKey] = $dataElement[ + DataGeneratorConstants::DATA_ELEMENT_UNIQUENESS_ATTR + ]; + } $dataValues[$dataElementKey] = $dataElementValue; } @@ -121,7 +127,8 @@ private function parseDataEntities() $entityName, $entityType, $dataValues, - $linkedEntities + $linkedEntities, + $uniquenessValues ); $this->data[$entityXmlObject->getName()] = $entityXmlObject; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index 2d1e3fdbf..932606d3e 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -3,14 +3,44 @@ namespace Magento\AcceptanceTestFramework\DataGenerator\Objects; use Magento\AcceptanceTestFramework\DataGenerator\DataGeneratorConstants; -use Magento\AcceptanceTestFramework\DataGenerator\Managers\EntityDataManager; +use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager; class EntityDataObject { + /** + * Entity name. + * + * @var string + */ private $name; + + /** + * Entity type. + * + * @var string + */ private $type; - private $linkedEntities = []; //array of required entity name to corresponding type - private $data = []; //array of Data Name to Data Value + + /** + * Array of required entity name to corresponding type. + * + * @var array + */ + private $linkedEntities = []; + + /** + * Array of data name to data value. + * + * @var array + */ + private $data = []; + + /** + * Array of data name and its uniqueness attribute value. + * + * @var array + */ + private $uniquenessData = []; /** * EntityDataObject constructor. @@ -18,13 +48,17 @@ class EntityDataObject * @param string $entityType * @param array $data * @param array $linkedEntities + * @param array $uniquenessData */ - public function __construct($entityName, $entityType, $data, $linkedEntities) + public function __construct($entityName, $entityType, $data, $linkedEntities, $uniquenessData = null) { $this->name = $entityName; $this->type = $entityType; $this->data = $data; $this->linkedEntities = $linkedEntities; + if ($uniquenessData) { + $this->uniquenessData = $uniquenessData; + } } public function getLinkedEntities() @@ -68,7 +102,7 @@ public function getDataByName($dataName) */ public function getLinkedEntitiesOfType($fieldType) { - $groupedArray = array(); + $groupedArray = []; foreach ($this->linkedEntities as $entityName => $entityType) { if ($entityType == $fieldType) { @@ -78,4 +112,21 @@ public function getLinkedEntitiesOfType($fieldType) return $groupedArray; } + + /** + * This function retrieves uniqueness data by its name. + * + * @param string $dataName + * @return string|null + */ + public function getUniquenessDataByName($dataName) + { + $name = strtolower($dataName); + + if (array_key_exists($name, $this->uniquenessData)) { + return $this->uniquenessData[$name]; + } + + return null; + } } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd index 4d413dcb6..24a7eed6b 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd @@ -72,6 +72,13 @@ + + + + Add suite or test wide unique sequence as "prefix" or "suffix" to the data value if specified. + + + @@ -103,4 +110,11 @@ + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php b/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php index eca5ec194..cfb8d8730 100644 --- a/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php +++ b/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php @@ -2,7 +2,7 @@ namespace Magento\AcceptanceTestFramework\Module; use Codeception\Module\REST; -use Codeception\Module\Sequence; +use Magento\AcceptanceTestFramework\Module\MagentoSequence; use Flow\JSONPath; /** @@ -107,7 +107,7 @@ public function _beforeSuite($settings = []) $this->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); $this->haveHttpHeader('Authorization', 'Bearer ' . $token); self::$adminTokens[$this->config['username']] = $token; - $this->getModule('Sequence')->_initialize(); + $this->getModule('\Magento\AcceptanceTestFramework\Module\MagentoSequence')->_initialize(); } /** diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php b/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php new file mode 100644 index 000000000..724a977c6 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php @@ -0,0 +1,19 @@ + '']; +} + +if (!function_exists('msq') && !function_exists('msqs')) { + require_once __DIR__ . '/../Util/msq.php'; +} else { + throw new ModuleException('Magento\AcceptanceTestFramework\Module\MagentoSequence', "function 'msq' and 'msqs' already defined"); +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 91be5c220..251f0131a 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -5,6 +5,7 @@ use Magento\AcceptanceTestFramework\PageObject\Page\Page; use Magento\AcceptanceTestFramework\PageObject\Section\Section; use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager; +use Magento\AcceptanceTestFramework\DataGenerator\DataGeneratorConstants; class ActionObject { @@ -26,6 +27,7 @@ class ActionObject private $timeout; const DATA_ENABLED_ATTRIBUTES = ["userInput", "parameterArray"]; + const UNIQUENESS_FUNCTION = 'msq'; /** * ActionObject constructor. @@ -239,6 +241,14 @@ private function resolveDataInputReferences() return; } + $uniquenessData = $entityObj->getUniquenessDataByName($entityKey); + + if ($uniquenessData == DataGeneratorConstants::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX) { + $replacement = self::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")' . $replacement; + } elseif ($uniquenessData == DataGeneratorConstants::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX) { + $replacement .= self::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")'; + } + $varInput = str_replace($reference, $replacement, $varInput); } diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index da146b851..01032b4ef 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -3,6 +3,7 @@ namespace Magento\AcceptanceTestFramework\Util; use Magento\AcceptanceTestFramework\Test\Managers\CestArrayProcessor; +use Magento\AcceptanceTestFramework\Test\Objects\ActionObject; class TestGenerator { @@ -281,7 +282,33 @@ private function generateStepsPhp($stepsObject, $hookObject = false) if (isset($customActionAttributes['url']) && isset($customActionAttributes['userInput'])) { $input = sprintf("\"%s\"", $customActionAttributes['userInput']); } elseif (isset($customActionAttributes['userInput'])) { - $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + preg_match( + '/' . ActionObject::UNIQUENESS_FUNCTION .'\("[\w]+.[\w]+"\)/', + $customActionAttributes['userInput'], + $matches + ); + if (!empty($matches)) { + $parts = preg_split( + '/' . ActionObject::UNIQUENESS_FUNCTION . '\("[\w]+.[\w]+"\)/', + $customActionAttributes['userInput'], + -1 + ); + foreach ($parts as $part) { + if (!$part) { + if (!empty($input)) { + $input .= '.'; + } + $input .= $matches[0]; + } else { + if (!empty($input)) { + $input .= '.'; + } + $input .= sprintf("\"%s\"", $part); + } + } + } else { + $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + } } elseif (isset($customActionAttributes['url'])) { $input = sprintf("\"%s\"", $customActionAttributes['url']); } elseif (isset($customActionAttributes['time'])) { diff --git a/src/Magento/AcceptanceTestFramework/Util/msq.php b/src/Magento/AcceptanceTestFramework/Util/msq.php new file mode 100644 index 000000000..2b24f1a85 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Util/msq.php @@ -0,0 +1,32 @@ + Date: Thu, 17 Aug 2017 15:28:18 +0300 Subject: [PATCH 114/149] MQE-148: Add Code Sniffer static test to Acceptance Test Framework & Tests projects and run it in Jenkins build for PR - fix statics --- composer.json | 3 +- composer.lock | 260 +++++++++---- entryPoint.php | 7 - .../Config/Converter.php | 14 +- .../Config/Converter/Dom/Flat.php | 2 + .../AcceptanceTestFramework/Config/Data.php | 10 +- .../Config/DataInterface.php | 6 +- .../AcceptanceTestFramework/Config/Dom.php | 102 ++--- .../Config/Dom/ArrayNodeConfig.php | 3 + .../Config/Dom/NodeMergingConfig.php | 3 + .../Config/FileResolver/Mask.php | 2 + .../Config/FileResolver/Module.php | 7 +- .../AcceptanceTestFramework/Config/Reader.php | 32 +- .../Config/Reader/Filesystem.php | 65 ++-- .../Config/ReplacerInterface.php | 4 +- .../Config/SchemaLocator.php | 1 - .../Config/ValidationState.php | 10 +- .../Data/Argument/Interpreter/Argument.php | 10 +- .../Data/Argument/Interpreter/ArrayType.php | 5 +- .../Data/Argument/Interpreter/Boolean.php | 3 + .../Data/Argument/Interpreter/Composite.php | 3 +- .../Data/Argument/Interpreter/DataObject.php | 5 +- .../Data/Argument/InterpreterInterface.php | 1 + .../Argument/InterpreterInterface/Proxy.php | 10 +- .../DataGenerator/Api/ApiExecutor.php | 52 ++- .../DataGenerator/Api/EntityApiHandler.php | 25 ++ .../DataGenerator/Managers/DataManager.php | 59 ++- .../Managers/JsonDefinitionManager.php | 91 +++-- .../Objects/EntityDataObject.php | 62 ++- .../DataGenerator/Objects/JsonDefinition.php | 129 ++++++- .../DataGenerator/Objects/JsonElement.php | 44 ++- .../Parsers/DataProfileSchemaParser.php | 21 +- .../DataGenerator/Parsers/MetadataParser.php | 18 +- .../Exceptions/XmlException.php | 18 +- .../Helper/Acceptance.php | 10 +- .../Helper/AdminUrlList.php | 6 + .../Helper/EntityRESTApiHelper.php | 40 +- .../Helper/MagentoFakerData.php | 11 +- .../Module/MagentoRestDriver.php | 1 + .../Module/MagentoWebDriver.php | 1 + .../AcceptanceTestFramework/ObjectManager.php | 32 +- .../ObjectManager/Config.php | 16 +- .../ObjectManager/Config/Config.php | 93 ++--- .../Config/Mapper/ArgumentParser.php | 2 + .../ObjectManager/Config/Mapper/Dom.php | 1 + .../ObjectManager/Config/Reader/Dom.php | 2 + .../Config/Reader/DomFactory.php | 10 +- .../ObjectManager/ConfigInterface.php | 2 +- .../ObjectManager/ConfigLoader/Primary.php | 5 +- .../ObjectManager/Definition/Runtime.php | 22 +- .../ObjectManager/Factory.php | 25 +- .../Factory/Dynamic/Developer.php | 24 +- .../ObjectManager/ObjectManager.php | 35 +- .../ObjectManager/Relations/Runtime.php | 15 +- .../ObjectManagerFactory.php | 1 + .../ObjectManagerInterface.php | 4 +- .../PageObject/Page/Page.php | 11 +- .../PageObject/Page/PageInterface.php | 6 +- .../PageObject/Section/Section.php | 14 +- .../PageObject/Section/SectionInterface.php | 6 +- .../Stdlib/BooleanUtils.php | 2 + .../Step/Backend/AdminStep.php | 1 + .../Test/CestDataConstants.php | 8 +- .../Test/Config/Converter/Dom/Flat.php | 2 + .../Test/Managers/CestArrayProcessor.php | 35 +- .../Test/Objects/ActionObject.php | 62 ++- .../Test/Objects/CestHookObject.php | 33 ++ .../Test/Objects/CestObject.php | 57 +++ .../Test/Objects/TestObject.php | 88 ++++- .../Test/TestDataParser.php | 18 +- .../Util/ApiClientUtil.php | 50 ++- .../Util/Iterator/AbstractIterator.php | 14 +- .../Util/Iterator/File.php | 1 + .../Util/ModuleResolver.php | 6 +- .../Util/ModuleResolver/SequenceSorter.php | 2 +- .../SequenceSorterInterface.php | 2 +- .../Util/TestGenerator.php | 362 +++++++++++++++--- .../XmlParser/PageParser.php | 4 +- .../XmlParser/ParserInterface.php | 2 +- .../XmlParser/SectionParser.php | 4 +- 80 files changed, 1732 insertions(+), 503 deletions(-) delete mode 100644 entryPoint.php diff --git a/composer.json b/composer.json index 090aea1c1..d682a1f71 100755 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "vlucas/phpdotenv": "~2.4" }, "require-dev": { - "squizlabs/php_codesniffer": "1.5.3" + "squizlabs/php_codesniffer": "1.5.3", + "sebastian/phpcpd": "~3.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 2dca5b611..9d1503b4c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "914002cc8b4343fa30ba1b75bd356c68", + "hash": "5fcb6f9193fe765beb17e4c5e231cdd3", + "content-hash": "36b93cb68ae06b7687a2317b009cc462", "packages": [ { "name": "behat/gherkin", @@ -63,7 +64,7 @@ "gherkin", "parser" ], - "time": "2016-10-30T11:50:56+00:00" + "time": "2016-10-30 11:50:56" }, { "name": "codeception/codeception", @@ -157,36 +158,36 @@ "functional testing", "unit testing" ], - "time": "2017-05-22T23:47:35+00:00" + "time": "2017-05-22 23:47:35" }, { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -211,7 +212,7 @@ "constructor", "instantiate" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "facebook/webdriver", @@ -263,7 +264,7 @@ "selenium", "webdriver" ], - "time": "2017-04-28T14:54:49+00:00" + "time": "2017-04-28 14:54:49" }, { "name": "flow/jsonpath", @@ -304,7 +305,7 @@ } ], "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2016-09-06T17:43:18+00:00" + "time": "2016-09-06 17:43:18" }, { "name": "fzaninotto/faker", @@ -352,7 +353,7 @@ "faker", "fixtures" ], - "time": "2016-04-29T12:21:54+00:00" + "time": "2016-04-29 12:21:54" }, { "name": "guzzlehttp/guzzle", @@ -417,7 +418,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2017-06-22 18:50:49" }, { "name": "guzzlehttp/promises", @@ -468,7 +469,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "time": "2016-12-20 10:07:11" }, { "name": "guzzlehttp/psr7", @@ -533,7 +534,7 @@ "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2017-03-20 17:10:46" }, { "name": "myclabs/deep-copy", @@ -575,7 +576,7 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2017-04-12 18:52:22" }, { "name": "phpdocumentor/reflection-common", @@ -629,26 +630,26 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.2.0", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585" + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/46f7e8bb075036c92695b15a1ddb6971c751e585", - "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", "shasum": "" }, "require": { "php": ">=5.5", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.4.0", + "phpdocumentor/type-resolver": "^0.3.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -674,20 +675,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-07-15T11:38:20+00:00" + "time": "2017-08-08 06:39:58" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", "shasum": "" }, "require": { @@ -721,7 +722,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "time": "2017-06-03 08:32:36" }, { "name": "phpspec/prophecy", @@ -784,7 +785,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-03-02 20:05:34" }, { "name": "phpunit/php-code-coverage", @@ -847,7 +848,7 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2017-04-02 07:44:40" }, { "name": "phpunit/php-file-iterator", @@ -894,7 +895,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -935,7 +936,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -984,7 +985,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -1033,7 +1034,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-03T14:17:41+00:00" + "time": "2017-08-03 14:17:41" }, { "name": "phpunit/phpunit", @@ -1115,7 +1116,7 @@ "testing", "xunit" ], - "time": "2017-06-21T08:11:54+00:00" + "time": "2017-06-21 08:11:54" }, { "name": "phpunit/phpunit-mock-objects", @@ -1174,7 +1175,7 @@ "mock", "xunit" ], - "time": "2017-06-30T09:13:00+00:00" + "time": "2017-06-30 09:13:00" }, { "name": "psr/http-message", @@ -1224,7 +1225,7 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" + "time": "2016-08-06 14:39:51" }, { "name": "psr/log", @@ -1271,7 +1272,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1316,7 +1317,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2017-03-04 06:30:41" }, { "name": "sebastian/comparator", @@ -1380,7 +1381,7 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", @@ -1432,7 +1433,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -1482,7 +1483,7 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2016-11-26 07:53:53" }, { "name": "sebastian/exporter", @@ -1549,7 +1550,7 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2016-11-19 08:54:04" }, { "name": "sebastian/global-state", @@ -1600,7 +1601,7 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/object-enumerator", @@ -1646,7 +1647,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "time": "2017-02-18 15:18:39" }, { "name": "sebastian/recursion-context", @@ -1699,7 +1700,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2016-11-19 07:33:16" }, { "name": "sebastian/resource-operations", @@ -1741,7 +1742,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", @@ -1784,7 +1785,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "stecman/symfony-console-completion", @@ -1829,7 +1830,7 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24T05:08:54+00:00" + "time": "2016-02-24 05:08:54" }, { "name": "symfony/browser-kit", @@ -1886,7 +1887,7 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-07-12T13:03:20+00:00" + "time": "2017-07-12 13:03:20" }, { "name": "symfony/console", @@ -1955,7 +1956,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:27:59+00:00" + "time": "2017-07-29 21:27:59" }, { "name": "symfony/css-selector", @@ -2008,7 +2009,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01T15:01:29+00:00" + "time": "2017-05-01 15:01:29" }, { "name": "symfony/debug", @@ -2064,7 +2065,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-07-28T15:27:31+00:00" + "time": "2017-07-28 15:27:31" }, { "name": "symfony/dom-crawler", @@ -2120,7 +2121,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-05-25T23:10:31+00:00" + "time": "2017-05-25 23:10:31" }, { "name": "symfony/event-dispatcher", @@ -2183,7 +2184,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-09T14:53:08+00:00" + "time": "2017-06-09 14:53:08" }, { "name": "symfony/finder", @@ -2232,7 +2233,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-06-01T21:01:25+00:00" + "time": "2017-06-01 21:01:25" }, { "name": "symfony/polyfill-mbstring", @@ -2291,7 +2292,7 @@ "portable", "shim" ], - "time": "2017-06-09T14:24:12+00:00" + "time": "2017-06-09 14:24:12" }, { "name": "symfony/process", @@ -2340,7 +2341,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-13T13:05:09+00:00" + "time": "2017-07-13 13:05:09" }, { "name": "symfony/yaml", @@ -2395,7 +2396,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-07-23T12:43:26+00:00" + "time": "2017-07-23 12:43:26" }, { "name": "vlucas/phpdotenv", @@ -2445,7 +2446,7 @@ "env", "environment" ], - "time": "2016-09-01T10:05:43+00:00" + "time": "2016-09-01 10:05:43" }, { "name": "webmozart/assert", @@ -2495,10 +2496,99 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2016-11-23 20:04:58" } ], "packages-dev": [ + { + "name": "sebastian/finder-facade", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/finder-facade.git", + "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", + "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", + "shasum": "" + }, + "require": { + "symfony/finder": "~2.3|~3.0", + "theseer/fdomdocument": "~1.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", + "homepage": "https://github.com/sebastianbergmann/finder-facade", + "time": "2016-02-17 07:02:23" + }, + { + "name": "sebastian/phpcpd", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpcpd.git", + "reference": "d7006078b75a34c9250831c3453a2e256a687615" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/d7006078b75a34c9250831c3453a2e256a687615", + "reference": "d7006078b75a34c9250831c3453a2e256a687615", + "shasum": "" + }, + "require": { + "php": "^5.6|^7.0", + "phpunit/php-timer": "^1.0.6", + "sebastian/finder-facade": "^1.1", + "sebastian/version": "^2.0", + "symfony/console": "^3.0" + }, + "bin": [ + "phpcpd" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Copy/Paste Detector (CPD) for PHP code.", + "homepage": "https://github.com/sebastianbergmann/phpcpd", + "time": "2017-02-05 07:48:01" + }, { "name": "squizlabs/php_codesniffer", "version": "1.5.3", @@ -2572,7 +2662,47 @@ "phpcs", "standards" ], - "time": "2014-05-01T03:07:07+00:00" + "time": "2014-05-01 03:07:07" + }, + { + "name": "theseer/fdomdocument", + "version": "1.6.6", + "source": { + "type": "git", + "url": "https://github.com/theseer/fDOMDocument.git", + "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/6e8203e40a32a9c770bcb62fe37e68b948da6dca", + "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "lib-libxml": "*", + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "lead" + } + ], + "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", + "homepage": "https://github.com/theseer/fDOMDocument", + "time": "2017-06-30 11:53:12" } ], "aliases": [], diff --git a/entryPoint.php b/entryPoint.php deleted file mode 100644 index 864abaf7f..000000000 --- a/entryPoint.php +++ /dev/null @@ -1,7 +0,0 @@ -create(\Magento\AcceptanceTestFramework\Dummy::class); -//$dummy->readPageObjects(); diff --git a/src/Magento/AcceptanceTestFramework/Config/Converter.php b/src/Magento/AcceptanceTestFramework/Config/Converter.php index bcea63166..82701925a 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Converter.php +++ b/src/Magento/AcceptanceTestFramework/Config/Converter.php @@ -19,30 +19,40 @@ class Converter implements \Magento\AcceptanceTestFramework\Config\ConverterInte const NAME_ATTRIBUTE = 'name'; /** + * Argument parser. + * * @var ArgumentParser */ protected $argumentParser; /** + * Argument interpreter. + * * @var InterpreterInterface */ protected $argumentInterpreter; /** + * Argument node name. + * * @var string */ protected $argumentNodeName; /** + * Id attributes. + * * @var string[] */ protected $idAttributes; /** + * Constructor for Converter object. + * * @param ArgumentParser $argumentParser * @param InterpreterInterface $argumentInterpreter * @param string $argumentNodeName - * @param string[] $idAttributes + * @param array $idAttributes */ public function __construct( ArgumentParser $argumentParser, @@ -135,6 +145,8 @@ protected function getElementKey(\DOMElement $element) } /** + * Verify attribute is main key for element. + * * @param \DOMElement $element * @param \DOMAttr $attribute * @return bool diff --git a/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php b/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php index 7a3c40064..f11453d57 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php +++ b/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php @@ -13,6 +13,8 @@ class Flat { /** + * Array node configuration. + * * @var ArrayNodeConfig */ protected $arrayNodeConfig; diff --git a/src/Magento/AcceptanceTestFramework/Config/Data.php b/src/Magento/AcceptanceTestFramework/Config/Data.php index 52cf7a7da..431549b81 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Data.php +++ b/src/Magento/AcceptanceTestFramework/Config/Data.php @@ -47,11 +47,13 @@ public function merge(array $config) $this->data = array_replace_recursive($this->data, $config); } + // @codingStandardsIgnoreStart /** * Get config value by key * * @param string $path - * @param mixed $default + * + * @param null|mixed $default * @return array|mixed|null */ public function get($path = null, $default = null) @@ -70,6 +72,7 @@ public function get($path = null, $default = null) } return $data; } + // @codingStandardsIgnoreEnd /** * Set name of the config file @@ -79,7 +82,7 @@ public function get($path = null, $default = null) */ public function setFileName($fileName) { - if (!is_null($fileName)) { + if ($fileName !== null) { $this->reader->setFileName($fileName); } return $this; @@ -89,6 +92,7 @@ public function setFileName($fileName) * Load config data * * @param string|null $scope + * @return void */ public function load($scope = null) { @@ -96,4 +100,4 @@ public function load($scope = null) $this->reader->read($scope) ); } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/Config/DataInterface.php b/src/Magento/AcceptanceTestFramework/Config/DataInterface.php index a20324c41..f290634d2 100644 --- a/src/Magento/AcceptanceTestFramework/Config/DataInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/DataInterface.php @@ -18,14 +18,16 @@ interface DataInterface */ public function merge(array $config); + // @codingStandardsIgnoreStart /** * Get config value by key * * @param string $key - * @param mixed $default - * @return mixed + * @param mixed|null $default + * @return mixed|null */ public function get($key = null, $default = null); + // @codingStandardsIgnoreEnd /** * Load config data diff --git a/src/Magento/AcceptanceTestFramework/Config/Dom.php b/src/Magento/AcceptanceTestFramework/Config/Dom.php index da2fe4bb2..199988e53 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Dom.php +++ b/src/Magento/AcceptanceTestFramework/Config/Dom.php @@ -26,40 +26,42 @@ class Dom * * @var \DOMDocument */ - protected $_dom; + protected $dom; /** + * Configuration of identifier attributes to be taken into account during merging. + * * @var Dom\NodeMergingConfig */ - protected $_nodeMergingConfig; + protected $nodeMergingConfig; /** * Name of attribute that specifies type of argument node * * @var string|null */ - protected $_typeAttributeName; + protected $typeAttributeName; /** * Schema validation file * * @var string */ - protected $_schemaFile; + protected $schemaFile; /** * Format of error messages * * @var string */ - protected $_errorFormat; + protected $errorFormat; /** * Default namespace for xml elements * * @var string */ - protected $_rootNamespace; + protected $rootNamespace; /** * Build DOM with initial XML contents and specifying identifier attributes for merging @@ -80,12 +82,12 @@ public function __construct( $schemaFile = null, $errorFormat = self::ERROR_FORMAT_DEFAULT ) { - $this->_schemaFile = $schemaFile; - $this->_nodeMergingConfig = new Dom\NodeMergingConfig(new Dom\NodePathMatcher(), $idAttributes); - $this->_typeAttributeName = $typeAttributeName; - $this->_errorFormat = $errorFormat; - $this->_dom = $this->_initDom($xml); - $this->_rootNamespace = $this->_dom->lookupNamespaceUri($this->_dom->namespaceURI); + $this->schemaFile = $schemaFile; + $this->nodeMergingConfig = new Dom\NodeMergingConfig(new Dom\NodePathMatcher(), $idAttributes); + $this->typeAttributeName = $typeAttributeName; + $this->errorFormat = $errorFormat; + $this->dom = $this->initDom($xml); + $this->rootNamespace = $this->dom->lookupNamespaceUri($this->dom->namespaceURI); } /** @@ -96,8 +98,8 @@ public function __construct( */ public function merge($xml) { - $dom = $this->_initDom($xml); - $this->_mergeNode($dom->documentElement, ''); + $dom = $this->initDom($xml); + $this->mergeNode($dom->documentElement, ''); } /** @@ -113,27 +115,27 @@ public function merge($xml) * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - protected function _mergeNode(\DOMElement $node, $parentPath) + protected function mergeNode(\DOMElement $node, $parentPath) { - $path = $this->_getNodePathByParent($node, $parentPath); + $path = $this->getNodePathByParent($node, $parentPath); - $matchedNode = $this->_getMatchedNode($path); + $matchedNode = $this->getMatchedNode($path); /* Update matched node attributes and value */ if ($matchedNode) { //different node type - if ($this->_typeAttributeName - && $node->hasAttribute($this->_typeAttributeName) - && $matchedNode->hasAttribute($this->_typeAttributeName) - && $node->getAttribute($this->_typeAttributeName) - !== $matchedNode->getAttribute($this->_typeAttributeName) + if ($this->typeAttributeName + && $node->hasAttribute($this->typeAttributeName) + && $matchedNode->hasAttribute($this->typeAttributeName) + && $node->getAttribute($this->typeAttributeName) + !== $matchedNode->getAttribute($this->typeAttributeName) ) { $this->replaceNodeValue($parentPath, $node, $matchedNode); return; } - $this->_mergeAttributes($matchedNode, $node); + $this->mergeAttributes($matchedNode, $node); if ($node->nodeValue === '' && $matchedNode->nodeValue !== '' && $matchedNode->childNodes->length === 1) { $this->replaceNodeValue($parentPath, $node, $matchedNode); } @@ -141,23 +143,23 @@ protected function _mergeNode(\DOMElement $node, $parentPath) return; } /* override node value */ - if ($this->_isTextNode($node)) { + if ($this->isTextNode($node)) { /* skip the case when the matched node has children, otherwise they get overridden */ - if (!$matchedNode->hasChildNodes() || $this->_isTextNode($matchedNode)) { + if (!$matchedNode->hasChildNodes() || $this->isTextNode($matchedNode)) { $matchedNode->nodeValue = $node->childNodes->item(0)->nodeValue; } } else { /* recursive merge for all child nodes */ foreach ($node->childNodes as $childNode) { if ($childNode instanceof \DOMElement) { - $this->_mergeNode($childNode, $path); + $this->mergeNode($childNode, $path); } } } } else { /* Add node as is to the document under the same parent element */ - $parentMatchedNode = $this->_getMatchedNode($parentPath); - $newNode = $this->_dom->importNode($node, true); + $parentMatchedNode = $this->getMatchedNode($parentPath); + $newNode = $this->dom->importNode($node, true); $parentMatchedNode->appendChild($newNode); } } @@ -173,8 +175,8 @@ protected function _mergeNode(\DOMElement $node, $parentPath) */ private function replaceNodeValue($parentPath, \DOMElement $node, \DOMElement $matchedNode) { - $parentMatchedNode = $this->_getMatchedNode($parentPath); - $newNode = $this->_dom->importNode($node, true); + $parentMatchedNode = $this->getMatchedNode($parentPath); + $newNode = $this->dom->importNode($node, true); $parentMatchedNode->replaceChild($newNode, $matchedNode); } @@ -184,7 +186,7 @@ private function replaceNodeValue($parentPath, \DOMElement $node, \DOMElement $m * @param \DOMElement $node * @return bool */ - protected function _isTextNode($node) + protected function isTextNode($node) { return $node->childNodes->length == 1 && $node->childNodes->item(0) instanceof \DOMText; } @@ -196,10 +198,10 @@ protected function _isTextNode($node) * @param \DOMNode $mergeNode * @return void */ - protected function _mergeAttributes($baseNode, $mergeNode) + protected function mergeAttributes($baseNode, $mergeNode) { foreach ($mergeNode->attributes as $attribute) { - $baseNode->setAttribute($this->_getAttributeName($attribute), $attribute->value); + $baseNode->setAttribute($this->getAttributeName($attribute), $attribute->value); } } @@ -210,11 +212,11 @@ protected function _mergeAttributes($baseNode, $mergeNode) * @param string $parentPath * @return string */ - protected function _getNodePathByParent(\DOMElement $node, $parentPath) + protected function getNodePathByParent(\DOMElement $node, $parentPath) { - $prefix = is_null($this->_rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; + $prefix = $this->rootNamespace === null ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; $path = $parentPath . '/' . $prefix . $node->tagName; - $idAttribute = $this->_nodeMergingConfig->getIdAttribute($path); + $idAttribute = $this->nodeMergingConfig->getIdAttribute($path); if ($idAttribute) { foreach (explode('|', $idAttribute) as $idAttributeValue) { if ($value = $node->getAttribute($idAttributeValue)) { @@ -234,11 +236,11 @@ protected function _getNodePathByParent(\DOMElement $node, $parentPath) * @throws \Exception * @return \DOMElement|null */ - protected function _getMatchedNode($nodePath) + protected function getMatchedNode($nodePath) { - $xPath = new \DOMXPath($this->_dom); - if ($this->_rootNamespace) { - $xPath->registerNamespace(self::ROOT_NAMESPACE_PREFIX, $this->_rootNamespace); + $xPath = new \DOMXPath($this->dom); + if ($this->rootNamespace) { + $xPath->registerNamespace(self::ROOT_NAMESPACE_PREFIX, $this->rootNamespace); } $matchedNodes = $xPath->query($nodePath); $node = null; @@ -272,7 +274,7 @@ public static function validateDomDocument( $validationErrors = libxml_get_errors(); if (count($validationErrors)) { foreach ($validationErrors as $error) { - $errors[] = self::_renderErrorMessage($error, $errorFormat); + $errors[] = self::renderErrorMessage($error, $errorFormat); } } else { $errors[] = 'Unknown validation error'; @@ -300,7 +302,7 @@ public static function validateDomDocument( * @return string * @throws \InvalidArgumentException */ - private static function _renderErrorMessage(\LibXMLError $errorInfo, $format) + private static function renderErrorMessage(\LibXMLError $errorInfo, $format) { $result = $format; foreach ($errorInfo as $field => $value) { @@ -321,7 +323,7 @@ private static function _renderErrorMessage(\LibXMLError $errorInfo, $format) */ public function getDom() { - return $this->_dom; + return $this->dom; } /** @@ -331,12 +333,12 @@ public function getDom() * @return \DOMDocument * @throws \Magento\AcceptanceTestFramework\Config\Dom\ValidationException */ - protected function _initDom($xml) + protected function initDom($xml) { $dom = new \DOMDocument(); $dom->loadXML($xml); - if ($this->_schemaFile) { - $errors = self::validateDomDocument($dom, $this->_schemaFile, $this->_errorFormat); + if ($this->schemaFile) { + $errors = self::validateDomDocument($dom, $this->schemaFile, $this->errorFormat); if (count($errors)) { throw new \Magento\AcceptanceTestFramework\Config\Dom\ValidationException(implode("\n", $errors)); } @@ -353,7 +355,7 @@ protected function _initDom($xml) */ public function validate($schemaFileName, &$errors = []) { - $errors = self::validateDomDocument($this->_dom, $schemaFileName, $this->_errorFormat); + $errors = self::validateDomDocument($this->dom, $schemaFileName, $this->errorFormat); return !count($errors); } @@ -365,7 +367,7 @@ public function validate($schemaFileName, &$errors = []) */ public function setSchemaFile($schemaFile) { - $this->_schemaFile = $schemaFile; + $this->schemaFile = $schemaFile; return $this; } @@ -375,9 +377,9 @@ public function setSchemaFile($schemaFile) * @param \DOMAttr $attribute * @return string */ - private function _getAttributeName($attribute) + private function getAttributeName($attribute) { - if (!is_null($attribute->prefix) && !empty($attribute->prefix)) { + if ($attribute->prefix !== null && !empty($attribute->prefix)) { $attributeName = $attribute->prefix . ':' . $attribute->name; } else { $attributeName = $attribute->name; diff --git a/src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php b/src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php index d4e61ed40..2dc5436b8 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php +++ b/src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php @@ -11,6 +11,8 @@ class ArrayNodeConfig { /** + * Matching of XPath expressions to path patterns. + * * @var NodePathMatcher */ private $nodePathMatcher; @@ -30,6 +32,7 @@ class ArrayNodeConfig private $numericArrays = []; /** + * ArrayNodeConfig constructor. * @param NodePathMatcher $nodePathMatcher * @param array $assocArrayAttributes * @param array $numericArrays diff --git a/src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php b/src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php index d40b2f217..47fd9eb1f 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php +++ b/src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php @@ -11,6 +11,8 @@ class NodeMergingConfig { /** + * Matching of XPath expressions to path patterns. + * * @var NodePathMatcher */ private $nodePathMatcher; @@ -23,6 +25,7 @@ class NodeMergingConfig private $idAttributes = []; /** + * NodeMergingConfig constructor. * @param NodePathMatcher $nodePathMatcher * @param array $idAttributes */ diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php index df569b2ba..3ac8210f2 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php @@ -17,6 +17,8 @@ class Mask implements FileResolverInterface { /** + * Resolves module paths based on enabled modules of target Magento instance. + * * @var ModuleResolver */ protected $moduleResolver; diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php index 731854e75..0ffd5c411 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php +++ b/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php @@ -16,12 +16,15 @@ class Module implements FileResolverInterface { /** + * Resolves module paths based on enabled modules of target Magento instance. + * * @var ModuleResolver */ private $moduleResolver; /** - * @param ModuleResolver $moduleResolver + * Module constructor. + * @param ModuleResolver|null $moduleResolver */ public function __construct(ModuleResolver $moduleResolver = null) { @@ -29,7 +32,7 @@ public function __construct(ModuleResolver $moduleResolver = null) } /** - * Retrieve the list of configuration files with given name that relate to specified scope + * Retrieve the list of configuration files with given name that relate to specified scope. * * @param string $filename * @param string $scope diff --git a/src/Magento/AcceptanceTestFramework/Config/Reader.php b/src/Magento/AcceptanceTestFramework/Config/Reader.php index 990fd4876..38d9e3370 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Reader.php +++ b/src/Magento/AcceptanceTestFramework/Config/Reader.php @@ -16,22 +16,22 @@ class Reader extends \Magento\AcceptanceTestFramework\Config\Reader\Filesystem * * @var array */ - protected $_idAttributes = [ + protected $idAttributes = [ '/scenarios/scenario' => 'name', '/scenarios/scenario/methods/method' => 'name', '/scenarios/scenario/methods/method/steps/step' => 'name', ]; /** - * @constructor + * Reader constructor. * @param FileResolverInterface $fileResolver * @param ConverterInterface $converter * @param SchemaLocatorInterface $schemaLocator * @param ValidationStateInterface $validationState - * @param string $fileName [optional] - * @param array $idAttributes [optional] - * @param string $domDocumentClass [optional] - * @param string $defaultScope [optional] + * @param string $fileName + * @param array $idAttributes + * @param string $domDocumentClass + * @param string $defaultScope */ public function __construct( FileResolverInterface $fileResolver, @@ -43,15 +43,15 @@ public function __construct( $domDocumentClass = 'Magento\AcceptanceTestFramework\Config\Dom', $defaultScope = 'etc' ) { - $this->_fileResolver = $fileResolver; - $this->_converter = $converter; - $this->_fileName = $fileName; - $this->_idAttributes = array_replace($this->_idAttributes, $idAttributes); - $this->_schemaFile = $schemaLocator->getSchema(); - $this->_isValidated = $validationState->isValidated(); - $this->_perFileSchema = $schemaLocator->getPerFileSchema() && - $this->_isValidated ? $schemaLocator->getPerFileSchema() : null; - $this->_domDocumentClass = $domDocumentClass; - $this->_defaultScope = $defaultScope; + $this->fileResolver = $fileResolver; + $this->converter = $converter; + $this->fileName = $fileName; + $this->idAttributes = array_replace($this->idAttributes, $idAttributes); + $this->schemaFile = $schemaLocator->getSchema(); + $this->isValidated = $validationState->isValidated(); + $this->perFileSchema = $schemaLocator->getPerFileSchema() && + $this->isValidated ? $schemaLocator->getPerFileSchema() : null; + $this->domDocumentClass = $domDocumentClass; + $this->defaultScope = $defaultScope; } } diff --git a/src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php b/src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php index 5b84cc050..4fca5d79e 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php +++ b/src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php @@ -1,15 +1,12 @@ _fileResolver = $fileResolver; - $this->_converter = $converter; - $this->_fileName = $fileName; - $this->_idAttributes = array_replace($this->_idAttributes, $idAttributes); + $this->fileResolver = $fileResolver; + $this->converter = $converter; + $this->fileName = $fileName; + $this->idAttributes = array_replace($this->idAttributes, $idAttributes); $this->validationState = $validationState; - $this->_schemaFile = $schemaLocator->getSchema(); - $this->_perFileSchema = $schemaLocator->getPerFileSchema() && $validationState->isValidationRequired() + $this->schemaFile = $schemaLocator->getSchema(); + $this->perFileSchema = $schemaLocator->getPerFileSchema() && $validationState->isValidationRequired() ? $schemaLocator->getPerFileSchema() : null; - $this->_domDocumentClass = $domDocumentClass; - $this->_defaultScope = $defaultScope; + $this->domDocumentClass = $domDocumentClass; + $this->defaultScope = $defaultScope; } /** @@ -119,12 +122,12 @@ public function __construct( */ public function read($scope = null) { - $scope = $scope ?: $this->_defaultScope; - $fileList = $this->_fileResolver->get($this->_fileName, $scope); + $scope = $scope ?: $this->defaultScope; + $fileList = $this->fileResolver->get($this->fileName, $scope); if (!count($fileList)) { return []; } - $output = $this->_readFiles($fileList); + $output = $this->readFiles($fileList); return $output; } @@ -136,14 +139,14 @@ public function read($scope = null) * @return array * @throws \Exception */ - protected function _readFiles($fileList) + protected function readFiles($fileList) { /** @var \Magento\AcceptanceTestFramework\Config\Dom $configMerger */ $configMerger = null; foreach ($fileList as $key => $content) { try { if (!$configMerger) { - $configMerger = $this->_createConfigMerger($this->_domDocumentClass, $content); + $configMerger = $this->createConfigMerger($this->domDocumentClass, $content); } else { $configMerger->merge($content); } @@ -153,7 +156,7 @@ protected function _readFiles($fileList) } if ($this->validationState->isValidationRequired()) { $errors = []; - if ($configMerger && !$configMerger->validate($this->_schemaFile, $errors)) { + if ($configMerger && !$configMerger->validate($this->schemaFile, $errors)) { $message = "Invalid Document \n"; throw new \Exception($message . implode("\n", $errors)); } @@ -161,7 +164,7 @@ protected function _readFiles($fileList) $output = []; if ($configMerger) { - $output = $this->_converter->convert($configMerger->getDom()); + $output = $this->converter->convert($configMerger->getDom()); } return $output; } @@ -174,13 +177,13 @@ protected function _readFiles($fileList) * @return \Magento\AcceptanceTestFramework\Config\Dom * @throws \UnexpectedValueException */ - protected function _createConfigMerger($mergerClass, $initialContents) + protected function createConfigMerger($mergerClass, $initialContents) { $result = new $mergerClass( $initialContents, - $this->_idAttributes, + $this->idAttributes, null, - $this->_perFileSchema + $this->perFileSchema ); if (!$result instanceof \Magento\AcceptanceTestFramework\Config\Dom) { throw new \UnexpectedValueException( diff --git a/src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php b/src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php index 516140609..d053f76a4 100644 --- a/src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php +++ b/src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php @@ -14,8 +14,8 @@ interface ReplacerInterface /** * Apply specified node in 'replace' attribute instead of original. * - * @param array $output + * @param array &$output * @return array */ - public function apply(&$output); + public function apply(array &$output); } diff --git a/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php b/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php index 757ee52b5..49fba1e4e 100644 --- a/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php +++ b/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php @@ -21,7 +21,6 @@ class SchemaLocator implements \Magento\AcceptanceTestFramework\Config\SchemaLoc /** * Class constructor * - * @constructor * @param string $schemaPath */ public function __construct($schemaPath) diff --git a/src/Magento/AcceptanceTestFramework/Config/ValidationState.php b/src/Magento/AcceptanceTestFramework/Config/ValidationState.php index 445f4d09b..4163c7fe1 100644 --- a/src/Magento/AcceptanceTestFramework/Config/ValidationState.php +++ b/src/Magento/AcceptanceTestFramework/Config/ValidationState.php @@ -15,17 +15,19 @@ class ValidationState implements ValidationStateInterface { /** + * Application mode value. + * * @var string */ - protected $_appMode; + protected $appMode; /** - * @constructor + * ValidationState constructor. * @param string $appMode */ public function __construct($appMode) { - $this->_appMode = $appMode; + $this->appMode = $appMode; } /** @@ -35,6 +37,6 @@ public function __construct($appMode) */ public function isValidationRequired() { - return $this->_appMode == 'developer'; // @todo + return $this->appMode == 'developer'; // @todo } } diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php index 65f530884..76908b52a 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php @@ -14,11 +14,14 @@ class Argument implements InterpreterInterface { /** + * Interpreter that returns value of a constant by its name. + * * @var Constant */ private $constInterpreter; /** + * Argument constructor. * @param Constant $constInterpreter */ public function __construct(Constant $constInterpreter) @@ -27,9 +30,10 @@ public function __construct(Constant $constInterpreter) } /** - * {@inheritdoc} - * @return mixed - * @throws MissingOptionalValueException + * Compute and return effective value of an argument. + * + * @param array $data + * @return array */ public function evaluate(array $data) { diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php index 1ad061761..9dbf3b52b 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php @@ -20,6 +20,7 @@ class ArrayType implements InterpreterInterface private $itemInterpreter; /** + * ArrayType constructor. * @param InterpreterInterface $itemInterpreter */ public function __construct(InterpreterInterface $itemInterpreter) @@ -78,8 +79,8 @@ function ($firstItemKey, $secondItemKey) use ($indexedItems) { /** * Compare sortOrder of item * - * @param mixed $firstItemKey - * @param mixed $secondItemKey + * @param string|int $firstItemKey + * @param string|int $secondItemKey * @param array $indexedItems * @return int */ diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php index 6759c3444..4da2bc536 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php @@ -14,11 +14,14 @@ class Boolean implements InterpreterInterface { /** + * Utility methods for the boolean data type + * * @var BooleanUtils */ private $booleanUtils; /** + * Boolean constructor. * @param BooleanUtils $booleanUtils */ public function __construct(BooleanUtils $booleanUtils) diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php index 72aca9d97..0be27171f 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php @@ -27,7 +27,8 @@ class Composite implements InterpreterInterface private $discriminator; /** - * @param InterpreterInterface[] $interpreters + * Composite constructor. + * @param array $interpreters * @param string $discriminator * @throws \InvalidArgumentException */ diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php index c62b07167..706c00bfb 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php @@ -12,11 +12,14 @@ class DataObject implements InterpreterInterface { /** + * Utility methods for the boolean data type. + * * @var \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils */ protected $booleanUtils; /** + * DataObject constructor. * @param BooleanUtils $booleanUtils */ public function __construct(BooleanUtils $booleanUtils) @@ -28,7 +31,7 @@ public function __construct(BooleanUtils $booleanUtils) * Compute and return effective value of an argument * * @param array $data - * @return mixed + * @return array * @throws \InvalidArgumentException * @throws \UnexpectedValueException */ diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php b/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php index abf4b3a64..1e89503fc 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php @@ -8,6 +8,7 @@ /** * Interface that encapsulates complexity of expression computation */ +// @codingStandardsIgnoreFile interface InterpreterInterface { /** diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php b/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php index b578a9483..59c0194ed 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php +++ b/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php @@ -56,6 +56,8 @@ public function __construct( } /** + * Definition of field which should be serialized. + * * @return array */ public function __sleep() @@ -65,6 +67,7 @@ public function __sleep() /** * Retrieve ObjectManager from global scope + * @return void */ public function __wakeup() { @@ -73,10 +76,11 @@ public function __wakeup() /** * Clone proxied instance + * @return void */ public function __clone() { - $this->subject = clone $this->_getSubject(); + $this->subject = clone $this->getSubject(); } /** @@ -84,7 +88,7 @@ public function __clone() * * @return \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface */ - protected function _getSubject() + protected function getSubject() { if (!$this->subject) { $this->subject = true === $this->isShared @@ -99,6 +103,6 @@ protected function _getSubject() */ public function evaluate(array $data) { - return $this->_getSubject()->evaluate($data); + return $this->getSubject()->evaluate($data); } } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index 291c42ea2..68e14c424 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -1,5 +1,8 @@ jsonDefinition->getApiUrl(); @@ -91,7 +121,7 @@ private function getAuthorizationHeader($authUrl) * recursively forming an array which represents the json structure for the api of the desired type. * * @param EntityDataObject $entityObject - * @param Array $jsonDefMetadata + * @param array $jsonDefMetadata * * @return array */ @@ -102,7 +132,7 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) $entityObject->getType() )->getJsonMetadata() : $jsonDefMetadata; - $jsonArray = array(); + $jsonArray = []; foreach ($jsonArrayMetadata as $jsonElement) { $jsonElementType = $jsonElement->getValue(); @@ -131,6 +161,11 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) return $jsonArray; } + /** + * Encodes data to json string. + * + * @return string + */ private function getEncodedJsonString() { $jsonArray = $this->getJsonDataArray($this->entityObject, $this->jsonDefinition->getJsonMetadata()); @@ -138,6 +173,14 @@ private function getEncodedJsonString() return json_encode([$this->entityObject->getType() => $jsonArray], JSON_PRETTY_PRINT); } + // @codingStandardsIgnoreStart + /** + * Casting value based on type. + * + * @param string $type + * @param string $value + * @return mixed + */ private function castValue($type, $value) { $newVal = $value; @@ -158,4 +201,5 @@ private function castValue($type, $value) return $newVal; } -} \ No newline at end of file + // @codingStandardsIgnoreEnd +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php index 8f1a6262c..1c38656c1 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php @@ -1,4 +1,8 @@ entityObject = $entityObject; } + /** + * Method responsible for creating entity. + * + * @return void + */ public function createEntity() { $apiExecutor = new ApiExecutor('create', $this->entityObject); @@ -31,6 +51,11 @@ public function createEntity() ); } + /** + * Method responsible for deleting entity. + * + * @return bool|string + */ public function deleteEntity() { $apiExecutor = new ApiExecutor('delete', $this->createdObject); diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php index 06600643e..a99ffb6e0 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/DataManager.php @@ -1,5 +1,8 @@ arrayData = $arrayData; + } /** * Singleton method to access instance of DataManager. + * * @return DataManager * @throws Exception */ @@ -36,18 +71,11 @@ public static function getInstance() return self::$dataManager; } - /** - * DataManager constructor. - * @param array $arrayData - */ - private function __construct($arrayData) - { - $this->arrayData = $arrayData; - } - /** * Adds all .env variables defined in the PROJECT_ROOT as EntityDataObjects. This is to allow resolution * of these variables when referenced in a cest. + * + * @return void */ private function parseEnvVariables() { @@ -66,7 +94,6 @@ private function parseEnvVariables() $envData[strtolower(trim($params[0]))] = trim($params[1]); } - $envDataObject = new EntityDataObject(self::ENV_DATA_OBJECT_NAME, 'environment', $envData, null); $this->data[$envDataObject->getName()] = $envDataObject; } @@ -74,6 +101,8 @@ private function parseEnvVariables() /** * Parses data xml and extracts all information into EntityDataObject. + * + * @return void */ private function parseDataEntities() { @@ -133,7 +162,8 @@ private function parseDataEntities() /** * Method returns a single data entity by name based on what is defined in data.xml. - * @param $entityName + * + * @param string $entityName * @return EntityDataObject */ public function getEntity($entityName) @@ -143,6 +173,7 @@ public function getEntity($entityName) /** * Method returns all data entities read from data.xml into objects. + * * @return array */ public function getAllEntities() diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php index 1b7c1cba4..cc2eae217 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Managers/JsonDefinitionManager.php @@ -1,4 +1,8 @@ create(MetadataParser::class); - foreach ($metadataParser->readMetadata()[JsonDefinitionManager::ENTITY_OPERATION_ROOT_TAG] as + foreach ($metadataParser->readMetadata()[self::ENTITY_OPERATION_ROOT_TAG] as $jsonDefName => $jsonDefArray) { - $operation = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_TYPE]; - $dataType = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_DATA_TYPE]; - $url = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_URL] ?? null; - $method = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_METHOD] ?? null; - $auth = $jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_AUTH] ?? null; + $operation = $jsonDefArray[self::ENTITY_OPERATION_TYPE]; + $dataType = $jsonDefArray[self::ENTITY_OPERATION_DATA_TYPE]; + $url = $jsonDefArray[self::ENTITY_OPERATION_URL] ?? null; + $method = $jsonDefArray[self::ENTITY_OPERATION_METHOD] ?? null; + $auth = $jsonDefArray[self::ENTITY_OPERATION_AUTH] ?? null; $headers = []; $params = []; $jsonMetadata = []; - if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_HEADER, $jsonDefArray)) { - foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_HEADER] as $headerEntry) { - $headers[] = $headerEntry[JsonDefinitionManager::ENTITY_OPERATION_HEADER_PARAM] . ': ' . - $headerEntry[JsonDefinitionManager::ENTITY_OPERATION_HEADER_VALUE]; + if (array_key_exists(self::ENTITY_OPERATION_HEADER, $jsonDefArray)) { + foreach ($jsonDefArray[self::ENTITY_OPERATION_HEADER] as $headerEntry) { + $headers[] = $headerEntry[self::ENTITY_OPERATION_HEADER_PARAM] . ': ' . + $headerEntry[self::ENTITY_OPERATION_HEADER_VALUE]; } } - if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM, $jsonDefArray)) { - foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM] as $paramEntry) { - $params[$paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_TYPE]] - [$paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_KEY]] = - $paramEntry[JsonDefinitionManager::ENTITY_OPERATION_URL_PARAM_VALUE]; + if (array_key_exists(self::ENTITY_OPERATION_URL_PARAM, $jsonDefArray)) { + foreach ($jsonDefArray[self::ENTITY_OPERATION_URL_PARAM] as $paramEntry) { + $params[$paramEntry[self::ENTITY_OPERATION_URL_PARAM_TYPE]] + [$paramEntry[self::ENTITY_OPERATION_URL_PARAM_KEY]] = + $paramEntry[self::ENTITY_OPERATION_URL_PARAM_VALUE]; } } - if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_ENTRY, $jsonDefArray)) { - foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_ENTRY] as $jsonEntryType) { + if (array_key_exists(self::ENTITY_OPERATION_ENTRY, $jsonDefArray)) { + foreach ($jsonDefArray[self::ENTITY_OPERATION_ENTRY] as $jsonEntryType) { $jsonMetadata[] = new JsonElement( - $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ENTRY_KEY], - $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ENTRY_VALUE], - JsonDefinitionManager::ENTITY_OPERATION_ENTRY + $jsonEntryType[self::ENTITY_OPERATION_ENTRY_KEY], + $jsonEntryType[self::ENTITY_OPERATION_ENTRY_VALUE], + self::ENTITY_OPERATION_ENTRY ); } } - if (array_key_exists(JsonDefinitionManager::ENTITY_OPERATION_ARRAY, $jsonDefArray)) { - foreach ($jsonDefArray[JsonDefinitionManager::ENTITY_OPERATION_ARRAY] as $jsonEntryType) { + if (array_key_exists(self::ENTITY_OPERATION_ARRAY, $jsonDefArray)) { + foreach ($jsonDefArray[self::ENTITY_OPERATION_ARRAY] as $jsonEntryType) { $jsonMetadata[] = new JsonElement( - $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ARRAY_KEY], - $jsonEntryType[JsonDefinitionManager::ENTITY_OPERATION_ARRAY_VALUE], - JsonDefinitionManager::ENTITY_OPERATION_ARRAY + $jsonEntryType[self::ENTITY_OPERATION_ARRAY_KEY], + $jsonEntryType[self::ENTITY_OPERATION_ARRAY_VALUE], + self::ENTITY_OPERATION_ARRAY ); } } @@ -112,13 +142,16 @@ private function getObjects() } /** - * @param $type + * Returns json definition object. + * + * @param string $operation + * @param string $type * @return JsonDefinition */ public function getJsonDefinition($operation, $type) { if (!$this->jsonDefinitions) { - $this->getObjects(); + $this->retrieveJsonDefinitions(); } return $this->jsonDefinitions[$operation][$type]; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index 2d1e3fdbf..7fcbcee52 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -1,4 +1,8 @@ name = $entityName; $this->type = $entityType; @@ -27,17 +54,32 @@ public function __construct($entityName, $entityType, $data, $linkedEntities) $this->linkedEntities = $linkedEntities; } - public function getLinkedEntities() + /** + * Returns array of linked entities. + * + * @return array + */ + public function getLinkedEntities(): array { return $this->linkedEntities; } - public function getName() + /** + * Returns entity name. + * + * @return string + */ + public function getName(): string { return $this->name; } - public function getType() + /** + * Returns entity type. + * + * @return string + */ + public function getType(): string { return $this->type; } @@ -46,9 +88,9 @@ public function getType() * This function retrieves data from an entity defined in xml. * * @param string $dataName - * @return string + * @return string|null */ - public function getDataByName($dataName) + public function getDataByName(string $dataName) { $name = strtolower($dataName); @@ -66,9 +108,9 @@ public function getDataByName($dataName) * @param string $fieldType * @return array */ - public function getLinkedEntitiesOfType($fieldType) + public function getLinkedEntitiesOfType(string $fieldType): array { - $groupedArray = array(); + $groupedArray = []; foreach ($this->linkedEntities as $entityName => $entityType) { if ($entityType == $fieldType) { diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php index 8fd9e2555..de25c11e3 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonDefinition.php @@ -1,20 +1,98 @@ jsonMetadata = $jsonMetadata; } + /** + * Returns data type. + * + * @return string + */ public function getDataType() { return $this->dataType; } + /** + * Returns operation. + * + * @return string + */ public function getOperation() { return $this->operation; } + /** + * Returns HTTP request method. + * + * @return string + */ public function getApiMethod() { return $this->apiMethod; } + /** + * Returns API url. + * + * @return string + */ public function getApiUrl() { $this->cleanApiUrl(); @@ -67,21 +165,41 @@ public function getApiUrl() return $this->apiUrl; } + /** + * Returns auth key. + * + * @return string + */ public function getAuth() { return $this->auth; } + /** + * Returns request headers. + * + * @return array + */ public function getHeaders() { return $this->headers; } + /** + * Returns entity metadata. + * + * @return array + */ public function getJsonMetadata() { return $this->jsonMetadata; } + /** + * Cleans api url. + * + * @return void + */ private function cleanApiUrl() { if (substr($this->baseUrl, -1) == "/") { @@ -91,6 +209,11 @@ private function cleanApiUrl() } } + /** + * Adding path params. + * + * @return void + */ private function addPathParam() { foreach ($this->params['path'] as $paramName => $paramValue) { @@ -98,6 +221,11 @@ private function addPathParam() } } + /** + * Adding query params. + * + * @return void + */ private function addQueryParams() { @@ -111,5 +239,4 @@ private function addQueryParams() $this->apiUrl = $paramName . "=" . $paramValue; } } - } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php index 3015031fa..9dce1815c 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php @@ -1,13 +1,40 @@ key = $key; @@ -15,18 +42,33 @@ public function __construct($key, $value, $type) $this->type = $type; } + /** + * Returns key. + * + * @return string + */ public function getKey() { return $this->key; } + /** + * Returns value. + * + * @return string + */ public function getValue() { return $this->value; } + /** + * Returns type. + * + * @return string + */ public function getType() { return $this->type; } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php index 4200b12a8..3363a243b 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/DataProfileSchemaParser.php @@ -1,25 +1,34 @@ dataProfiles = $dataProfiles; } + /** + * Returns all data profiles. + * + * @return array|null + */ public function readDataProfiles() { return $this->dataProfiles->get(); } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php index 43964a2a8..d064ec69a 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Parsers/MetadataParser.php @@ -1,18 +1,34 @@ metadata = $metadata; } + /** + * Returns metadata. + * + * @return array|null + */ public function readMetadata() { return $this->metadata->get(); } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/Exceptions/XmlException.php b/src/Magento/AcceptanceTestFramework/Exceptions/XmlException.php index 535e9fd7a..94ca97b83 100644 --- a/src/Magento/AcceptanceTestFramework/Exceptions/XmlException.php +++ b/src/Magento/AcceptanceTestFramework/Exceptions/XmlException.php @@ -1,14 +1,22 @@ getModule('\Magento\AcceptanceTestFramework\Module\MagentoWebDriver')->_reconfigure(array($config => $value)); + $this->getModule(\Magento\AcceptanceTestFramework\Module\MagentoWebDriver::class) + ->_reconfigure([$config => $value]); } /** @@ -29,6 +35,6 @@ public function changeConfiguration($config, $value) */ public function getConfiguration($config) { - return $this->getModule('\Magento\AcceptanceTestFramework\Module\MagentoWebDriver')->_getConfig($config); + return $this->getModule(\Magento\AcceptanceTestFramework\Module\MagentoWebDriver::class)->_getConfig($config); } } diff --git a/src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php b/src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php index 8912c32e5..027c0c30b 100644 --- a/src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php +++ b/src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php @@ -1,9 +1,15 @@ 'application/json']; + /** + * Rest API client. + * + * @var Client + */ + private $guzzle_client; + + /** + * EntityRESTApiHelper constructor. + * @param string $host + * @param string $port + */ public function __construct($host, $port) { $this->guzzle_client = new Client([ @@ -18,6 +44,15 @@ public function __construct($host, $port) ]); } + /** + * Submit Auth API Request. + * + * @param string $apiMethod + * @param string $requestURI + * @param string $jsonBody + * @param array $headers + * @return \Psr\Http\Message\ResponseInterface + */ public function submitAuthAPIRequest($apiMethod, $requestURI, $jsonBody, $headers) { $allHeaders = $headers; @@ -30,9 +65,9 @@ public function submitAuthAPIRequest($apiMethod, $requestURI, $jsonBody, $header /** * Function that sends a REST call to the integration endpoint for an authorization token. + * * @return string */ - private function getAuthToken() { $jsonArray = json_encode(['username' => 'admin', 'password' => 'admin123']); @@ -54,6 +89,7 @@ private function getAuthToken() /** * Function that submits an api request from the guzzle client using the following parameters: + * * @param string $apiMethod * @param string $requestURI * @param string $jsonBody diff --git a/src/Magento/AcceptanceTestFramework/Helper/MagentoFakerData.php b/src/Magento/AcceptanceTestFramework/Helper/MagentoFakerData.php index c09795b2d..72b25d753 100644 --- a/src/Magento/AcceptanceTestFramework/Helper/MagentoFakerData.php +++ b/src/Magento/AcceptanceTestFramework/Helper/MagentoFakerData.php @@ -1,6 +1,14 @@ $faker->word, 'metaKeywords' => $faker->sentence($nbWords = 5, $variableNbWords = true), 'metaDescription' => $faker->sentence($nbWords = 10, $variableNbWords = true), - 'layoutUpdateXml' => "ToveJaniReminderDon't forget me this weekend!", 'from' => $faker->date($format = 'm/d/Y', $max = 'now'), 'to' => $faker->date($format = 'm/d/Y') ]; + $pageContent['layoutUpdateXml'] = "ToveJaniReminder"; + $pageContent['layoutUpdateXml'] .= "Don't forget me this weekend!"; return $pageContent; } diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php b/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php index eca5ec194..498f10b2c 100644 --- a/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php +++ b/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php @@ -43,6 +43,7 @@ * Conflicts with SOAP module * */ +// @codingStandardsIgnoreFile class MagentoRestDriver extends REST { /** diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php b/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php index 1c8bcf31a..404bdce73 100644 --- a/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php +++ b/src/Magento/AcceptanceTestFramework/Module/MagentoWebDriver.php @@ -32,6 +32,7 @@ * browser: chrome * ``` */ +// @codingStandardsIgnoreFile class MagentoWebDriver extends WebDriver { use AttachmentSupport; diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager.php b/src/Magento/AcceptanceTestFramework/ObjectManager.php index 30cae7a79..20d324fc3 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager.php @@ -19,19 +19,23 @@ class ObjectManager extends \Magento\AcceptanceTestFramework\ObjectManager\ObjectManager { /** + * Object manager factory. + * * @var \Magento\AcceptanceTestFramework\ObjectManager\Factory */ - protected $_factory; + protected $factory; /** + * Object manager instance. + * * @var ObjectManager */ - protected static $_instance; + protected static $instance; /** - * @constructor - * @param \Magento\AcceptanceTestFramework\ObjectManager\Factory $factory - * @param \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config + * ObjectManager constructor. + * @param ObjectManager\Factory|null $factory + * @param ObjectManager\ConfigInterface|null $config * @param array $sharedInstances */ public function __construct( @@ -40,7 +44,7 @@ public function __construct( array $sharedInstances = [] ) { parent::__construct($factory, $config, $sharedInstances); - $this->_sharedInstances['Magento\AcceptanceTestFramework\ObjectManager'] = $this; + $this->sharedInstances[\Magento\AcceptanceTestFramework\ObjectManager::class] = $this; } /** @@ -52,7 +56,7 @@ public function __construct( */ public function getParameters($type, $method) { - return $this->_factory->getParameters($type, $method); + return $this->factory->getParameters($type, $method); } /** @@ -65,9 +69,10 @@ public function getParameters($type, $method) */ public function prepareArguments($object, $method, array $arguments = []) { - return $this->_factory->prepareArguments($object, $method, $arguments); + return $this->factory->prepareArguments($object, $method, $arguments); } + // @codingStandardsIgnoreStart /** * Invoke class method with prepared arguments * @@ -78,8 +83,9 @@ public function prepareArguments($object, $method, array $arguments = []) */ public function invoke($object, $method, array $arguments = []) { - return $this->_factory->invoke($object, $method, $arguments); + return $this->factory->invoke($object, $method, $arguments); } + // @codingStandardsIgnoreEnd /** * Set object manager instance @@ -89,21 +95,21 @@ public function invoke($object, $method, array $arguments = []) */ public static function setInstance(ObjectManager $objectManager) { - self::$_instance = $objectManager; + self::$instance = $objectManager; } /** * Retrieve object manager * - * @return ObjectManager + * @return ObjectManager|bool * @throws \RuntimeException */ public static function getInstance() { - if (!self::$_instance instanceof ObjectManager) { + if (!self::$instance instanceof ObjectManager) { return false; } - return self::$_instance; + return self::$instance; } /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config.php index 318f1787a..d373b1007 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config.php @@ -17,9 +17,11 @@ class Config extends ObjectManagerConfig { /** + * Class reflections. + * * @var \ReflectionClass[] */ - protected $_nonSharedRefClasses = []; + protected $nonSharedRefClasses = []; /** * Check whether type is shared @@ -30,19 +32,19 @@ class Config extends ObjectManagerConfig */ public function isShared($type) { - if (isset($this->_nonShared[$type])) { + if (isset($this->nonShared[$type])) { return false; } - if (isset($this->_virtualTypes[$type])) { + if (isset($this->virtualTypes[$type])) { return true; } - if (!isset($this->_nonSharedRefClasses[$type])) { - $this->_nonSharedRefClasses[$type] = new \ReflectionClass($type); + if (!isset($this->nonSharedRefClasses[$type])) { + $this->nonSharedRefClasses[$type] = new \ReflectionClass($type); } - foreach ($this->_nonShared as $noneShared => $flag) { - if ($this->_nonSharedRefClasses[$type]->isSubclassOf($noneShared)) { + foreach ($this->nonShared as $noneShared => $flag) { + if ($this->nonSharedRefClasses[$type]->isSubclassOf($noneShared)) { return false; } } diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php index 7846e98a1..2a5cdede1 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php @@ -18,65 +18,66 @@ class Config implements \Magento\AcceptanceTestFramework\ObjectManager\ConfigInt * * @var \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface */ - protected $_definitions; + protected $definitions; /** * Current cache key * * @var string */ - protected $_currentCacheKey; + protected $currentCacheKey; /** * Interface preferences * * @var array */ - protected $_preferences = []; + protected $preferences = []; /** * Virtual types * * @var array */ - protected $_virtualTypes = []; + protected $virtualTypes = []; /** * Instance arguments * * @var array */ - protected $_arguments = []; + protected $arguments = []; /** * Type shareability * * @var array */ - protected $_nonShared = []; + protected $nonShared = []; /** * List of relations * * @var RelationsInterface */ - protected $_relations; + protected $relations; /** * List of merged arguments * * @var array */ - protected $_mergedArguments; + protected $mergedArguments; /** - * @param RelationsInterface $relations - * @param DefinitionInterface $definitions + * Config constructor. + * @param RelationsInterface|null $relations + * @param DefinitionInterface|null $definitions */ public function __construct(RelationsInterface $relations = null, DefinitionInterface $definitions = null) { - $this->_relations = $relations ? : new \Magento\AcceptanceTestFramework\ObjectManager\Relations\Runtime(); - $this->_definitions = $definitions ? : new \Magento\AcceptanceTestFramework\ObjectManager\Definition\Runtime(); + $this->relations = $relations ? : new \Magento\AcceptanceTestFramework\ObjectManager\Relations\Runtime(); + $this->definitions = $definitions ? : new \Magento\AcceptanceTestFramework\ObjectManager\Definition\Runtime(); } /** @@ -87,9 +88,9 @@ public function __construct(RelationsInterface $relations = null, DefinitionInte */ public function getArguments($type) { - return isset($this->_mergedArguments[$type]) - ? $this->_mergedArguments[$type] - : $this->_collectConfiguration($type); + return isset($this->mergedArguments[$type]) + ? $this->mergedArguments[$type] + : $this->collectConfiguration($type); } /** @@ -100,19 +101,19 @@ public function getArguments($type) */ public function isShared($type) { - return !isset($this->_nonShared[$type]); + return !isset($this->nonShared[$type]); } /** * Retrieve instance type * * @param string $instanceName - * @return mixed + * @return string */ public function getInstanceType($instanceName) { - while (isset($this->_virtualTypes[$instanceName])) { - $instanceName = $this->_virtualTypes[$instanceName]; + while (isset($this->virtualTypes[$instanceName])) { + $instanceName = $this->virtualTypes[$instanceName]; } return $instanceName; } @@ -128,17 +129,17 @@ public function getPreference($type) { $type = ltrim($type, '\\'); $preferencePath = []; - while (isset($this->_preferences[$type])) { - if (isset($preferencePath[$this->_preferences[$type]])) { + while (isset($this->preferences[$type])) { + if (isset($preferencePath[$this->preferences[$type]])) { throw new \LogicException( 'Circular type preference: ' . $type . ' relates to ' . - $this->_preferences[$type] . + $this->preferences[$type] . ' and viceversa.' ); } - $type = $this->_preferences[$type]; + $type = $this->preferences[$type]; $preferencePath[$type] = 1; } return $type; @@ -151,18 +152,18 @@ public function getPreference($type) * @return array * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - protected function _collectConfiguration($type) + protected function collectConfiguration($type) { - if (!isset($this->_mergedArguments[$type])) { - if (isset($this->_virtualTypes[$type])) { - $arguments = $this->_collectConfiguration($this->_virtualTypes[$type]); + if (!isset($this->mergedArguments[$type])) { + if (isset($this->virtualTypes[$type])) { + $arguments = $this->collectConfiguration($this->virtualTypes[$type]); } else { - if ($this->_relations->has($type)) { - $relations = $this->_relations->getParents($type); + if ($this->relations->has($type)) { + $relations = $this->relations->getParents($type); $arguments = []; foreach ($relations as $relation) { if ($relation) { - $relationArguments = $this->_collectConfiguration($relation); + $relationArguments = $this->collectConfiguration($relation); if ($relationArguments) { $arguments = array_replace($arguments, $relationArguments); } @@ -173,17 +174,17 @@ protected function _collectConfiguration($type) } } - if (isset($this->_arguments[$type])) { + if (isset($this->arguments[$type])) { if ($arguments && count($arguments)) { - $arguments = array_replace_recursive($arguments, $this->_arguments[$type]); + $arguments = array_replace_recursive($arguments, $this->arguments[$type]); } else { - $arguments = $this->_arguments[$type]; + $arguments = $this->arguments[$type]; } } - $this->_mergedArguments[$type] = $arguments; + $this->mergedArguments[$type] = $arguments; return $arguments; } - return $this->_mergedArguments[$type]; + return $this->mergedArguments[$type]; } /** @@ -193,36 +194,36 @@ protected function _collectConfiguration($type) * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - protected function _mergeConfiguration(array $configuration) + protected function mergeConfiguration(array $configuration) { foreach ($configuration as $key => $curConfig) { switch ($key) { case 'preferences': foreach ($curConfig as $for => $to) { - $this->_preferences[ltrim($for, '\\')] = ltrim($to, '\\'); + $this->preferences[ltrim($for, '\\')] = ltrim($to, '\\'); } break; default: $key = ltrim($key, '\\'); if (isset($curConfig['type'])) { - $this->_virtualTypes[$key] = ltrim($curConfig['type'], '\\'); + $this->virtualTypes[$key] = ltrim($curConfig['type'], '\\'); } if (isset($curConfig['arguments'])) { - if (!empty($this->_mergedArguments)) { - $this->_mergedArguments = []; + if (!empty($this->mergedArguments)) { + $this->mergedArguments = []; } - if (isset($this->_arguments[$key])) { - $this->_arguments[$key] = array_replace($this->_arguments[$key], $curConfig['arguments']); + if (isset($this->arguments[$key])) { + $this->arguments[$key] = array_replace($this->arguments[$key], $curConfig['arguments']); } else { - $this->_arguments[$key] = $curConfig['arguments']; + $this->arguments[$key] = $curConfig['arguments']; } } if (isset($curConfig['shared'])) { if (!$curConfig['shared']) { - $this->_nonShared[$key] = 1; + $this->nonShared[$key] = 1; } else { - unset($this->_nonShared[$key]); + unset($this->nonShared[$key]); } } break; @@ -238,6 +239,6 @@ protected function _mergeConfiguration(array $configuration) */ public function extend(array $configuration) { - $this->_mergeConfiguration($configuration); + $this->mergeConfiguration($configuration); } } diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php index 9f4131798..e96b851b2 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php @@ -15,6 +15,8 @@ class ArgumentParser { /** + * Converter. + * * @var FlatConverter */ private $converter; diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php index cea88ed19..14ffdcbd9 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php @@ -8,6 +8,7 @@ use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; use Magento\AcceptanceTestFramework\Stdlib\BooleanUtils; +// @codingStandardsIgnoreFile class Dom implements \Magento\AcceptanceTestFramework\Config\ConverterInterface { /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php index a1745fdef..921b76120 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php @@ -10,6 +10,7 @@ * * @internal */ +// @codingStandardsIgnoreFile class Dom extends \Magento\AcceptanceTestFramework\Config\Reader\Filesystem { /** @@ -18,6 +19,7 @@ class Dom extends \Magento\AcceptanceTestFramework\Config\Reader\Filesystem const TYPE_ATTRIBUTE = 'xsi:type'; /** + * Dom constructor. * @param \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver * @param \Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom $converter * @param \Magento\AcceptanceTestFramework\ObjectManager\Config\SchemaLocator $schemaLocator diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php index 41101a12f..9f8dc3dbd 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php @@ -17,14 +17,14 @@ class DomFactory * * @var \Magento\AcceptanceTestFramework\ObjectManagerInterface */ - protected $_objectManager = null; + protected $objectManager = null; /** * Instance name to create * * @var string */ - protected $_instanceName = null; + protected $instanceName = null; /** * Factory constructor @@ -36,8 +36,8 @@ public function __construct( \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager, $instanceName = \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom::class ) { - $this->_objectManager = $objectManager; - $this->_instanceName = $instanceName; + $this->objectManager = $objectManager; + $this->instanceName = $instanceName; } /** @@ -48,6 +48,6 @@ public function __construct( */ public function create(array $data = []) { - return $this->_objectManager->create($this->_instanceName, $data); + return $this->objectManager->create($this->instanceName, $data); } } diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php index 207514b83..6b6777bbe 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php @@ -30,7 +30,7 @@ public function isShared($type); * Retrieve instance type * * @param string $instanceName - * @return mixed + * @return string */ public function getInstanceType($instanceName); diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php index 48effe944..20e3bd5ca 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php @@ -13,6 +13,7 @@ * @internal * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ +// @codingStandardsIgnoreFile class Primary { /** @@ -20,7 +21,7 @@ class Primary * * @var string */ - protected $_appMode = 'developer'; + protected $appMode = 'developer'; /** * Load primary DI configuration @@ -35,7 +36,7 @@ public function load() $this->createArgumentInterpreter() ), new \Magento\AcceptanceTestFramework\ObjectManager\Config\SchemaLocator(), - new \Magento\AcceptanceTestFramework\Config\ValidationState($this->_appMode) + new \Magento\AcceptanceTestFramework\Config\ValidationState($this->appMode) ); return $reader->read(); diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php index f9d7073b2..aeebbe33b 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php @@ -12,16 +12,26 @@ class Runtime implements \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface { /** + * Definitions. + * * @var array */ - protected $_definitions = []; + protected $definitions = []; + + /** + * Reader. + * + * @var \Magento\AcceptanceTestFramework\Code\Reader\ClassReader + */ + private $reader; /** - * @param \Magento\AcceptanceTestFramework\Code\Reader\ClassReader $reader + * Runtime constructor. + * @param \Magento\AcceptanceTestFramework\Code\Reader\ClassReader|null $reader */ public function __construct(\Magento\AcceptanceTestFramework\Code\Reader\ClassReader $reader = null) { - $this->_reader = $reader ? : new \Magento\AcceptanceTestFramework\Code\Reader\ClassReader(); + $this->reader = $reader ? : new \Magento\AcceptanceTestFramework\Code\Reader\ClassReader(); } /** @@ -42,10 +52,10 @@ public function __construct(\Magento\AcceptanceTestFramework\Code\Reader\ClassRe */ public function getParameters($className) { - if (!array_key_exists($className, $this->_definitions)) { - $this->_definitions[$className] = $this->_reader->getConstructor($className); + if (!array_key_exists($className, $this->definitions)) { + $this->definitions[$className] = $this->reader->getConstructor($className); } - return $this->_definitions[$className]; + return $this->definitions[$className]; } /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php index 8743dea87..6e7b0fc29 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php @@ -16,28 +16,30 @@ class Factory extends \Magento\AcceptanceTestFramework\ObjectManager\Factory\Dynamic\Developer { /** + * Class reader. + * * @var \Magento\AcceptanceTestFramework\System\Code\ClassReader */ protected $classReader; /** - * @constructor - * - * @param \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config - * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager - * @param \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface $definitions + * Factory constructor. + * @param ConfigInterface $config + * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface|null $objectManager + * @param DefinitionInterface|null $definitions * @param array $globalArguments */ public function __construct( - \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config, + ConfigInterface $config, \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager = null, - \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface $definitions = null, + DefinitionInterface $definitions = null, $globalArguments = [] ) { parent::__construct($config, $objectManager, $definitions, $globalArguments); $this->classReader = new ClassReader(); } + // @codingStandardsIgnoreStart /** * Invoke class method and prepared arguments * @@ -56,6 +58,7 @@ public function invoke($object, $method, array $args = []) return $method->invokeArgs($object, $args); } + // @codingStandardsIgnoreEnd /** * Get list of parameters for class method @@ -85,7 +88,7 @@ public function prepareArguments($object, $method, array $arguments = []) return []; } - return $this->_resolveArguments($type, $parameters, $arguments); + return $this->resolveArguments($type, $parameters, $arguments); } /** @@ -101,7 +104,7 @@ public function prepareArguments($object, $method, array $arguments = []) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ - protected function _resolveArguments($requestedType, array $parameters, array $arguments = []) + protected function resolveArguments($requestedType, array $parameters, array $arguments = []) { $resolvedArguments = []; $arguments = count($arguments) @@ -174,7 +177,7 @@ protected function _resolveArguments($requestedType, array $parameters, array $a /** * Parse array argument * - * @param array $array + * @param array &$array * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -233,7 +236,7 @@ public function create($requestedType, array $arguments = []) } $this->creationStack[$requestedType] = $requestedType; try { - $args = $this->_resolveArguments($requestedType, $parameters, $arguments); + $args = $this->resolveArguments($requestedType, $parameters, $arguments); unset($this->creationStack[$requestedType]); } catch (\Exception $e) { unset($this->creationStack[$requestedType]); diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php index dad7e355f..809fd8ca4 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php @@ -39,9 +39,17 @@ class Developer implements \Magento\AcceptanceTestFramework\ObjectManager\Factor protected $creationStack = []; /** + * Global arguments. + * + * @var array + */ + protected $globalArguments; + + /** + * Developer constructor. * @param \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config - * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager - * @param \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface $definitions + * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface|null $objectManager + * @param \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface|null $definitions * @param array $globalArguments */ public function __construct( @@ -80,7 +88,7 @@ public function setObjectManager(\Magento\AcceptanceTestFramework\ObjectManagerI * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ - protected function _resolveArguments($requestedType, array $parameters, array $arguments = []) + protected function resolveArguments($requestedType, array $parameters, array $arguments = []) { $resolvedArguments = []; $arguments = count($arguments) @@ -91,7 +99,7 @@ protected function _resolveArguments($requestedType, array $parameters, array $a $argument = null; if (!empty($arguments) && (isset($arguments[$paramName]) || array_key_exists($paramName, $arguments))) { $argument = $arguments[$paramName]; - } else if ($paramRequired) { + } elseif ($paramRequired) { if ($paramType) { $argument = ['instance' => $paramType]; } else { @@ -114,12 +122,12 @@ protected function _resolveArguments($requestedType, array $parameters, array $a $argument = $isShared ? $this->objectManager->get($argumentType) : $this->objectManager->create($argumentType); - } else if (is_array($argument)) { + } elseif (is_array($argument)) { if (isset($argument['argument'])) { $argument = isset($this->globalArguments[$argument['argument']]) ? $this->globalArguments[$argument['argument']] : $paramDefault; - } else if (!empty($argument)) { + } elseif (!empty($argument)) { $this->parseArray($argument); } } @@ -131,7 +139,7 @@ protected function _resolveArguments($requestedType, array $parameters, array $a /** * Parse array argument * - * @param array $array + * @param array &$array * @return void */ protected function parseArray(&$array) @@ -179,7 +187,7 @@ public function create($requestedType, array $arguments = []) } $this->creationStack[$requestedType] = $requestedType; try { - $args = $this->_resolveArguments($requestedType, $parameters, $arguments); + $args = $this->resolveArguments($requestedType, $parameters, $arguments); unset($this->creationStack[$requestedType]); } catch (\Exception $e) { unset($this->creationStack[$requestedType]); diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php index e231a89d0..352534f19 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php @@ -12,33 +12,38 @@ class ObjectManager implements \Magento\AcceptanceTestFramework\ObjectManagerInterface { /** + * Create instance with call time arguments. + * * @var \Magento\AcceptanceTestFramework\ObjectManager\FactoryInterface */ - protected $_factory; + protected $factory; /** * List of shared instances * * @var array */ - protected $_sharedInstances = []; + protected $sharedInstances = []; /** + * Class config. + * * @var Config\Config */ - protected $_config; + protected $config; /** + * ObjectManager constructor. * @param FactoryInterface $factory * @param ConfigInterface $config * @param array $sharedInstances */ public function __construct(FactoryInterface $factory, ConfigInterface $config, array $sharedInstances = []) { - $this->_config = $config; - $this->_factory = $factory; - $this->_sharedInstances = $sharedInstances; - $this->_sharedInstances['Magento\AcceptanceTestFramework\ObjectManagerInterface'] = $this; + $this->config = $config; + $this->factory = $factory; + $this->sharedInstances = $sharedInstances; + $this->sharedInstances[\Magento\AcceptanceTestFramework\ObjectManagerInterface::class] = $this; } /** @@ -46,26 +51,26 @@ public function __construct(FactoryInterface $factory, ConfigInterface $config, * * @param string $type * @param array $arguments - * @return mixed + * @return object */ public function create($type, array $arguments = []) { - return $this->_factory->create($this->_config->getPreference($type), $arguments); + return $this->factory->create($this->config->getPreference($type), $arguments); } /** * Retrieve cached object instance * * @param string $type - * @return mixed + * @return object */ public function get($type) { - $type = $this->_config->getPreference($type); - if (!isset($this->_sharedInstances[$type])) { - $this->_sharedInstances[$type] = $this->_factory->create($type); + $type = $this->config->getPreference($type); + if (!isset($this->sharedInstances[$type])) { + $this->sharedInstances[$type] = $this->factory->create($type); } - return $this->_sharedInstances[$type]; + return $this->sharedInstances[$type]; } /** @@ -76,7 +81,7 @@ public function get($type) */ public function configure(array $configuration) { - $this->_config->extend($configuration); + $this->config->extend($configuration); } /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php index 4318f8284..d5d281256 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php @@ -11,23 +11,26 @@ class Runtime implements \Magento\AcceptanceTestFramework\ObjectManager\RelationsInterface { /** + * Class reader. + * * @var \Magento\AcceptanceTestFramework\Code\Reader\ClassReader */ - protected $_classReader; + protected $classReader; /** * Default behavior * * @var array */ - protected $_default = []; + protected $default = []; /** - * @param \Magento\AcceptanceTestFramework\Code\Reader\ClassReader $classReader + * Runtime constructor. + * @param \Magento\AcceptanceTestFramework\Code\Reader\ClassReader|null $classReader */ public function __construct(\Magento\AcceptanceTestFramework\Code\Reader\ClassReader $classReader = null) { - $this->_classReader = $classReader ? : new \Magento\AcceptanceTestFramework\Code\Reader\ClassReader(); + $this->classReader = $classReader ? : new \Magento\AcceptanceTestFramework\Code\Reader\ClassReader(); } /** @@ -50,8 +53,8 @@ public function has($type) public function getParents($type) { if (!class_exists($type)) { - return $this->_default; + return $this->default; } - return $this->_classReader->getParents($type) ? : $this->_default; + return $this->classReader->getParents($type) ? : $this->default; } } diff --git a/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php b/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php index 587e9582d..c89077141 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php @@ -15,6 +15,7 @@ * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ +// @codingStandardsIgnoreFile class ObjectManagerFactory { /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php index 1c9650c1a..ddefaf71f 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php @@ -16,7 +16,7 @@ interface ObjectManagerInterface * * @param string $type * @param array $arguments - * @return mixed + * @return object */ public function create($type, array $arguments = []); @@ -24,7 +24,7 @@ public function create($type, array $arguments = []); * Retrieve cached object instance * * @param string $type - * @return mixed + * @return object */ public function get($type); diff --git a/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php b/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php index fc5c67b23..09863d713 100644 --- a/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php +++ b/src/Magento/AcceptanceTestFramework/PageObject/Page/Page.php @@ -1,9 +1,16 @@ parsedArray = $parsedCestArray; @@ -80,7 +104,6 @@ public function getCestData() $tests = $this->stripDescriptorTags($tests, CestDataConstants::CEST_ANNOTATIONS); } - $cests[] = new CestObject( $cestName, $annotations, @@ -98,7 +121,7 @@ public function getCestData() * * @param string $hookType * @param array $cestHook - * @return array + * @return CestHookObject */ private function extractHook($hookType, $cestHook) { @@ -112,7 +135,6 @@ private function extractHook($hookType, $cestHook) $this->extractTestActions($hookActions) ); - return $hook; } @@ -232,7 +254,7 @@ private function extractTestActions($testActions) return $actions; } - + // @codingStandardsIgnoreStart /** * This method takes an array of data and an array representing irrelevant tags. The method strips * the data passed in of the irrelevant tags and returns the result. @@ -250,4 +272,5 @@ private function stripDescriptorTags($data, ...$tags) return $results; } + // @codingStandardsIgnoreEnd } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 91be5c220..2ed988879 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -1,28 +1,66 @@ type = $type; $this->actions = $actions; } + /** + * Returns type. + * + * @return string + */ public function getType() { return $this->type; } + /** + * Returns actions. + * + * @return array + */ public function getActions() { return $this->actions; diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/CestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/CestObject.php index 3bc312b02..236bf4920 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/CestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/CestObject.php @@ -1,14 +1,51 @@ name = $name; @@ -17,21 +54,41 @@ public function __construct($name, $annotations, $tests, $hooks) $this->hooks = $hooks; } + /** + * Returns name. + * + * @return string + */ public function getName() { return $this->name; } + /** + * Returns annotations. + * + * @return array + */ public function getAnnotations() { return $this->annotations; } + /** + * Returns tests. + * + * @return array + */ public function getTests() { return $this->tests; } + /** + * Returns hooks. + * + * @return array + */ public function getHooks() { return $this->hooks; diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index 199869777..b391b05d3 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -1,20 +1,63 @@ name = $name; @@ -22,18 +65,29 @@ public function __construct($name, $parsedSteps, $annotations) $this->annotations = $annotations; } + /** + * Returns name + * + * @return string + */ public function getName() { return $this->name; } + /** + * Returns annotations + * + * @return array + */ public function getAnnotations() { return $this->annotations; } /** - *This method calls a function to merge custom steps and returns the resulting ordered set of steps. + * This method calls a function to merge custom steps and returns the resulting ordered set of steps. + * * @return array */ public function getOrderedActions() @@ -45,6 +99,7 @@ public function getOrderedActions() /** * This method takes the steps from the parser and splits steps which need merge from steps that are ordered. + * * @return void * @throws XmlException */ @@ -62,6 +117,7 @@ private function sortActions() /** * This method runs a step sort, loops steps which need to be merged, and runs the mergeStep function on each one. + * * @return void */ private function mergeActions() @@ -79,6 +135,7 @@ private function mergeActions() /** * Recursively merges in each step and its dependencies + * * @param ActionObject $stepToMerge * @throws XmlException * @return void @@ -89,7 +146,8 @@ private function mergeAction($stepToMerge) if (!array_key_exists($linkedStep, $this->orderedSteps) and - !array_key_exists($linkedStep, $this->stepsToMerge)) { + !array_key_exists($linkedStep, $this->stepsToMerge) + ) { throw new XmlException(sprintf( self::STEP_MISSING_ERROR_MSG, $this->getName(), @@ -105,6 +163,7 @@ private function mergeAction($stepToMerge) /** * Runs through the prepared orderedSteps and calls insertWait if a step requires a wait after it. + * * @return void */ private function insertWaits() @@ -112,16 +171,29 @@ private function insertWaits() foreach ($this->orderedSteps as $step) { if ($step->getTimeout()) { - $waitStepAttributes = array('timeout' => $step->getTimeout()); - $waitStep = new ActionObject($step->getMergeKey() . 'WaitForPageLoad', 'waitForPageLoad', $waitStepAttributes, $step->getMergeKey(), 'after'); + $waitStepAttributes = ['timeout' => $step->getTimeout()]; + $waitStep = new ActionObject( + $step->getMergeKey() . 'WaitForPageLoad', + 'waitForPageLoad', + $waitStepAttributes, + $step->getMergeKey(), + 'after' + ); $this->insertStep($waitStep); } } } + /** + * Insert step. + * + * @param ActionObject $stepToMerge + * @return void + */ private function insertStep($stepToMerge) { - $position = array_search($stepToMerge->getLinkedAction(), array_keys($this->orderedSteps)) + $stepToMerge->getOrderOffset(); + $position = array_search($stepToMerge->getLinkedAction(), array_keys($this->orderedSteps)) + + $stepToMerge->getOrderOffset(); $previous_items = array_slice($this->orderedSteps, 0, $position, true); $next_items = array_slice($this->orderedSteps, $position, null, true); $this->orderedSteps = $previous_items + [$stepToMerge->getMergeKey() => $stepToMerge] + $next_items; diff --git a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php b/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php index 2655dfecc..6224f1b28 100644 --- a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php +++ b/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php @@ -1,18 +1,34 @@ testData = $testData; } + /** + * Returns test data. + * + * @return array|null + */ public function readTestData() { return $this->testData->get(); } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php index ffe379760..c25ba2d11 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php +++ b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php @@ -1,15 +1,55 @@ apiPath = $apiPath; @@ -20,6 +60,12 @@ public function __construct($apiPath, $headers, $apiOperation, $jsonBody) $this->curl = curl_init(); } + /** + * Submit API request. + * + * @param bool $verbose + * @return string|bool + */ public function submit($verbose = false) { if ($this->jsonBody) { @@ -28,12 +74,12 @@ public function submit($verbose = false) curl_setopt($this->curl, CURLOPT_VERBOSE, $verbose); - curl_setopt_array($this->curl, array( + curl_setopt_array($this->curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_HTTPHEADER => $this->headers, CURLOPT_CUSTOMREQUEST => $this->apiOperation, CURLOPT_URL => HOSTNAME . ':' . PORT . $this->apiPath - )); + ]); $response = curl_exec($this->curl); curl_close($this->curl); diff --git a/src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php b/src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php index a453b534c..6a2f1775e 100644 --- a/src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php +++ b/src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php @@ -20,6 +20,7 @@ abstract class AbstractIterator implements \Iterator, \Countable */ protected $data = []; + // @codingStandardsIgnoreStart /** * Current data element * @@ -28,18 +29,19 @@ abstract class AbstractIterator implements \Iterator, \Countable protected $current; /** - * Key associated with the current row data + * Get current element * - * @var int|string + * @return mixed */ - protected $key; + abstract public function current(); + // @codingStandardsIgnoreEnd /** - * Get current element + * Key associated with the current row data * - * @return mixed + * @var int|string */ - abstract public function current(); + protected $key; /** * Check if current element is valid diff --git a/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php b/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php index 191988bba..e3a8bacf8 100644 --- a/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php +++ b/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php @@ -21,6 +21,7 @@ class File extends AbstractIterator protected $cached = []; /** + * File constructor. * @param array $paths */ public function __construct(array $paths) diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php index 2bae29f1e..b3eb6da1b 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php @@ -88,12 +88,14 @@ public static function getInstance() } /** - * @constructor + * ModuleResolver constructor. */ private function __construct() { $objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); - $this->sequenceSorter = $objectManager->get('Magento\AcceptanceTestFramework\Util\ModuleResolver\SequenceSorterInterface'); + $this->sequenceSorter = $objectManager->get( + \Magento\AcceptanceTestFramework\Util\ModuleResolver\SequenceSorterInterface::class + ); } /** diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php index ac80d06fb..a0f7bfbc4 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php @@ -10,7 +10,7 @@ class SequenceSorter implements SequenceSorterInterface * Sort files according to specified sequence. * * @param array $paths - * @return mixed + * @return array */ public function sort(array $paths) { diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorterInterface.php b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorterInterface.php index ab658f2f2..855dfed20 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorterInterface.php +++ b/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorterInterface.php @@ -10,7 +10,7 @@ interface SequenceSorterInterface * Sort files according to specified sequence. * * @param array $paths - * @return mixed + * @return array */ public function sort(array $paths); } diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index da146b851..f15804167 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -1,4 +1,8 @@ block, outside * of the blocks. - * @param $classAnnotationsObject + * + * @param array $classAnnotationsObject * @return string */ private function generateClassAnnotationsPhp($classAnnotationsObject) @@ -251,8 +274,8 @@ private function generateClassAnnotationsPhp($classAnnotationsObject) * Since nearly half of all Codeception methods don't share the same signature I had to setup a massive Case * statement to handle each unique action. At the bottom of the case statement there is a generic function that can * construct the PHP string for nearly half of all Codeception actions. - * @param $stepsObject - * @param $hookObject + * @param array $stepsObject + * @param array|bool $hookObject * @return string */ private function generateStepsPhp($stepsObject, $hookObject = false) @@ -358,11 +381,19 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $key = $steps->getMergeKey(); if ($hookObject) { - $testSteps .= sprintf("\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, $entity); + $testSteps .= sprintf( + "\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", + $entity, + $entity + ); $testSteps .= sprintf("\t\t\$this->%s = new EntityApiHandler($%s);\n", $key, $entity); $testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key); } else { - $testSteps .= sprintf("\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, $entity); + $testSteps .= sprintf( + "\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", + $entity, + $entity + ); $testSteps .= sprintf("\t\t$%s = new EntityApiHandler($%s);\n", $key, $entity); $testSteps .= sprintf("\t\t$%s->createEntity();\n", $key); } @@ -398,14 +429,26 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "dontSeeElement": if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } break; case "dontSeeElementInDOM": if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } @@ -425,13 +468,25 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "dontSeeLink": if (isset($customActionAttributes['url'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['url']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\");\n", + $actor, + $actionName, + $input, + $customActionAttributes['url'] + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } break; case "dragAndDrop": - $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $customActionAttributes['selector1'], $customActionAttributes['selector2']); + $testSteps .= sprintf( + "\t\t$%s->%s(\"%s\", \"%s\");\n", + $actor, + $actionName, + $customActionAttributes['selector1'], + $customActionAttributes['selector2'] + ); break; case "executeInSelenium": $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $function); @@ -444,7 +499,13 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "formatMoney": if (isset($customActionAttributes['locale'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['locale']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\");\n", + $actor, + actionName, + $input, + $customActionAttributes['locale'] + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } @@ -452,13 +513,32 @@ private function generateStepsPhp($stepsObject, $hookObject = false) case "grabCookie": if (isset($returnVariable)) { if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $input, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s, %s);\n", + $returnVariable, + $actor, + $actionName, + $input, + $parameterArray + ); } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $input + ); } } else { if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $input, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } @@ -467,7 +547,13 @@ private function generateStepsPhp($stepsObject, $hookObject = false) case "grabFromCurrentUrl": if (isset($returnVariable)) { if ($input) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $input + ); } else { $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); } @@ -481,14 +567,26 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "grabValueFrom": if (isset($returnVariable)) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $selector + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } break; case "loginAsAdmin": if (isset($customActionAttributes['username']) && isset($customActionAttributes['password'])) { - $testSteps .= sprintf("\t\t$%s->%s(\"%s\", \"%s\");\n", $actor, $actionName, $customActionAttributes['username'], $customActionAttributes['password']); + $testSteps .= sprintf( + "\t\t$%s->%s(\"%s\", \"%s\");\n", + $actor, + $actionName, + $customActionAttributes['username'], + $customActionAttributes['password'] + ); } else { $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); } @@ -506,7 +604,13 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "mSetLocale": if (isset($customActionAttributes['locale'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['locale']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\");\n", + $actor, + $actionName, + $input, + $customActionAttributes['locale'] + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } @@ -516,7 +620,13 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "pressKey": if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); } @@ -529,16 +639,35 @@ private function generateStepsPhp($stepsObject, $hookObject = false) } break; case "resizeWindow": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $customActionAttributes['width'], $customActionAttributes['height']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $customActionAttributes['width'], + $customActionAttributes['height'] + ); break; case "scrollTo": $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); break; case "searchAndMultiSelectOption": if (isset($customActionAttributes['requiredAction'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray'], $customActionAttributes['requiredAction']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s, %s);\n", + $actor, + $actionName, + $selector, + $customActionAttributes['parameterArray'], + $customActionAttributes['requiredAction'] + ); } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $customActionAttributes['parameterArray'] + ); } break; case "see": @@ -563,14 +692,26 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "seeElement": if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } break; case "seeElementInDOM": if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } @@ -592,33 +733,77 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "seeLink": if (isset($step['url'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['url']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\");\n", + $actor, + $actionName, + $input, + $customActionAttributes['url'] + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } break; case "seeNumberOfElements": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $customActionAttributes['userInput'] + ); break; case "selectOption": if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); } break; case "setCookie": if ($parameterArray) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", %s);\n", $actor, $actionName, $input, $customActionAttributes['value'], $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\", %s);\n", + $actor, + $actionName, + $input, + $customActionAttributes['value'], + $parameterArray + ); } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $input, $customActionAttributes['value']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\");\n", + $actor, + $actionName, + $input, + $customActionAttributes['value'] + ); } break; case "submitForm": if (isset($step['button'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\", \"%s\");\n", $actor, $actionName, $selector, $parameterArray, $customActionAttributes['button']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\", \"%s\");\n", + $actor, + $actionName, + $selector, + $parameterArray, + $customActionAttributes['button'] + ); } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\");\n", + $actor, + $actionName, + $selector, + $parameterArray + ); } break; case "wait": @@ -635,7 +820,14 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $time); break; case "waitForElementChange": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $function, $time); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s, %s);\n", + $actor, + $actionName, + $selector, + $function, + $time + ); break; case "waitForJS": $testSteps .= sprintf("\t\t$%s->%s(\"%s\", %s);\n", $actor, $actionName, $function, $time); @@ -649,7 +841,14 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "waitForText": if ($selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $input, $time, $selector); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s, %s);\n", + $actor, + $actionName, + $input, + $time, + $selector + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $time); } @@ -658,17 +857,49 @@ private function generateStepsPhp($stepsObject, $hookObject = false) if ($returnVariable) { if ($selector) { if (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, \"%s\");\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['userInput']); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s, \"%s\");\n", + $returnVariable, + $actor, + $actionName, + $selector, + $customActionAttributes['userInput'] + ); } elseif (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['parameter']); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s, %s);\n", + $returnVariable, + $actor, + $actionName, + $selector, + $customActionAttributes['parameter'] + ); } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $selector + ); } } else { if (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $actionName, $customActionAttributes['userInput']); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(\"%s\");\n", + $returnVariable, + $actor, + $actionName, + $customActionAttributes['userInput'] + ); } elseif (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $customActionAttributes['parameter']); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $customActionAttributes['parameter'] + ); } else { $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); } @@ -676,17 +907,39 @@ private function generateStepsPhp($stepsObject, $hookObject = false) } else { if ($selector) { if (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, \"%s\");\n", + $actor, + $actionName, + $selector, + $customActionAttributes['userInput'] + ); } elseif (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameter']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $customActionAttributes['parameter'] + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } } else { if (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $customActionAttributes['userInput']); + $testSteps .= sprintf( + "\t\t$%s->%s(\"%s\");\n", + $actor, + $actionName, + $customActionAttributes['userInput'] + ); } elseif (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $customActionAttributes['parameter']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s);\n", + $actor, + $actionName, + $customActionAttributes['parameter'] + ); } else { $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); } @@ -700,7 +953,7 @@ private function generateStepsPhp($stepsObject, $hookObject = false) /** * Creates a PHP string for the _before/_after methods if the Test contains an or block. - * @param $hookObjects + * @param array $hookObjects * @return string */ private function generateHooksPhp($hookObjects) @@ -745,7 +998,8 @@ private function generateHooksPhp($hookObjects) /** * Creates a PHP string for the Test Annotations block if the Test contains an block. - * @param $testAnnotationsObject + * + * @param array $testAnnotationsObject * @return string */ private function generateTestAnnotationsPhp($testAnnotationsObject) @@ -824,7 +1078,7 @@ private function generateTestAnnotationsPhp($testAnnotationsObject) /** * Creates a PHP string based on a block. * Concatenates the Test Annotations PHP and Test PHP for a single Test. - * @param $testsObject + * @param array $testsObject * @return string */ private function generateTestsPhp($testsObject) @@ -851,4 +1105,4 @@ private function generateTestsPhp($testsObject) return $testPhp; } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php b/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php index 063662382..b109edd10 100644 --- a/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php +++ b/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php @@ -24,7 +24,7 @@ class PageParser implements ParserInterface protected $configData; /** - * @constructor + * PageParser constructor. * @param ObjectManagerInterface $objectManager * @param DataInterface $configData */ @@ -38,7 +38,7 @@ public function __construct(ObjectManagerInterface $objectManager, DataInterface * Get parsed xml data. * * @param string $type - * @return mixed + * @return array */ public function getData($type) { diff --git a/src/Magento/AcceptanceTestFramework/XmlParser/ParserInterface.php b/src/Magento/AcceptanceTestFramework/XmlParser/ParserInterface.php index 10decfc48..26c034aa3 100644 --- a/src/Magento/AcceptanceTestFramework/XmlParser/ParserInterface.php +++ b/src/Magento/AcceptanceTestFramework/XmlParser/ParserInterface.php @@ -10,7 +10,7 @@ interface ParserInterface * Get parsed xml data. * * @param string $type - * @return mixed + * @return array */ public function getData($type); } diff --git a/src/Magento/AcceptanceTestFramework/XmlParser/SectionParser.php b/src/Magento/AcceptanceTestFramework/XmlParser/SectionParser.php index 9bda81336..7b79f7eb9 100644 --- a/src/Magento/AcceptanceTestFramework/XmlParser/SectionParser.php +++ b/src/Magento/AcceptanceTestFramework/XmlParser/SectionParser.php @@ -24,7 +24,7 @@ class SectionParser implements ParserInterface protected $configData; /** - * @constructor + * SectionParser constructor. * @param ObjectManagerInterface $objectManager * @param DataInterface $configData */ @@ -38,7 +38,7 @@ public function __construct(ObjectManagerInterface $objectManager, DataInterface * Get parsed xml data. * * @param string $type - * @return mixed + * @return array */ public function getData($type) { From c78b9f3a05eb954a3b086a0cd0954e7f80ab9d72 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Thu, 17 Aug 2017 16:06:53 +0300 Subject: [PATCH 115/149] MQE-148: Add Code Sniffer static test to Acceptance Test Framework & Tests projects and run it in Jenkins --- .../DataGenerator/Api/ApiExecutor.php | 18 +++++-- .../DataGenerator/Api/EntityApiHandler.php | 9 +++- .../Handlers/DataObjectHandler.php | 1 + .../Handlers/JsonDefinitionObjectHandler.php | 24 ++++++---- .../Objects/EntityDataObject.php | 24 ++++++++-- .../DataGenerator/Objects/JsonDefinition.php | 48 ++++++++++++++----- .../DataGenerator/Objects/JsonElement.php | 10 ++++ .../Parsers/DataProfileSchemaParser.php | 9 +++- .../Parsers/OperationMetadataParser.php | 10 +++- .../ObjectManager/ObjectHandlerInterface.php | 10 ++++ .../Page/Handlers/PageObjectHandler.php | 25 ++++++---- .../Page/Handlers/SectionObjectHandler.php | 29 +++++++---- .../Page/Objects/ElementObject.php | 27 ++++++++--- .../Page/Objects/PageObject.php | 30 +++++++++--- .../Page/Objects/SectionObject.php | 25 ++++++++-- .../Test/Handlers/CestObjectHandler.php | 24 +++++++--- .../Test/Objects/ActionObject.php | 38 +++++++++++---- .../Test/Objects/CestHookObject.php | 16 +++++-- .../Test/Objects/TestObject.php | 43 ++++++++++++----- .../Test/TestDataParser.php | 10 +++- .../Util/ApiClientUtil.php | 20 +++++--- .../Util/TestGenerator.php | 5 +- .../XmlParser/PageParser.php | 9 +++- 23 files changed, 356 insertions(+), 108 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index e7dd76cef..cacf43790 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -1,5 +1,8 @@ entityObject->getType() => $jsonArray], JSON_PRETTY_PRINT); } + // @codingStandardsIgnoreStart /** * This function takes a string value and its corresponding type and returns the string cast * into its the type passed. + * * @param string $type * @param string $value - * @return bool|float|int|string + * @return mixed */ private function castValue($type, $value) { @@ -189,4 +196,5 @@ private function castValue($type, $value) return $newVal; } + // @codingStandardsIgnoreEnd } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php index 05bb6f099..f4a06effc 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php @@ -1,4 +1,8 @@ apiUrl = $paramName . "=" . $paramValue; } } - } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php index baed7ed38..29d20eafa 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php @@ -1,4 +1,8 @@ metadata->get(); } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php index 972cb0bdc..8964d9526 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php @@ -1,17 +1,26 @@ timeout; } - } diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php b/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php index 683cd9663..3be5c5b00 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php +++ b/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php @@ -1,39 +1,49 @@ elements[$elementName]; } -} \ No newline at end of file +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php b/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php index 2c9215d1e..5481fc519 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php @@ -1,5 +1,8 @@ extractTestActions($hookActions) ); - return $hook; } @@ -275,7 +286,7 @@ private function extractTestActions($testActions) return $actions; } - + // @codingStandardsIgnoreStart /** * This method takes an array of data and an array representing irrelevant tags. The method strips * the data passed in of the irrelevant tags and returns the result. @@ -293,4 +304,5 @@ private function stripDescriptorTags($data, ...$tags) return $results; } + // @codingStandardsIgnoreEnd } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index a7a9e8fad..493b6cfb6 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -1,5 +1,8 @@ value1, expected => value2] * The returned array is also the merged result of the resolved and normal actions, giving * priority to the resolved actions (resolved selector instead of section.element, etc). + * * @return array */ public function getCustomActionAttributes() @@ -116,6 +128,7 @@ public function getCustomActionAttributes() /** * This function returns the string property linkedAction, describing a step to reference for a merge. + * * @return string */ public function getLinkedAction() @@ -125,6 +138,7 @@ public function getLinkedAction() /** * This function returns the int property orderOffset, describing before or after for a merge. + * * @return int */ public function getOrderOffset() @@ -135,6 +149,7 @@ public function getOrderOffset() /** * This function returns the int property timeout, this can be set as a result of the use of a section element * requiring a wait. + * * @return int */ public function getTimeout() @@ -147,6 +162,7 @@ public function getTimeout() * selector * url * userInput + * * @return void */ public function resolveReferences() @@ -162,6 +178,7 @@ public function resolveReferences() * Look up the selector for SomeSectionName.ElementName and set it as the selector attribute in the * resolved custom attributes. Also set the timeout value. * e.g. {{SomeSectionName.ElementName}} becomes #login-button + * * @return void */ private function resolveSelectorReferenceAndTimeout() @@ -182,6 +199,7 @@ private function resolveSelectorReferenceAndTimeout() * Look up the url for SomePageName and set it, with MAGENTO_BASE_URL prepended, as the url attribute in the * resolved custom attributes. * e.g. {{SomePageName}} becomes http://localhost:76543/some/url + * * @return void */ private function resolveUrlReference() @@ -202,6 +220,7 @@ private function resolveUrlReference() * Look up the value for EntityDataObjectName.Key and set it as the corresponding attribute in the resolved custom * attributes. * e.g. {{CustomerEntityFoo.FirstName}} becomes Jerry + * * @return void */ private function resolveDataInputReferences() @@ -225,6 +244,7 @@ private function resolveDataInputReferences() /** * Return an array containing the name (before the period) and key (after the period) in a {{reference.foo}}. * @param string $reference + * * @return string[] The name and key that is referenced. */ private function stripAndSplitReference($reference) diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php index ffd169f5f..e18d8257f 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php @@ -1,24 +1,32 @@ orderedSteps as $step) { if ($step->getTimeout()) { - $waitStepAttributes = array('timeout' => $step->getTimeout()); + $waitStepAttributes = ['timeout' => $step->getTimeout()]; $waitStep = new ActionObject( $step->getMergeKey() . 'WaitForPageLoad', 'waitForPageLoad', @@ -166,7 +184,8 @@ private function insertWaits() /** * Inserts a step into the ordered steps array based on position and step referenced. - * @param $stepToMerge + * + * @param ActionObject $stepToMerge * @return void */ private function insertStep($stepToMerge) diff --git a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php b/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php index 91c2ba0e8..806f1ffbf 100644 --- a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php +++ b/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php @@ -1,14 +1,21 @@ curl, CURLOPT_VERBOSE, $verbose); - curl_setopt_array($this->curl, array( + curl_setopt_array($this->curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_HTTPHEADER => $this->headers, CURLOPT_CUSTOMREQUEST => $this->apiOperation, CURLOPT_URL => HOSTNAME . ':' . PORT . $this->apiPath - )); + ]); $response = curl_exec($this->curl); curl_close($this->curl); diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index b4380fed6..cba028f60 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -27,6 +27,7 @@ private function __construct() /** * Singleton method to retrieve Test Generator + * * @return TestGenerator */ public static function getInstance() @@ -40,12 +41,12 @@ public static function getInstance() /** * Load all Cest files as Objects using the Cest Array Processor. + * * @return array */ private function loadAllCestObjects() { - $cestOutput = CestObjectHandler::getInstance()->getAllObjects(); - return $cestOutput; + return CestObjectHandler::getInstance()->getAllObjects(); } /** diff --git a/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php b/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php index f65985cd2..ee136f4ad 100644 --- a/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php +++ b/src/Magento/AcceptanceTestFramework/XmlParser/PageParser.php @@ -1,4 +1,8 @@ Date: Thu, 17 Aug 2017 18:33:03 +0300 Subject: [PATCH 116/149] MQE-148: Add Code Sniffer static test to Acceptance Test Framework & Tests projects and run it in Jenkins - fix cp detector --- .../Config/Converter/Dom/Flat.php | 38 +++++++++---------- .../ObjectManager/Factory.php | 8 ++-- .../Factory/Dynamic/Developer.php | 1 + 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php b/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php index f11453d57..eae23e30b 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php +++ b/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php @@ -29,6 +29,25 @@ public function __construct(ArrayNodeConfig $arrayNodeConfig) $this->arrayNodeConfig = $arrayNodeConfig; } + /** + * Retrieve key-value pairs of node attributes + * + * @param \DOMNode $node + * @return array + */ + protected function getNodeAttributes(\DOMNode $node) + { + $result = []; + $attributes = $node->attributes ?: []; + /** @var \DOMNode $attribute */ + foreach ($attributes as $attribute) { + if ($attribute->nodeType == XML_ATTRIBUTE_NODE) { + $result[$attribute->nodeName] = $attribute->nodeValue; + } + } + return $result; + } + /** * Convert dom node tree to array in general case or to string in a case of a text node * @@ -109,23 +128,4 @@ public function convert(\DOMNode $source, $basePath = '') } return $result; } - - /** - * Retrieve key-value pairs of node attributes - * - * @param \DOMNode $node - * @return array - */ - protected function getNodeAttributes(\DOMNode $node) - { - $result = []; - $attributes = $node->attributes ?: []; - /** @var \DOMNode $attribute */ - foreach ($attributes as $attribute) { - if ($attribute->nodeType == XML_ATTRIBUTE_NODE) { - $result[$attribute->nodeName] = $attribute->nodeValue; - } - } - return $result; - } } diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php index 6e7b0fc29..48e4d46ad 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php @@ -224,10 +224,10 @@ protected function parseArray(&$array) */ public function create($requestedType, array $arguments = []) { - $type = $this->config->getInstanceType($requestedType); - $parameters = $this->definitions->getParameters($type); + $instanceType = $this->config->getInstanceType($requestedType); + $parameters = $this->definitions->getParameters($instanceType); if ($parameters == null) { - return new $type(); + return new $instanceType(); } if (isset($this->creationStack[$requestedType])) { $lastFound = end($this->creationStack); @@ -243,7 +243,7 @@ public function create($requestedType, array $arguments = []) throw $e; } - $reflection = new \ReflectionClass($type); + $reflection = new \ReflectionClass($instanceType); return $reflection->newInstanceArgs($args); } diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php index 809fd8ca4..7c0d4c219 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php +++ b/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php @@ -172,6 +172,7 @@ protected function parseArray(&$array) * @throws \Exception * * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPCPD) */ public function create($requestedType, array $arguments = []) { From bf024176cfa02b3edbc07f6cb71a2b545aebe5c8 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Thu, 17 Aug 2017 13:47:40 -0500 Subject: [PATCH 117/149] MQE-251: Fixed a bug in ActionObject findAndReplaceReferences --- .../AcceptanceTestFramework/Test/Objects/ActionObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index a7a9e8fad..5e8ff5e3a 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -273,7 +273,7 @@ private function findAndReplaceReferences($objectHandler, $inputString) //Check to see if field is defined as data if cannot be found in a different interface if ($replacement == null && get_class($obj) != EntityDataObject::class) { - $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $inputString); + return $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $inputString); } $outputString = str_replace($match, $replacement, $outputString); From 87df6498b1707a55fdd60db99db9f25da97ae982 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Fri, 18 Aug 2017 14:48:27 -0500 Subject: [PATCH 118/149] Remove required from all testSchema attributes except mergeKey --- .../Test/etc/testSchema.xsd | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index 7c229e142..ee0d15b2d 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -201,7 +201,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -310,7 +310,7 @@ - + @@ -321,7 +321,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -394,7 +394,7 @@ - + @@ -406,7 +406,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -528,7 +528,7 @@ - + @@ -539,8 +539,8 @@ - - + + @@ -551,7 +551,7 @@ - + @@ -562,7 +562,7 @@ - + @@ -600,7 +600,7 @@ - + @@ -615,7 +615,7 @@ - + @@ -628,7 +628,7 @@ - + @@ -640,9 +640,9 @@ - + - + @@ -665,8 +665,8 @@ - - + + @@ -679,7 +679,7 @@ - + @@ -738,7 +738,7 @@ - + @@ -826,8 +826,8 @@ - - + + @@ -838,7 +838,7 @@ - + @@ -875,8 +875,8 @@ - - + + @@ -923,7 +923,7 @@ - + @@ -950,7 +950,7 @@ - + @@ -1011,7 +1011,7 @@ - + @@ -1061,7 +1061,7 @@ - + @@ -1084,7 +1084,7 @@ - + @@ -1120,7 +1120,7 @@ - + @@ -1134,7 +1134,7 @@ - + @@ -1164,7 +1164,7 @@ - + @@ -1175,7 +1175,7 @@ - + @@ -1248,7 +1248,7 @@ - + @@ -1273,7 +1273,7 @@ - + @@ -1295,9 +1295,9 @@ - - - + + + @@ -1308,8 +1308,8 @@ - - + + @@ -1320,8 +1320,8 @@ - - + + @@ -1332,8 +1332,8 @@ - - + + @@ -1344,8 +1344,8 @@ - - + + @@ -1378,7 +1378,7 @@ - + From 4e2b47b45422ade75834031003672ef8ba33ed21 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Mon, 21 Aug 2017 16:36:11 +0300 Subject: [PATCH 119/149] MQE-148: Add Code Sniffer static test to Acceptance Test Framework & Tests projects and run it in Jenkins - fix code review item --- .../DataGenerator/Objects/JsonElement.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php index 29d20eafa..10ebc6e22 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php @@ -11,21 +11,21 @@ class JsonElement /** * Json parameter name * - * @var string $key + * @var string */ private $key; /** * Json parameter metadata value (e.g. string, bool) * - * @var string $value + * @var string */ private $value; /** * Json type such as array or entry * - * @var string $type + * @var string */ private $type; From 06f1442ba00f342b8b0ff049a064f04a87e5b0c8 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Mon, 21 Aug 2017 13:48:16 -0500 Subject: [PATCH 120/149] MQE-281: Rename timeOut attribute to timeout --- .../AcceptanceTestFramework/Page/etc/SectionObject.xsd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd index 2cd26f9ae..a310f5f24 100644 --- a/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd +++ b/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd @@ -72,7 +72,7 @@ - + Optional timeout value in second to wait for the operation on the element. use "-" for default value. @@ -107,7 +107,7 @@ - + From 7e7a69183254a0a410d82a3cbc7dc3243f49caf5 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Tue, 22 Aug 2017 10:26:17 -0500 Subject: [PATCH 121/149] - Adding "iframe" to the enum list for element types. --- .../AcceptanceTestFramework/PageObject/etc/SectionObject.xsd | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd b/src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd index 2cd26f9ae..d4cd92eea 100644 --- a/src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd +++ b/src/Magento/AcceptanceTestFramework/PageObject/etc/SectionObject.xsd @@ -98,6 +98,7 @@ + From 962ea9cf9794b66dd708897153142941af026bf8 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Wed, 23 Aug 2017 13:32:37 -0500 Subject: [PATCH 122/149] - I made the "returnVariable" required for the "grab*" methods since it doesn't make sense to grab something and not store it. - Adding additional case statements to support variables in a few unusual methods. --- .../Test/etc/testSchema.xsd | 14 +- .../Util/TestGenerator.php | 154 ++++++++++++------ 2 files changed, 111 insertions(+), 57 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index ee0d15b2d..1ba9974c1 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -602,6 +602,7 @@ + @@ -615,7 +616,7 @@ - + @@ -628,7 +629,7 @@ - + @@ -642,7 +643,7 @@ - + @@ -654,7 +655,7 @@ - + @@ -666,7 +667,7 @@ - + @@ -679,7 +680,7 @@ - + @@ -1163,7 +1164,6 @@ - diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index cba028f60..a4e26b653 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -302,7 +302,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $returnVariable = $customActionAttributes['returnVariable']; } - if (isset($customActionAttributes['url']) && isset($customActionAttributes['userInput'])) { + if (isset($customActionAttributes['variable'])) { + $input = sprintf("$%s", $customActionAttributes['variable']); + } elseif (isset($customActionAttributes['url']) && isset($customActionAttributes['userInput'])) { $input = sprintf("\"%s\"", $customActionAttributes['userInput']); } elseif (isset($customActionAttributes['userInput'])) { $input = sprintf("\"%s\"", $customActionAttributes['userInput']); @@ -354,6 +356,12 @@ private function generateStepsPhp($stepsObject, $hookObject = false) case "amOnUrl": $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); break; + case "appendField": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; + case "attachFile": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; case "click": if ($input && $selector) { $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); @@ -463,6 +471,12 @@ private function generateStepsPhp($stepsObject, $hookObject = false) case "dontSeeInFormFields": $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); break; + case "dontSeeInTitle": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "dontSeeInPageSource": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; case "dontSeeInSource": // TODO: Solve the HTML parsing issue. $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $html); @@ -480,6 +494,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } break; + case "dontSeeOptionIsSelected": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; case "dragAndDrop": $testSteps .= sprintf( "\t\t$%s->%s(\"%s\", \"%s\");\n", @@ -503,7 +520,7 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $testSteps .= sprintf( "\t\t$%s->%s(%s, \"%s\");\n", $actor, - actionName, + $actionName, $input, $customActionAttributes['locale'] ); @@ -512,58 +529,46 @@ private function generateStepsPhp($stepsObject, $hookObject = false) } break; case "grabCookie": - if (isset($returnVariable)) { - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s, %s);\n", - $returnVariable, - $actor, - $actionName, - $input, - $parameterArray - ); - } else { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $input - ); - } + if (isset($parameterArray)) { + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s, %s);\n", + $returnVariable, + $actor, + $actionName, + $input, + $parameterArray + ); } else { - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $input, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $input + ); } break; + case "grabAttributeFrom": + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $input); + break; case "grabFromCurrentUrl": - if (isset($returnVariable)) { - if ($input) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $input - ); - } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); - } + if ($input) { + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $input + ); } else { - if ($input) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } + $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); + } + break; + case "grabMultiple": + if ($input) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $input); + } else { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); } break; case "grabValueFrom": @@ -579,6 +584,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } break; + case "loadSessionSnapshot": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; case "loginAsAdmin": if (isset($customActionAttributes['username']) && isset($customActionAttributes['password'])) { $testSteps .= sprintf( @@ -648,6 +656,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $customActionAttributes['height'] ); break; + case "saveSessionSnapshot": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; case "scrollTo": $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); break; @@ -729,9 +740,15 @@ private function generateStepsPhp($stepsObject, $hookObject = false) case "seeInPageSource": // TODO: Solve the HTML parsing issue. break; + case "seeInPopup": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; case "seeInSource": // TODO: Solve the HTML parsing issue. break; + case "seeInTitle": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; case "seeLink": if (isset($step['url'])) { $testSteps .= sprintf( @@ -751,9 +768,12 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $actor, $actionName, $selector, - $customActionAttributes['userInput'] + $input ); break; + case "seeOptionIsSelected": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; case "selectOption": if ($parameterArray) { $testSteps .= sprintf( @@ -807,6 +827,40 @@ private function generateStepsPhp($stepsObject, $hookObject = false) ); } break; + case "switchToIFrame": + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; + case "switchToPreviousTab": + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; + case "switchToNextTab": + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; + case "switchToWindow": + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } else { + $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); + } + break; + case "typeInPopup": + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + break; + case "unselectOption": + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + break; case "wait": $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); break; From a23a16944a7525a89d7dbdc3ad1f826d47ceaaa6 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Wed, 23 Aug 2017 14:04:28 -0500 Subject: [PATCH 123/149] MQE-68 - Create Configurable Product test generator adjustments. --- .../Test/etc/testSchema.xsd | 4 +++- .../Util/TestGenerator.php | 23 +++++-------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index 55e23b264..ba498b369 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -895,7 +895,8 @@ - + + @@ -1146,6 +1147,7 @@ + diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index cba028f60..ebe5b953c 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -249,7 +249,7 @@ private function generateClassAnnotationsPhp($classAnnotationsObject) } if ($annotationType == "testCaseId") { - $classAnnotationsPhp .= sprintf(" * TestCaseId(\"%s\")", $annotationName[0]); + $classAnnotationsPhp .= sprintf(" * TestCaseId(\"%s\")\n", $annotationName[0]); } if ($annotationType == "group") { @@ -503,7 +503,7 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $testSteps .= sprintf( "\t\t$%s->%s(%s, \"%s\");\n", $actor, - actionName, + $actionName, $input, $customActionAttributes['locale'] ); @@ -653,22 +653,11 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "searchAndMultiSelectOption": if (isset($customActionAttributes['requiredAction'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s, %s);\n", - $actor, - $actionName, - $selector, - $customActionAttributes['parameterArray'], - $customActionAttributes['requiredAction'] - ); + $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray'], $customActionAttributes['requiredAction']); + } else if (isset($customActionAttributes['parameterArray'])) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray']); } else { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $customActionAttributes['parameterArray'] - ); + $testSteps .= sprintf("\t\t$%s->%s(%s, [%s]);\n", $actor, $actionName, $selector, $input); } break; case "see": From 561fa4120b178c3f1930b98eb405aded0801f30b Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 23 Aug 2017 14:31:01 -0500 Subject: [PATCH 124/149] MQE-259 (#5) * MQE-228:Resolve bootstrap.php in Acceptance Test Framework - delete bootstrap.php file, relocated to tests project - update to include class def for TestGenerator.php * MQE-19: Tests and Framework packaging. * MQE-259 Schema Changes, DI Changes, ApiExecutor/EntityAPIHandler Changes. * MQE-259 * MQE-259 Test/Hook CustomData definition and methods complete. * MQE-259 Finished CreatedData required entity changes. Adjusted Entity. * MQE-259 Made getData exposed to be able to clone entitydataobjects, bugfixing for scoping. * MQE-259 In-test variable replacement. * MQE-259 Static Test Fixes Fixes to make the codesniffer tests be happy. * MQE-259 More Codesniffer fixes. * MQE-259 Test Fixes Still more test fixes to have the build be happy. * MQE-259 CR Fixes. Minor fix to TestGenerator as well, introduced during merge of static fixes. * MQE-259 CodeSniffer fix. * MQE-259 CR Use Statements appended regardless of data existense. * MQE-259 Static Fix * MQE 259 CR changes * MQE-259 More CR Changes * MQE-259 EntityAPI Static Test * Merge Static Test Fixes. --- etc/di.xml | 18 +- .../DataGenerator/Api/ApiExecutor.php | 24 ++- .../DataGenerator/Api/EntityApiHandler.php | 44 +++- .../Objects/EntityDataObject.php | 9 + .../Test/Handlers/CestObjectHandler.php | 50 ++++- .../Test/Objects/CestHookObject.php | 19 +- .../Test/Objects/TestObject.php | 19 +- .../Test/etc/testSchema.xsd | 46 ++++- .../Util/TestGenerator.php | 193 ++++++++++++++---- 9 files changed, 361 insertions(+), 61 deletions(-) diff --git a/etc/di.xml b/etc/di.xml index 3c7a0cd6c..e2fc87447 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -221,7 +221,10 @@ name name - mergeKey + key + key + name + mergeKey *Cest.xml Cest @@ -231,9 +234,20 @@ - mergeKey + mergeKey + mergeKey + mergeKey name name + key + key + name + key + key + name + key + key + name /config/cest/annotations/env diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index cacf43790..94875a31c 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -32,17 +32,30 @@ class ApiExecutor */ private $jsonDefinition; + /** + * The array of dependentEntities this class can be given. When finding linked entities, APIExecutor + * uses this repository before looking for static data. + * @var null + */ + private $dependentEntities; + const PRIMITIVE_TYPES = ['string', 'boolean', 'integer', 'double', 'array']; /** * ApiSubObject constructor. * @param string $operation * @param EntityDataObject $entityObject + * @param array $dependentEntities */ - public function __construct($operation, $entityObject) + public function __construct($operation, $entityObject, $dependentEntities = null) { $this->operation = $operation; $this->entityObject = $entityObject; + if ($dependentEntities != null) { + foreach ($dependentEntities as $entity) { + $this->dependentEntities[$entity->getName()] = $entity; + } + } $this->jsonDefinition = JsonDefinitionObjectHandler::getInstance()->getJsonDefinition( $this->operation, @@ -140,7 +153,14 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) $entityNamesOfType = $entityObject->getLinkedEntitiesOfType($jsonElementType); foreach ($entityNamesOfType as $entityName) { - $linkedEntityObj = DataObjectHandler::getInstance()->getObject($entityName); + // If this entity's name exists in the dependentEntities (Test-defined data), use that. + // Else go to the DataManager and try and get the entity from the overall repository of data. + if (array_key_exists($entityName, $this->dependentEntities)) { + $linkedEntityObj = $this->dependentEntities[$entityName]; + } else { + $linkedEntityObj = DataObjectHandler::getInstance()->getObject($entityName); + } + $jsonDataSubArray = self::getJsonDataArray($linkedEntityObj); if ($jsonElement->getType() == 'array') { diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php index f4a06effc..12f1200ea 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php @@ -6,7 +6,13 @@ namespace Magento\AcceptanceTestFramework\DataGenerator\Api; +use Codeception\Test\Cest; +use Magento\AcceptanceTestFramework\Config\Data; +use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; +use Magento\AcceptanceTestFramework\Test\Handlers\CestObjectHandler; +use Magento\AcceptanceTestFramework\Test\Managers\CestArrayProcessor; +use Magento\AcceptanceTestFramework\Util\TestGenerator; class EntityApiHandler { @@ -24,23 +30,30 @@ class EntityApiHandler */ private $createdObject; + /** + * Array of dependent entities, handed to ApiExecutor when entity is created. + * @var array|null + */ + private $dependentObjects = []; + /** * ApiPersistenceHandler constructor. * @param EntityDataObject $entityObject + * @param array $dependentObjects */ - public function __construct($entityObject) + public function __construct($entityObject, $dependentObjects = null) { - $this->entityObject = $entityObject; + $this->entityObject = clone $entityObject; + $this->dependentObjects = $dependentObjects; } /** * Function which executes a create request based on specific operation metadata - * - * @return string | false + * @return void */ public function createEntity() { - $apiExecutor = new ApiExecutor('create', $this->entityObject); + $apiExecutor = new ApiExecutor('create', $this->entityObject, $this->dependentObjects); $result = $apiExecutor->executeRequest(); $this->createdObject = new EntityDataObject( @@ -49,8 +62,6 @@ public function createEntity() json_decode($result, true), null ); - - return $result; } /** @@ -66,6 +77,25 @@ public function deleteEntity() return $result; } + /** + * Returns the createdDataObject, instantiated when the entity is created via API. + * @return EntityDataObject + */ + public function getCreatedObject() + { + return $this->createdObject; + } + + /** + * Returns a specific data value based on the CreatedObject's definition. + * @param string $dataName + * @return string + */ + public function getCreatedDataByName($dataName) + { + return $this->createdObject->getDataByName($dataName); + } + // TODO add update function /* public function updateEntity() { diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index c28b1a332..e2afc23f2 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -84,6 +84,15 @@ public function getType() return $this->type; } + /** + * Getter for Entity's data. + * @return array + */ + public function getData() + { + return $this->data; + } + /** * This function retrieves data from an entity defined in xml. * diff --git a/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php b/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php index 5481fc519..db09dd648 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php @@ -32,6 +32,10 @@ class CestObjectHandler implements ObjectHandlerInterface const NODE_NAME = 'nodeName'; const NAME = 'name'; const ANNOTATION_VALUE = 'value'; + const TEST_STEP_ENTITY_CREATION = 'entity'; + const TEST_ENTITY_CREATION_KEY = 'key'; + const TEST_ENTITY_CREATION_VALUE = 'value'; + const TEST_STEP_DATA_CREATION = 'createData'; /** * Cest Object Handler @@ -139,6 +143,7 @@ private function initCestData($parsedArray) $tests = $this->stripDescriptorTags($tests, CestObjectHandler::CEST_ANNOTATIONS); } + //add customData before here. $this->cests[$cestName] = new CestObject( $cestName, $annotations, @@ -165,7 +170,8 @@ private function extractHook($hookType, $cestHook) $hook = new CestHookObject( $hookType, - $this->extractTestActions($hookActions) + $this->extractTestActions($hookActions), + $this->extractTestEntities($hookActions) ); return $hook; @@ -228,7 +234,8 @@ private function extractTestData($cestTestData) $testObjects[] = new TestObject( $testName, $this->extractTestActions($testActions), - $testAnnotations + $testAnnotations, + $this->extractTestEntities($testActions) ); } @@ -238,6 +245,8 @@ private function extractTestData($cestTestData) /** * This method takes an array of test actions read in from a CestHook or Test. The actions are stripped of * irrelevant tags and returned as an array of ActionObjects. + * This method also strips data-declaration from test-action attributes and passes in the appropriate customData + * array to the CestObject. * * @param array $testActions * @return array @@ -248,6 +257,14 @@ private function extractTestActions($testActions) $actions = []; foreach ($testActions as $actionName => $actionData) { + $mergeKey = $actionData[CestObjectHandler::TEST_STEP_MERGE_KEY]; + if ($actionData[CestObjectHandler::NODE_NAME] === CestObjectHandler::TEST_STEP_ENTITY_CREATION) { + foreach ($actionData as $key => $attribute) { + if (is_array($attribute)) { + unset($actionData[$key]); + } + } + } $mergeKey = $actionData[CestObjectHandler::TEST_STEP_MERGE_KEY]; $actionAttributes = $this->stripDescriptorTags( $actionData, @@ -258,7 +275,8 @@ private function extractTestActions($testActions) $order = null; if (array_key_exists(CestObjectHandler::TEST_ACTION_BEFORE, $actionData) - and array_key_exists(CestObjectHandler::TEST_ACTION_AFTER, $actionData)) { + and array_key_exists(CestObjectHandler::TEST_ACTION_AFTER, $actionData) + ) { throw new XmlException(sprintf(self::BEFORE_AFTER_ERROR_MSG, $actionName)); } @@ -286,6 +304,32 @@ private function extractTestActions($testActions) return $actions; } + /** + * Extracts custom entity or data definitions from test actions. + * Returns array of entity data objects indexed by mergeKey, and an array of key-value pairs. + * @param array $testActions + * @return array $entityData + */ + private function extractTestEntities($testActions) + { + $testEntities = []; + + foreach ($testActions as $actionName => $actionData) { + $entityData = []; + if ($actionData[CestObjectHandler::NODE_NAME] === CestObjectHandler::TEST_STEP_ENTITY_CREATION) { + foreach ($actionData as $key => $attribute) { + if (is_array($attribute)) { + $entityData[$attribute[CestObjectHandler::TEST_ENTITY_CREATION_KEY]] + = $attribute[CestObjectHandler::TEST_ENTITY_CREATION_VALUE]; + unset($actionData[$key]); + } + } + $testEntities[$actionData[CestObjectHandler::NAME]] = $entityData; + } + } + + return $testEntities; + } // @codingStandardsIgnoreStart /** * This method takes an array of data and an array representing irrelevant tags. The method strips diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php index e18d8257f..567d1b12f 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php @@ -25,15 +25,23 @@ class CestHookObject */ private $actions = []; + /** + * Array of Hook-defined data. + * @var array|null + */ + private $customData = []; + /** * CestHookObject constructor. * @param string $type * @param array $actions + * @param array $customData */ - public function __construct($type, $actions) + public function __construct($type, $actions, $customData = null) { $this->type = $type; $this->actions = $actions; + $this->customData = $customData; } /** @@ -55,4 +63,13 @@ public function getActions() { return $this->actions; } + + /** + * Returns an array of customData to be interperpreted by the generator. + * @return array|null + */ + public function getCustomData() + { + return $this->customData; + } } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index d46c41680..18654ea93 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -52,17 +52,25 @@ class TestObject */ private $annotations = []; + /** + * Array that contains test-defined data. + * @var array + */ + private $customData = []; + /** * TestObject constructor. * @param string $name * @param array $parsedSteps * @param array $annotations + * @param array $customData */ - public function __construct($name, $parsedSteps, $annotations) + public function __construct($name, $parsedSteps, $annotations, $customData = null) { $this->name = $name; $this->parsedSteps = $parsedSteps; $this->annotations = $annotations; + $this->customData = $customData; } /** @@ -85,6 +93,15 @@ public function getAnnotations() return $this->annotations; } + /** + * Getter for the custom data + * @return array|null + */ + public function getCustomData() + { + return $this->customData; + } + /** *This method calls a function to merge custom steps and returns the resulting ordered set of steps. * diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index ba498b369..3b090f883 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -74,6 +74,7 @@ + @@ -302,10 +303,19 @@ + + + + + + + + + + - - + @@ -532,6 +542,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index ebe5b953c..734b0d1ae 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -150,33 +150,11 @@ private function assembleAllCestPhp() */ private function generateUseStatementsPhp($cestObject) { - $hooks = $cestObject->getHooks(); - $data = false; - - /** - * Loop over each Hook object, loop over each Step in the Hook object looking for a createData or deleteData. - * If they are present set a variable to True so the PHP generator uses $this->_____->createData() instead of - * $______->createData(). - */ - foreach ($hooks as $hook) { - if (!$data) { - $steps = $hook->getActions(); - - foreach ($steps as $step) { - if ($step->getType() === "createData" || $step->getType() === "deleteData") { - $data = true; - break; - } - } - } - } - $useStatementsPhp = "use Magento\AcceptanceTestFramework\AcceptanceTester;\n"; - if ($data) { - $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Managers\DataManager;\n"; - $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Api\EntityApiHandler;\n"; - } + $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler;\n"; + $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Api\EntityApiHandler;\n"; + $useStatementsPhp .= "use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject;\n"; $allureStatements = [ "Yandex\Allure\Adapter\Annotation\Features;", @@ -276,10 +254,11 @@ private function generateClassAnnotationsPhp($classAnnotationsObject) * statement to handle each unique action. At the bottom of the case statement there is a generic function that can * construct the PHP string for nearly half of all Codeception actions. * @param array $stepsObject + * @param array $stepsData * @param array|bool $hookObject * @return string */ - private function generateStepsPhp($stepsObject, $hookObject = false) + private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) { $testSteps = ""; @@ -287,6 +266,7 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $actor = "I"; $actionName = $steps->getType(); $customActionAttributes = $steps->getCustomActionAttributes(); + $key = $steps->getMergeKey(); $selector = null; $input = null; $parameterArray = null; @@ -380,24 +360,72 @@ private function generateStepsPhp($stepsObject, $hookObject = false) case "createData": $entity = $customActionAttributes['entity']; $key = $steps->getMergeKey(); + //Get Entity from Static data. + $testSteps .= sprintf( + "\t\t$%s = DataObjectHandler::getInstance()->getObject(\"%s\");\n", + $entity, + $entity + ); - if ($hookObject) { + //HookObject End-Product needs to be created in the Class/Cest scope, + //otherwise create them in the Test scope. + //Determine if there are required-entities and create array of required-entities for merging. + $requiredEntities = []; + $requiredEntityObjects = []; + foreach ($customActionAttributes as $customAttribute) { + if (is_array($customAttribute) && $customAttribute['nodeName'] = 'required-entity') { + if ($hookObject) { + $requiredEntities [] = "\$this->" . $customAttribute['name'] . "->getName() => " . + "\$this->" . $customAttribute['name'] . "->getType()"; + $requiredEntityObjects [] = '$this->' . $customAttribute['name']; + } else { + $requiredEntities [] = "\$" . $customAttribute['name'] . "->getName() => " + . "\$" . $customAttribute['name'] . "->getType()"; + $requiredEntityObjects [] = '$' . $customAttribute['name']; + } + } + } + //If required-entities are defined, reassign dataObject to not overwrite the static definition. + //Also, EntityApiHandler needs to be defined with customData array. + if (!empty($requiredEntities)) { $testSteps .= sprintf( - "\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", + "\t\t$%s = new EntityDataObject($%s->getName(), $%s->getType(), $%s->getData() + , array_merge($%s->getLinkedEntities(), [%s]));\n", + $entity, $entity, - $entity - ); - $testSteps .= sprintf("\t\t\$this->%s = new EntityApiHandler($%s);\n", $key, $entity); - $testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key); - } else { - $testSteps .= sprintf( - "\t\t$%s = DataManager::getInstance()->getEntity(\"%s\");\n", $entity, - $entity + $entity, + $entity, + implode(", ", $requiredEntities) ); - $testSteps .= sprintf("\t\t$%s = new EntityApiHandler($%s);\n", $key, $entity); - $testSteps .= sprintf("\t\t$%s->createEntity();\n", $key); + + if ($hookObject) { + $testSteps .= sprintf( + "\t\t\$this->%s = new EntityApiHandler($%s, [%s]);\n", + $key, + $entity, + implode(', ', $requiredEntityObjects) + ); + $testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key); + } else { + $testSteps .= sprintf( + "\t\t$%s = new EntityApiHandler($%s, [%s]);\n", + $key, + $entity, + implode(', ', $requiredEntityObjects) + ); + $testSteps .= sprintf("\t\t$%s->createEntity();\n", $key); + } + } else { + if ($hookObject) { + $testSteps .= sprintf("\t\t\$this->%s = new EntityApiHandler($%s);\n", $key, $entity); + $testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key); + } else { + $testSteps .= sprintf("\t\t$%s = new EntityApiHandler($%s);\n", $key, $entity); + $testSteps .= sprintf("\t\t$%s->createEntity();\n", $key); + } } + break; case "deleteData": $key = $customActionAttributes['createDataKey']; @@ -492,6 +520,40 @@ private function generateStepsPhp($stepsObject, $hookObject = false) case "executeInSelenium": $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $function); break; + case "entity": + $entityData = "["; + foreach ($stepsData[$customActionAttributes['name']] as $dataKey => $dataValue) { + $variableReplace = ''; + if ($hookObject) { + $variableReplace = $this->resolveTestVariable($dataValue, true); + } else { + $variableReplace = $this->resolveTestVariable($dataValue); + } + if (!empty($variableReplace)) { + $entityData .= sprintf("'%s' => %s, ", $dataKey, $variableReplace); + } else { + $entityData .= sprintf("'%s' => '%s', ", $dataKey, $dataValue); + } + } + $entityData .= ']'; + if ($hookObject) { + $testSteps .= sprintf( + "\t\t\$this->%s = new EntityDataObject('%s','%s',%s,null);\n", + $customActionAttributes['name'], + $customActionAttributes['name'], + $customActionAttributes['type'], + $entityData + ); + } else { + $testSteps .= sprintf( + "\t\t$%s = new EntityDataObject('%s','%s',%s,null);\n", + $customActionAttributes['name'], + $customActionAttributes['name'], + $customActionAttributes['type'], + $entityData + ); + } + break; case "executeJS": $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $function); break; @@ -653,9 +715,22 @@ private function generateStepsPhp($stepsObject, $hookObject = false) break; case "searchAndMultiSelectOption": if (isset($customActionAttributes['requiredAction'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray'], $customActionAttributes['requiredAction']); - } else if (isset($customActionAttributes['parameterArray'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameterArray']); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s, %s);\n", + $actor, + $actionName, + $selector, + $customActionAttributes['parameterArray'], + $customActionAttributes['requiredAction'] + ); + } elseif (isset($customActionAttributes['parameterArray'])) { + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $customActionAttributes['parameterArray'] + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s, [%s]);\n", $actor, $actionName, $selector, $input); } @@ -941,6 +1016,33 @@ private function generateStepsPhp($stepsObject, $hookObject = false) return $testSteps; } + /** + * Resolves regex for given variable. Can be given a cestScope, otherwise assumes it's a test variable. + * @param string $variable + * @param bool $cestScope + * @return string + */ + private function resolveTestVariable($variable, $cestScope = false) + { + $replacement = ''; + if (!$cestScope) { + preg_match("/\\$[\w.]+\\$/", $variable, $match); + if (!empty($match)) { + $match[0] = str_replace('$', '', $match[0]); + list($entity, $value) = explode('.', $match[0]); + $replacement = sprintf("$%s->getCreatedDataByName('%s')", $entity, $value); + } + } else { + preg_match("/\\$\\$[\w.]+\\$\\$/", $variable, $match); + if (!empty($match)) { + $match[0] = str_replace('$$', '', $match[0]); + list($entity, $value) = explode('.', $match[0]); + $replacement = sprintf("\$this->%s->getCreatedDataByName('%s')", $entity, $value); + } + } + return $replacement; + } + /** * Creates a PHP string for the _before/_after methods if the Test contains an or block. * @param array $hookObjects @@ -961,10 +1063,15 @@ private function generateHooksPhp($hookObjects) $hooks .= "\t */\n"; $hooks .= sprintf("\tprotected $%s;\n\n", $step->getMergeKey()); $createData = true; + } elseif ($step->getType() == "entity") { + $hooks .= "\t/**\n"; + $hooks .= sprintf("\t * @var EntityDataObject $%s;\n", $step->getMergeKey()); + $hooks .= "\t */\n"; + $hooks .= sprintf("\tprotected $%s;\n\n", $step->getCustomActionAttributes()['name']); } } - $steps = $this->generateStepsPhp($hookObject->getActions(), $createData); + $steps = $this->generateStepsPhp($hookObject->getActions(), $hookObject->getCustomData(), $createData); if ($type == "after") { $hooks .= sprintf("\tpublic function _after(%s)\n", $dependencies); @@ -1080,7 +1187,7 @@ private function generateTestsPhp($testsObject) $testName = str_replace(' ', '', $testName); $testAnnotations = $this->generateTestAnnotationsPhp($test->getAnnotations()); $dependencies = 'AcceptanceTester $I'; - $steps = $this->generateStepsPhp($test->getOrderedActions()); + $steps = $this->generateStepsPhp($test->getOrderedActions(), $test->getCustomData()); $testPhp .= $testAnnotations; $testPhp .= sprintf("\tpublic function %s(%s)\n", $testName, $dependencies); From 0ee85355d994e219472bfb4fa619f5fccf167665 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Thu, 24 Aug 2017 13:50:50 -0500 Subject: [PATCH 125/149] MQE-68 - Create Configurable Product test generator adjustments. --- .../Test/etc/testSchema.xsd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index 1ba9974c1..ba74a7abb 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -155,7 +155,7 @@ - + @@ -602,7 +602,7 @@ - + @@ -616,7 +616,7 @@ - + @@ -629,7 +629,7 @@ - + @@ -643,7 +643,7 @@ - + @@ -655,7 +655,7 @@ - + @@ -667,7 +667,7 @@ - + @@ -680,7 +680,7 @@ - + From bba6a431ed9a168de317073f11359c2e5cd8b141 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 24 Aug 2017 16:53:37 -0500 Subject: [PATCH 126/149] MQE-19: Implemented test modules composer packaging. --- .../Util/TestGenerator.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 01032b4ef..a4db45f5e 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -684,7 +684,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false) default: if ($returnVariable) { if ($selector) { - if (isset($customActionAttributes['userInput'])) { + if ($input) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $input); + } elseif (isset($customActionAttributes['userInput'])) { $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, \"%s\");\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['userInput']); } elseif (isset($customActionAttributes['parameter'])) { $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $customActionAttributes['parameter']); @@ -692,7 +694,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); } } else { - if (isset($customActionAttributes['userInput'])) { + if ($input) { + $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $input); + } elseif (isset($customActionAttributes['userInput'])) { $testSteps .= sprintf("\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, $actor, $actionName, $customActionAttributes['userInput']); } elseif (isset($customActionAttributes['parameter'])) { $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $customActionAttributes['parameter']); @@ -702,7 +706,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false) } } else { if ($selector) { - if (isset($customActionAttributes['userInput'])) { + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + } elseif (isset($customActionAttributes['userInput'])) { $testSteps .= sprintf("\t\t$%s->%s(%s, \"%s\");\n", $actor, $actionName, $selector, $customActionAttributes['userInput']); } elseif (isset($customActionAttributes['parameter'])) { $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $customActionAttributes['parameter']); @@ -710,7 +716,9 @@ private function generateStepsPhp($stepsObject, $hookObject = false) $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } } else { - if (isset($customActionAttributes['userInput'])) { + if ($input) { + $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + } elseif (isset($customActionAttributes['userInput'])) { $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $customActionAttributes['userInput']); } elseif (isset($customActionAttributes['parameter'])) { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $customActionAttributes['parameter']); From 45cad02165ef13b879277ee20bb1f10b99bd2538 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 23 Aug 2017 23:03:42 -0500 Subject: [PATCH 127/149] MQE-275: Implemented data uniqueness for input fields. (Resolved merge conflict) (cherry picked from commit b2b8eca) --- .../Handlers/DataObjectHandler.php | 49 ++++++++++++------- .../Objects/EntityDataObject.php | 30 +++++++++++- .../Test/Objects/ActionObject.php | 21 ++++++++ .../Util/TestGenerator.php | 29 ++++++++++- 4 files changed, 109 insertions(+), 20 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php index 337896bc3..07d9b6a77 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php @@ -33,6 +33,9 @@ class DataObjectHandler implements ObjectHandlerInterface const DATA_VALUES = 'data'; const DATA_ELEMENT_KEY = 'key'; const DATA_ELEMENT_VALUE = 'value'; + const DATA_ELEMENT_UNIQUENESS_ATTR = 'unique'; + const DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX = 'prefix'; + const DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX = 'suffix'; const ARRAY_VALUES = 'array'; const ARRAY_ELEMENT_KEY = 'key'; @@ -120,7 +123,12 @@ private function parseEnvVariables() } $envData[strtolower(trim($params[0]))] = trim($params[1]); } - $envDataObject = new EntityDataObject(self::ENV_DATA_OBJECT_NAME, 'environment', $envData, null); + $envDataObject = new EntityDataObject( + self::ENV_DATA_OBJECT_NAME, + 'environment', + $envData, + null + ); $this->data[$envDataObject->getName()] = $envDataObject; } } @@ -133,38 +141,42 @@ private function parseDataEntities() { $entities = $this->arrayData; - foreach ($entities[DataObjectHandler::ENTITY_DATA] as $entityName => $entity) { - $entityType = $entity[DataObjectHandler::ENTITY_DATA_TYPE]; + foreach ($entities[self::ENTITY_DATA] as $entityName => $entity) { + $entityType = $entity[self::ENTITY_DATA_TYPE]; $dataValues = []; $linkedEntities = []; $arrayValues = []; - - if (array_key_exists(DataObjectHandler::DATA_VALUES, $entity)) { - foreach ($entity[DataObjectHandler::DATA_VALUES] as $dataElement) { - $dataElementKey = strtolower($dataElement[DataObjectHandler::DATA_ELEMENT_KEY]); - $dataElementValue = $dataElement[DataObjectHandler::DATA_ELEMENT_VALUE]; + $uniquenessValues = []; + + if (array_key_exists(self::DATA_VALUES, $entity)) { + foreach ($entity[self::DATA_VALUES] as $dataElement) { + $dataElementKey = strtolower($dataElement[self::DATA_ELEMENT_KEY]); + $dataElementValue = $dataElement[self::DATA_ELEMENT_VALUE]; + if (array_key_exists(self::DATA_ELEMENT_UNIQUENESS_ATTR, $dataElement)) { + $uniquenessValues[$dataElementKey] = $dataElement[self::DATA_ELEMENT_UNIQUENESS_ATTR]; + } $dataValues[$dataElementKey] = $dataElementValue; } unset($dataElement); } - if (array_key_exists(DataObjectHandler::REQUIRED_ENTITY, $entity)) { - foreach ($entity[DataObjectHandler::REQUIRED_ENTITY] as $linkedEntity) { - $linkedEntityName = $linkedEntity[DataObjectHandler::REQUIRED_ENTITY_VALUE]; - $linkedEntityType = $linkedEntity[DataObjectHandler::REQUIRED_ENTITY_TYPE]; + if (array_key_exists(self::REQUIRED_ENTITY, $entity)) { + foreach ($entity[self::REQUIRED_ENTITY] as $linkedEntity) { + $linkedEntityName = $linkedEntity[self::REQUIRED_ENTITY_VALUE]; + $linkedEntityType = $linkedEntity[self::REQUIRED_ENTITY_TYPE]; $linkedEntities[$linkedEntityName] = $linkedEntityType; } unset($linkedEntity); } - if (array_key_exists(DataObjectHandler::ARRAY_VALUES, $entity)) { - foreach ($entity[DataObjectHandler::ARRAY_VALUES] as $arrayElement) { - $arrayKey = $arrayElement[DataObjectHandler::ARRAY_ELEMENT_KEY]; - foreach ($arrayElement[DataObjectHandler::ARRAY_ELEMENT_ITEM] as $arrayValue) { - $arrayValues[] = $arrayValue[DataObjectHandler::ARRAY_ELEMENT_ITEM_VALUE]; + if (array_key_exists(self::ARRAY_VALUES, $entity)) { + foreach ($entity[self::ARRAY_VALUES] as $arrayElement) { + $arrayKey = $arrayElement[self::ARRAY_ELEMENT_KEY]; + foreach ($arrayElement[self::ARRAY_ELEMENT_ITEM] as $arrayValue) { + $arrayValues[] = $arrayValue[self::ARRAY_ELEMENT_ITEM_VALUE]; } $dataValues[$arrayKey] = $arrayValues; @@ -175,7 +187,8 @@ private function parseDataEntities() $entityName, $entityType, $dataValues, - $linkedEntities + $linkedEntities, + $uniquenessValues ); $this->data[$entityDataObject->getName()] = $entityDataObject; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index e2afc23f2..a8b3d7b92 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -39,19 +39,30 @@ class EntityDataObject */ private $data = []; + /** + * Array of data name and its uniqueness attribute value. + * + * @var array + */ + private $uniquenessData = []; + /** * EntityDataObject constructor. * @param string $entityName * @param string $entityType * @param array $data * @param array $linkedEntities + * @param array $uniquenessData */ - public function __construct($entityName, $entityType, $data, $linkedEntities) + public function __construct($entityName, $entityType, $data, $linkedEntities, $uniquenessData = null) { $this->name = $entityName; $this->type = $entityType; $this->data = $data; $this->linkedEntities = $linkedEntities; + if ($uniquenessData) { + $this->uniquenessData = $uniquenessData; + } } /** @@ -129,4 +140,21 @@ public function getLinkedEntitiesOfType($fieldType) return $groupedArray; } + + /** + * This function retrieves uniqueness data by its name. + * + * @param string $dataName + * @return string|null + */ + public function getUniquenessDataByName($dataName) + { + $name = strtolower($dataName); + + if (array_key_exists($name, $this->uniquenessData)) { + return $this->uniquenessData[$name]; + } + + return null; + } } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 66dec8816..497f7e9c9 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -23,6 +23,7 @@ class ActionObject const ACTION_ATTRIBUTE_URL = 'url'; const ACTION_ATTRIBUTE_SELECTOR = 'selector'; const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w.]+}}/'; + const UNIQUENESS_FUNCTION = 'msq'; /** * The unique identifier for the action @@ -288,6 +289,7 @@ private function findAndReplaceReferences($objectHandler, $inputString) case (get_class($obj) == EntityDataObject::class): list(,$objField) = $this->stripAndSplitReference($match); $replacement = $obj->getDataByName($objField); + $replacement = $this->resolveEntityDataUniquenessReference($replacement, $obj, $objField); break; } @@ -302,4 +304,23 @@ private function findAndReplaceReferences($objectHandler, $inputString) return $outputString; } + + /** + * @param string $reference + * @param EntityDataObject $entityDataObject + * @param string $entityKey + * @return string + */ + private function resolveEntityDataUniquenessReference($reference, $entityDataObject, $entityKey) + { + $uniquenessData = $entityDataObject->getUniquenessDataByName($entityKey); + $entityName = $entityDataObject->getName(); + + if ($uniquenessData == DataObjectHandler::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX) { + $reference = self::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")' . $reference; + } elseif ($uniquenessData == DataObjectHandler::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX) { + $reference .= self::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")'; + } + return $reference; + } } diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 7d87e6f40..4eff07f2a 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -7,6 +7,7 @@ namespace Magento\AcceptanceTestFramework\Util; use Magento\AcceptanceTestFramework\Test\Handlers\CestObjectHandler; +use Magento\AcceptanceTestFramework\Test\Objects\ActionObject; class TestGenerator { @@ -287,7 +288,33 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } elseif (isset($customActionAttributes['url']) && isset($customActionAttributes['userInput'])) { $input = sprintf("\"%s\"", $customActionAttributes['userInput']); } elseif (isset($customActionAttributes['userInput'])) { - $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + preg_match( + '/' . ActionObject::UNIQUENESS_FUNCTION .'\("[\w]+.[\w]+"\)/', + $customActionAttributes['userInput'], + $matches + ); + if (!empty($matches)) { + $parts = preg_split( + '/' . ActionObject::UNIQUENESS_FUNCTION . '\("[\w]+.[\w]+"\)/', + $customActionAttributes['userInput'], + -1 + ); + foreach ($parts as $part) { + if (!$part) { + if (!empty($input)) { + $input .= '.'; + } + $input .= $matches[0]; + } else { + if (!empty($input)) { + $input .= '.'; + } + $input .= sprintf("\"%s\"", $part); + } + } + } else { + $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + } } elseif (isset($customActionAttributes['url'])) { $input = sprintf("\"%s\"", $customActionAttributes['url']); } elseif (isset($customActionAttributes['time'])) { From 11522e876bf5b8787ea3527cdab5562083d91f98 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 25 Aug 2017 12:29:29 -0500 Subject: [PATCH 128/149] MQE-275: Implemented data uniqueness for input fields. --- .../DataGenerator/Api/ApiExecutor.php | 14 ++++-- .../Handlers/DataObjectHandler.php | 1 + .../Objects/EntityDataObject.php | 2 +- .../Test/Objects/ActionObject.php | 7 ++- .../Util/TestGenerator.php | 45 ++++++++++++++++--- 5 files changed, 54 insertions(+), 15 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index 94875a31c..973150a03 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -145,10 +145,16 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) $jsonElementType = $jsonElement->getValue(); if (in_array($jsonElementType, ApiExecutor::PRIMITIVE_TYPES)) { - $jsonArray[$jsonElement->getKey()] = $this->castValue( - $jsonElementType, - $entityObject->getDataByName($jsonElement->getKey()) - ); + $elementData = $entityObject->getDataByName($jsonElement->getKey()); + $elementUniquenessData = $entityObject->getUniquenessDataByName($jsonElement->getKey()); + if ($elementUniquenessData) { + if ($elementUniquenessData == 'prefix') { + $elementData = DataObjectHandler::UNIQUENESS_FUNCTION($entityObject->getName() . '.' . $jsonElement->getKey()) . $elementData; + } elseif ($elementUniquenessData == 'suffix') { + $elementData .= DataObjectHandler::UNIQUENESS_FUNCTION($entityObject->getName() . '.'. $jsonElement->getKey()); + } + } + $jsonArray[$jsonElement->getKey()] = $this->castValue($jsonElementType, $elementData); } else { $entityNamesOfType = $entityObject->getLinkedEntitiesOfType($jsonElementType); diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php index 07d9b6a77..7ee7ace05 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php @@ -36,6 +36,7 @@ class DataObjectHandler implements ObjectHandlerInterface const DATA_ELEMENT_UNIQUENESS_ATTR = 'unique'; const DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX = 'prefix'; const DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX = 'suffix'; + const UNIQUENESS_FUNCTION = 'msq'; const ARRAY_VALUES = 'array'; const ARRAY_ELEMENT_KEY = 'key'; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index a8b3d7b92..5330a2d3e 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -114,7 +114,7 @@ public function getDataByName($dataName) { $name = strtolower($dataName); - if (array_key_exists($name, $this->data)) { + if (!is_null($this->data) && array_key_exists($name, $this->data)) { return $this->data[$name]; } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 497f7e9c9..a819a3560 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -23,7 +23,6 @@ class ActionObject const ACTION_ATTRIBUTE_URL = 'url'; const ACTION_ATTRIBUTE_SELECTOR = 'selector'; const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w.]+}}/'; - const UNIQUENESS_FUNCTION = 'msq'; /** * The unique identifier for the action @@ -294,7 +293,7 @@ private function findAndReplaceReferences($objectHandler, $inputString) } //Check to see if field is defined as data if cannot be found in a different interface - if ($replacement == null && get_class($obj) != EntityDataObject::class) { + if ($replacement == null && get_class($objectHandler) != DataObjectHandler::class) { return $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $inputString); } @@ -317,9 +316,9 @@ private function resolveEntityDataUniquenessReference($reference, $entityDataObj $entityName = $entityDataObject->getName(); if ($uniquenessData == DataObjectHandler::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX) { - $reference = self::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")' . $reference; + $reference = DataObjectHandler::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")' . $reference; } elseif ($uniquenessData == DataObjectHandler::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX) { - $reference .= self::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")'; + $reference .= DataObjectHandler::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")'; } return $reference; } diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 4eff07f2a..a86a8bfb1 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -8,6 +8,7 @@ use Magento\AcceptanceTestFramework\Test\Handlers\CestObjectHandler; use Magento\AcceptanceTestFramework\Test\Objects\ActionObject; +use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; class TestGenerator { @@ -289,13 +290,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $input = sprintf("\"%s\"", $customActionAttributes['userInput']); } elseif (isset($customActionAttributes['userInput'])) { preg_match( - '/' . ActionObject::UNIQUENESS_FUNCTION .'\("[\w]+.[\w]+"\)/', + '/' . DataObjectHandler::UNIQUENESS_FUNCTION .'\("[\w]+.[\w]+"\)/', $customActionAttributes['userInput'], $matches ); if (!empty($matches)) { $parts = preg_split( - '/' . ActionObject::UNIQUENESS_FUNCTION . '\("[\w]+.[\w]+"\)/', + '/' . DataObjectHandler::UNIQUENESS_FUNCTION . '\("[\w]+.[\w]+"\)/', $customActionAttributes['userInput'], -1 ); @@ -1002,7 +1003,16 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) default: if ($returnVariable) { if ($selector) { - if (isset($customActionAttributes['userInput'])) { + if ($input) { + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s, %s);\n", + $returnVariable, + $actor, + $actionName, + $selector, + $input + ); + } elseif (isset($customActionAttributes['userInput'])) { $testSteps .= sprintf( "\t\t$%s = $%s->%s(%s, \"%s\");\n", $returnVariable, @@ -1030,7 +1040,15 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) ); } } else { - if (isset($customActionAttributes['userInput'])) { + if ($input) { + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $input + ); + } elseif (isset($customActionAttributes['userInput'])) { $testSteps .= sprintf( "\t\t$%s = $%s->%s(\"%s\");\n", $returnVariable, @@ -1052,7 +1070,15 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } } else { if ($selector) { - if (isset($customActionAttributes['userInput'])) { + if ($input) { + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $input + ); + } elseif (isset($customActionAttributes['userInput'])) { $testSteps .= sprintf( "\t\t$%s->%s(%s, \"%s\");\n", $actor, @@ -1072,7 +1098,14 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } } else { - if (isset($customActionAttributes['userInput'])) { + if ($input) { + $testSteps .= sprintf( + "\t\t$%s->%s(%s);\n", + $actor, + $actionName, + $input + ); + } elseif (isset($customActionAttributes['userInput'])) { $testSteps .= sprintf( "\t\t$%s->%s(\"%s\");\n", $actor, From e18c162bdfe06142325b4ca2cd407f1a10485de3 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Fri, 25 Aug 2017 13:42:41 -0500 Subject: [PATCH 129/149] MQE-238:[CAP] Add support for groups of actions (ex 'loginAsAdmin') - create action group schema with shared action tags - update test schema to include actions tag - update object model for support of action groups and variable resolution --- etc/di.xml | 44 ++- .../Handlers/DataObjectHandler.php | 2 + .../Page/Handlers/PageObjectHandler.php | 3 + .../Handlers/ActionGroupObjectHandler.php | 104 +++++++ .../Test/Handlers/CestObjectHandler.php | 277 +----------------- .../Test/Objects/ActionGroupObject.php | 106 +++++++ .../Test/Objects/ActionObject.php | 19 +- .../Test/Objects/TestObject.php | 133 ++------- .../Test/Parsers/ActionGroupDataParser.php | 35 +++ .../Test/{ => Parsers}/TestDataParser.php | 2 +- .../Test/Util/ActionGroupObjectExtractor.php | 56 ++++ .../Test/Util/ActionMergeUtil.php | 160 ++++++++++ .../Test/Util/ActionObjectExtractor.php | 103 +++++++ .../Test/Util/AnnotationExtractor.php | 48 +++ .../Test/Util/BaseCestObjectExtractor.php | 44 +++ .../Test/Util/CestHookObjectExtractor.php | 62 ++++ .../Test/Util/CestObjectExtractor.php | 82 ++++++ .../Test/Util/TestEntityExtractor.php | 57 ++++ .../Test/Util/TestObjectExtractor.php | 88 ++++++ .../Test/etc/sampleActions.xml | 83 ++++++ .../Test/etc/sampleCest.xml | 136 ++++----- .../Test/etc/testSchema.xsd | 43 ++- 22 files changed, 1229 insertions(+), 458 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Parsers/ActionGroupDataParser.php rename src/Magento/AcceptanceTestFramework/Test/{ => Parsers}/TestDataParser.php (91%) create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/ActionMergeUtil.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/AnnotationExtractor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/BaseCestObjectExtractor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/CestHookObjectExtractor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/CestObjectExtractor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/Util/TestObjectExtractor.php create mode 100644 src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml diff --git a/etc/di.xml b/etc/di.xml index e2fc87447..9b124613f 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -278,7 +278,7 @@ - + Magento\AcceptanceTestFramework\Test\Config\Data @@ -288,4 +288,46 @@ Magento\AcceptanceTestFramework\Config\Reader\TestData + + + + + + Magento\AcceptanceTestFramework\Config\FileResolver\Module + Magento\AcceptanceTestFramework\Config\ActionGroupDataConverter + Magento\AcceptanceTestFramework\Config\SchemaLocator\TestData + + name + mergeKey + + *-action_group.xml + Cest + + + + + + + mergeKey + name + + + + + + + Magento\AcceptanceTestFramework\Test\Config\Dom\ActionGroupArrayNodeConfig + + + + + + Magento\AcceptanceTestFramework\Test\Config\ActionGroupData + + + + + Magento\AcceptanceTestFramework\Config\Reader\ActionGroupData + + diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php index 7ee7ace05..8b4430705 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php @@ -19,6 +19,7 @@ class DataObjectHandler implements ObjectHandlerInterface * @var array $arrayData */ private $arrayData = []; + /** * @var array $data */ @@ -49,6 +50,7 @@ class DataObjectHandler implements ObjectHandlerInterface /** * Singleton method to retrieve instance of DataArrayProcessor + * * @return DataObjectHandler * @throws \Exception */ diff --git a/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php b/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php index 1f41d0396..1d3dd4ac6 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php @@ -11,6 +11,9 @@ use Magento\AcceptanceTestFramework\Page\Objects\PageObject; use Magento\AcceptanceTestFramework\XmlParser\PageParser; +/** + * Class PageObjectHandler + */ class PageObjectHandler implements ObjectHandlerInterface { const TYPE = 'page'; diff --git a/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php b/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php new file mode 100644 index 000000000..20d61a640 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php @@ -0,0 +1,104 @@ +initActionGroups(); + } + + return self::$ACTION_GROUP_OBJECT_HANDLER; + } + + /** + * ActionGroupObjectHandler constructor. + */ + private function __construct() + { + // private constructor + } + + /** + * Function to return a single object by name + * + * @param string $actionGroupName + * @return ActionGroupObject + */ + public function getObject($actionGroupName) + { + return $this->getAllObjects()[$actionGroupName]; + } + + /** + * Function to return all objects for which the handler is responsible + * + * @return array + */ + public function getAllObjects() + { + return $this->actionGroups; + } + + /** + * Method which populates field array with objects from parsed action_group.xml + * + * @return void + */ + private function initActionGroups() + { + $actionGroupParser = ObjectManagerFactory::getObjectManager()->create(ActionGroupDataParser::class); + $parsedActionGroups = $actionGroupParser->readActionGroupData(); + + $actionGroupObjectExtractor = new ActionGroupObjectExtractor(); + + foreach ($parsedActionGroups[ActionGroupObjectHandler::ACTION_GROUP_ROOT] as + $actionGroupName => $actionGroupData) { + if (!is_array($actionGroupData)) { + continue; + } + + $this->actionGroups[$actionGroupName] = + $actionGroupObjectExtractor->extractActionGroup($actionGroupData); + } + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php b/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php index db09dd648..6a0568843 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php @@ -5,37 +5,18 @@ */ namespace Magento\AcceptanceTestFramework\Test\Handlers; -use Magento\AcceptanceTestFramework\Exceptions\XmlException; use Magento\AcceptanceTestFramework\ObjectManager\ObjectHandlerInterface; use Magento\AcceptanceTestFramework\ObjectManagerFactory; -use Magento\AcceptanceTestFramework\Test\Objects\ActionObject; use Magento\AcceptanceTestFramework\Test\Objects\CestObject; -use Magento\AcceptanceTestFramework\Test\Objects\TestObject; -use Magento\AcceptanceTestFramework\Test\Objects\CestHookObject; -use Magento\AcceptanceTestFramework\Test\TestDataParser; +use Magento\AcceptanceTestFramework\Test\Parsers\TestDataParser; +use Magento\AcceptanceTestFramework\Test\Util\CestObjectExtractor; /** * Class CestObjectHandler */ class CestObjectHandler implements ObjectHandlerInterface { - const BEFORE_AFTER_ERROR_MSG = "Merge Error - Steps cannot have both before and after attributes.\tTestStep='%s'"; - const CEST_ROOT = 'config'; - const CEST_ANNOTATIONS = 'annotations'; - const CEST_BEFORE_HOOK = 'before'; - const CEST_AFTER_HOOK = 'after'; - const CEST_TEST_TAG = 'test'; - const TEST_ANNOTATIONS = 'annotations'; - const TEST_ACTION_BEFORE = 'before'; - const TEST_ACTION_AFTER = 'after'; - const TEST_STEP_MERGE_KEY = 'mergeKey'; - const NODE_NAME = 'nodeName'; - const NAME = 'name'; - const ANNOTATION_VALUE = 'value'; - const TEST_STEP_ENTITY_CREATION = 'entity'; - const TEST_ENTITY_CREATION_KEY = 'key'; - const TEST_ENTITY_CREATION_VALUE = 'value'; - const TEST_STEP_DATA_CREATION = 'createData'; + const XML_ROOT = 'config'; /** * Cest Object Handler @@ -59,10 +40,8 @@ class CestObjectHandler implements ObjectHandlerInterface public static function getInstance() { if (!self::$cestObjectHandler) { - $testDataParser = ObjectManagerFactory::getObjectManager()->create(TestDataParser::class); - $parsedCestArray = $testDataParser->readTestData(); self::$cestObjectHandler = new CestObjectHandler(); - self::$cestObjectHandler->initCestData($parsedCestArray); + self::$cestObjectHandler->initCestData(); } return self::$cestObjectHandler; @@ -98,255 +77,23 @@ public function getAllObjects() } /** - * This method takes the parsed cest array and returns CestObjects parsed from defined *Cest.xml files + * This method reads all Cest.xml files into objects and stores them in an array for future access. * - * @param array $parsedArray * @return void */ - private function initCestData($parsedArray) + private function initCestData() { - foreach ($parsedArray[CestObjectHandler::CEST_ROOT] as $cestName => $cestData) { - $hooks = []; - $annotations = []; + $testDataParser = ObjectManagerFactory::getObjectManager()->create(TestDataParser::class); + $parsedCestArray = $testDataParser->readTestData(); - if (!is_array($cestData)) { - continue; - } - - $tests = $this->stripDescriptorTags( - $cestData, - CestObjectHandler::NODE_NAME, - CestObjectHandler::NAME - ); - - if (array_key_exists(CestObjectHandler::CEST_BEFORE_HOOK, $cestData)) { - $hooks[CestObjectHandler::CEST_BEFORE_HOOK] = $this->extractHook( - CestObjectHandler::CEST_BEFORE_HOOK, - $cestData[CestObjectHandler::CEST_BEFORE_HOOK] - ); - - $tests = $this->stripDescriptorTags($tests, CestObjectHandler::CEST_BEFORE_HOOK); - } - - if (array_key_exists(CestObjectHandler::CEST_AFTER_HOOK, $cestData)) { - $hooks[CestObjectHandler::CEST_AFTER_HOOK] = $this->extractHook( - CestObjectHandler::CEST_AFTER_HOOK, - $cestData[CestObjectHandler::CEST_AFTER_HOOK] - ); - - $tests = $this->stripDescriptorTags($tests, CestObjectHandler::CEST_AFTER_HOOK); - } - - if (array_key_exists(CestObjectHandler::CEST_ANNOTATIONS, $cestData)) { - $annotations = $this->extractAnnotations($cestData[CestObjectHandler::CEST_ANNOTATIONS]); - - $tests = $this->stripDescriptorTags($tests, CestObjectHandler::CEST_ANNOTATIONS); - } - - //add customData before here. - $this->cests[$cestName] = new CestObject( - $cestName, - $annotations, - $this->extractTestData($tests), - $hooks - ); - } - } - - /** - * This method trims all irrelevant tags to extract hook information including before and after tags - * and their relevant actions. The result is an array of CestHookObjects. - * - * @param string $hookType - * @param array $cestHook - * @return CestHookObject - */ - private function extractHook($hookType, $cestHook) - { - $hookActions = $this->stripDescriptorTags( - $cestHook, - CestObjectHandler::NODE_NAME - ); - - $hook = new CestHookObject( - $hookType, - $this->extractTestActions($hookActions), - $this->extractTestEntities($hookActions) - ); - - return $hook; - } - - /** - * This method trims away irrelevant tags and returns annotations used in the array passed. The annotations - * can be found in both Cests and their child element tests. - * - * @param array $cestAnnotations - * @return array - */ - private function extractAnnotations($cestAnnotations) - { - $annotationObjects = []; - $annotations = $this->stripDescriptorTags($cestAnnotations, CestObjectHandler::NODE_NAME); - - // parse the Cest annotations - foreach ($annotations as $annotationKey => $annotationData) { - $annotationValues = []; - foreach ($annotationData as $annotationValue) { - $annotationValues[] = $annotationValue[CestObjectHandler::ANNOTATION_VALUE]; - } - - $annotationObjects[$annotationKey] = $annotationValues; - } - - return $annotationObjects; - } - - /** - * This method takes and array of test data and strips away irrelevant tags. The data is converted into an array of - * TestObjects. - * - * @param array $cestTestData - * @return array - */ - private function extractTestData($cestTestData) - { - $testObjects = []; + $cestObjectExtractor = new CestObjectExtractor(); - // parse the tests - foreach ($cestTestData as $testName => $testData) { - if (!is_array($testData)) { + foreach ($parsedCestArray[CestObjectHandler::XML_ROOT] as $cestName => $cestData) { + if (!is_array($cestData)) { continue; } - $testAnnotations = []; - $testActions = $this->stripDescriptorTags( - $testData, - CestObjectHandler::NODE_NAME, - CestObjectHandler::NAME, - CestObjectHandler::TEST_ANNOTATIONS - ); - - if (array_key_exists(CestObjectHandler::TEST_ANNOTATIONS, $testData)) { - $testAnnotations = $this->extractAnnotations($testData[CestObjectHandler::TEST_ANNOTATIONS]); - } - - $testObjects[] = new TestObject( - $testName, - $this->extractTestActions($testActions), - $testAnnotations, - $this->extractTestEntities($testActions) - ); - } - - return $testObjects; - } - - /** - * This method takes an array of test actions read in from a CestHook or Test. The actions are stripped of - * irrelevant tags and returned as an array of ActionObjects. - * This method also strips data-declaration from test-action attributes and passes in the appropriate customData - * array to the CestObject. - * - * @param array $testActions - * @return array - * @throws XmlException - */ - private function extractTestActions($testActions) - { - $actions = []; - - foreach ($testActions as $actionName => $actionData) { - $mergeKey = $actionData[CestObjectHandler::TEST_STEP_MERGE_KEY]; - if ($actionData[CestObjectHandler::NODE_NAME] === CestObjectHandler::TEST_STEP_ENTITY_CREATION) { - foreach ($actionData as $key => $attribute) { - if (is_array($attribute)) { - unset($actionData[$key]); - } - } - } - $mergeKey = $actionData[CestObjectHandler::TEST_STEP_MERGE_KEY]; - $actionAttributes = $this->stripDescriptorTags( - $actionData, - CestObjectHandler::TEST_STEP_MERGE_KEY, - CestObjectHandler::NODE_NAME - ); - $linkedAction = null; - $order = null; - - if (array_key_exists(CestObjectHandler::TEST_ACTION_BEFORE, $actionData) - and array_key_exists(CestObjectHandler::TEST_ACTION_AFTER, $actionData) - ) { - throw new XmlException(sprintf(self::BEFORE_AFTER_ERROR_MSG, $actionName)); - } - - if (array_key_exists(CestObjectHandler::TEST_ACTION_BEFORE, $actionData)) { - $linkedAction = $actionData[CestObjectHandler::TEST_ACTION_BEFORE]; - $order = "before"; - } elseif (array_key_exists(CestObjectHandler::TEST_ACTION_AFTER, $actionData)) { - $linkedAction = $actionData[CestObjectHandler::TEST_ACTION_AFTER]; - $order = "after"; - } - // TODO this is to be implemented later. Currently the schema does not use or need return var. - /*if (array_key_exists(CestObjectHandler::TEST_ACTION_RETURN_VARIABLE, $actionData)) { - $returnVariable = $actionData[CestObjectHandler::TEST_ACTION_RETURN_VARIABLE]; - }*/ - - $actions[] = new ActionObject( - $mergeKey, - $actionData[CestObjectHandler::NODE_NAME], - $actionAttributes, - $linkedAction, - $order - ); - } - - return $actions; - } - - /** - * Extracts custom entity or data definitions from test actions. - * Returns array of entity data objects indexed by mergeKey, and an array of key-value pairs. - * @param array $testActions - * @return array $entityData - */ - private function extractTestEntities($testActions) - { - $testEntities = []; - - foreach ($testActions as $actionName => $actionData) { - $entityData = []; - if ($actionData[CestObjectHandler::NODE_NAME] === CestObjectHandler::TEST_STEP_ENTITY_CREATION) { - foreach ($actionData as $key => $attribute) { - if (is_array($attribute)) { - $entityData[$attribute[CestObjectHandler::TEST_ENTITY_CREATION_KEY]] - = $attribute[CestObjectHandler::TEST_ENTITY_CREATION_VALUE]; - unset($actionData[$key]); - } - } - $testEntities[$actionData[CestObjectHandler::NAME]] = $entityData; - } - } - - return $testEntities; - } - // @codingStandardsIgnoreStart - /** - * This method takes an array of data and an array representing irrelevant tags. The method strips - * the data passed in of the irrelevant tags and returns the result. - * - * @param array $data - * @param array $tags - * @return array - */ - private function stripDescriptorTags($data, ...$tags) - { - $results = $data; - foreach ($tags as $tag) { - unset($results[$tag]); + $this->cests[$cestName] = $cestObjectExtractor->extractCest($cestData); } - - return $results; } - // @codingStandardsIgnoreEnd } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php new file mode 100644 index 000000000..aac693162 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php @@ -0,0 +1,106 @@ +name = $name; + $this->defaultEntity = $defaultEntity; + $this->parsedActions = $actions; + } + + /** + * Gets the ordered steps including merged waits + * + * @param string $entity + * @return array + */ + public function getSteps($entity) + { + $mergeUtil = new ActionMergeUtil(); + if (!$entity) { + $entity = $this->defaultEntity; + } + return $mergeUtil->mergeStepsAndInsertWaits($this->getResolvedActions($entity)); + } + + /** + * Function which takes the name of the entity object to be appended to an action objects fields returns resulting + * action objects with proper entity.field references. + * + * @param string $entity + * @return array + */ + private function getResolvedActions($entity) + { + $resolvedActions = []; + + foreach ($this->parsedActions as $action) { + /**@var \Magento\AcceptanceTestFramework\Test\Objects\ActionObject $action **/ + if (array_key_exists('userInput', $action->getCustomActionAttributes())) { + $regexPattern = '/{{.[\w]+}}/'; + preg_match_all($regexPattern, $action->getCustomActionAttributes()['userInput'], $matches); + + $userInputString = $action->getCustomActionAttributes()['userInput']; + foreach ($matches[0] as $match) { + $search = str_replace('}}', '', str_replace('{{', '', $match)); + $userInputString = str_replace($search, $entity . $search, $userInputString); + } + + $attribute['userInput'] = $userInputString; + + $resolvedActions[$action->getMergeKey()] = new ActionObject( + $action->getMergeKey(), + $action->getType(), + array_merge($action->getCustomActionAttributes(), $attribute), + $action->getLinkedAction(), + $action->getOrderOffset() + ); + } else { + // add action here if we do not see any userInput in this particular action + $resolvedActions[$action->getMergeKey()] = $action; + } + } + + return $resolvedActions; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index a819a3560..25209f2b1 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -39,7 +39,7 @@ class ActionObject private $type; /** - * THe attributes which describe the action (e.g. selector, + * THe attributes which describe the action (e.g. selector, userInput) * * @var array $actionAttributes */ @@ -75,6 +75,7 @@ class ActionObject /** * ActionObject constructor. + * * @param string $mergeKey * @param string $type * @param array $actionAttributes @@ -95,6 +96,7 @@ public function __construct($mergeKey, $type, $actionAttributes, $linkedAction = /** * This function returns the string property mergeKey. + * * @return string */ public function getMergeKey() @@ -104,6 +106,7 @@ public function getMergeKey() /** * This function returns the string property type. + * * @return string */ public function getType() @@ -243,8 +246,8 @@ private function resolveDataInputReferences() /** * Return an array containing the name (before the period) and key (after the period) in a {{reference.foo}}. - * @param string $reference * + * @param string $reference * @return string[] The name and key that is referenced. */ private function stripAndSplitReference($reference) @@ -255,9 +258,11 @@ private function stripAndSplitReference($reference) /** * Return a string based on a reference to a page, section, or data field (e.g. {{foo.ref}} resolves to 'data') + * * @param ObjectHandlerInterface $objectHandler * @param string $inputString * @return string | null + * @throws \Exception */ private function findAndReplaceReferences($objectHandler, $inputString) { @@ -275,7 +280,7 @@ private function findAndReplaceReferences($objectHandler, $inputString) $obj = $objectHandler->getObject($objName); - // sepcify behavior depending on field + // specify behavior depending on field switch (get_class($obj)) { case PageObject::class: $replacement = $obj->getUrl(); @@ -292,9 +297,10 @@ private function findAndReplaceReferences($objectHandler, $inputString) break; } - //Check to see if field is defined as data if cannot be found in a different interface if ($replacement == null && get_class($objectHandler) != DataObjectHandler::class) { - return $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $inputString); + return $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $outputString); + } elseif ($replacement == null) { + throw new \Exception("Could not resolve entity reference " . $inputString); } $outputString = str_replace($match, $replacement, $outputString); @@ -316,7 +322,8 @@ private function resolveEntityDataUniquenessReference($reference, $entityDataObj $entityName = $entityDataObject->getName(); if ($uniquenessData == DataObjectHandler::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX) { - $reference = DataObjectHandler::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")' . $reference; + $reference = + DataObjectHandler::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")' . $reference; } elseif ($uniquenessData == DataObjectHandler::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX) { $reference .= DataObjectHandler::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")'; } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index 18654ea93..1d99db4e2 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -6,7 +6,8 @@ namespace Magento\AcceptanceTestFramework\Test\Objects; -use Magento\AcceptanceTestFramework\Exceptions\XmlException; +use Magento\AcceptanceTestFramework\Test\Handlers\ActionGroupObjectHandler; +use Magento\AcceptanceTestFramework\Test\Util\ActionMergeUtil; /** * Class TestObject @@ -24,20 +25,6 @@ class TestObject */ private $name; - /** - * Array which contains the final set of test steps in order after merge - * - * @var array - */ - private $orderedSteps = []; - - /** - * Array which contains steps to be merged into test flow - * - * @var array - */ - private $stepsToMerge = []; - /** * Array which contains steps parsed in and are the default set * @@ -60,6 +47,7 @@ class TestObject /** * TestObject constructor. + * * @param string $name * @param array $parsedSteps * @param array $annotations @@ -103,116 +91,41 @@ public function getCustomData() } /** - *This method calls a function to merge custom steps and returns the resulting ordered set of steps. + * This method calls a function to merge custom steps and returns the resulting ordered set of steps. * * @return array */ public function getOrderedActions() { - $this->mergeActions(); - $this->insertWaits(); - return $this->orderedSteps; - } - - /** - * This method takes the steps from the parser and splits steps which need merge from steps that are ordered. - * - * @return void - * @throws XmlException - */ - private function sortActions() - { - foreach ($this->parsedSteps as $parsedStep) { - $parsedStep->resolveReferences(); - if ($parsedStep->getLinkedAction()) { - $this->stepsToMerge[$parsedStep->getMergeKey()] = $parsedStep; - } else { - $this->orderedSteps[$parsedStep->getMergeKey()] = $parsedStep; - } - } - } - - /** - * This method runs a step sort, loops steps which need to be merged, and runs the mergeStep function on each one. - * - * @return void - */ - private function mergeActions() - { - $this->sortActions(); - - foreach ($this->stepsToMerge as $stepName => $stepToMerge) { - if (!array_key_exists($stepName, $this->orderedSteps)) { - $this->mergeAction($stepToMerge); - } - } - unset($stepName); - unset($stepToMerge); + $mergeUtil = new ActionMergeUtil(); + $mergedSteps = $mergeUtil->mergeStepsAndInsertWaits($this->parsedSteps); + return $this->extractActionGroups($mergedSteps); } /** - * Recursively merges in each step and its dependencies + * Method to insert action group references into step flow * - * @param ActionObject $stepToMerge - * @throws XmlException - * @return void + * @param array $mergedSteps + * @return array */ - private function mergeAction($stepToMerge) + private function extractActionGroups($mergedSteps) { - $linkedStep = $stepToMerge->getLinkedAction(); - - if (!array_key_exists($linkedStep, $this->orderedSteps) - and - !array_key_exists($linkedStep, $this->stepsToMerge)) { - throw new XmlException(sprintf( - self::STEP_MISSING_ERROR_MSG, - $this->getName(), - $stepToMerge->getMergeKey(), - $linkedStep - )); - } elseif (!array_key_exists($linkedStep, $this->orderedSteps)) { - $this->mergeAction($this->stepsToMerge[$linkedStep]); - } - - $this->insertStep($stepToMerge); - } + $newOrderedList = []; - /** - * Runs through the prepared orderedSteps and calls insertWait if a step requires a wait after it. - * - * @return void - */ - private function insertWaits() - { - foreach ($this->orderedSteps as $step) { - if ($step->getTimeout()) { - $waitStepAttributes = ['timeout' => $step->getTimeout()]; - $waitStep = new ActionObject( - $step->getMergeKey() . 'WaitForPageLoad', - 'waitForPageLoad', - $waitStepAttributes, - $step->getMergeKey(), - 'after' + foreach ($mergedSteps as $key => $mergedStep) { + /**@var ActionObject $mergedStep**/ + if ($mergedStep->getType() == 'actions') { + $actionGroup = ActionGroupObjectHandler::getInstance()->getObject( + $mergedStep->getCustomActionAttributes()['ref'] ); - $this->insertStep($waitStep); + $entity = $mergedStep->getCustomActionAttributes()['entity'] ?? null; + $actionsToMerge = $actionGroup->getSteps($entity); + $newOrderedList = $newOrderedList + $actionsToMerge; + } else { + $newOrderedList[$key] = $mergedStep; } } - } - /** - * Inserts a step into the ordered steps array based on position and step referenced. - * - * @param ActionObject $stepToMerge - * @return void - */ - private function insertStep($stepToMerge) - { - $position = array_search( - $stepToMerge->getLinkedAction(), - array_keys($this->orderedSteps) - ) + $stepToMerge->getOrderOffset(); - $previous_items = array_slice($this->orderedSteps, 0, $position, true); - $next_items = array_slice($this->orderedSteps, $position, null, true); - $this->orderedSteps = $previous_items + [$stepToMerge->getMergeKey() => $stepToMerge] + $next_items; + return $newOrderedList; } } diff --git a/src/Magento/AcceptanceTestFramework/Test/Parsers/ActionGroupDataParser.php b/src/Magento/AcceptanceTestFramework/Test/Parsers/ActionGroupDataParser.php new file mode 100644 index 000000000..459439279 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Parsers/ActionGroupDataParser.php @@ -0,0 +1,35 @@ +actionGroupData = $actionGroupData; + } + + /** + * Read action group xml and return as an array. + * + * @return array + */ + public function readActionGroupData() + { + return $this->actionGroupData->get(); + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php b/src/Magento/AcceptanceTestFramework/Test/Parsers/TestDataParser.php similarity index 91% rename from src/Magento/AcceptanceTestFramework/Test/TestDataParser.php rename to src/Magento/AcceptanceTestFramework/Test/Parsers/TestDataParser.php index 806f1ffbf..9b1af3fc1 100644 --- a/src/Magento/AcceptanceTestFramework/Test/TestDataParser.php +++ b/src/Magento/AcceptanceTestFramework/Test/Parsers/TestDataParser.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test; +namespace Magento\AcceptanceTestFramework\Test\Parsers; use Magento\AcceptanceTestFramework\Config\DataInterface; diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php new file mode 100644 index 000000000..1bfa4e3a1 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php @@ -0,0 +1,56 @@ +actionObjectExtractor = new ActionObjectExtractor(); + } + + /** + * Method to parse array of action group data into ActionGroupObject + * + * @param array $actionGroupData + * @return ActionGroupObject + */ + public function extractActionGroup($actionGroupData) + { + $actionData = $this->stripDescriptorTags( + $actionGroupData, + self::NODE_NAME, + self::DEFAULT_ENTITY, + self::NAME + ); + + $actions = $this->actionObjectExtractor->extractActions($actionData); + + return new ActionGroupObject( + $actionGroupData[self::NAME], + $actionGroupData[self::DEFAULT_ENTITY], + $actions + ); + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionMergeUtil.php b/src/Magento/AcceptanceTestFramework/Test/Util/ActionMergeUtil.php new file mode 100644 index 000000000..67a2fcdf7 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Util/ActionMergeUtil.php @@ -0,0 +1,160 @@ +mergeActions($parsedSteps); + $this->insertWaits(); + + return $this->orderedSteps; + } + + /** + * This method runs a step sort, loops steps which need to be merged, and runs the mergeStep function on each one. + * + * @param array $parsedSteps + * @return void + */ + private function mergeActions($parsedSteps) + { + $this->sortActions($parsedSteps); + + foreach ($this->stepsToMerge as $stepName => $stepToMerge) { + if (!array_key_exists($stepName, $this->orderedSteps)) { + $this->mergeAction($stepToMerge); + } + } + unset($stepName); + unset($stepToMerge); + } + + /** + * Runs through the prepared orderedSteps and calls insertWait if a step requires a wait after it. + * + * @return void + */ + private function insertWaits() + { + foreach ($this->orderedSteps as $step) { + if ($step->getTimeout()) { + $waitStepAttributes = [self::WAIT_ATTR => $step->getTimeout()]; + $waitStep = new ActionObject( + $step->getMergeKey() . self::WAIT_ACTION_SUFFIX, + self::WAIT_ACTION_NAME, + $waitStepAttributes, + $step->getMergeKey(), + self::DEFAULT_WAIT_ORDER + ); + $this->insertStep($waitStep); + } + } + } + + /** + * This method takes the steps from the parser and splits steps which need merge from steps that are ordered. + * + * @param array $parsedSteps + * @return void + * @throws XmlException + */ + private function sortActions($parsedSteps) + { + foreach ($parsedSteps as $parsedStep) { + $parsedStep->resolveReferences(); + if ($parsedStep->getLinkedAction()) { + $this->stepsToMerge[$parsedStep->getMergeKey()] = $parsedStep; + } else { + $this->orderedSteps[$parsedStep->getMergeKey()] = $parsedStep; + } + } + } + + /** + * Recursively merges in each step and its dependencies + * + * @param ActionObject $stepToMerge + * @throws XmlException + * @return void + */ + private function mergeAction($stepToMerge) + { + $linkedStep = $stepToMerge->getLinkedAction(); + + if (!array_key_exists($linkedStep, $this->orderedSteps) + and + !array_key_exists($linkedStep, $this->stepsToMerge)) { + throw new XmlException(sprintf( + self::STEP_MISSING_ERROR_MSG, + $this->getName(), + $stepToMerge->getMergeKey(), + $linkedStep + )); + } elseif (!array_key_exists($linkedStep, $this->orderedSteps)) { + $this->mergeAction($this->stepsToMerge[$linkedStep]); + } + + $this->insertStep($stepToMerge); + } + + /** + * Inserts a step into the ordered steps array based on position and step referenced. + * + * @param ActionObject $stepToMerge + * @return void + */ + private function insertStep($stepToMerge) + { + $position = array_search( + $stepToMerge->getLinkedAction(), + array_keys($this->orderedSteps) + ) + $stepToMerge->getOrderOffset(); + $previous_items = array_slice($this->orderedSteps, 0, $position, true); + $next_items = array_slice($this->orderedSteps, $position, null, true); + $this->orderedSteps = $previous_items + [$stepToMerge->getMergeKey() => $stepToMerge] + $next_items; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php new file mode 100644 index 000000000..8d4cfa766 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php @@ -0,0 +1,103 @@ + $actionData) { + $mergeKey = $actionData[self::TEST_STEP_MERGE_KEY]; + if ($actionData[self::NODE_NAME] === TestEntityExtractor::TEST_STEP_ENTITY_CREATION) { + $actionData = $this->stripDataFields($actionData); + } + + $actionAttributes = $this->stripDescriptorTags( + $actionData, + self::TEST_STEP_MERGE_KEY, + self::NODE_NAME + ); + $linkedAction = null; + $order = null; + + if (array_key_exists(self::TEST_ACTION_BEFORE, $actionData) + and array_key_exists(self::TEST_ACTION_AFTER, $actionData)) { + throw new XmlException(sprintf(self::BEFORE_AFTER_ERROR_MSG, $actionName)); + } + + if (array_key_exists(self::TEST_ACTION_BEFORE, $actionData)) { + $linkedAction = $actionData[self::TEST_ACTION_BEFORE]; + $order = "before"; + } elseif (array_key_exists(self::TEST_ACTION_AFTER, $actionData)) { + $linkedAction = $actionData[self::TEST_ACTION_AFTER]; + $order = "after"; + } + // TODO this is to be implemented later. Currently the schema does not use or need return var. + /*if (array_key_exists(ActionGroupObjectHandler::TEST_ACTION_RETURN_VARIABLE, $actionData)) { + $returnVariable = $actionData[ActionGroupObjectHandler::TEST_ACTION_RETURN_VARIABLE]; + }*/ + + $actions[] = new ActionObject( + $mergeKey, + $actionData[self::NODE_NAME], + $actionAttributes, + $linkedAction, + $order + ); + } + + return $actions; + } + + /** + * Function which checks an entity definition for type array and strips this key out (as data is not stores in this + * type of object). + * + * @param $entityDataArray + * @return array + */ + private function stripDataFields($entityDataArray) + { + $results = $entityDataArray; + foreach ($entityDataArray as $key => $attribute) { + if (is_array($attribute)) { + unset($results[$key]); + } + } + + return $results; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/AnnotationExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/AnnotationExtractor.php new file mode 100644 index 000000000..3730929c1 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Util/AnnotationExtractor.php @@ -0,0 +1,48 @@ +stripDescriptorTags($cestAnnotations, self::NODE_NAME); + + // parse the Cest annotations + foreach ($annotations as $annotationKey => $annotationData) { + $annotationValues = []; + foreach ($annotationData as $annotationValue) { + $annotationValues[] = $annotationValue[self::ANNOTATION_VALUE]; + } + + $annotationObjects[$annotationKey] = $annotationValues; + } + + return $annotationObjects; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/BaseCestObjectExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/BaseCestObjectExtractor.php new file mode 100644 index 000000000..00c7a86a1 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Util/BaseCestObjectExtractor.php @@ -0,0 +1,44 @@ +actionObjectExtractor = new ActionObjectExtractor(); + $this->testEntityExtractor = new TestEntityExtractor(); + } + + /** + * This method trims all irrelevant tags to extract hook information including before and after tags + * and their relevant actions. The result is an array of CestHookObjects. + * + * @param string $hookType + * @param array $cestHook + * @return CestHookObject + */ + public function extractHook($hookType, $cestHook) + { + $hookActions = $this->stripDescriptorTags( + $cestHook, + self::NODE_NAME + ); + + $hook = new CestHookObject( + $hookType, + $this->actionObjectExtractor->extractActions($hookActions), + $this->testEntityExtractor->extractTestEntities($hookActions) + ); + + return $hook; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/CestObjectExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/CestObjectExtractor.php new file mode 100644 index 000000000..78cee7785 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Util/CestObjectExtractor.php @@ -0,0 +1,82 @@ +stripDescriptorTags( + $cestData, + self::NODE_NAME, + self::NAME + ); + + if (array_key_exists(self::CEST_BEFORE_HOOK, $cestData)) { + $hooks[self::CEST_BEFORE_HOOK] = $cestHookObjectExtractor->extractHook( + self::CEST_BEFORE_HOOK, + $cestData[self::CEST_BEFORE_HOOK] + ); + + $tests = $this->stripDescriptorTags($tests, self::CEST_BEFORE_HOOK); + } + + if (array_key_exists(self::CEST_AFTER_HOOK, $cestData)) { + $hooks[self::CEST_AFTER_HOOK] = $cestHookObjectExtractor->extractHook( + self::CEST_AFTER_HOOK, + $cestData[self::CEST_AFTER_HOOK] + ); + + $tests = $this->stripDescriptorTags($tests, self::CEST_AFTER_HOOK); + } + + if (array_key_exists(self::CEST_ANNOTATIONS, $cestData)) { + $annotations = $annotationExtractor->extractAnnotations($cestData[self::CEST_ANNOTATIONS]); + + $tests = $this->stripDescriptorTags($tests, self::CEST_ANNOTATIONS); + } + + return new CestObject( + $cestData[self::NAME], + $annotations, + $testObjectExtractor->extractTestData($tests), + $hooks + ); + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php new file mode 100644 index 000000000..a18584fb5 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php @@ -0,0 +1,57 @@ + $actionData) { + $entityData = []; + if ($actionData[TestEntityExtractor::NODE_NAME] === TestEntityExtractor::TEST_STEP_ENTITY_CREATION) { + foreach ($actionData as $key => $attribute) { + if (is_array($attribute)) { + $entityData[$attribute[TestEntityExtractor::TEST_ENTITY_CREATION_KEY]] + = $attribute[TestEntityExtractor::TEST_ENTITY_CREATION_VALUE]; + unset($actionData[$key]); + } + } + $testEntities[$actionData[TestEntityExtractor::NAME]] = $entityData; + } + } + + return $testEntities; + } +} \ No newline at end of file diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/TestObjectExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/TestObjectExtractor.php new file mode 100644 index 000000000..8fbc797ce --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/Util/TestObjectExtractor.php @@ -0,0 +1,88 @@ +actionObjectExtractor = new ActionObjectExtractor(); + $this->annotationExtractor = new AnnotationExtractor(); + $this->testEntityExtractor = new TestEntityExtractor(); + } + + /** + * This method takes and array of test data and strips away irrelevant tags. The data is converted into an array of + * TestObjects. + * + * @param array $cestTestData + * @return array + */ + public function extractTestData($cestTestData) + { + $testObjects = []; + + // parse the tests + foreach ($cestTestData as $testName => $testData) { + if (!is_array($testData)) { + continue; + } + + $testAnnotations = []; + $testActions = $this->stripDescriptorTags( + $testData, + self::NODE_NAME, + self::NAME, + self::TEST_ANNOTATIONS + ); + + if (array_key_exists(self::TEST_ANNOTATIONS, $testData)) { + $testAnnotations = $this->annotationExtractor->extractAnnotations($testData[self::TEST_ANNOTATIONS]); + } + + $testObjects[] = new TestObject( + $testName, + $this->actionObjectExtractor->extractActions($testActions), + $testAnnotations, + $this->testEntityExtractor->extractTestEntities($testActions) + ); + } + + return $testObjects; + } +} diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml b/src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml new file mode 100644 index 000000000..aaa1a130c --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml b/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml index e3c88628c..b02b90a86 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml +++ b/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml @@ -9,84 +9,84 @@ + - - - - + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index fdf08e1db..a9aba6a46 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -6,7 +6,10 @@ - + + + + @@ -18,8 +21,15 @@ + + + + + + + - + @@ -40,7 +50,15 @@ - + + + + + + + + + @@ -95,7 +113,6 @@ - @@ -146,10 +163,22 @@ - - - + + + + + + + + + + + + + + + From 18205625877b2023ca3e2b1280a0467d3309c7dc Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Fri, 25 Aug 2017 13:52:44 -0500 Subject: [PATCH 130/149] MQE-238:[CAP] Add support for groups of actions (ex 'loginAsAdmin') -fixes for code sniffer failures --- .../AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php | 2 +- .../AcceptanceTestFramework/Test/Util/TestEntityExtractor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php index 8d4cfa766..4bb799451 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php +++ b/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php @@ -86,7 +86,7 @@ public function extractActions($testActions) * Function which checks an entity definition for type array and strips this key out (as data is not stores in this * type of object). * - * @param $entityDataArray + * @param array $entityDataArray * @return array */ private function stripDataFields($entityDataArray) diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php index a18584fb5..a0dc0f575 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php +++ b/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php @@ -54,4 +54,4 @@ public function extractTestEntities($testActions) return $testEntities; } -} \ No newline at end of file +} From 7222c90605fc29a11b24d14af490c0bf5c7a4682 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 25 Aug 2017 16:51:17 -0500 Subject: [PATCH 131/149] MQE-275: Implemented data uniqueness for input fields. (cherry picked from commit 4ab7fcd) --- .../DataGenerator/Api/ApiExecutor.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index 973150a03..747c03a93 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -149,9 +149,17 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) $elementUniquenessData = $entityObject->getUniquenessDataByName($jsonElement->getKey()); if ($elementUniquenessData) { if ($elementUniquenessData == 'prefix') { - $elementData = DataObjectHandler::UNIQUENESS_FUNCTION($entityObject->getName() . '.' . $jsonElement->getKey()) . $elementData; + if (DataObjectHandler::UNIQUENESS_FUNCTION == 'msq') { + $elementData = msq($entityObject->getName().'.' . $jsonElement->getKey()).$elementData; + } elseif (DataObjectHandler::UNIQUENESS_FUNCTION == 'msqs') { + $elementData = msqs($entityObject->getName().'.' . $jsonElement->getKey()).$elementData; + } } elseif ($elementUniquenessData == 'suffix') { - $elementData .= DataObjectHandler::UNIQUENESS_FUNCTION($entityObject->getName() . '.'. $jsonElement->getKey()); + if (DataObjectHandler::UNIQUENESS_FUNCTION == 'msq') { + $elementData .= msq($entityObject->getName() . '.'. $jsonElement->getKey()); + } elseif (DataObjectHandler::UNIQUENESS_FUNCTION == 'msqs') { + $elementData .= msqs($entityObject->getName() . '.'. $jsonElement->getKey()); + } } } $jsonArray[$jsonElement->getKey()] = $this->castValue($jsonElementType, $elementData); From 998cd7c338a30a54877175221d664b65a1b2d9e1 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Mon, 28 Aug 2017 09:38:11 -0500 Subject: [PATCH 132/149] Add AcceptanceTester.php to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e8d88e61e..8e2330435 100755 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ composer.phar vendor/* .env _generated +AcceptanceTester.php From ecc24949ce93b70defe73e20fd5c086fe6e609d8 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Mon, 28 Aug 2017 09:55:55 -0500 Subject: [PATCH 133/149] MQE-288 Data Persistence using multiple created Entities --- .../Util/TestGenerator.php | 102 ++++++++++++------ 1 file changed, 70 insertions(+), 32 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index a86a8bfb1..440410c10 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -568,17 +568,8 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) case "entity": $entityData = "["; foreach ($stepsData[$customActionAttributes['name']] as $dataKey => $dataValue) { - $variableReplace = ''; - if ($hookObject) { - $variableReplace = $this->resolveTestVariable($dataValue, true); - } else { - $variableReplace = $this->resolveTestVariable($dataValue); - } - if (!empty($variableReplace)) { - $entityData .= sprintf("'%s' => %s, ", $dataKey, $variableReplace); - } else { - $entityData .= sprintf("'%s' => '%s', ", $dataKey, $dataValue); - } + $variableReplace = $this->resolveTestVariable($dataValue); + $entityData .= sprintf("'%s' => %s, ", $dataKey, $variableReplace); } $entityData .= ']'; if ($hookObject) { @@ -639,7 +630,14 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } break; case "grabAttributeFrom": - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $input); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s, %s);\n", + $returnVariable, + $actor, + $actionName, + $selector, + $input + ); break; case "grabFromCurrentUrl": if ($input) { @@ -656,9 +654,22 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) break; case "grabMultiple": if ($input) { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s, %s);\n", $returnVariable, $actor, $actionName, $selector, $input); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s, %s);\n", + $returnVariable, + $actor, + $actionName, + $selector, + $input + ); } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s(%s);\n", $returnVariable, $actor, $actionName, $selector); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s(%s);\n", + $returnVariable, + $actor, + $actionName, + $selector + ); } break; case "grabValueFrom": @@ -1131,30 +1142,57 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } /** - * Resolves regex for given variable. Can be given a cestScope, otherwise assumes it's a test variable. - * @param string $variable - * @param bool $cestScope + * Resolves regex for given inputString. + * @param string $inputString * @return string */ - private function resolveTestVariable($variable, $cestScope = false) + private function resolveTestVariable($inputString) { - $replacement = ''; - if (!$cestScope) { - preg_match("/\\$[\w.]+\\$/", $variable, $match); - if (!empty($match)) { - $match[0] = str_replace('$', '', $match[0]); - list($entity, $value) = explode('.', $match[0]); - $replacement = sprintf("$%s->getCreatedDataByName('%s')", $entity, $value); + $outputString = $inputString; + $replaced = false; + + // Chesk for Cest-scope variables first, stricter regex match. + preg_match_all("/\\$\\$[\w.]+\\$\\$/", $outputString, $matches); + if (!empty($matches)) { + foreach ($matches[0] as $match) { + $replacement = null; + $variable = $this->stripAndSplitReference($match, '$$'); + $replacement = sprintf("\$this->%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); + $outputString = str_replace($match, $replacement, $outputString); + $replaced = true; } - } else { - preg_match("/\\$\\$[\w.]+\\$\\$/", $variable, $match); - if (!empty($match)) { - $match[0] = str_replace('$$', '', $match[0]); - list($entity, $value) = explode('.', $match[0]); - $replacement = sprintf("\$this->%s->getCreatedDataByName('%s')", $entity, $value); + } + + // Check Test-scope variables + preg_match_all("/\\$[\w.]+\\$/", $outputString, $matches); + if (!empty($matches)) { + foreach ($matches[0] as $match) { + $replacement = null; + $variable = $this->stripAndSplitReference($match, '$'); + $replacement = sprintf("$%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); + $outputString = str_replace($match, $replacement, $outputString); + $replaced = true; } } - return $replacement; + + // If no replacement was made, assume it is a string literal and append single quotes. + if (!$replaced) { + return "'" . $outputString ."'"; + } + + return $outputString; + } + + /** + * Performs str_replace on variable reference, dependent on delimiter and returns exploded array. + * @param string $reference + * @param string $delimiter + * @return array + */ + private function stripAndSplitReference($reference, $delimiter) + { + $strippedReference = str_replace($delimiter, '', $reference); + return explode('.', $strippedReference); } /** From 998600257d8fc4168563d3cc30437c2301b8adf6 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 28 Aug 2017 10:54:34 -0500 Subject: [PATCH 134/149] Fixed some code style issues. --- .../Module/MagentoSequence.php | 2 + .../Util/TestGenerator.php | 104 +++++++++++++++--- .../AcceptanceTestFramework/Util/msq.php | 12 ++ 3 files changed, 104 insertions(+), 14 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php b/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php index 724a977c6..955b66ecf 100644 --- a/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php +++ b/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php @@ -6,6 +6,8 @@ /** * MagentoSequence module. + * + * @codingStandardsIgnoreFile */ class MagentoSequence extends Sequence { diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 440410c10..435ba2428 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -217,7 +217,11 @@ private function generateClassAnnotationsPhp($classAnnotationsObject) } if ($annotationType == "title") { - $classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]); + $classAnnotationsPhp .= sprintf( + " * @Title(\"%s\")\n", + ucwords($annotationType), + $annotationName[0] + ); } if ($annotationType == "description") { @@ -381,14 +385,28 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) break; case "clickWithLeftButton": if ($selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s, %s);\n", + $actor, + $actionName, + $selector, + $x, + $y + ); } else { $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); } break; case "clickWithRightButton": if ($selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s, %s);\n", + $actor, + $actionName, + $selector, + $x, + $y + ); } else { $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); } @@ -454,7 +472,11 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } } else { if ($hookObject) { - $testSteps .= sprintf("\t\t\$this->%s = new EntityApiHandler($%s);\n", $key, $entity); + $testSteps .= sprintf( + "\t\t\$this->%s = new EntityApiHandler($%s);\n", + $key, + $entity + ); $testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key); } else { $testSteps .= sprintf("\t\t$%s = new EntityApiHandler($%s);\n", $key, $entity); @@ -481,7 +503,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) break; case "dontSeeCookie": if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $input, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } @@ -525,7 +553,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); break; case "dontSeeInFormFields": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $parameterArray + ); break; case "dontSeeInTitle": $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); @@ -704,7 +738,14 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) case "moveMouseOver": if ($selector) { if (isset($step['x']) || isset($step['y'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s, %s);\n", + $actor, + $actionName, + $selector, + $x, + $y + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); } @@ -743,7 +784,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) break; case "resetCookie": if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $input, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } @@ -782,7 +829,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $customActionAttributes['parameterArray'] ); } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, [%s]);\n", $actor, $actionName, $selector, $input); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, [%s]);\n", + $actor, + $actionName, + $selector, + $input + ); } break; case "see": @@ -794,7 +847,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) break; case "seeCookie": if (isset($parameterArray)) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $input, + $parameterArray + ); } else { $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); } @@ -838,7 +897,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); break; case "seeInFormFields": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray); + $testSteps .= sprintf( + "\t\t$%s->%s(%s, %s);\n", + $actor, + $actionName, + $selector, + $parameterArray + ); break; case "seeInPageSource": // TODO: Solve the HTML parsing issue. @@ -1076,7 +1141,12 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $customActionAttributes['parameter'] ); } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); + $testSteps .= sprintf( + "\t\t$%s = $%s->%s();\n", + $returnVariable, + $actor, + $actionName + ); } } } else { @@ -1293,7 +1363,10 @@ private function generateTestAnnotationsPhp($testAnnotationsObject) } if ($annotationType == "severity") { - $testAnnotationsPhp .= sprintf("\t * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]); + $testAnnotationsPhp .= sprintf( + "\t * @Severity(level = SeverityLevel::%s)\n", + $annotationName[0] + ); } if ($annotationType == "testCaseId") { @@ -1301,7 +1374,10 @@ private function generateTestAnnotationsPhp($testAnnotationsObject) } } - $testAnnotationsPhp .= sprintf("\t * @Parameter(name = \"%s\", value=\"$%s\")\n", "AcceptanceTester", "I"); + $testAnnotationsPhp .= sprintf( + "\t * @Parameter(name = \"%s\", value=\"$%s\")\n", + "AcceptanceTester", "I" + ); foreach ($testAnnotationsObject as $annotationType => $annotationName) { if ($annotationType == "group") { diff --git a/src/Magento/AcceptanceTestFramework/Util/msq.php b/src/Magento/AcceptanceTestFramework/Util/msq.php index 2b24f1a85..6d6dfb73b 100644 --- a/src/Magento/AcceptanceTestFramework/Util/msq.php +++ b/src/Magento/AcceptanceTestFramework/Util/msq.php @@ -2,6 +2,12 @@ use Magento\AcceptanceTestFramework\Module\MagentoSequence; if (!function_exists('msq')) { + /** + * Return unique sequence within test. + * + * @param null $id + * @return string + */ function msq($id = null) { if ($id and isset(MagentoSequence::$hash[$id])) { @@ -17,6 +23,12 @@ function msq($id = null) } if (!function_exists('msqs')) { + /** + * Return unique sequence within suite. + * + * @param null $id + * @return string + */ function msqs($id = null) { if ($id and isset(MagentoSequence::$suiteHash[$id])) { From 303f305067624e6c9cb644d9024abfe5c571dba6 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Mon, 28 Aug 2017 14:19:53 -0500 Subject: [PATCH 135/149] MQE-295:[Data Input] Nested persistence definition support - change to reference new metadata format - update to JsonElement object to reference metadata def within declaration --- etc/di.xml | 1 + .../DataGenerator/Api/ApiExecutor.php | 88 ++++++++---- .../Handlers/JsonDefinitionObjectHandler.php | 50 ++++++- .../Objects/EntityDataObject.php | 2 +- .../DataGenerator/Objects/JsonElement.php | 45 +++++- .../Util/JsonObjectExtractor.php | 129 ++++++++++++++++++ .../DataGenerator/etc/dataOperation.xsd | 86 ++++++------ 7 files changed, 332 insertions(+), 69 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/DataGenerator/Util/JsonObjectExtractor.php diff --git a/etc/di.xml b/etc/di.xml index 9b124613f..e72404039 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -200,6 +200,7 @@ name key key + key *-meta.xml Metadata diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index 747c03a93..ac7ca9741 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -9,10 +9,17 @@ use Magento\AcceptanceTestFramework\DataGenerator\Handlers\JsonDefinitionObjectHandler; use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; use Magento\AcceptanceTestFramework\DataGenerator\Objects\JsonDefinition; +use Magento\AcceptanceTestFramework\DataGenerator\Objects\JsonElement; +use Magento\AcceptanceTestFramework\DataGenerator\Util\JsonObjectExtractor; use Magento\AcceptanceTestFramework\Util\ApiClientUtil; +/** + * Class ApiExecutor + */ class ApiExecutor { + const PRIMITIVE_TYPES = ['string', 'boolean', 'integer', 'double', 'array']; + /** * Describes the operation for the executor ('create','update','delete') * @@ -35,11 +42,9 @@ class ApiExecutor /** * The array of dependentEntities this class can be given. When finding linked entities, APIExecutor * uses this repository before looking for static data. - * @var null + * @var array */ - private $dependentEntities; - - const PRIMITIVE_TYPES = ['string', 'boolean', 'integer', 'double', 'array']; + private $dependentEntities = []; /** * ApiSubObject constructor. @@ -128,20 +133,19 @@ private function getAuthorizationHeader($authUrl) * recursively forming an array which represents the json structure for the api of the desired type. * * @param EntityDataObject $entityObject - * @param array $jsonDefMetadata - * + * @param array $jsonArrayMetadata * @return array */ - private function getJsonDataArray($entityObject, $jsonDefMetadata = null) + private function convertJsonArray($entityObject, $jsonArrayMetadata) { - $jsonArrayMetadata = !$jsonDefMetadata ? JsonDefinitionObjectHandler::getInstance()->getJsonDefinition( - $this->operation, - $entityObject->getType() - )->getJsonMetadata() : $jsonDefMetadata; - $jsonArray = []; foreach ($jsonArrayMetadata as $jsonElement) { + if ($jsonElement->getType() == JsonObjectExtractor::JSON_OBJECT_OBJ_NAME) { + $jsonArray[$jsonElement->getValue()] = + $this->convertJsonArray($entityObject, $jsonElement->getNestedMetadata()); + } + $jsonElementType = $jsonElement->getValue(); if (in_array($jsonElementType, ApiExecutor::PRIMITIVE_TYPES)) { @@ -167,15 +171,7 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) $entityNamesOfType = $entityObject->getLinkedEntitiesOfType($jsonElementType); foreach ($entityNamesOfType as $entityName) { - // If this entity's name exists in the dependentEntities (Test-defined data), use that. - // Else go to the DataManager and try and get the entity from the overall repository of data. - if (array_key_exists($entityName, $this->dependentEntities)) { - $linkedEntityObj = $this->dependentEntities[$entityName]; - } else { - $linkedEntityObj = DataObjectHandler::getInstance()->getObject($entityName); - } - - $jsonDataSubArray = self::getJsonDataArray($linkedEntityObj); + $jsonDataSubArray = $this->resolveNonPrimitiveElement($entityName, $jsonElement); if ($jsonElement->getType() == 'array') { $jsonArray[$jsonElement->getKey()][] = $jsonDataSubArray; @@ -189,6 +185,52 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) return $jsonArray; } + /** + * Resolves JsonObjects and pre-defined metadata (in other operation.xml file) referenced by the json metadata + * + * @param string $entityName + * @param JsonElement $jsonElement + * @return array + */ + private function resolveNonPrimitiveElement($entityName, $jsonElement) + { + $linkedEntityObj = $this->resolveLinkedEntityObject($entityName); + + if (!empty($jsonElement->getNestedJsonElement($jsonElement->getValue())) + && $jsonElement->getType() == 'array') { + $jsonSubArray = $this->convertJsonArray( + $linkedEntityObj, + [$jsonElement->getNestedJsonElement($jsonElement->getValue())] + ); + + return $jsonSubArray[$jsonElement->getValue()]; + } + + $jsonMetadata = JsonDefinitionObjectHandler::getInstance()->getJsonDefinition( + $this->operation, + $linkedEntityObj->getType() + )->getJsonMetadata(); + + return $this->convertJsonArray($linkedEntityObj, $jsonMetadata); + } + + + /** + * Method to wrap entity resolution, checks locally defined dependent entities first + * + * @param string $entityName + * @return EntityDataObject + */ + private function resolveLinkedEntityObject($entityName) + { + // check our dependent entity list to see if we have this defined + if (array_key_exists($entityName, $this->dependentEntities)) { + return $this->dependentEntities[$entityName]; + } + + return DataObjectHandler::getInstance()->getObject($entityName); + } + /** * This function retrieves an array representative of json body for a request and returns it encoded as a string. * @@ -196,9 +238,9 @@ private function getJsonDataArray($entityObject, $jsonDefMetadata = null) */ public function getEncodedJsonString() { - $jsonArray = $this->getJsonDataArray($this->entityObject, $this->jsonDefinition->getJsonMetadata()); + $jsonMetadataArray = $this->convertJsonArray($this->entityObject, $this->jsonDefinition->getJsonMetadata()); - return json_encode([$this->entityObject->getType() => $jsonArray], JSON_PRETTY_PRINT); + return json_encode($jsonMetadataArray, JSON_PRETTY_PRINT); } // @codingStandardsIgnoreStart diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/JsonDefinitionObjectHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/JsonDefinitionObjectHandler.php index 3d993f53b..edca69b06 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/JsonDefinitionObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/JsonDefinitionObjectHandler.php @@ -1,10 +1,14 @@ jsonDefExtractor = new JsonObjectExtractor(); } /** @@ -135,6 +150,15 @@ private function initJsonDefinitions() } } + // extract relevant jsonObjects as JsonElements + if (array_key_exists(JsonDefinitionObjectHandler::ENTITY_OPERATION_JSON_OBJECT, $jsonDefArray)) { + foreach ($jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_JSON_OBJECT] as $jsonObjectArray) { + $jsonMetadata[] = $this->jsonDefExtractor->extractJsonObject($jsonObjectArray); + } + } + + //handle loose entries + if (array_key_exists(JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY, $jsonDefArray)) { foreach ($jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY] as $jsonEntryType) { $jsonMetadata[] = new JsonElement( @@ -147,10 +171,28 @@ private function initJsonDefinitions() if (array_key_exists(JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY, $jsonDefArray)) { foreach ($jsonDefArray[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY] as $jsonEntryType) { + $jsonSubMetadata = []; + $value = null; + $type = null; + + if (array_key_exists('jsonObject', $jsonEntryType)) { + $jsonNestedElement = $this->jsonDefExtractor->extractJsonObject( + $jsonEntryType['jsonObject'][0] + ); + $jsonSubMetadata[$jsonNestedElement->getKey()] = $jsonNestedElement; + $value = $jsonNestedElement->getValue(); + $type = $jsonNestedElement->getKey(); + } else { + $value = $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_VALUE][0] + [JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_VALUE]; + $type = [JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_VALUE]; + } + $jsonMetadata[] = new JsonElement( $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_KEY], - $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_VALUE], - JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY + $value, + $type, + $jsonSubMetadata ); } } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index 5330a2d3e..e9390a5b0 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -114,7 +114,7 @@ public function getDataByName($dataName) { $name = strtolower($dataName); - if (!is_null($this->data) && array_key_exists($name, $this->data)) { + if ($this->data != null && array_key_exists($name, $this->data)) { return $this->data[$name]; } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php index 10ebc6e22..3f96c892f 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/JsonElement.php @@ -29,17 +29,35 @@ class JsonElement */ private $type; + /** + * Nested Json Objects defined within the same operation.xml file + * + * @var array + */ + private $nestedElements = []; + + /** + * Nested Metadata which must be included for a jsonElement of type jsonObject + * + * @var array|null + */ + private $nestedMetadata = []; + /** * JsonElement constructor. * @param string $key * @param string $value * @param string $type + * @param array $nestedElements + * @param array $nestedMetadata */ - public function __construct($key, $value, $type) + public function __construct($key, $value, $type, $nestedElements = [], $nestedMetadata = null) { $this->key = $key; $this->value = $value; $this->type = $type; + $this->nestedElements = $nestedElements; + $this->nestedMetadata = $nestedMetadata; } /** @@ -71,4 +89,29 @@ public function getType() { return $this->type; } + + /** + * Returns the nested json element based on the type of entity passed + * + * @param string $type + * @return array + */ + public function getNestedJsonElement($type) + { + if (array_key_exists($type, $this->nestedElements)) { + return $this->nestedElements[$type]; + } + + return []; + } + + /** + * Returns relevant nested json metadata for a json element which is a json object + * + * @return array|null + */ + public function getNestedMetadata() + { + return $this->nestedMetadata; + } } diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Util/JsonObjectExtractor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Util/JsonObjectExtractor.php new file mode 100644 index 000000000..eb8e0df79 --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Util/JsonObjectExtractor.php @@ -0,0 +1,129 @@ +extractJsonEntries($jsonMetadata, $jsonObjectArray[JsonObjectExtractor::JSON_OBJECT_ENTRY]); + } + + // extract nested arrays + if (array_key_exists(JsonObjectExtractor::JSON_OBJECT_ARRAY, $jsonObjectArray)) { + $this->extractJsonArrays($jsonMetadata, $jsonObjectArray[JsonObjectExtractor::JSON_OBJECT_ARRAY]); + } + + // extract nested + if (array_key_exists(JsonObjectExtractor::JSON_OBJECT_OBJ_NAME, $jsonObjectArray)) { + foreach ($jsonObjectArray[JsonObjectExtractor::JSON_OBJECT_OBJ_NAME] as $jsonObject) { + $nestedJsonElement = $this->extractJsonObject($jsonObject); + $nestedJsonElements[$nestedJsonElement->getKey()] = $nestedJsonElement; + } + } + + // a jsonObject specified in xml must contain corresponding metadata for the object + if (empty($jsonMetadata)) { + throw new \Exception("must specificy jsonObject metadata if declaration is used"); + } + + return new JsonElement( + $jsonDefKey, + $dataType, + JsonObjectExtractor::JSON_OBJECT_OBJ_NAME, + $nestedJsonElements, + $jsonMetadata + ); + } + + /** + * Creates and Adds relevant JsonElements from json entries defined within jsonObject array + * + * @param array &$jsonMetadata + * @param array $jsonEntryArray + * @return void + */ + private function extractJsonEntries(&$jsonMetadata, $jsonEntryArray) + { + foreach ($jsonEntryArray as $jsonEntryType) { + $jsonMetadata[] = new JsonElement( + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY_KEY], + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY_VALUE], + JsonDefinitionObjectHandler::ENTITY_OPERATION_ENTRY + ); + } + } + + /** + * Creates and Adds relevant JsonElements from json arrays defined within jsonObject array + * + * @param array &$jsonArrayData + * @param array $jsonArrayArray + * @return void + */ + private function extractJsonArrays(&$jsonArrayData, $jsonArrayArray) + { + foreach ($jsonArrayArray as $jsonEntryType) { + $jsonElementValue = + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_VALUE][0] + [JsonObjectExtractor::JSON_OBJECT_ARRAY_VALUE] ?? null; + + $nestedJsonElements = []; + if (array_key_exists(JsonObjectExtractor::JSON_OBJECT_OBJ_NAME, $jsonEntryType)) { + //add the key to reference this object later + $jsonObjectKeyedArray = $jsonEntryType[JsonObjectExtractor::JSON_OBJECT_OBJ_NAME][0]; + $jsonObjectKeyedArray[JsonObjectExtractor::JSON_OBJECT_KEY] = + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_KEY]; + $jsonElement = $this->extractJsonObject($jsonObjectKeyedArray); + $jsonElementValue = $jsonElement->getValue(); + $nestedJsonElements[$jsonElement->getValue()] = $jsonElement; + } + $jsonArrayData[] = new JsonElement( + $jsonEntryType[JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY_KEY], + $jsonElementValue, + JsonDefinitionObjectHandler::ENTITY_OPERATION_ARRAY, + $nestedJsonElements + ); + } + } +} diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd index 7bf8aae5a..52e144f22 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd @@ -5,46 +5,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + @@ -57,6 +23,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 17deebed314035a5e9742101a77b094370717ea2 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Mon, 28 Aug 2017 14:30:21 -0500 Subject: [PATCH 136/149] fixes for codesniffer failures --- .../DataGenerator/Api/ApiExecutor.php | 1 - .../AcceptanceTestFramework/Test/Objects/ActionObject.php | 2 ++ src/Magento/AcceptanceTestFramework/Util/TestGenerator.php | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index ac7ca9741..4d5bb8635 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -214,7 +214,6 @@ private function resolveNonPrimitiveElement($entityName, $jsonElement) return $this->convertJsonArray($linkedEntityObj, $jsonMetadata); } - /** * Method to wrap entity resolution, checks locally defined dependent entities first * diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 25209f2b1..714603c10 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -311,6 +311,8 @@ private function findAndReplaceReferences($objectHandler, $inputString) } /** + * Method which resolves data references requiring uniqueness for test idempotentcy + * * @param string $reference * @param EntityDataObject $entityDataObject * @param string $entityKey diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 435ba2428..803cc9ef8 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -1375,8 +1375,10 @@ private function generateTestAnnotationsPhp($testAnnotationsObject) } $testAnnotationsPhp .= sprintf( - "\t * @Parameter(name = \"%s\", value=\"$%s\")\n", - "AcceptanceTester", "I" + "\t * @Parameter(name = \"%s\", + value=\"$%s\")\n", + "AcceptanceTester", + "I" ); foreach ($testAnnotationsObject as $annotationType => $annotationName) { From c2e9f39b0a32f35376d5b6dd202e74ac37fd5845 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Wed, 30 Aug 2017 22:48:09 -0500 Subject: [PATCH 137/149] MQE-70: [Test Creation] Place an Order via Guest Checkout - Via the Storefront --- .../Test/Objects/ActionObject.php | 16 ++++++++++++++-- .../Util/ApiClientUtil.php | 17 ++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 714603c10..99eb435e7 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -22,7 +22,7 @@ class ActionObject const MERGE_ACTION_ORDER_AFTER = 'after'; const ACTION_ATTRIBUTE_URL = 'url'; const ACTION_ATTRIBUTE_SELECTOR = 'selector'; - const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w.]+}}/'; + const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w.\[\]]+}}/'; /** * The unique identifier for the action @@ -292,8 +292,20 @@ private function findAndReplaceReferences($objectHandler, $inputString) break; case (get_class($obj) == EntityDataObject::class): list(,$objField) = $this->stripAndSplitReference($match); - $replacement = $obj->getDataByName($objField); + + if (strpos($objField, '[') == true) { + // Access ... + $parts = explode('[', $objField); + $name = $parts[0]; + $index = str_replace(']', '', $parts[1]); + $replacement = $obj->getDataByName($name)[$index]; + } else { + // Access + $replacement = $obj->getDataByName($objField); + } + $replacement = $this->resolveEntityDataUniquenessReference($replacement, $obj, $objField); + break; } diff --git a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php index 7a6a56109..53a03f650 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php +++ b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php @@ -81,7 +81,22 @@ public function submit($verbose = false) CURLOPT_URL => HOSTNAME . ':' . PORT . $this->apiPath ]); - $response = curl_exec($this->curl); + try { + $response = curl_exec($this->curl); + if ($response === false) { + throw new \Exception(curl_error($this->curl), curl_errno($this->curl)); + } + } catch (\Exception $e) { + trigger_error( + sprintf( + 'Curl failed with error #%d: %s', + $e->getCode(), + $e->getMessage() + ), + E_USER_ERROR + ); + } + curl_close($this->curl); return $response; From e6f34471bd7c291bcdeb81a7e34fef27f3abb294 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 31 Aug 2017 14:25:18 -0500 Subject: [PATCH 138/149] MQE-317: Make rest api server host and port environment variables optional. --- .../Util/ApiClientUtil.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php index 7a6a56109..5388c327c 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php +++ b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php @@ -68,17 +68,31 @@ public function __construct($apiPath, $headers, $apiOperation, $jsonBody) */ public function submit($verbose = false) { + $url = null; + if ($this->jsonBody) { curl_setopt($this->curl, CURLOPT_POSTFIELDS, $this->jsonBody); } curl_setopt($this->curl, CURLOPT_VERBOSE, $verbose); + if ((getenv('MAGENTO_RESTAPI_SERVER_HOST') !== false) + && (getenv('MAGENTO_RESTAPI_SERVER_HOST') !== '') ) { + $url = getenv('MAGENTO_RESTAPI_SERVER_HOST'); + } else { + $url = getenv('MAGENTO_BASE_URL'); + } + + if ((getenv('MAGENTO_RESTAPI_SERVER_PORT') !== false) + && (getenv('MAGENTO_RESTAPI_SERVER_PORT') !== '')) { + $url .= ':' . getenv('MAGENTO_RESTAPI_SERVER_PORT'); + } + curl_setopt_array($this->curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_HTTPHEADER => $this->headers, CURLOPT_CUSTOMREQUEST => $this->apiOperation, - CURLOPT_URL => HOSTNAME . ':' . PORT . $this->apiPath + CURLOPT_URL => $url . $this->apiPath ]); $response = curl_exec($this->curl); From 7987f639eb2c83119397141a5dd7a39b67f69ce0 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 31 Aug 2017 11:22:44 -0500 Subject: [PATCH 139/149] MQE-306: Refactor test generator. --- .../Util/TestGenerator.php | 1074 ++++++----------- 1 file changed, 341 insertions(+), 733 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 803cc9ef8..cfc6b0784 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -147,10 +147,9 @@ private function assembleAllCestPhp() * Creates a PHP string for the necessary Allure and AcceptanceTester use statements. * Since we don't support other dependencies at this time, this function takes no parameter. * - * @param \Magento\AcceptanceTestFramework\Test\Objects\CestObject $cestObject * @return string */ - private function generateUseStatementsPhp($cestObject) + private function generateUseStatementsPhp() { $useStatementsPhp = "use Magento\AcceptanceTestFramework\AcceptanceTester;\n"; @@ -272,8 +271,9 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $actor = "I"; $actionName = $steps->getType(); $customActionAttributes = $steps->getCustomActionAttributes(); - $key = $steps->getMergeKey(); $selector = null; + $selector1 = null; + $selector2 = null; $input = null; $parameterArray = null; $returnVariable = null; @@ -283,57 +283,58 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $url = null; $function = null; $time = null; + $locale = null; + $username = null; + $password = null; + $width = null; + $height = null; + $requiredAction = null; + $value = null; + $button = null; + $parameter = null; if (isset($customActionAttributes['returnVariable'])) { $returnVariable = $customActionAttributes['returnVariable']; } if (isset($customActionAttributes['variable'])) { - $input = sprintf("$%s", $customActionAttributes['variable']); - } elseif (isset($customActionAttributes['url']) && isset($customActionAttributes['userInput'])) { - $input = sprintf("\"%s\"", $customActionAttributes['userInput']); + $input = $this->addDollarSign($customActionAttributes['variable']); + } elseif (isset($customActionAttributes['userInput']) && isset($customActionAttributes['url'])) { + $input = $this->addUniquenessFunctionCall($customActionAttributes['userInput']); + $url = $this->addUniquenessFunctionCall($customActionAttributes['url']); } elseif (isset($customActionAttributes['userInput'])) { - preg_match( - '/' . DataObjectHandler::UNIQUENESS_FUNCTION .'\("[\w]+.[\w]+"\)/', - $customActionAttributes['userInput'], - $matches - ); - if (!empty($matches)) { - $parts = preg_split( - '/' . DataObjectHandler::UNIQUENESS_FUNCTION . '\("[\w]+.[\w]+"\)/', - $customActionAttributes['userInput'], - -1 - ); - foreach ($parts as $part) { - if (!$part) { - if (!empty($input)) { - $input .= '.'; - } - $input .= $matches[0]; - } else { - if (!empty($input)) { - $input .= '.'; - } - $input .= sprintf("\"%s\"", $part); - } - } - } else { - $input = sprintf("\"%s\"", $customActionAttributes['userInput']); - } + $input = $this->addUniquenessFunctionCall($customActionAttributes['userInput']); } elseif (isset($customActionAttributes['url'])) { - $input = sprintf("\"%s\"", $customActionAttributes['url']); - } elseif (isset($customActionAttributes['time'])) { - $input = sprintf("\"%s\"", $customActionAttributes['time']); + $input = $this->addUniquenessFunctionCall($customActionAttributes['url']); + } + + if (isset($customActionAttributes['time'])) { + $time = $customActionAttributes['time']; + } + + if (isset($customActionAttributes['timeout'])) { + $time = $customActionAttributes['timeout']; } if (isset($customActionAttributes['parameterArray'])) { $parameterArray = $customActionAttributes['parameterArray']; } + if (isset($customActionAttributes['requiredAction'])) { + $requiredAction = $customActionAttributes['requiredAction']; + } if (isset($customActionAttributes['selectorArray'])) { - $selector = sprintf("%s", $customActionAttributes['selectorArray']); + $selector = $customActionAttributes['selectorArray']; } elseif (isset($customActionAttributes['selector'])) { - $selector = sprintf("\"%s\"", $customActionAttributes['selector']); + $selector = $this->wrapWithSingleQuotes($customActionAttributes['selector']); + } + + if (isset($customActionAttributes['selector1'])) { + $selector1 = $this->wrapWithSingleQuotes($customActionAttributes['selector1']); + } + + if (isset($customActionAttributes['selector2'])) { + $selector2 = $this->wrapWithSingleQuotes($customActionAttributes['selector2']); } if (isset($customActionAttributes['x'])) { @@ -352,65 +353,39 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $html = $customActionAttributes['html']; } - if (isset($customActionAttributes['time'])) { - $time = $customActionAttributes['time']; - } elseif (isset($customActionAttributes['timeout'])) { - $time = $customActionAttributes['timeout']; + if (isset($customActionAttributes['locale'])) { + $locale = $this->wrapWithSingleQuotes($customActionAttributes['locale']); + } + + if (isset($customActionAttributes['username'])) { + $username = $this->wrapWithSingleQuotes($customActionAttributes['username']); + } + + if (isset($customActionAttributes['password'])) { + $password = $this->wrapWithSingleQuotes($customActionAttributes['password']); + } + + if (isset($customActionAttributes['width'])) { + $width = $customActionAttributes['width']; + } + + if (isset($customActionAttributes['height'])) { + $height = $customActionAttributes['height']; + } + + if (isset($customActionAttributes['value'])) { + $value = $this->wrapWithSingleQuotes($customActionAttributes['value']); + } + + if (isset($customActionAttributes['button'])) { + $button = $this->wrapWithSingleQuotes($customActionAttributes['button']); + } + + if (isset($customActionAttributes['parameter'])) { + $parameter = $this->wrapWithSingleQuotes($customActionAttributes['parameter']); } switch ($actionName) { - case "amOnPage": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "amOnSubdomain": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "amOnUrl": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "appendField": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "attachFile": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "click": - if ($input && $selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); - } elseif ($input && !$selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } elseif (!$input && $selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "clickWithLeftButton": - if ($selector) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s, %s);\n", - $actor, - $actionName, - $selector, - $x, - $y - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); - } - break; - case "clickWithRightButton": - if ($selector) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s, %s);\n", - $actor, - $actionName, - $selector, - $x, - $y - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); - } - break; case "createData": $entity = $customActionAttributes['entity']; $key = $steps->getMergeKey(); @@ -494,111 +469,6 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $testSteps .= sprintf("\t\t$%s->deleteEntity();\n", $key); } break; - case "dontSee": - if ($selector) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "dontSeeCookie": - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $input, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "dontSeeCurrentUrlEquals": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "dontSeeCurrentUrlMatches": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "dontSeeElement": - if ($parameterArray) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "dontSeeElementInDOM": - if ($parameterArray) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "dontSeeInCurrentUrl": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "dontSeeInField": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "dontSeeInFormFields": - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $parameterArray - ); - break; - case "dontSeeInTitle": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "dontSeeInPageSource": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "dontSeeInSource": - // TODO: Solve the HTML parsing issue. - $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $html); - break; - case "dontSeeLink": - if (isset($customActionAttributes['url'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\");\n", - $actor, - $actionName, - $input, - $customActionAttributes['url'] - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "dontSeeOptionIsSelected": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "dragAndDrop": - $testSteps .= sprintf( - "\t\t$%s->%s(\"%s\", \"%s\");\n", - $actor, - $actionName, - $customActionAttributes['selector1'], - $customActionAttributes['selector2'] - ); - break; - case "executeInSelenium": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $function); - break; case "entity": $entityData = "["; foreach ($stepsData[$customActionAttributes['name']] as $dataKey => $dataValue) { @@ -624,586 +494,197 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) ); } break; - case "executeJS": - $testSteps .= sprintf("\t\t$%s->%s(\"%s\");\n", $actor, $actionName, $function); - break; - case "fillField": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "formatMoney": - if (isset($customActionAttributes['locale'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\");\n", - $actor, - $actionName, - $input, - $customActionAttributes['locale'] - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "grabCookie": - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s, %s);\n", - $returnVariable, - $actor, - $actionName, - $input, - $parameterArray - ); - } else { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $input - ); - } - break; - case "grabAttributeFrom": - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s, %s);\n", - $returnVariable, - $actor, - $actionName, - $selector, - $input - ); - break; - case "grabFromCurrentUrl": - if ($input) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $input - ); - } else { - $testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName); - } - break; - case "grabMultiple": - if ($input) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s, %s);\n", - $returnVariable, - $actor, - $actionName, - $selector, - $input - ); - } else { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $selector - ); - } - break; - case "grabValueFrom": - if (isset($returnVariable)) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $selector - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - break; - case "loadSessionSnapshot": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "loginAsAdmin": - if (isset($customActionAttributes['username']) && isset($customActionAttributes['password'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(\"%s\", \"%s\");\n", - $actor, - $actionName, - $customActionAttributes['username'], - $customActionAttributes['password'] - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } - break; - case "moveMouseOver": - if ($selector) { - if (isset($step['x']) || isset($step['y'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s, %s);\n", - $actor, - $actionName, - $selector, - $x, - $y - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - } else { - $testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y); - } - break; - case "mSetLocale": - if (isset($customActionAttributes['locale'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\");\n", - $actor, - $actionName, - $input, - $customActionAttributes['locale'] - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "performOn": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $function); - break; - case "pressKey": - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - } - break; - case "resetCookie": - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $input, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "resizeWindow": - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $customActionAttributes['width'], - $customActionAttributes['height'] - ); - break; + case "dontSeeCurrentUrlEquals": + case "dontSeeCurrentUrlMatches": + case "seeInPopup": case "saveSessionSnapshot": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "scrollTo": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y); - break; - case "searchAndMultiSelectOption": - if (isset($customActionAttributes['requiredAction'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s, %s);\n", - $actor, - $actionName, - $selector, - $customActionAttributes['parameterArray'], - $customActionAttributes['requiredAction'] - ); - } elseif (isset($customActionAttributes['parameterArray'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $customActionAttributes['parameterArray'] - ); - } else { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, [%s]);\n", - $actor, - $actionName, - $selector, - $input - ); - } - break; - case "see": - if (isset($customActionAttributes['selector'])) { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $selector); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; - case "seeCookie": - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $input, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } - break; case "seeCurrentUrlEquals": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; case "seeCurrentUrlMatches": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + case "seeInTitle": + case "seeInCurrentUrl": + case "switchToIFrame": + case "switchToWindow": + case "typeInPopup": + case "dontSee": + case "see": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $input, $selector); break; - case "seeElement": - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } + case "switchToNextTab": + case "switchToPreviousTab": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $this->stripWrappedQuotes($input)); break; - case "seeElementInDOM": - if (isset($parameterArray)) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); + case "clickWithLeftButton": + case "clickWithRightButton": + case "moveMouseOver": + case "scrollTo": + if (!$selector) { + $selector = 'null'; } + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $x, $y); break; - case "seeInCurrentUrl": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - break; - case "seeInField": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + case "dontSeeCookie": + case "resetCookie": + case "seeCookie": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $input, $parameterArray); break; - case "seeInFormFields": - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", + case "grabCookie": + $testSteps .= $this->wrapFunctionCallWithReturnValue( + $returnVariable, $actor, $actionName, - $selector, + $input, $parameterArray ); break; - case "seeInPageSource": - // TODO: Solve the HTML parsing issue. + case "dontSeeElement": + case "dontSeeElementInDOM": + case "dontSeeInFormFields": + case "seeElement": + case "seeElementInDOM": + case "seeInFormFields": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $parameterArray); break; - case "seeInPopup": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + case "pressKey": + case "selectOption": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input, $parameterArray); break; - case "seeInSource": - // TODO: Solve the HTML parsing issue. + case "submitForm": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $parameterArray, $button); break; - case "seeInTitle": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + case "dragAndDrop": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector1, $selector2); break; - case "seeLink": - if (isset($step['url'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\");\n", - $actor, - $actionName, - $input, - $customActionAttributes['url'] - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } + case "executeInSelenium": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $function); break; - case "seeNumberOfElements": - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", + case "executeJS": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $this->wrapWithSingleQuotes($function)); + break; + case "performOn": + case "waitForElementChange": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $function, $time); + break; + case "waitForJS": + $testSteps .= $this->wrapFunctionCall( $actor, $actionName, - $selector, - $input + $this->wrapWithSingleQuotes($function), + $time ); break; - case "seeOptionIsSelected": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); + case "wait": + case "waitForAjaxLoad": + case "waitForElement": + case "waitForElementVisible": + case "waitForElementNotVisible": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $time); break; - case "selectOption": - if ($parameterArray) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $parameterArray - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - } + case "waitForPageLoad": + case "waitForText": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $input, $time, $selector); break; - case "setCookie": - if ($parameterArray) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\", %s);\n", - $actor, - $actionName, - $input, - $customActionAttributes['value'], - $parameterArray - ); - } else { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\");\n", - $actor, - $actionName, - $input, - $customActionAttributes['value'] - ); - } + case "formatMoney": + case "mSetLocale": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $input, $locale); break; - case "submitForm": - if (isset($step['button'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\", \"%s\");\n", + case "grabAttributeFrom": + case "grabMultiple": + case "grabFromCurrentUrl": + $testSteps .= $this->wrapFunctionCallWithReturnValue( + $returnVariable, + $actor, + $actionName, + $selector, + $input + ); + break; + case "grabValueFrom": + if (isset($returnVariable)) { + $testSteps .= $this->wrapFunctionCallWithReturnValue( + $returnVariable, $actor, $actionName, - $selector, - $parameterArray, - $customActionAttributes['button'] + $selector ); } else { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\");\n", - $actor, - $actionName, - $selector, - $parameterArray - ); + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector); } break; - case "switchToIFrame": - if ($input) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } + case "loginAsAdmin": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $username, $password); break; - case "switchToPreviousTab": - if ($input) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } + case "resizeWindow": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $width, $height); break; - case "switchToNextTab": - if ($input) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } + case "searchAndMultiSelectOption": + $testSteps .= $this->wrapFunctionCall( + $actor, + $actionName, + $selector, + $input, + $parameterArray, + $requiredAction + ); break; - case "switchToWindow": - if ($input) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } + case "seeLink": + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $input, $url); break; - case "typeInPopup": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input); + case "setCookie": + $testSteps .= $this->wrapFunctionCall( + $actor, + $actionName, + $selector, + $input, + $value, + $parameterArray + ); break; + case "amOnPage": + case "amOnSubdomain": + case "amOnUrl": + case "appendField": + case "attachFile": + case "click": + case "dontSeeInField": + case "dontSeeInCurrentUrl": + case "dontSeeInTitle": + case "dontSeeInPageSource": + case "dontSeeOptionIsSelected": + case "fillField": + case "loadSessionSnapshot": + case "seeInField": + case "seeOptionIsSelected": + case "dontSeeLink": case "unselectOption": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input); - break; - case "wait": - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); - break; - case "waitForAjaxLoad": - if ($input) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } - break; - case "waitForElement": - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $time); + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input); break; - case "waitForElementChange": - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s, %s);\n", + case "seeNumberOfElements": + $testSteps .= $this->wrapFunctionCall( $actor, $actionName, $selector, - $function, - $time + $this->stripWrappedQuotes($input), + $parameterArray ); break; - case "waitForJS": - $testSteps .= sprintf("\t\t$%s->%s(\"%s\", %s);\n", $actor, $actionName, $function, $time); - break; - case "waitForPageLoad": - if ($time) { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $time); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } + case "seeInPageSource": + case "seeInSource": + case "dontSeeInSource": + // TODO: Need to fix xml parser to allow parsing html. + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $html); break; - case "waitForText": - if ($selector) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s, %s);\n", + default: + if ($returnVariable) { + $testSteps .= $this->wrapFunctionCallWithReturnValue( + $returnVariable, $actor, $actionName, + $selector, $input, - $time, - $selector + $parameter ); } else { - $testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $time); - } - break; - default: - if ($returnVariable) { - if ($selector) { - if ($input) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s, %s);\n", - $returnVariable, - $actor, - $actionName, - $selector, - $input - ); - } elseif (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s, \"%s\");\n", - $returnVariable, - $actor, - $actionName, - $selector, - $customActionAttributes['userInput'] - ); - } elseif (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s, %s);\n", - $returnVariable, - $actor, - $actionName, - $selector, - $customActionAttributes['parameter'] - ); - } else { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $selector - ); - } - } else { - if ($input) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $input - ); - } elseif (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(\"%s\");\n", - $returnVariable, - $actor, - $actionName, - $customActionAttributes['userInput'] - ); - } elseif (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s(%s);\n", - $returnVariable, - $actor, - $actionName, - $customActionAttributes['parameter'] - ); - } else { - $testSteps .= sprintf( - "\t\t$%s = $%s->%s();\n", - $returnVariable, - $actor, - $actionName - ); - } - } - } else { - if ($selector) { - if ($input) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $input - ); - } elseif (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, \"%s\");\n", - $actor, - $actionName, - $selector, - $customActionAttributes['userInput'] - ); - } elseif (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s, %s);\n", - $actor, - $actionName, - $selector, - $customActionAttributes['parameter'] - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector); - } - } else { - if ($input) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s);\n", - $actor, - $actionName, - $input - ); - } elseif (isset($customActionAttributes['userInput'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(\"%s\");\n", - $actor, - $actionName, - $customActionAttributes['userInput'] - ); - } elseif (isset($customActionAttributes['parameter'])) { - $testSteps .= sprintf( - "\t\t$%s->%s(%s);\n", - $actor, - $actionName, - $customActionAttributes['parameter'] - ); - } else { - $testSteps .= sprintf("\t\t$%s->%s();\n", $actor, $actionName); - } - } + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input, $parameter); } } } @@ -1221,7 +702,7 @@ private function resolveTestVariable($inputString) $outputString = $inputString; $replaced = false; - // Chesk for Cest-scope variables first, stricter regex match. + // Check for Cest-scope variables first, stricter regex match. preg_match_all("/\\$\\$[\w.]+\\$\\$/", $outputString, $matches); if (!empty($matches)) { foreach ($matches[0] as $match) { @@ -1375,8 +856,7 @@ private function generateTestAnnotationsPhp($testAnnotationsObject) } $testAnnotationsPhp .= sprintf( - "\t * @Parameter(name = \"%s\", - value=\"$%s\")\n", + "\t * @Parameter(name = \"%s\", value=\"$%s\")\n", "AcceptanceTester", "I" ); @@ -1432,4 +912,132 @@ private function generateTestsPhp($testsObject) return $testPhp; } + + /** + * Add uniqueness function call to input string based on regex pattern. + * + * @param string $input + * @return string + */ + private function addUniquenessFunctionCall($input) + { + $output = ''; + + preg_match('/' . DataObjectHandler::UNIQUENESS_FUNCTION .'\("[\w]+.[\w]+"\)/', $input, $matches); + if (!empty($matches)) { + $parts = preg_split('/' . DataObjectHandler::UNIQUENESS_FUNCTION . '\("[\w]+.[\w]+"\)/', $input, -1); + foreach ($parts as $part) { + if (!$part) { + if (!empty($output)) { + $output .= '.'; + } + $output .= $matches[0]; + } else { + if (!empty($output)) { + $output .= '.'; + } + $output .= sprintf("\"%s\"", $part); + } + } + } else { + $output = $this->wrapWithSingleQuotes($input); + } + + return $output; + } + + /** + * Wrap input string with single quotes. + * + * @param string $input + * @return string + */ + private function wrapWithSingleQuotes($input) + { + $input = str_replace("'", '"', $input); + return sprintf("'%s'", $input); + } + + /** + * Strip beginning and ending quotes of input string. + * + * @param string $input + * @return string + */ + private function stripWrappedQuotes($input) + { + if (substr($input, 0, 1) === '"' || substr($input, 0, 1) === "'") { + $input = substr($input, 1); + } + if (substr($input, -1, 1) === '"' || substr($input, -1, 1) === "'") { + $input = substr($input, 0, -1); + } + return $input; + } + + /** + * Add dollar sign at the beginning of input string. + * + * @param string $input + * @return string + */ + private function addDollarSign($input) + { + return sprintf("$%s", $input); + } + + // @codingStandardsIgnoreStart + /** + * Wrap parameters into a function call. + * + * @param string $actor + * @param string $action + * @param array ...$args + * @return string + */ + private function wrapFunctionCall($actor, $action, ...$args) + { + $isFirst = true; + $output = sprintf("\t\t$%s->%s(", $actor, $action); + for ($i = 0; $i < count($args); $i++) { + if (null === $args[$i]) { + continue; + } + if (!$isFirst) { + $output .= ', '; + } + $output .= $args[$i]; + $isFirst = false; + } + $output .= ");\n"; + return $output; + } + + /** + * Wrap parameters into a function call with a return value. + * + * @param string $returnVariable + * @param string $actor + * @param string $action + * @param array ...$args + * @return string + */ + private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $action, ...$args) + { + $isFirst = true; + $output = sprintf("\t\t$%s = $%s->%s(", $returnVariable, $actor, $action); + for ($i = 0; $i < count($args); $i++) { + if (null === $args[$i]) { + continue; + } + if (!$isFirst) { + $output .= ', '; + } + $output .= $args[$i]; + $isFirst = false; + } + $output .= ");\n"; + return $output; + } + // @codingStandardsIgnoreEnd } From 9ccd984d51bdb0cc19bbe276983a1042544fb09e Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 5 Sep 2017 11:07:53 -0500 Subject: [PATCH 140/149] MQE-260: ApiExecutor - Logging/Error detection for failed API Calls --- .../Util/ApiClientUtil.php | 27 +++++++++---------- .../Util/TestGenerator.php | 12 +++++++++ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php index 6c167ea22..523f2cc0e 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php +++ b/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php @@ -43,6 +43,13 @@ class ApiClientUtil */ private $jsonBody; + /** + * A list of successful HTTP responses that will not trigger an exception + * + * @var int[] SUCCESSFUL_HTTP_CODES + */ + const SUCCESSFUL_HTTP_CODES = [200, 201, 202, 203, 204, 205]; + /** * ApiClientUtil constructor. * @param string $apiPath @@ -65,6 +72,7 @@ public function __construct($apiPath, $headers, $apiOperation, $jsonBody) * * @param bool $verbose * @return string|bool + * @throws \Exception */ public function submit($verbose = false) { @@ -95,20 +103,11 @@ public function submit($verbose = false) CURLOPT_URL => $url . $this->apiPath ]); - try { - $response = curl_exec($this->curl); - if ($response === false) { - throw new \Exception(curl_error($this->curl), curl_errno($this->curl)); - } - } catch (\Exception $e) { - trigger_error( - sprintf( - 'Curl failed with error #%d: %s', - $e->getCode(), - $e->getMessage() - ), - E_USER_ERROR - ); + $response = curl_exec($this->curl); + $http_code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE); + + if ($response === false || !in_array($http_code, ApiClientUtil::SUCCESSFUL_HTTP_CODES)) { + throw new \Exception('API returned response code: ' . $http_code . ' Response:' . $response); } curl_close($this->curl); diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index cfc6b0784..4b45dc544 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -389,6 +389,12 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) case "createData": $entity = $customActionAttributes['entity']; $key = $steps->getMergeKey(); + //Add an informative statement to help the user debug test runs + $testSteps .= sprintf( + "\t\t$%s->amGoingTo(\"create entity that has the mergeKey: %s\");\n", + $actor, + $key + ); //Get Entity from Static data. $testSteps .= sprintf( "\t\t$%s = DataObjectHandler::getInstance()->getObject(\"%s\");\n", @@ -462,6 +468,12 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) break; case "deleteData": $key = $customActionAttributes['createDataKey']; + //Add an informative statement to help the user debug test runs + $testSteps .= sprintf( + "\t\t$%s->amGoingTo(\"delete entity that has the createDataKey: %s\");\n", + $actor, + $key + ); if ($hookObject) { $testSteps .= sprintf("\t\t\$this->%s->deleteEntity();\n", $key); From a11f49ddc2192f285549ec531ee6a805a6c3591b Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 6 Sep 2017 16:14:01 -0500 Subject: [PATCH 141/149] MQE-293 [Customizability] Implement "parameterized" tag for page url and section element --- .../Page/Handlers/PageObjectHandler.php | 4 +- .../Page/Handlers/SectionObjectHandler.php | 5 +- .../Page/Objects/ElementObject.php | 22 ++++- .../Page/Objects/PageObject.php | 22 ++++- .../Page/etc/PageObject.xsd | 8 +- .../Page/etc/SectionObject.xsd | 1 + .../Test/Objects/ActionObject.php | 88 +++++++++++++++++-- .../Util/TestGenerator.php | 85 ++++++++++++------ 8 files changed, 194 insertions(+), 41 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php b/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php index 1d3dd4ac6..bb547f12a 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php @@ -20,6 +20,7 @@ class PageObjectHandler implements ObjectHandlerInterface const SUB_TYPE = 'section'; const URL_PATH_ATTR = 'urlPath'; const MODULE_ATTR = 'module'; + const PARAMETERIZED = 'parameterized'; /** * Singleton class variable instance @@ -97,8 +98,9 @@ private function initPageObjects() $urlPath = $pageData[PageObjectHandler::URL_PATH_ATTR]; $module = $pageData[PageObjectHandler::MODULE_ATTR]; $sections = array_keys($pageData[PageObjectHandler::SUB_TYPE]); + $parameterized = $pageData[PageObjectHandler::PARAMETERIZED] ?? false; - $this->pages[$pageName] = new PageObject($pageName, $urlPath, $module, $sections); + $this->pages[$pageName] = new PageObject($pageName, $urlPath, $module, $sections, $parameterized); } } } diff --git a/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php b/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php index bf73ba37a..0dc726fb7 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php @@ -22,6 +22,7 @@ class SectionObjectHandler implements ObjectHandlerInterface const ELEMENT_TYPE_ATTR = 'type'; const ELEMENT_LOCATOR_ATTR = 'locator'; const ELEMENT_TIMEOUT_ATTR = 'timeout'; + const ELEMENT_PARAMETERIZED = 'parameterized'; /** * Singleton variable instance of class @@ -103,12 +104,14 @@ private function initSectionObjects() $elementType = $elementData[SectionObjectHandler::ELEMENT_TYPE_ATTR]; $elementLocator = $elementData[SectionObjectHandler::ELEMENT_LOCATOR_ATTR]; $elementTimeout = $elementData[SectionObjectHandler::ELEMENT_TIMEOUT_ATTR] ?? null; + $elementParameterized = $elementData[SectionObjectHandler::ELEMENT_PARAMETERIZED] ?? false; $elements[$elementName] = new ElementObject( $elementName, $elementType, $elementLocator, - $elementTimeout + $elementTimeout, + $elementParameterized ); } diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php b/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php index c9c6a0b8e..690e37ea3 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php +++ b/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php @@ -40,19 +40,28 @@ class ElementObject */ private $timeout; + /** + * Section element locator is parameterized + * + * @var bool $parameterized + */ + private $parameterized; + /** * ElementObject constructor. * @param string $name * @param string $type * @param string $locator * @param string $timeout + * @param bool $parameterized */ - public function __construct($name, $type, $locator, $timeout) + public function __construct($name, $type, $locator, $timeout, $parameterized) { $this->name = $name; $this->type = $type; $this->locator = $locator; $this->timeout = $timeout; + $this->parameterized = $parameterized; } /** @@ -98,4 +107,15 @@ public function getTimeout() return (int)$this->timeout; } + + /** + * Determines if the element's selector is parameterized. Based on $parameterized property. + * + * @return bool + */ + + public function isParameterized() + { + return $this->parameterized; + } } diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php b/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php index 3be5c5b00..e0e4ded0f 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php +++ b/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php @@ -35,6 +35,13 @@ class PageObject */ private $module; + /** + * Page url is parameterized + * + * @var bool $parameterized + */ + private $parameterized; + /** * Array of page section names * @@ -48,13 +55,15 @@ class PageObject * @param string $urlPath * @param string $module * @param array $sections + * @param bool $parameterized */ - public function __construct($name, $urlPath, $module, $sections) + public function __construct($name, $urlPath, $module, $sections, $parameterized) { $this->name = $name; $this->url = $urlPath; $this->module = $module; $this->sectionNames = $sections; + $this->parameterized = $parameterized; } /** @@ -122,4 +131,15 @@ public function getSection($sectionName) return null; } + + /** + * Determines if the page's url is parameterized. Based on $parameterized property. + * + * @return bool + */ + + public function isParameterized() + { + return $this->parameterized; + } } diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd index d21476d41..aca2a5ee9 100644 --- a/src/Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd +++ b/src/Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd @@ -49,13 +49,6 @@ - - - - Optional variable names separated by "," which are used to substitute %s in urlPath attribute. - - - @@ -63,6 +56,7 @@ + diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd b/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd index 914552e6e..d69706881 100644 --- a/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd +++ b/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd @@ -79,6 +79,7 @@ + diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index 99eb435e7..a24be1844 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -12,6 +12,7 @@ use Magento\AcceptanceTestFramework\Page\Objects\SectionObject; use Magento\AcceptanceTestFramework\Page\Handlers\PageObjectHandler; use Magento\AcceptanceTestFramework\Page\Handlers\SectionObjectHandler; +use Magento\AcceptanceTestFramework\Test\Managers\CestArrayProcessor; /** * Class ActionObject @@ -22,7 +23,9 @@ class ActionObject const MERGE_ACTION_ORDER_AFTER = 'after'; const ACTION_ATTRIBUTE_URL = 'url'; const ACTION_ATTRIBUTE_SELECTOR = 'selector'; + const ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER = '/\(.+\)/'; const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w.\[\]]+}}/'; + const ACTION_ATTRIBUTE_VARIABLE_REGEX_NESTED = '/{{[\w.\[\]()\',${} ]+}}/'; /** * The unique identifier for the action @@ -246,6 +249,7 @@ private function resolveDataInputReferences() /** * Return an array containing the name (before the period) and key (after the period) in a {{reference.foo}}. + * Also truncates variables inside parenthesis. * * @param string $reference * @return string[] The name and key that is referenced. @@ -253,9 +257,31 @@ private function resolveDataInputReferences() private function stripAndSplitReference($reference) { $strippedReference = str_replace('}}', '', str_replace('{{', '', $reference)); + $strippedReference = preg_replace( + ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER, + '', + $strippedReference + ); return explode('.', $strippedReference); } + /** + * Returns an array containing all parameters found inside () block of test input. + * Returns null if no parameters were found. + * + * @param string $reference + * @return array|null + */ + private function stripAndReturnParameters($reference) + { + preg_match(ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER, $reference, $matches); + if (!empty($matches)) { + $strippedReference = str_replace(')', '', str_replace('(', '', $matches[0])); + return explode(',', $strippedReference); + } + return null; + } + /** * Return a string based on a reference to a page, section, or data field (e.g. {{foo.ref}} resolves to 'data') * @@ -266,16 +292,24 @@ private function stripAndSplitReference($reference) */ private function findAndReplaceReferences($objectHandler, $inputString) { - preg_match_all(ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN, $inputString, $matches); + //Determine if there are Parethesis and parameters. If not, use strict regex. If so, use nested regex. + preg_match_all(ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN, $inputString, $variableMatches); + if (!empty($variableMatches[0])) { + $regex = ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN; + } else { + $regex = ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_NESTED; + } + preg_match_all($regex, $inputString, $matches); if (empty($matches[0])) { - return null; + return $inputString; } $outputString = $inputString; foreach ($matches[0] as $match) { $replacement = null; + $parameterized = false; list($objName) = $this->stripAndSplitReference($match); $obj = $objectHandler->getObject($objName); @@ -284,11 +318,12 @@ private function findAndReplaceReferences($objectHandler, $inputString) switch (get_class($obj)) { case PageObject::class: $replacement = $obj->getUrl(); + $parameterized = $obj->isParameterized(); break; case SectionObject::class: list(,$objField) = $this->stripAndSplitReference($match); + $parameterized = $obj->getElement($objField)->isParameterized(); $replacement = $obj->getElement($objField)->getLocator(); - $this->timeout = $obj->getElement($objField)->getTimeout(); break; case (get_class($obj) == EntityDataObject::class): list(,$objField) = $this->stripAndSplitReference($match); @@ -315,10 +350,13 @@ private function findAndReplaceReferences($objectHandler, $inputString) throw new \Exception("Could not resolve entity reference " . $inputString); } + //If Page or Section's Element is has parameterized = true attribute, attempt to do parameter replacement. + if ($parameterized) { + $parameterList = $this->stripAndReturnParameters($match); + $replacement = $this->matchParameterReferences($replacement, $parameterList); + } $outputString = str_replace($match, $replacement, $outputString); - } - return $outputString; } @@ -343,4 +381,44 @@ private function resolveEntityDataUniquenessReference($reference, $entityDataObj } return $reference; } + + /** + * Finds all {{var}} occurrences in reference, and replaces them in sequence with parameters list given. + * Parameter list given is also resolved, attempting to match {{data.field}} references. + * + * @param string $reference + * @param array $parameters + * @return string + * @throws \Exception + */ + private function matchParameterReferences($reference, $parameters) + { + preg_match_all('/{{[\w.]+}}/', $reference, $varMatches); + if (count($varMatches[0]) > count($parameters)) { + throw new \Exception( + "Parameter Resolution Failed: Not enough parameters given for reference " . + $reference . ". Parameters Given: " . implode(",", $parameters) + ); + } elseif (count($varMatches[0]) < count($parameters)) { + throw new \Exception( + "Parameter Resolution Failed: Too many parameters given for reference " . + $reference . ". Parameters Given: " . implode(",", $parameters) + ); + } + + //Attempt to Resolve {{data}} references to actual output. + $resolvedParameters = []; + foreach ($parameters as $parameter) { + $resolvedParameters[] = $this->findAndReplaceReferences( + DataObjectHandler::getInstance(), + $parameter + ); + } + + $resolveIndex = 0; + foreach ($varMatches[0] as $var) { + $reference = str_replace($var, $resolvedParameters[$resolveIndex++], $reference); + } + return $reference; + } } diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 4b45dc544..aa468d196 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -293,6 +293,30 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $button = null; $parameter = null; + //Resolve $input$ and $$input$$ replacement in url, selector, and userInput. + if (isset($customActionAttributes['url'])) { + $customActionAttributes['url'] = $this->resolveTestVariable( + $customActionAttributes['url'], + true + ); + } + + if (isset($customActionAttributes['userInput'])) { + $customActionAttributes['userInput'] = $this->resolveTestVariable( + $customActionAttributes['userInput'], + true + ); + } + + if (isset($customActionAttributes['selector'])) { + $customActionAttributes['selector'] = $this->resolveTestVariable( + $customActionAttributes['selector'], + true + ); + } + + //Resume step building + if (isset($customActionAttributes['returnVariable'])) { $returnVariable = $customActionAttributes['returnVariable']; } @@ -482,10 +506,10 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } break; case "entity": - $entityData = "["; + $entityData = '['; foreach ($stepsData[$customActionAttributes['name']] as $dataKey => $dataValue) { - $variableReplace = $this->resolveTestVariable($dataValue); - $entityData .= sprintf("'%s' => %s, ", $dataKey, $variableReplace); + $variableReplace = $this->resolveTestVariable($dataValue, true); + $entityData .= sprintf("'%s' => '%s', ", $dataKey, $variableReplace); } $entityData .= ']'; if ($hookObject) { @@ -705,42 +729,54 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } /** - * Resolves regex for given inputString. + * Resolves replacement of $input$ and $$input$$ in given string. + * Can be given a boolean to surround replacement with quote breaking. * @param string $inputString + * @param bool $quoteBreak * @return string + * @throws \Exception */ - private function resolveTestVariable($inputString) + private function resolveTestVariable($inputString, $quoteBreak = false) { $outputString = $inputString; $replaced = false; // Check for Cest-scope variables first, stricter regex match. preg_match_all("/\\$\\$[\w.]+\\$\\$/", $outputString, $matches); - if (!empty($matches)) { - foreach ($matches[0] as $match) { - $replacement = null; - $variable = $this->stripAndSplitReference($match, '$$'); - $replacement = sprintf("\$this->%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); - $outputString = str_replace($match, $replacement, $outputString); - $replaced = true; + foreach ($matches[0] as $match) { + $replacement = null; + $variable = $this->stripAndSplitReference($match, '$$'); + if (count($variable) != 2) { + throw new \Exception( + "Invalid Persisted Entity Reference: " . $match . + ". Hook persisted entity references must follow \$\$entityMergeKey.field\$\$ format." + ); } + $replacement = sprintf("\$this->%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); + if ($quoteBreak) { + $replacement = "' . " . $replacement . " . '"; + } + $outputString = str_replace($match, $replacement, $outputString); + $replaced = true; } // Check Test-scope variables preg_match_all("/\\$[\w.]+\\$/", $outputString, $matches); - if (!empty($matches)) { - foreach ($matches[0] as $match) { - $replacement = null; - $variable = $this->stripAndSplitReference($match, '$'); - $replacement = sprintf("$%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); - $outputString = str_replace($match, $replacement, $outputString); - $replaced = true; + foreach ($matches[0] as $match) { + $replacement = null; + $variable = $this->stripAndSplitReference($match, '$'); + if (count($variable) != 2) { + throw new \Exception( + "Invalid Persisted Entity Reference: " . $match . + ". Test persisted entity references must follow \$entityMergeKey.field\$ format." + ); } - } - - // If no replacement was made, assume it is a string literal and append single quotes. - if (!$replaced) { - return "'" . $outputString ."'"; + $replacement = sprintf("$%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); + if ($quoteBreak) { + $replacement = "' . " . $replacement . " . '"; + } + $outputString = str_replace($match, $replacement, $outputString); + $replaced = true; } return $outputString; @@ -966,7 +1002,6 @@ private function addUniquenessFunctionCall($input) */ private function wrapWithSingleQuotes($input) { - $input = str_replace("'", '"', $input); return sprintf("'%s'", $input); } From b1a466571d277a28d72983e7a30a7fb62cacac42 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Thu, 7 Sep 2017 14:09:19 +0300 Subject: [PATCH 142/149] MQE-279: Create repositories in magento organization --- composer.json | 10 +- composer.lock | 243 +++---- dev/tests/static/Magento/ruleset.xml | 4 +- etc/di.xml | 186 +++--- .../ObjectManager/ConfigLoader/Primary.php | 71 -- .../ObjectManagerFactory.php | 120 ---- .../Code/Reader/ClassReader.php | 2 +- .../Code/Reader/ClassReaderInterface.php | 2 +- .../Config/Converter.php | 8 +- .../Config/Converter/Dom/Flat.php | 4 +- .../Config/ConverterInterface.php | 2 +- .../Config/Data.php | 10 +- .../Config/DataInterface.php | 2 +- .../Config/Dom.php | 6 +- .../Config/Dom/ArrayNodeConfig.php | 2 +- .../Config/Dom/NodeMergingConfig.php | 2 +- .../Config/Dom/NodePathMatcher.php | 2 +- .../Config/Dom/ValidationException.php | 2 +- .../Config/FileResolver/Mask.php | 10 +- .../Config/FileResolver/Module.php | 8 +- .../Config/FileResolver/Primary.php | 6 +- .../Config/FileResolverInterface.php | 2 +- .../Config/Reader.php | 6 +- .../Config/Reader/Filesystem.php | 36 +- .../Config/ReaderInterface.php | 2 +- .../Config/ReplacerInterface.php | 2 +- .../Config/SchemaLocator.php | 4 +- .../Config/SchemaLocatorInterface.php | 2 +- .../Config/ValidationState.php | 2 +- .../Config/ValidationStateInterface.php | 2 +- .../Data/Argument/Interpreter/Argument.php | 6 +- .../Data/Argument/Interpreter/ArrayType.php | 4 +- .../Data/Argument/Interpreter/Boolean.php | 6 +- .../Data/Argument/Interpreter/Composite.php | 4 +- .../Data/Argument/Interpreter/Constant.php | 4 +- .../Data/Argument/Interpreter/DataObject.php | 8 +- .../Data/Argument/Interpreter/NullType.php | 4 +- .../Data/Argument/Interpreter/Number.php | 4 +- .../Data/Argument/Interpreter/StringUtils.php | 4 +- .../Data/Argument/InterpreterInterface.php | 2 +- .../Argument/InterpreterInterface/Proxy.php | 20 +- .../Data/etc/types.xsd | 0 .../DataGenerator/Api/ApiExecutor.php | 18 +- .../DataGenerator/Api/EntityApiHandler.php | 14 +- .../Handlers/DataObjectHandler.php | 10 +- .../Handlers/JsonDefinitionObjectHandler.php | 16 +- .../Objects/EntityDataObject.php | 2 +- .../DataGenerator/Objects/JsonDefinition.php | 2 +- .../DataGenerator/Objects/JsonElement.php | 2 +- .../Parsers/DataProfileSchemaParser.php | 4 +- .../Parsers/OperationMetadataParser.php | 4 +- .../Util/JsonObjectExtractor.php | 6 +- .../DataGenerator/etc/dataOperation.xsd | 0 .../DataGenerator/etc/dataProfileSchema.xsd | 0 .../DataGenerator/etc/sample.xml | 0 .../Exceptions/XmlException.php | 2 +- .../Helper/Acceptance.php | 6 +- .../Helper/AdminUrlList.php | 2 +- .../Helper/EntityRESTApiHelper.php | 4 +- .../Helper/MagentoFakerData.php | 2 +- .../Module/MagentoRestDriver.php | 6 +- .../Module/MagentoSequence.php | 4 +- .../Module/MagentoWebDriver.php | 6 +- .../ObjectManager.php | 12 +- .../ObjectManager/Config.php | 4 +- .../ObjectManager/Config/Config.php | 14 +- .../Config/Mapper/ArgumentParser.php | 8 +- .../ObjectManager/Config/Mapper/Dom.php | 8 +- .../ObjectManager/Config/Reader/Dom.php | 24 +- .../Config/Reader/DomFactory.php | 14 +- .../ObjectManager/Config/SchemaLocator.php | 4 +- .../ObjectManager/ConfigInterface.php | 2 +- .../ObjectManager/ConfigLoader/Primary.php | 71 ++ .../ObjectManager/Definition/Runtime.php | 12 +- .../ObjectManager/DefinitionInterface.php | 2 +- .../ObjectManager/Factory.php | 12 +- .../Factory/Dynamic/Developer.php | 28 +- .../ObjectManager/FactoryInterface.php | 2 +- .../ObjectManager/ObjectHandlerInterface.php | 2 +- .../ObjectManager/ObjectManager.php | 8 +- .../ObjectManager/Relations/Runtime.php | 12 +- .../ObjectManager/RelationsInterface.php | 2 +- .../ObjectManager/etc/config.xsd | 0 .../ObjectManagerFactory.php | 120 ++++ .../ObjectManagerInterface.php | 2 +- .../Page/Handlers/PageObjectHandler.php | 12 +- .../Page/Handlers/SectionObjectHandler.php | 14 +- .../Page/Objects/ElementObject.php | 2 +- .../Page/Objects/PageObject.php | 4 +- .../Page/Objects/SectionObject.php | 2 +- .../Page/etc/PageObject.xsd | 0 .../Page/etc/SectionObject.xsd | 0 .../Stdlib/BooleanUtils.php | 2 +- .../Step/Backend/AdminStep.php | 614 +++++++++--------- .../System/Code/ClassReader.php | 2 +- .../Test/Config/Converter/Dom/Flat.php | 6 +- .../Handlers/ActionGroupObjectHandler.php | 14 +- .../Test/Handlers/CestObjectHandler.php | 12 +- .../Test/Objects/ActionGroupObject.php | 6 +- .../Test/Objects/ActionObject.php | 18 +- .../Test/Objects/CestHookObject.php | 2 +- .../Test/Objects/CestObject.php | 2 +- .../Test/Objects/TestObject.php | 6 +- .../Test/Parsers/ActionGroupDataParser.php | 4 +- .../Test/Parsers/TestDataParser.php | 4 +- .../Test/Util/ActionGroupObjectExtractor.php | 4 +- .../Test/Util/ActionMergeUtil.php | 4 +- .../Test/Util/ActionObjectExtractor.php | 6 +- .../Test/Util/AnnotationExtractor.php | 2 +- .../Test/Util/BaseCestObjectExtractor.php | 2 +- .../Test/Util/CestHookObjectExtractor.php | 4 +- .../Test/Util/CestObjectExtractor.php | 4 +- .../Test/Util/TestEntityExtractor.php | 2 +- .../Test/Util/TestObjectExtractor.php | 4 +- .../Test/etc/sampleActions.xml | 0 .../Test/etc/sampleCest.xml | 0 .../Test/etc/testSchema.xsd | 0 .../Util/ApiClientUtil.php | 2 +- .../Util/Iterator/AbstractIterator.php | 2 +- .../Util/Iterator/File.php | 2 +- .../Util/ModuleResolver.php | 8 +- .../Util/ModuleResolver/SequenceSorter.php | 2 +- .../SequenceSorterInterface.php | 2 +- .../Util/TestGenerator.php | 18 +- .../Util/msq.php | 2 +- .../XmlParser/PageParser.php | 8 +- .../XmlParser/ParserInterface.php | 2 +- .../XmlParser/SectionParser.php | 8 +- 128 files changed, 1032 insertions(+), 1081 deletions(-) delete mode 100644 src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php delete mode 100644 src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Code/Reader/ClassReader.php (97%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Code/Reader/ClassReaderInterface.php (92%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Converter.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Converter/Dom/Flat.php (96%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/ConverterInterface.php (85%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Data.php (82%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/DataInterface.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Dom.php (97%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Dom/ArrayNodeConfig.php (97%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Dom/NodeMergingConfig.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Dom/NodePathMatcher.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Dom/ValidationException.php (82%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/FileResolver/Mask.php (87%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/FileResolver/Module.php (83%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/FileResolver/Primary.php (91%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/FileResolverInterface.php (88%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Reader.php (89%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/Reader/Filesystem.php (74%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/ReaderInterface.php (88%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/ReplacerInterface.php (87%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/SchemaLocator.php (87%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/SchemaLocatorInterface.php (89%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/ValidationState.php (93%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Config/ValidationStateInterface.php (85%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/Argument.php (79%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/ArrayType.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/Boolean.php (81%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/Composite.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/Constant.php (79%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/DataObject.php (77%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/NullType.php (72%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/Number.php (80%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/Interpreter/StringUtils.php (82%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/InterpreterInterface.php (89%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/Argument/InterpreterInterface/Proxy.php (67%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Data/etc/types.xsd (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Api/ApiExecutor.php (93%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Api/EntityApiHandler.php (83%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Handlers/DataObjectHandler.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Handlers/JsonDefinitionObjectHandler.php (93%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Objects/EntityDataObject.php (97%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Objects/JsonDefinition.php (98%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Objects/JsonElement.php (97%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Parsers/DataProfileSchemaParser.php (82%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Parsers/OperationMetadataParser.php (82%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/Util/JsonObjectExtractor.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/etc/dataOperation.xsd (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/etc/dataProfileSchema.xsd (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/DataGenerator/etc/sample.xml (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Exceptions/XmlException.php (86%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Helper/Acceptance.php (72%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Helper/AdminUrlList.php (99%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Helper/EntityRESTApiHelper.php (96%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Helper/MagentoFakerData.php (98%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Module/MagentoRestDriver.php (99%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Module/MagentoSequence.php (65%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Module/MagentoWebDriver.php (97%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager.php (84%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Config.php (88%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Config/Config.php (90%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Config/Mapper/ArgumentParser.php (79%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Config/Mapper/Dom.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Config/Reader/Dom.php (59%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Config/Reader/DomFactory.php (58%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Config/SchemaLocator.php (81%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/ConfigInterface.php (94%) create mode 100644 src/Magento/FunctionalTestingFramework/ObjectManager/ConfigLoader/Primary.php rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Definition/Runtime.php (69%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/DefinitionInterface.php (93%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Factory.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Factory/Dynamic/Developer.php (82%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/FactoryInterface.php (88%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/ObjectHandlerInterface.php (91%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/ObjectManager.php (85%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/Relations/Runtime.php (61%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/RelationsInterface.php (88%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManager/etc/config.xsd (100%) create mode 100644 src/Magento/FunctionalTestingFramework/ObjectManagerFactory.php rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/ObjectManagerInterface.php (93%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Page/Handlers/PageObjectHandler.php (84%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Page/Handlers/SectionObjectHandler.php (85%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Page/Objects/ElementObject.php (96%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Page/Objects/PageObject.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Page/Objects/SectionObject.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Page/etc/PageObject.xsd (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Page/etc/SectionObject.xsd (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Stdlib/BooleanUtils.php (96%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Step/Backend/AdminStep.php (58%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/System/Code/ClassReader.php (96%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Config/Converter/Dom/Flat.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Handlers/ActionGroupObjectHandler.php (83%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Handlers/CestObjectHandler.php (83%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Objects/ActionGroupObject.php (92%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Objects/ActionObject.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Objects/CestHookObject.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Objects/CestObject.php (96%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Objects/TestObject.php (93%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Parsers/ActionGroupDataParser.php (83%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Parsers/TestDataParser.php (82%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/ActionGroupObjectExtractor.php (90%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/ActionMergeUtil.php (97%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/ActionObjectExtractor.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/AnnotationExtractor.php (95%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/BaseCestObjectExtractor.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/CestHookObjectExtractor.php (92%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/CestObjectExtractor.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/TestEntityExtractor.php (96%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/Util/TestObjectExtractor.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/etc/sampleActions.xml (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/etc/sampleCest.xml (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Test/etc/testSchema.xsd (100%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Util/ApiClientUtil.php (98%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Util/Iterator/AbstractIterator.php (97%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Util/Iterator/File.php (93%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Util/ModuleResolver.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Util/ModuleResolver/SequenceSorter.php (81%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Util/ModuleResolver/SequenceSorterInterface.php (78%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Util/TestGenerator.php (98%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/Util/msq.php (94%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/XmlParser/PageParser.php (78%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/XmlParser/ParserInterface.php (79%) rename src/Magento/{AcceptanceTestFramework => FunctionalTestingFramework}/XmlParser/SectionParser.php (76%) diff --git a/composer.json b/composer.json index 97a5de943..f8b95c65d 100755 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "magento/magento2-acceptance-test-framework", + "name": "magento/magento2-functional-testing-framework", "type": "library", - "description": "Magento Acceptance Testing Framework", - "keywords": ["magento", "automation", "acceptance", "testing"], + "description": "Magento2 Functional Testing Framework", + "keywords": ["magento", "automation", "functional", "testing"], "require": { "php": "~7.0", "codeception/codeception": "2.2|2.3", @@ -15,8 +15,8 @@ }, "autoload": { "psr-4": { - "Magento\\AcceptanceTestFramework\\": [ - "src/Magento/AcceptanceTestFramework" + "Magento\\FunctionalTestingFramework\\": [ + "src/Magento/FunctionalTestingFramework" ] } } diff --git a/composer.lock b/composer.lock index 9d1503b4c..88f87805a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "5fcb6f9193fe765beb17e4c5e231cdd3", - "content-hash": "36b93cb68ae06b7687a2317b009cc462", + "hash": "4ccd9ed4f8c2fde43e5784bdc02b4064", + "content-hash": "d2c73e722ab7776b4cf486b17e2abfa7", "packages": [ { "name": "behat/gherkin", @@ -309,29 +309,31 @@ }, { "name": "fzaninotto/faker", - "version": "v1.6.0", + "version": "v1.7.1", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123" + "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123", - "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", + "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", "shasum": "" }, "require": { - "php": "^5.3.3|^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { "ext-intl": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5" + "phpunit/phpunit": "^4.0 || ^5.0", + "squizlabs/php_codesniffer": "^1.5" }, "type": "library", "extra": { - "branch-alias": [] + "branch-alias": { + "dev-master": "1.8-dev" + } }, "autoload": { "psr-4": { @@ -353,7 +355,7 @@ "faker", "fixtures" ], - "time": "2016-04-29 12:21:54" + "time": "2017-08-15 16:48:10" }, { "name": "guzzlehttp/guzzle", @@ -634,22 +636,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.2.2", + "version": "4.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^7.0", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.3.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -675,20 +677,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-08 06:39:58" + "time": "2017-08-30 18:51:59" }, { "name": "phpdocumentor/type-resolver", - "version": "0.3.0", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { @@ -722,26 +724,26 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-06-03 08:32:36" + "time": "2017-07-14 14:27:02" }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -752,7 +754,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -785,7 +787,7 @@ "spy", "stub" ], - "time": "2017-03-02 20:05:34" + "time": "2017-09-04 11:05:03" }, { "name": "phpunit/php-code-coverage", @@ -989,16 +991,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ecb0b2cdaa0add708fe6f329ef65ae0c5225130b" + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ecb0b2cdaa0add708fe6f329ef65ae0c5225130b", - "reference": "ecb0b2cdaa0add708fe6f329ef65ae0c5225130b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", "shasum": "" }, "require": { @@ -1034,7 +1036,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-03 14:17:41" + "time": "2017-08-20 05:47:52" }, { "name": "phpunit/phpunit", @@ -1834,20 +1836,20 @@ }, { "name": "symfony/browser-kit", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0" + "reference": "aee7120b058c268363e606ff5fe8271da849a1b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", - "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/aee7120b058c268363e606ff5fe8271da849a1b5", + "reference": "aee7120b058c268363e606ff5fe8271da849a1b5", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/dom-crawler": "~2.8|~3.0" }, "require-dev": { @@ -1887,24 +1889,24 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-07-12 13:03:20" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/console", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "b0878233cb5c4391347e5495089c7af11b8e6201" + "reference": "d6596cb5022b6a0bd940eae54a1de78646a5fda6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201", - "reference": "b0878233cb5c4391347e5495089c7af11b8e6201", + "url": "https://api.github.com/repos/symfony/console/zipball/d6596cb5022b6a0bd940eae54a1de78646a5fda6", + "reference": "d6596cb5022b6a0bd940eae54a1de78646a5fda6", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/debug": "~2.8|~3.0", "symfony/polyfill-mbstring": "~1.0" }, @@ -1917,7 +1919,6 @@ "symfony/dependency-injection": "~3.3", "symfony/event-dispatcher": "~2.8|~3.0", "symfony/filesystem": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" }, "suggest": { @@ -1956,24 +1957,24 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-07-29 21:27:59" + "time": "2017-08-27 14:52:21" }, { "name": "symfony/css-selector", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "4d882dced7b995d5274293039370148e291808f2" + "reference": "c5f5263ed231f164c58368efbce959137c7d9488" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/4d882dced7b995d5274293039370148e291808f2", - "reference": "4d882dced7b995d5274293039370148e291808f2", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/c5f5263ed231f164c58368efbce959137c7d9488", + "reference": "c5f5263ed231f164c58368efbce959137c7d9488", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { @@ -2009,24 +2010,24 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01 15:01:29" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/debug", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13" + "reference": "084d804fe35808eb2ef596ec83d85d9768aa6c9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13", - "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13", + "url": "https://api.github.com/repos/symfony/debug/zipball/084d804fe35808eb2ef596ec83d85d9768aa6c9d", + "reference": "084d804fe35808eb2ef596ec83d85d9768aa6c9d", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { @@ -2065,24 +2066,24 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-07-28 15:27:31" + "time": "2017-08-27 14:52:21" }, { "name": "symfony/dom-crawler", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1" + "reference": "d15dfaf71b65bf3affb80900470caf4451a8217e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1", - "reference": "fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d15dfaf71b65bf3affb80900470caf4451a8217e", + "reference": "d15dfaf71b65bf3affb80900470caf4451a8217e", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { @@ -2121,24 +2122,24 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-05-25 23:10:31" + "time": "2017-08-15 13:31:09" }, { "name": "symfony/event-dispatcher", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e" + "reference": "54ca9520a00386f83bca145819ad3b619aaa2485" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/67535f1e3fd662bdc68d7ba317c93eecd973617e", - "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/54ca9520a00386f83bca145819ad3b619aaa2485", + "reference": "54ca9520a00386f83bca145819ad3b619aaa2485", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "conflict": { "symfony/dependency-injection": "<3.3" @@ -2184,24 +2185,24 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-09 14:53:08" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/finder", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" + "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4", - "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", + "url": "https://api.github.com/repos/symfony/finder/zipball/b2260dbc80f3c4198f903215f91a1ac7fe9fe09e", + "reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { @@ -2233,20 +2234,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-06-01 21:01:25" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", "shasum": "" }, "require": { @@ -2258,7 +2259,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -2292,24 +2293,24 @@ "portable", "shim" ], - "time": "2017-06-09 14:24:12" + "time": "2017-06-14 15:44:48" }, { "name": "symfony/process", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" + "reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", + "url": "https://api.github.com/repos/symfony/process/zipball/b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0", + "reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { @@ -2341,24 +2342,24 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-13 13:05:09" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/yaml", - "version": "v3.3.6", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" + "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "url": "https://api.github.com/repos/symfony/yaml/zipball/1d8c2a99c80862bdc3af94c1781bf70f86bccac0", + "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "require-dev": { "symfony/console": "~2.8|~3.0" @@ -2396,57 +2397,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-07-23 12:43:26" - }, - { - "name": "vlucas/phpdotenv", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause-Attribution" - ], - "authors": [ - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "time": "2016-09-01 10:05:43" + "time": "2017-07-29 21:54:42" }, { "name": "webmozart/assert", diff --git a/dev/tests/static/Magento/ruleset.xml b/dev/tests/static/Magento/ruleset.xml index 434d1df53..794b5a8ff 100644 --- a/dev/tests/static/Magento/ruleset.xml +++ b/dev/tests/static/Magento/ruleset.xml @@ -5,8 +5,8 @@ * See COPYING.txt for license details. */ --> - - Custom Magento Acceptance Test Framework coding standard. + + Custom Magento2 Functional Testing Framework coding standard. diff --git a/etc/di.xml b/etc/di.xml index e72404039..bffdccc85 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -5,65 +5,65 @@ * See COPYING.txt for license details. */ --> - - - - - - - - - - - + + + + + + + + + + + - + - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\DataObject + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\DataObject arrayArgumentInterpreterProxy - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Boolean - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Number - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\StringUtils - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\NullType - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Constant + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Boolean + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Number + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\StringUtils + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\NullType + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Constant xsi:type - + - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Composite - + developer - + converterArgumentParser - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Composite data - - + + - Magento\AcceptanceTestFramework\Page\Config\Data + Magento\FunctionalTestingFramework\Page\Config\Data - + - Magento\AcceptanceTestFramework\Block\Config\Data + Magento\FunctionalTestingFramework\Block\Config\Data - + - Magento\AcceptanceTestFramework\Generate\GeneratePage - Magento\AcceptanceTestFramework\Generate\GenerateBlock + Magento\FunctionalTestingFramework\Generate\GeneratePage + Magento\FunctionalTestingFramework\Generate\GenerateBlock @@ -71,30 +71,30 @@ Array item can be of any type just like an argument, including array type itself, which creates circular dependency. Proxy is used to resolve the circular dependency, so that array items undergo the same interpretation as arguments. --> - - + + - Magento\AcceptanceTestFramework\Data\Argument\Interpreter\ArrayType + Magento\FunctionalTestingFramework\Data\Argument\Interpreter\ArrayType - + Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd - + Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd - + - Magento\AcceptanceTestFramework\Config\FileResolver\Mask - Magento\AcceptanceTestFramework\Config\Converter - Magento\AcceptanceTestFramework\Config\SchemaLocator\Page + Magento\FunctionalTestingFramework\Config\FileResolver\Mask + Magento\FunctionalTestingFramework\Config\Converter + Magento\FunctionalTestingFramework\Config\SchemaLocator\Page name name @@ -103,11 +103,11 @@ Page - + - Magento\AcceptanceTestFramework\Config\FileResolver\Mask - Magento\AcceptanceTestFramework\Config\Converter - Magento\AcceptanceTestFramework\Config\SchemaLocator\Section + Magento\FunctionalTestingFramework\Config\FileResolver\Mask + Magento\FunctionalTestingFramework\Config\Converter + Magento\FunctionalTestingFramework\Config\SchemaLocator\Section name name @@ -117,52 +117,52 @@ - + - Magento\AcceptanceTestFramework\Page\Config\Data + Magento\FunctionalTestingFramework\Page\Config\Data - + - Magento\AcceptanceTestFramework\Config\Reader\Page + Magento\FunctionalTestingFramework\Config\Reader\Page - + - Magento\AcceptanceTestFramework\Section\Config\Data + Magento\FunctionalTestingFramework\Section\Config\Data - + - Magento\AcceptanceTestFramework\Config\Reader\Section + Magento\FunctionalTestingFramework\Config\Reader\Section - + - Magento\AcceptanceTestFramework\DataProfile\Config\Data + Magento\FunctionalTestingFramework\DataProfile\Config\Data - + - Magento\AcceptanceTestFramework\Config\Reader\DataProfile + Magento\FunctionalTestingFramework\Config\Reader\DataProfile - + Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd - + - Magento\AcceptanceTestFramework\Config\FileResolver\Module - Magento\AcceptanceTestFramework\Config\Converter - Magento\AcceptanceTestFramework\Config\SchemaLocator\DataProfile + Magento\FunctionalTestingFramework\Config\FileResolver\Module + Magento\FunctionalTestingFramework\Config\Converter + Magento\FunctionalTestingFramework\Config\SchemaLocator\DataProfile name key @@ -176,26 +176,26 @@ - + - Magento\AcceptanceTestFramework\DataProfile\Config\Metadata + Magento\FunctionalTestingFramework\DataProfile\Config\Metadata - + - Magento\AcceptanceTestFramework\Config\Reader\Metadata + Magento\FunctionalTestingFramework\Config\Reader\Metadata - + Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd - + - Magento\AcceptanceTestFramework\Config\FileResolver\Module - Magento\AcceptanceTestFramework\Config\Converter - Magento\AcceptanceTestFramework\Config\SchemaLocator\Metadata + Magento\FunctionalTestingFramework\Config\FileResolver\Module + Magento\FunctionalTestingFramework\Config\Converter + Magento\FunctionalTestingFramework\Config\SchemaLocator\Metadata name key @@ -209,16 +209,16 @@ - + Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd - + - Magento\AcceptanceTestFramework\Config\FileResolver\Module - Magento\AcceptanceTestFramework\Config\TestDataConverter - Magento\AcceptanceTestFramework\Config\SchemaLocator\TestData + Magento\FunctionalTestingFramework\Config\FileResolver\Module + Magento\FunctionalTestingFramework\Config\TestDataConverter + Magento\FunctionalTestingFramework\Config\SchemaLocator\TestData name name @@ -232,7 +232,7 @@ - + mergeKey @@ -273,30 +273,30 @@ - + - Magento\AcceptanceTestFramework\Test\Config\Dom\ArrayNodeConfig + Magento\FunctionalTestingFramework\Test\Config\Dom\ArrayNodeConfig - + - Magento\AcceptanceTestFramework\Test\Config\Data + Magento\FunctionalTestingFramework\Test\Config\Data - + - Magento\AcceptanceTestFramework\Config\Reader\TestData + Magento\FunctionalTestingFramework\Config\Reader\TestData - + - Magento\AcceptanceTestFramework\Config\FileResolver\Module - Magento\AcceptanceTestFramework\Config\ActionGroupDataConverter - Magento\AcceptanceTestFramework\Config\SchemaLocator\TestData + Magento\FunctionalTestingFramework\Config\FileResolver\Module + Magento\FunctionalTestingFramework\Config\ActionGroupDataConverter + Magento\FunctionalTestingFramework\Config\SchemaLocator\TestData name mergeKey @@ -306,7 +306,7 @@ - + mergeKey @@ -315,20 +315,20 @@ - + - Magento\AcceptanceTestFramework\Test\Config\Dom\ActionGroupArrayNodeConfig + Magento\FunctionalTestingFramework\Test\Config\Dom\ActionGroupArrayNodeConfig - + - Magento\AcceptanceTestFramework\Test\Config\ActionGroupData + Magento\FunctionalTestingFramework\Test\Config\ActionGroupData - + - Magento\AcceptanceTestFramework\Config\Reader\ActionGroupData + Magento\FunctionalTestingFramework\Config\Reader\ActionGroupData diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php b/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php deleted file mode 100644 index 20e3bd5ca..000000000 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigLoader/Primary.php +++ /dev/null @@ -1,71 +0,0 @@ -createArgumentInterpreter() - ), - new \Magento\AcceptanceTestFramework\ObjectManager\Config\SchemaLocator(), - new \Magento\AcceptanceTestFramework\Config\ValidationState($this->appMode) - ); - - return $reader->read(); - } - - - /** - * Return newly created instance on an argument interpreter, suitable for processing DI arguments - * - * @return \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface - */ - protected function createArgumentInterpreter() - { - $booleanUtils = new \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils(); - $constInterpreter = new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Constant(); - $result = new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite( - [ - 'boolean' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), - 'string' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), - 'number' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Number(), - 'null' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\NullType(), - 'object' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\DataObject($booleanUtils), - 'const' => $constInterpreter, - 'init_parameter' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Argument($constInterpreter) - ], - \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE - ); - // Add interpreters that reference the composite - $result->addInterpreter('array', new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\ArrayType($result)); - return $result; - } -} diff --git a/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php b/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php deleted file mode 100644 index c89077141..000000000 --- a/src/Magento/AcceptanceTestFramework/ObjectManagerFactory.php +++ /dev/null @@ -1,120 +0,0 @@ -configClassName(); - - $factory = new Factory($diConfig); - $argInterpreter = $this->createArgumentInterpreter(new BooleanUtils()); - $argumentMapper = new \Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom($argInterpreter); - - - $sharedInstances['Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface'] = $argInterpreter; - $sharedInstances['Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom'] = $argumentMapper; - - /** @var \Magento\AcceptanceTestFramework\ObjectManager $objectManager */ - $objectManager = new $this->locatorClassName($factory, $diConfig, $sharedInstances); - - $factory->setObjectManager($objectManager); - ObjectManager::setInstance($objectManager); - - self::configure($objectManager); - - return $objectManager; - } - - /** - * Return newly created instance on an argument interpreter, suitable for processing DI arguments. - * - * @param \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils $booleanUtils - * @return \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface - */ - protected function createArgumentInterpreter( - \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils $booleanUtils - ) { - $constInterpreter = new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Constant(); - $result = new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Composite( - [ - 'boolean' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Boolean($booleanUtils), - 'string' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), - 'number' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Number(), - 'null' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\NullType(), - 'const' => $constInterpreter, - 'object' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\DataObject($booleanUtils), - 'init_parameter' => new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\Argument($constInterpreter), - ], - \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE - ); - // Add interpreters that reference the composite - $result->addInterpreter('array', new \Magento\AcceptanceTestFramework\Data\Argument\Interpreter\ArrayType($result)); - return $result; - } - - /** - * Get Object Manager instance. - * - * @return ObjectManager - */ - public static function getObjectManager() - { - if (!$objectManager = ObjectManager::getInstance()) { - $objectManagerFactory = new self(); - $objectManager = $objectManagerFactory->create(); - } - - return $objectManager; - } - - /** - * Configure Object Manager. - * This method is static to have the ability to configure multiple instances of Object manager when needed. - * - * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager - * @return void - */ - public static function configure(\Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager) - { - $objectManager->configure( - $objectManager->get(\Magento\AcceptanceTestFramework\ObjectManager\ConfigLoader\Primary::class)->load() - ); - } -} diff --git a/src/Magento/AcceptanceTestFramework/Code/Reader/ClassReader.php b/src/Magento/FunctionalTestingFramework/Code/Reader/ClassReader.php similarity index 97% rename from src/Magento/AcceptanceTestFramework/Code/Reader/ClassReader.php rename to src/Magento/FunctionalTestingFramework/Code/Reader/ClassReader.php index 4c2483766..bc29d47fc 100644 --- a/src/Magento/AcceptanceTestFramework/Code/Reader/ClassReader.php +++ b/src/Magento/FunctionalTestingFramework/Code/Reader/ClassReader.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Code\Reader; +namespace Magento\FunctionalTestingFramework\Code\Reader; class ClassReader implements ClassReaderInterface { diff --git a/src/Magento/AcceptanceTestFramework/Code/Reader/ClassReaderInterface.php b/src/Magento/FunctionalTestingFramework/Code/Reader/ClassReaderInterface.php similarity index 92% rename from src/Magento/AcceptanceTestFramework/Code/Reader/ClassReaderInterface.php rename to src/Magento/FunctionalTestingFramework/Code/Reader/ClassReaderInterface.php index 53f6102e6..21472847c 100644 --- a/src/Magento/AcceptanceTestFramework/Code/Reader/ClassReaderInterface.php +++ b/src/Magento/FunctionalTestingFramework/Code/Reader/ClassReaderInterface.php @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Code\Reader; +namespace Magento\FunctionalTestingFramework\Code\Reader; interface ClassReaderInterface { diff --git a/src/Magento/AcceptanceTestFramework/Config/Converter.php b/src/Magento/FunctionalTestingFramework/Config/Converter.php similarity index 95% rename from src/Magento/AcceptanceTestFramework/Config/Converter.php rename to src/Magento/FunctionalTestingFramework/Config/Converter.php index 82701925a..4686caedb 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Converter.php +++ b/src/Magento/FunctionalTestingFramework/Config/Converter.php @@ -3,15 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; -use Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\ArgumentParser; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper\ArgumentParser; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; /** * Converter for configuration data. */ -class Converter implements \Magento\AcceptanceTestFramework\Config\ConverterInterface +class Converter implements \Magento\FunctionalTestingFramework\Config\ConverterInterface { /** * Unique identifier of node. diff --git a/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php b/src/Magento/FunctionalTestingFramework/Config/Converter/Dom/Flat.php similarity index 96% rename from src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php rename to src/Magento/FunctionalTestingFramework/Config/Converter/Dom/Flat.php index eae23e30b..b67f543e4 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Converter/Dom/Flat.php +++ b/src/Magento/FunctionalTestingFramework/Config/Converter/Dom/Flat.php @@ -3,9 +3,9 @@ * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\Converter\Dom; +namespace Magento\FunctionalTestingFramework\Config\Converter\Dom; -use Magento\AcceptanceTestFramework\Config\Dom\ArrayNodeConfig; +use Magento\FunctionalTestingFramework\Config\Dom\ArrayNodeConfig; /** * Universal converter of any XML data to an array representation with no data loss diff --git a/src/Magento/AcceptanceTestFramework/Config/ConverterInterface.php b/src/Magento/FunctionalTestingFramework/Config/ConverterInterface.php similarity index 85% rename from src/Magento/AcceptanceTestFramework/Config/ConverterInterface.php rename to src/Magento/FunctionalTestingFramework/Config/ConverterInterface.php index a5a9a6937..3f3c0d87a 100644 --- a/src/Magento/AcceptanceTestFramework/Config/ConverterInterface.php +++ b/src/Magento/FunctionalTestingFramework/Config/ConverterInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Interface ConverterInterface diff --git a/src/Magento/AcceptanceTestFramework/Config/Data.php b/src/Magento/FunctionalTestingFramework/Config/Data.php similarity index 82% rename from src/Magento/AcceptanceTestFramework/Config/Data.php rename to src/Magento/FunctionalTestingFramework/Config/Data.php index 431549b81..a34ec1bf3 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Data.php +++ b/src/Magento/FunctionalTestingFramework/Config/Data.php @@ -4,17 +4,17 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Class Data */ -class Data implements \Magento\AcceptanceTestFramework\Config\DataInterface +class Data implements \Magento\FunctionalTestingFramework\Config\DataInterface { /** * Configuration reader model * - * @var \Magento\AcceptanceTestFramework\Config\ReaderInterface + * @var \Magento\FunctionalTestingFramework\Config\ReaderInterface */ protected $reader; @@ -28,9 +28,9 @@ class Data implements \Magento\AcceptanceTestFramework\Config\DataInterface /** * Constructor * - * @param \Magento\AcceptanceTestFramework\Config\ReaderInterface $reader + * @param \Magento\FunctionalTestingFramework\Config\ReaderInterface $reader */ - public function __construct(\Magento\AcceptanceTestFramework\Config\ReaderInterface $reader) + public function __construct(\Magento\FunctionalTestingFramework\Config\ReaderInterface $reader) { $this->reader = $reader; $this->load(); diff --git a/src/Magento/AcceptanceTestFramework/Config/DataInterface.php b/src/Magento/FunctionalTestingFramework/Config/DataInterface.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Config/DataInterface.php rename to src/Magento/FunctionalTestingFramework/Config/DataInterface.php index f290634d2..6af873001 100644 --- a/src/Magento/AcceptanceTestFramework/Config/DataInterface.php +++ b/src/Magento/FunctionalTestingFramework/Config/DataInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Interface DataInterface diff --git a/src/Magento/AcceptanceTestFramework/Config/Dom.php b/src/Magento/FunctionalTestingFramework/Config/Dom.php similarity index 97% rename from src/Magento/AcceptanceTestFramework/Config/Dom.php rename to src/Magento/FunctionalTestingFramework/Config/Dom.php index 199988e53..49b98675c 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Dom.php +++ b/src/Magento/FunctionalTestingFramework/Config/Dom.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Magento configuration XML DOM utility @@ -331,7 +331,7 @@ public function getDom() * * @param string $xml * @return \DOMDocument - * @throws \Magento\AcceptanceTestFramework\Config\Dom\ValidationException + * @throws \Magento\FunctionalTestingFramework\Config\Dom\ValidationException */ protected function initDom($xml) { @@ -340,7 +340,7 @@ protected function initDom($xml) if ($this->schemaFile) { $errors = self::validateDomDocument($dom, $this->schemaFile, $this->errorFormat); if (count($errors)) { - throw new \Magento\AcceptanceTestFramework\Config\Dom\ValidationException(implode("\n", $errors)); + throw new \Magento\FunctionalTestingFramework\Config\Dom\ValidationException(implode("\n", $errors)); } } return $dom; diff --git a/src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php b/src/Magento/FunctionalTestingFramework/Config/Dom/ArrayNodeConfig.php similarity index 97% rename from src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php rename to src/Magento/FunctionalTestingFramework/Config/Dom/ArrayNodeConfig.php index 2dc5436b8..eaa216649 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Dom/ArrayNodeConfig.php +++ b/src/Magento/FunctionalTestingFramework/Config/Dom/ArrayNodeConfig.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\Dom; +namespace Magento\FunctionalTestingFramework\Config\Dom; /** * Configuration of nodes that represent numeric or associative arrays diff --git a/src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php b/src/Magento/FunctionalTestingFramework/Config/Dom/NodeMergingConfig.php similarity index 95% rename from src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php rename to src/Magento/FunctionalTestingFramework/Config/Dom/NodeMergingConfig.php index 47fd9eb1f..f880680fb 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Dom/NodeMergingConfig.php +++ b/src/Magento/FunctionalTestingFramework/Config/Dom/NodeMergingConfig.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\Dom; +namespace Magento\FunctionalTestingFramework\Config\Dom; /** * Configuration of identifier attributes to be taken into account during merging diff --git a/src/Magento/AcceptanceTestFramework/Config/Dom/NodePathMatcher.php b/src/Magento/FunctionalTestingFramework/Config/Dom/NodePathMatcher.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Config/Dom/NodePathMatcher.php rename to src/Magento/FunctionalTestingFramework/Config/Dom/NodePathMatcher.php index bf221f6d8..bf70de73e 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Dom/NodePathMatcher.php +++ b/src/Magento/FunctionalTestingFramework/Config/Dom/NodePathMatcher.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\Dom; +namespace Magento\FunctionalTestingFramework\Config\Dom; /** * Matching of XPath expressions to path patterns diff --git a/src/Magento/AcceptanceTestFramework/Config/Dom/ValidationException.php b/src/Magento/FunctionalTestingFramework/Config/Dom/ValidationException.php similarity index 82% rename from src/Magento/AcceptanceTestFramework/Config/Dom/ValidationException.php rename to src/Magento/FunctionalTestingFramework/Config/Dom/ValidationException.php index bccf358a2..18498c8b7 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Dom/ValidationException.php +++ b/src/Magento/FunctionalTestingFramework/Config/Dom/ValidationException.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\Dom; +namespace Magento\FunctionalTestingFramework\Config\Dom; /** * \Exception that should be thrown by DOM model when incoming xml is not valid. diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Mask.php similarity index 87% rename from src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php rename to src/Magento/FunctionalTestingFramework/Config/FileResolver/Mask.php index 3ac8210f2..71bf62cdc 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Mask.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Mask.php @@ -4,15 +4,15 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\FileResolver; +namespace Magento\FunctionalTestingFramework\Config\FileResolver; -use Magento\AcceptanceTestFramework\Config\FileResolverInterface; -use Magento\AcceptanceTestFramework\Util\ModuleResolver; -use Magento\AcceptanceTestFramework\Util\Iterator\File; +use Magento\FunctionalTestingFramework\Config\FileResolverInterface; +use Magento\FunctionalTestingFramework\Util\ModuleResolver; +use Magento\FunctionalTestingFramework\Util\Iterator\File; /** * Class Mask - * @package Magento\AcceptanceTestFramework\Config\FileResolver + * @package Magento\FunctionalTestingFramework\Config\FileResolver */ class Mask implements FileResolverInterface { diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Module.php similarity index 83% rename from src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php rename to src/Magento/FunctionalTestingFramework/Config/FileResolver/Module.php index 0ffd5c411..9921fd42c 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Module.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Module.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\FileResolver; +namespace Magento\FunctionalTestingFramework\Config\FileResolver; -use Magento\AcceptanceTestFramework\Util\Iterator\File; -use Magento\AcceptanceTestFramework\Config\FileResolverInterface; -use Magento\AcceptanceTestFramework\Util\ModuleResolver; +use Magento\FunctionalTestingFramework\Util\Iterator\File; +use Magento\FunctionalTestingFramework\Config\FileResolverInterface; +use Magento\FunctionalTestingFramework\Util\ModuleResolver; /** * Provides the list of configuration files collected through modules test folders. diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Primary.php similarity index 91% rename from src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php rename to src/Magento/FunctionalTestingFramework/Config/FileResolver/Primary.php index ce5917e7d..14643b32e 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolver/Primary.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Primary.php @@ -4,10 +4,10 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\FileResolver; +namespace Magento\FunctionalTestingFramework\Config\FileResolver; -use Magento\AcceptanceTestFramework\Util\Iterator\File; -use Magento\AcceptanceTestFramework\Config\FileResolverInterface; +use Magento\FunctionalTestingFramework\Util\Iterator\File; +use Magento\FunctionalTestingFramework\Config\FileResolverInterface; /** * Provides the list of global configuration files. diff --git a/src/Magento/AcceptanceTestFramework/Config/FileResolverInterface.php b/src/Magento/FunctionalTestingFramework/Config/FileResolverInterface.php similarity index 88% rename from src/Magento/AcceptanceTestFramework/Config/FileResolverInterface.php rename to src/Magento/FunctionalTestingFramework/Config/FileResolverInterface.php index 6c45afa00..31fd9b94c 100644 --- a/src/Magento/AcceptanceTestFramework/Config/FileResolverInterface.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolverInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Interface FileResolverInterface diff --git a/src/Magento/AcceptanceTestFramework/Config/Reader.php b/src/Magento/FunctionalTestingFramework/Config/Reader.php similarity index 89% rename from src/Magento/AcceptanceTestFramework/Config/Reader.php rename to src/Magento/FunctionalTestingFramework/Config/Reader.php index 38d9e3370..9ceebb2f1 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Reader.php +++ b/src/Magento/FunctionalTestingFramework/Config/Reader.php @@ -3,13 +3,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Class Reader * Module declaration reader. Reads scenario.xml declaration files from module /etc directories. */ -class Reader extends \Magento\AcceptanceTestFramework\Config\Reader\Filesystem +class Reader extends \Magento\FunctionalTestingFramework\Config\Reader\Filesystem { /** * List of name attributes for merge. @@ -40,7 +40,7 @@ public function __construct( ValidationStateInterface $validationState, $fileName = 'scenario.xml', $idAttributes = [], - $domDocumentClass = 'Magento\AcceptanceTestFramework\Config\Dom', + $domDocumentClass = 'Magento\FunctionalTestingFramework\Config\Dom', $defaultScope = 'etc' ) { $this->fileResolver = $fileResolver; diff --git a/src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php b/src/Magento/FunctionalTestingFramework/Config/Reader/Filesystem.php similarity index 74% rename from src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php rename to src/Magento/FunctionalTestingFramework/Config/Reader/Filesystem.php index 4fca5d79e..9b86c6de1 100644 --- a/src/Magento/AcceptanceTestFramework/Config/Reader/Filesystem.php +++ b/src/Magento/FunctionalTestingFramework/Config/Reader/Filesystem.php @@ -3,24 +3,24 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config\Reader; +namespace Magento\FunctionalTestingFramework\Config\Reader; /** * Filesystem configuration loader. Loads configuration from XML files, split by scopes. */ -class Filesystem implements \Magento\AcceptanceTestFramework\Config\ReaderInterface +class Filesystem implements \Magento\FunctionalTestingFramework\Config\ReaderInterface { /** * File locator * - * @var \Magento\AcceptanceTestFramework\Config\FileResolverInterface + * @var \Magento\FunctionalTestingFramework\Config\FileResolverInterface */ protected $fileResolver; /** * Config converter * - * @var \Magento\AcceptanceTestFramework\Config\ConverterInterface + * @var \Magento\FunctionalTestingFramework\Config\ConverterInterface */ protected $converter; @@ -62,7 +62,7 @@ class Filesystem implements \Magento\AcceptanceTestFramework\Config\ReaderInterf /** * Config validation state object. * - * @var \Magento\AcceptanceTestFramework\Config\ValidationStateInterface + * @var \Magento\FunctionalTestingFramework\Config\ValidationStateInterface */ protected $validationState; @@ -83,23 +83,23 @@ class Filesystem implements \Magento\AcceptanceTestFramework\Config\ReaderInterf /** * Constructor * - * @param \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver - * @param \Magento\AcceptanceTestFramework\Config\ConverterInterface $converter - * @param \Magento\AcceptanceTestFramework\Config\SchemaLocatorInterface $schemaLocator - * @param \Magento\AcceptanceTestFramework\Config\ValidationStateInterface $validationState + * @param \Magento\FunctionalTestingFramework\Config\FileResolverInterface $fileResolver + * @param \Magento\FunctionalTestingFramework\Config\ConverterInterface $converter + * @param \Magento\FunctionalTestingFramework\Config\SchemaLocatorInterface $schemaLocator + * @param \Magento\FunctionalTestingFramework\Config\ValidationStateInterface $validationState * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass * @param string $defaultScope */ public function __construct( - \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver, - \Magento\AcceptanceTestFramework\Config\ConverterInterface $converter, - \Magento\AcceptanceTestFramework\Config\SchemaLocatorInterface $schemaLocator, - \Magento\AcceptanceTestFramework\Config\ValidationStateInterface $validationState, + \Magento\FunctionalTestingFramework\Config\FileResolverInterface $fileResolver, + \Magento\FunctionalTestingFramework\Config\ConverterInterface $converter, + \Magento\FunctionalTestingFramework\Config\SchemaLocatorInterface $schemaLocator, + \Magento\FunctionalTestingFramework\Config\ValidationStateInterface $validationState, $fileName, $idAttributes = [], - $domDocumentClass = \Magento\AcceptanceTestFramework\Config\Dom::class, + $domDocumentClass = \Magento\FunctionalTestingFramework\Config\Dom::class, $defaultScope = 'global' ) { $this->fileResolver = $fileResolver; @@ -141,7 +141,7 @@ public function read($scope = null) */ protected function readFiles($fileList) { - /** @var \Magento\AcceptanceTestFramework\Config\Dom $configMerger */ + /** @var \Magento\FunctionalTestingFramework\Config\Dom $configMerger */ $configMerger = null; foreach ($fileList as $key => $content) { try { @@ -150,7 +150,7 @@ protected function readFiles($fileList) } else { $configMerger->merge($content); } - } catch (\Magento\AcceptanceTestFramework\Config\Dom\ValidationException $e) { + } catch (\Magento\FunctionalTestingFramework\Config\Dom\ValidationException $e) { throw new \Exception("Invalid XML in file " . $key . ":\n" . $e->getMessage()); } } @@ -174,7 +174,7 @@ protected function readFiles($fileList) * * @param string $mergerClass * @param string $initialContents - * @return \Magento\AcceptanceTestFramework\Config\Dom + * @return \Magento\FunctionalTestingFramework\Config\Dom * @throws \UnexpectedValueException */ protected function createConfigMerger($mergerClass, $initialContents) @@ -185,7 +185,7 @@ protected function createConfigMerger($mergerClass, $initialContents) null, $this->perFileSchema ); - if (!$result instanceof \Magento\AcceptanceTestFramework\Config\Dom) { + if (!$result instanceof \Magento\FunctionalTestingFramework\Config\Dom) { throw new \UnexpectedValueException( "Instance of the DOM config merger is expected, got {$mergerClass} instead." ); diff --git a/src/Magento/AcceptanceTestFramework/Config/ReaderInterface.php b/src/Magento/FunctionalTestingFramework/Config/ReaderInterface.php similarity index 88% rename from src/Magento/AcceptanceTestFramework/Config/ReaderInterface.php rename to src/Magento/FunctionalTestingFramework/Config/ReaderInterface.php index 211a18b77..9e64a6715 100644 --- a/src/Magento/AcceptanceTestFramework/Config/ReaderInterface.php +++ b/src/Magento/FunctionalTestingFramework/Config/ReaderInterface.php @@ -6,7 +6,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Config reader interface. diff --git a/src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php b/src/Magento/FunctionalTestingFramework/Config/ReplacerInterface.php similarity index 87% rename from src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php rename to src/Magento/FunctionalTestingFramework/Config/ReplacerInterface.php index d053f76a4..6652f9bc8 100644 --- a/src/Magento/AcceptanceTestFramework/Config/ReplacerInterface.php +++ b/src/Magento/FunctionalTestingFramework/Config/ReplacerInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Config replacer interface. diff --git a/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php b/src/Magento/FunctionalTestingFramework/Config/SchemaLocator.php similarity index 87% rename from src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php rename to src/Magento/FunctionalTestingFramework/Config/SchemaLocator.php index 49fba1e4e..628d7c674 100644 --- a/src/Magento/AcceptanceTestFramework/Config/SchemaLocator.php +++ b/src/Magento/FunctionalTestingFramework/Config/SchemaLocator.php @@ -3,13 +3,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Class SchemaLocator * Scenario configuration schema locator */ -class SchemaLocator implements \Magento\AcceptanceTestFramework\Config\SchemaLocatorInterface +class SchemaLocator implements \Magento\FunctionalTestingFramework\Config\SchemaLocatorInterface { /** * XSD schema path diff --git a/src/Magento/AcceptanceTestFramework/Config/SchemaLocatorInterface.php b/src/Magento/FunctionalTestingFramework/Config/SchemaLocatorInterface.php similarity index 89% rename from src/Magento/AcceptanceTestFramework/Config/SchemaLocatorInterface.php rename to src/Magento/FunctionalTestingFramework/Config/SchemaLocatorInterface.php index be9d027f6..98ef8e73e 100644 --- a/src/Magento/AcceptanceTestFramework/Config/SchemaLocatorInterface.php +++ b/src/Magento/FunctionalTestingFramework/Config/SchemaLocatorInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Interface SchemaLocatorInterface diff --git a/src/Magento/AcceptanceTestFramework/Config/ValidationState.php b/src/Magento/FunctionalTestingFramework/Config/ValidationState.php similarity index 93% rename from src/Magento/AcceptanceTestFramework/Config/ValidationState.php rename to src/Magento/FunctionalTestingFramework/Config/ValidationState.php index 4163c7fe1..f08dc141a 100644 --- a/src/Magento/AcceptanceTestFramework/Config/ValidationState.php +++ b/src/Magento/FunctionalTestingFramework/Config/ValidationState.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Class ValidationState diff --git a/src/Magento/AcceptanceTestFramework/Config/ValidationStateInterface.php b/src/Magento/FunctionalTestingFramework/Config/ValidationStateInterface.php similarity index 85% rename from src/Magento/AcceptanceTestFramework/Config/ValidationStateInterface.php rename to src/Magento/FunctionalTestingFramework/Config/ValidationStateInterface.php index 4d46015e1..2bcb2adf0 100644 --- a/src/Magento/AcceptanceTestFramework/Config/ValidationStateInterface.php +++ b/src/Magento/FunctionalTestingFramework/Config/ValidationStateInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Config; +namespace Magento\FunctionalTestingFramework\Config; /** * Config validation state interface. diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Argument.php similarity index 79% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Argument.php index 76908b52a..04328daf5 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Argument.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Argument.php @@ -3,10 +3,10 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; -use Magento\AcceptanceTestFramework\Data\Argument\MissingOptionalValueException; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Data\Argument\MissingOptionalValueException; /** * Interpreter that returns value of an application argument, retrieving its name from a constant diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/ArrayType.php similarity index 95% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/ArrayType.php index 9dbf3b52b..98fcf05e2 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/ArrayType.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/ArrayType.php @@ -3,9 +3,9 @@ * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; /** * Interpreter of array data type that supports arrays of unlimited depth diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Boolean.php similarity index 81% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Boolean.php index 4da2bc536..f545c2aa4 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Boolean.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Boolean.php @@ -3,10 +3,10 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; -use Magento\AcceptanceTestFramework\Stdlib\BooleanUtils; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Stdlib\BooleanUtils; /** * Interpreter of boolean data type, such as boolean itself or boolean string diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Composite.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Composite.php index 0be27171f..2d3ea0e0e 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Composite.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Composite.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; /** * Interpreter that aggregates named interpreters and delegates every evaluation to one of them diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Constant.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Constant.php similarity index 79% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Constant.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Constant.php index 9a5fe62ec..05734375b 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Constant.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Constant.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; /** * Interpreter that returns value of a constant by its name diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/DataObject.php similarity index 77% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/DataObject.php index 706c00bfb..595d7df04 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/DataObject.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/DataObject.php @@ -4,17 +4,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; -use Magento\AcceptanceTestFramework\Stdlib\BooleanUtils; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Stdlib\BooleanUtils; class DataObject implements InterpreterInterface { /** * Utility methods for the boolean data type. * - * @var \Magento\AcceptanceTestFramework\Stdlib\BooleanUtils + * @var \Magento\FunctionalTestingFramework\Stdlib\BooleanUtils */ protected $booleanUtils; diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/NullType.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/NullType.php similarity index 72% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/NullType.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/NullType.php index aca27b08d..f1985cf3f 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/NullType.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/NullType.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; /** * Interpreter of NULL data type diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Number.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Number.php similarity index 80% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Number.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Number.php index 8ed8186dc..3583896c4 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/Number.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/Number.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; /** * Interpreter of numeric data, such as integer, float, or numeric string diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/StringUtils.php b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/StringUtils.php similarity index 82% rename from src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/StringUtils.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/StringUtils.php index fe21a2daa..ba979e21c 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/Interpreter/StringUtils.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/Interpreter/StringUtils.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\Interpreter; +namespace Magento\FunctionalTestingFramework\Data\Argument\Interpreter; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; /** * Interpreter of string data type that may optionally perform text translation diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php b/src/Magento/FunctionalTestingFramework/Data/Argument/InterpreterInterface.php similarity index 89% rename from src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/InterpreterInterface.php index 1e89503fc..6ff11b082 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/InterpreterInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument; +namespace Magento\FunctionalTestingFramework\Data\Argument; /** * Interface that encapsulates complexity of expression computation diff --git a/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php b/src/Magento/FunctionalTestingFramework/Data/Argument/InterpreterInterface/Proxy.php similarity index 67% rename from src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php rename to src/Magento/FunctionalTestingFramework/Data/Argument/InterpreterInterface/Proxy.php index 59c0194ed..1741952a6 100644 --- a/src/Magento/AcceptanceTestFramework/Data/Argument/InterpreterInterface/Proxy.php +++ b/src/Magento/FunctionalTestingFramework/Data/Argument/InterpreterInterface/Proxy.php @@ -3,17 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; +namespace Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; /** - * Proxy class for \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface + * Proxy class for \Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface */ -class Proxy implements \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface +class Proxy implements \Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface { /** * Object Manager instance * - * @var \Magento\AcceptanceTestFramework\ObjectManagerInterface + * @var \Magento\FunctionalTestingFramework\ObjectManagerInterface */ protected $objectManager = null; @@ -27,7 +27,7 @@ class Proxy implements \Magento\AcceptanceTestFramework\Data\Argument\Interprete /** * Proxied instance * - * @var \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface + * @var \Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface */ protected $subject = null; @@ -41,13 +41,13 @@ class Proxy implements \Magento\AcceptanceTestFramework\Data\Argument\Interprete /** * Proxy constructor * - * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager + * @param \Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager * @param string $instanceName * @param bool $shared */ public function __construct( - \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager, - $instanceName = \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface::class, + \Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager, + $instanceName = \Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface::class, $shared = true ) { $this->objectManager = $objectManager; @@ -71,7 +71,7 @@ public function __sleep() */ public function __wakeup() { - $this->objectManager = \Magento\AcceptanceTestFramework\ObjectManager::getInstance(); + $this->objectManager = \Magento\FunctionalTestingFramework\ObjectManager::getInstance(); } /** @@ -86,7 +86,7 @@ public function __clone() /** * Get proxied instance * - * @return \Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface + * @return \Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface */ protected function getSubject() { diff --git a/src/Magento/AcceptanceTestFramework/Data/etc/types.xsd b/src/Magento/FunctionalTestingFramework/Data/etc/types.xsd similarity index 100% rename from src/Magento/AcceptanceTestFramework/Data/etc/types.xsd rename to src/Magento/FunctionalTestingFramework/Data/etc/types.xsd diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Api/ApiExecutor.php similarity index 93% rename from src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php rename to src/Magento/FunctionalTestingFramework/DataGenerator/Api/ApiExecutor.php index 4d5bb8635..b3bbec16c 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Api/ApiExecutor.php @@ -3,15 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\DataGenerator\Api; - -use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; -use Magento\AcceptanceTestFramework\DataGenerator\Handlers\JsonDefinitionObjectHandler; -use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; -use Magento\AcceptanceTestFramework\DataGenerator\Objects\JsonDefinition; -use Magento\AcceptanceTestFramework\DataGenerator\Objects\JsonElement; -use Magento\AcceptanceTestFramework\DataGenerator\Util\JsonObjectExtractor; -use Magento\AcceptanceTestFramework\Util\ApiClientUtil; +namespace Magento\FunctionalTestingFramework\DataGenerator\Api; + +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\JsonDefinitionObjectHandler; +use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject; +use Magento\FunctionalTestingFramework\DataGenerator\Objects\JsonDefinition; +use Magento\FunctionalTestingFramework\DataGenerator\Objects\JsonElement; +use Magento\FunctionalTestingFramework\DataGenerator\Util\JsonObjectExtractor; +use Magento\FunctionalTestingFramework\Util\ApiClientUtil; /** * Class ApiExecutor diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Api/EntityApiHandler.php similarity index 83% rename from src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php rename to src/Magento/FunctionalTestingFramework/DataGenerator/Api/EntityApiHandler.php index 12f1200ea..8f41d40f7 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Api/EntityApiHandler.php @@ -4,15 +4,15 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\DataGenerator\Api; +namespace Magento\FunctionalTestingFramework\DataGenerator\Api; use Codeception\Test\Cest; -use Magento\AcceptanceTestFramework\Config\Data; -use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; -use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; -use Magento\AcceptanceTestFramework\Test\Handlers\CestObjectHandler; -use Magento\AcceptanceTestFramework\Test\Managers\CestArrayProcessor; -use Magento\AcceptanceTestFramework\Util\TestGenerator; +use Magento\FunctionalTestingFramework\Config\Data; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler; +use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject; +use Magento\FunctionalTestingFramework\Test\Handlers\CestObjectHandler; +use Magento\FunctionalTestingFramework\Test\Managers\CestArrayProcessor; +use Magento\FunctionalTestingFramework\Util\TestGenerator; class EntityApiHandler { diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php rename to src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php index 8b4430705..73e1c10ff 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php @@ -1,11 +1,11 @@ getModule(\Magento\AcceptanceTestFramework\Module\MagentoWebDriver::class) + $this->getModule(\Magento\FunctionalTestingFramework\Module\MagentoWebDriver::class) ->_reconfigure([$config => $value]); } @@ -35,6 +35,6 @@ public function changeConfiguration($config, $value) */ public function getConfiguration($config) { - return $this->getModule(\Magento\AcceptanceTestFramework\Module\MagentoWebDriver::class)->_getConfig($config); + return $this->getModule(\Magento\FunctionalTestingFramework\Module\MagentoWebDriver::class)->_getConfig($config); } } diff --git a/src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php b/src/Magento/FunctionalTestingFramework/Helper/AdminUrlList.php similarity index 99% rename from src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php rename to src/Magento/FunctionalTestingFramework/Helper/AdminUrlList.php index 027c0c30b..edb2b051b 100644 --- a/src/Magento/AcceptanceTestFramework/Helper/AdminUrlList.php +++ b/src/Magento/FunctionalTestingFramework/Helper/AdminUrlList.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Helper; +namespace Magento\FunctionalTestingFramework\Helper; /** * Class AdminUrlList diff --git a/src/Magento/AcceptanceTestFramework/Helper/EntityRESTApiHelper.php b/src/Magento/FunctionalTestingFramework/Helper/EntityRESTApiHelper.php similarity index 96% rename from src/Magento/AcceptanceTestFramework/Helper/EntityRESTApiHelper.php rename to src/Magento/FunctionalTestingFramework/Helper/EntityRESTApiHelper.php index 6a3cde4b9..b326c58a1 100644 --- a/src/Magento/AcceptanceTestFramework/Helper/EntityRESTApiHelper.php +++ b/src/Magento/FunctionalTestingFramework/Helper/EntityRESTApiHelper.php @@ -4,13 +4,13 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Helper; +namespace Magento\FunctionalTestingFramework\Helper; use GuzzleHttp\Client; /** * Class EntityRESTApiHelper - * @package Magento\AcceptanceTestFramework\Helper + * @package Magento\FunctionalTestingFramework\Helper */ class EntityRESTApiHelper { diff --git a/src/Magento/AcceptanceTestFramework/Helper/MagentoFakerData.php b/src/Magento/FunctionalTestingFramework/Helper/MagentoFakerData.php similarity index 98% rename from src/Magento/AcceptanceTestFramework/Helper/MagentoFakerData.php rename to src/Magento/FunctionalTestingFramework/Helper/MagentoFakerData.php index 72b25d753..9cf5322b2 100644 --- a/src/Magento/AcceptanceTestFramework/Helper/MagentoFakerData.php +++ b/src/Magento/FunctionalTestingFramework/Helper/MagentoFakerData.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Helper; +namespace Magento\FunctionalTestingFramework\Helper; /** * Class MagentoFakerData diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoRestDriver.php similarity index 99% rename from src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php rename to src/Magento/FunctionalTestingFramework/Module/MagentoRestDriver.php index 5122cfd87..bae3c50f7 100644 --- a/src/Magento/AcceptanceTestFramework/Module/MagentoRestDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoRestDriver.php @@ -1,8 +1,8 @@ seeResponseCodeIs(\Codeception\Util\HttpCode::OK); $this->haveHttpHeader('Authorization', 'Bearer ' . $token); self::$adminTokens[$this->config['username']] = $token; - $this->getModule('\Magento\AcceptanceTestFramework\Module\MagentoSequence')->_initialize(); + $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoSequence')->_initialize(); } /** diff --git a/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php b/src/Magento/FunctionalTestingFramework/Module/MagentoSequence.php similarity index 65% rename from src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php rename to src/Magento/FunctionalTestingFramework/Module/MagentoSequence.php index 955b66ecf..52a995be1 100644 --- a/src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoSequence.php @@ -1,5 +1,5 @@ sharedInstances[\Magento\AcceptanceTestFramework\ObjectManager::class] = $this; + $this->sharedInstances[\Magento\FunctionalTestingFramework\ObjectManager::class] = $this; } /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Config.php similarity index 88% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Config.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Config.php index d373b1007..fdc8ca373 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Config.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager; +namespace Magento\FunctionalTestingFramework\ObjectManager; -use Magento\AcceptanceTestFramework\ObjectManager\Config\Config as ObjectManagerConfig; +use Magento\FunctionalTestingFramework\ObjectManager\Config\Config as ObjectManagerConfig; /** * Class Config diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Config.php similarity index 90% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Config/Config.php index 2a5cdede1..8003f557c 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Config.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Config.php @@ -3,20 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Config; +namespace Magento\FunctionalTestingFramework\ObjectManager\Config; -use Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface; -use Magento\AcceptanceTestFramework\ObjectManager\RelationsInterface; +use Magento\FunctionalTestingFramework\ObjectManager\DefinitionInterface; +use Magento\FunctionalTestingFramework\ObjectManager\RelationsInterface; /** * Class Config */ -class Config implements \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface +class Config implements \Magento\FunctionalTestingFramework\ObjectManager\ConfigInterface { /** * Class definitions * - * @var \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface + * @var \Magento\FunctionalTestingFramework\ObjectManager\DefinitionInterface */ protected $definitions; @@ -76,8 +76,8 @@ class Config implements \Magento\AcceptanceTestFramework\ObjectManager\ConfigInt */ public function __construct(RelationsInterface $relations = null, DefinitionInterface $definitions = null) { - $this->relations = $relations ? : new \Magento\AcceptanceTestFramework\ObjectManager\Relations\Runtime(); - $this->definitions = $definitions ? : new \Magento\AcceptanceTestFramework\ObjectManager\Definition\Runtime(); + $this->relations = $relations ? : new \Magento\FunctionalTestingFramework\ObjectManager\Relations\Runtime(); + $this->definitions = $definitions ? : new \Magento\FunctionalTestingFramework\ObjectManager\Definition\Runtime(); } /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Mapper/ArgumentParser.php similarity index 79% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Config/Mapper/ArgumentParser.php index e96b851b2..33089e7a0 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/ArgumentParser.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Mapper/ArgumentParser.php @@ -3,11 +3,11 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper; +namespace Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper; -use Magento\AcceptanceTestFramework\Config\Converter\Dom\Flat as FlatConverter; -use Magento\AcceptanceTestFramework\Config\Dom\ArrayNodeConfig; -use Magento\AcceptanceTestFramework\Config\Dom\NodePathMatcher; +use Magento\FunctionalTestingFramework\Config\Converter\Dom\Flat as FlatConverter; +use Magento\FunctionalTestingFramework\Config\Dom\ArrayNodeConfig; +use Magento\FunctionalTestingFramework\Config\Dom\NodePathMatcher; /** * Parser of a DI argument node that returns its array representation with no data loss diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Mapper/Dom.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Config/Mapper/Dom.php index 14ffdcbd9..bf11e0003 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Mapper/Dom.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Mapper/Dom.php @@ -3,13 +3,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper; +namespace Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper; -use Magento\AcceptanceTestFramework\Data\Argument\InterpreterInterface; -use Magento\AcceptanceTestFramework\Stdlib\BooleanUtils; +use Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface; +use Magento\FunctionalTestingFramework\Stdlib\BooleanUtils; // @codingStandardsIgnoreFile -class Dom implements \Magento\AcceptanceTestFramework\Config\ConverterInterface +class Dom implements \Magento\FunctionalTestingFramework\Config\ConverterInterface { /** * @var BooleanUtils diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Reader/Dom.php similarity index 59% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Config/Reader/Dom.php index 921b76120..876e949cb 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/Dom.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Reader/Dom.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Config\Reader; +namespace Magento\FunctionalTestingFramework\ObjectManager\Config\Reader; /** * Class Dom @@ -11,7 +11,7 @@ * @internal */ // @codingStandardsIgnoreFile -class Dom extends \Magento\AcceptanceTestFramework\Config\Reader\Filesystem +class Dom extends \Magento\FunctionalTestingFramework\Config\Reader\Filesystem { /** * Name of an attribute that stands for data type of node values @@ -20,20 +20,20 @@ class Dom extends \Magento\AcceptanceTestFramework\Config\Reader\Filesystem /** * Dom constructor. - * @param \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver - * @param \Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom $converter - * @param \Magento\AcceptanceTestFramework\ObjectManager\Config\SchemaLocator $schemaLocator - * @param \Magento\AcceptanceTestFramework\Config\ValidationStateInterface $validationState + * @param \Magento\FunctionalTestingFramework\Config\FileResolverInterface $fileResolver + * @param \Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper\Dom $converter + * @param \Magento\FunctionalTestingFramework\ObjectManager\Config\SchemaLocator $schemaLocator + * @param \Magento\FunctionalTestingFramework\Config\ValidationStateInterface $validationState * @param string $fileName * @param array $idAttributes * @param string $domDocumentClass * @param string $defaultScope */ public function __construct( - \Magento\AcceptanceTestFramework\Config\FileResolverInterface $fileResolver, - \Magento\AcceptanceTestFramework\ObjectManager\Config\Mapper\Dom $converter, - \Magento\AcceptanceTestFramework\ObjectManager\Config\SchemaLocator $schemaLocator, - \Magento\AcceptanceTestFramework\Config\ValidationStateInterface $validationState, + \Magento\FunctionalTestingFramework\Config\FileResolverInterface $fileResolver, + \Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper\Dom $converter, + \Magento\FunctionalTestingFramework\ObjectManager\Config\SchemaLocator $schemaLocator, + \Magento\FunctionalTestingFramework\Config\ValidationStateInterface $validationState, $fileName = 'di.xml', $idAttributes = [ '/config/preference' => 'for', @@ -41,7 +41,7 @@ public function __construct( '/config/(type|virtualType)/arguments/argument' => 'name', '/config/(type|virtualType)/arguments/argument(/item)+' => 'name' ], - $domDocumentClass = 'Magento\AcceptanceTestFramework\Config\Dom', + $domDocumentClass = 'Magento\FunctionalTestingFramework\Config\Dom', $defaultScope = 'etc' ) { parent::__construct( @@ -61,7 +61,7 @@ public function __construct( * * @param string $mergerClass * @param string $initialContents - * @return \Magento\AcceptanceTestFramework\Config\Dom + * @return \Magento\FunctionalTestingFramework\Config\Dom */ protected function _createConfigMerger($mergerClass, $initialContents) { diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Reader/DomFactory.php similarity index 58% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Config/Reader/DomFactory.php index 9f8dc3dbd..78e977625 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/Reader/DomFactory.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Reader/DomFactory.php @@ -5,17 +5,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Config\Reader; +namespace Magento\FunctionalTestingFramework\ObjectManager\Config\Reader; /** - * Factory class for \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom + * Factory class for \Magento\FunctionalTestingFramework\ObjectManager\Config\Reader\Dom */ class DomFactory { /** * Object Manager instance * - * @var \Magento\AcceptanceTestFramework\ObjectManagerInterface + * @var \Magento\FunctionalTestingFramework\ObjectManagerInterface */ protected $objectManager = null; @@ -29,12 +29,12 @@ class DomFactory /** * Factory constructor * - * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager + * @param \Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager * @param string $instanceName */ public function __construct( - \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager, - $instanceName = \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom::class + \Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager, + $instanceName = \Magento\FunctionalTestingFramework\ObjectManager\Config\Reader\Dom::class ) { $this->objectManager = $objectManager; $this->instanceName = $instanceName; @@ -44,7 +44,7 @@ public function __construct( * Create class instance with specified parameters * * @param array $data - * @return \Magento\AcceptanceTestFramework\ObjectManager\Config\Reader\Dom + * @return \Magento\FunctionalTestingFramework\ObjectManager\Config\Reader\Dom */ public function create(array $data = []) { diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/SchemaLocator.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/SchemaLocator.php similarity index 81% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Config/SchemaLocator.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Config/SchemaLocator.php index ea45a4e49..fd4f92b17 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Config/SchemaLocator.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/SchemaLocator.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Config; +namespace Magento\FunctionalTestingFramework\ObjectManager\Config; -use Magento\AcceptanceTestFramework\Config\SchemaLocatorInterface; +use Magento\FunctionalTestingFramework\Config\SchemaLocatorInterface; /** * Class SchemaLocator diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php b/src/Magento/FunctionalTestingFramework/ObjectManager/ConfigInterface.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/ConfigInterface.php index 6b6777bbe..bec418fc0 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/ConfigInterface.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/ConfigInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager; +namespace Magento\FunctionalTestingFramework\ObjectManager; /** * Interface ConfigInterface diff --git a/src/Magento/FunctionalTestingFramework/ObjectManager/ConfigLoader/Primary.php b/src/Magento/FunctionalTestingFramework/ObjectManager/ConfigLoader/Primary.php new file mode 100644 index 000000000..265127c35 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/ConfigLoader/Primary.php @@ -0,0 +1,71 @@ +createArgumentInterpreter() + ), + new \Magento\FunctionalTestingFramework\ObjectManager\Config\SchemaLocator(), + new \Magento\FunctionalTestingFramework\Config\ValidationState($this->appMode) + ); + + return $reader->read(); + } + + + /** + * Return newly created instance on an argument interpreter, suitable for processing DI arguments + * + * @return \Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface + */ + protected function createArgumentInterpreter() + { + $booleanUtils = new \Magento\FunctionalTestingFramework\Stdlib\BooleanUtils(); + $constInterpreter = new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Constant(); + $result = new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Composite( + [ + 'boolean' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Boolean($booleanUtils), + 'string' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), + 'number' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Number(), + 'null' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\NullType(), + 'object' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\DataObject($booleanUtils), + 'const' => $constInterpreter, + 'init_parameter' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Argument($constInterpreter) + ], + \Magento\FunctionalTestingFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE + ); + // Add interpreters that reference the composite + $result->addInterpreter('array', new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\ArrayType($result)); + return $result; + } +} diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Definition/Runtime.php similarity index 69% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Definition/Runtime.php index aeebbe33b..f77e7d110 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Definition/Runtime.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Definition/Runtime.php @@ -4,12 +4,12 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Definition; +namespace Magento\FunctionalTestingFramework\ObjectManager\Definition; /** * Class Runtime */ -class Runtime implements \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface +class Runtime implements \Magento\FunctionalTestingFramework\ObjectManager\DefinitionInterface { /** * Definitions. @@ -21,17 +21,17 @@ class Runtime implements \Magento\AcceptanceTestFramework\ObjectManager\Definiti /** * Reader. * - * @var \Magento\AcceptanceTestFramework\Code\Reader\ClassReader + * @var \Magento\FunctionalTestingFramework\Code\Reader\ClassReader */ private $reader; /** * Runtime constructor. - * @param \Magento\AcceptanceTestFramework\Code\Reader\ClassReader|null $reader + * @param \Magento\FunctionalTestingFramework\Code\Reader\ClassReader|null $reader */ - public function __construct(\Magento\AcceptanceTestFramework\Code\Reader\ClassReader $reader = null) + public function __construct(\Magento\FunctionalTestingFramework\Code\Reader\ClassReader $reader = null) { - $this->reader = $reader ? : new \Magento\AcceptanceTestFramework\Code\Reader\ClassReader(); + $this->reader = $reader ? : new \Magento\FunctionalTestingFramework\Code\Reader\ClassReader(); } /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/DefinitionInterface.php b/src/Magento/FunctionalTestingFramework/ObjectManager/DefinitionInterface.php similarity index 93% rename from src/Magento/AcceptanceTestFramework/ObjectManager/DefinitionInterface.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/DefinitionInterface.php index ff41f69f0..124230fa3 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/DefinitionInterface.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/DefinitionInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager; +namespace Magento\FunctionalTestingFramework\ObjectManager; /** * Interface DefinitionInterface diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Factory.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Factory.php index 48e4d46ad..b377139e2 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Factory.php @@ -4,34 +4,34 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager; +namespace Magento\FunctionalTestingFramework\ObjectManager; -use Magento\AcceptanceTestFramework\System\Code\ClassReader; +use Magento\FunctionalTestingFramework\System\Code\ClassReader; /** * Class Factory * * @internal */ -class Factory extends \Magento\AcceptanceTestFramework\ObjectManager\Factory\Dynamic\Developer +class Factory extends \Magento\FunctionalTestingFramework\ObjectManager\Factory\Dynamic\Developer { /** * Class reader. * - * @var \Magento\AcceptanceTestFramework\System\Code\ClassReader + * @var \Magento\FunctionalTestingFramework\System\Code\ClassReader */ protected $classReader; /** * Factory constructor. * @param ConfigInterface $config - * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface|null $objectManager + * @param \Magento\FunctionalTestingFramework\ObjectManagerInterface|null $objectManager * @param DefinitionInterface|null $definitions * @param array $globalArguments */ public function __construct( ConfigInterface $config, - \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager = null, + \Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager = null, DefinitionInterface $definitions = null, $globalArguments = [] ) { diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Factory/Dynamic/Developer.php similarity index 82% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Factory/Dynamic/Developer.php index 7c0d4c219..5e452e55f 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Factory/Dynamic/Developer.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Factory/Dynamic/Developer.php @@ -3,31 +3,31 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Factory\Dynamic; +namespace Magento\FunctionalTestingFramework\ObjectManager\Factory\Dynamic; /** * Class Developer */ -class Developer implements \Magento\AcceptanceTestFramework\ObjectManager\FactoryInterface +class Developer implements \Magento\FunctionalTestingFramework\ObjectManager\FactoryInterface { /** * Object manager * - * @var \Magento\AcceptanceTestFramework\ObjectManagerInterface + * @var \Magento\FunctionalTestingFramework\ObjectManagerInterface */ protected $objectManager; /** * Object manager config * - * @var \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface + * @var \Magento\FunctionalTestingFramework\ObjectManager\ConfigInterface */ protected $config; /** * Definition list * - * @var \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface + * @var \Magento\FunctionalTestingFramework\ObjectManager\DefinitionInterface */ protected $definitions; @@ -47,30 +47,30 @@ class Developer implements \Magento\AcceptanceTestFramework\ObjectManager\Factor /** * Developer constructor. - * @param \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config - * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface|null $objectManager - * @param \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface|null $definitions + * @param \Magento\FunctionalTestingFramework\ObjectManager\ConfigInterface $config + * @param \Magento\FunctionalTestingFramework\ObjectManagerInterface|null $objectManager + * @param \Magento\FunctionalTestingFramework\ObjectManager\DefinitionInterface|null $definitions * @param array $globalArguments */ public function __construct( - \Magento\AcceptanceTestFramework\ObjectManager\ConfigInterface $config, - \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager = null, - \Magento\AcceptanceTestFramework\ObjectManager\DefinitionInterface $definitions = null, + \Magento\FunctionalTestingFramework\ObjectManager\ConfigInterface $config, + \Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager = null, + \Magento\FunctionalTestingFramework\ObjectManager\DefinitionInterface $definitions = null, $globalArguments = [] ) { $this->config = $config; $this->objectManager = $objectManager; - $this->definitions = $definitions ?: new \Magento\AcceptanceTestFramework\ObjectManager\Definition\Runtime(); + $this->definitions = $definitions ?: new \Magento\FunctionalTestingFramework\ObjectManager\Definition\Runtime(); $this->globalArguments = $globalArguments; } /** * Set object manager * - * @param \Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager + * @param \Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager * @return void */ - public function setObjectManager(\Magento\AcceptanceTestFramework\ObjectManagerInterface $objectManager) + public function setObjectManager(\Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager) { $this->objectManager = $objectManager; } diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/FactoryInterface.php b/src/Magento/FunctionalTestingFramework/ObjectManager/FactoryInterface.php similarity index 88% rename from src/Magento/AcceptanceTestFramework/ObjectManager/FactoryInterface.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/FactoryInterface.php index d77b62ffc..eca6f5bb1 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/FactoryInterface.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/FactoryInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager; +namespace Magento\FunctionalTestingFramework\ObjectManager; /** * Interface FactoryInterface diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php b/src/Magento/FunctionalTestingFramework/ObjectManager/ObjectHandlerInterface.php similarity index 91% rename from src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/ObjectHandlerInterface.php index 8964d9526..1c2e76b2d 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectHandlerInterface.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/ObjectHandlerInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager; +namespace Magento\FunctionalTestingFramework\ObjectManager; /** * Interface ObjectHandlerInterface diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php b/src/Magento/FunctionalTestingFramework/ObjectManager/ObjectManager.php similarity index 85% rename from src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/ObjectManager.php index 352534f19..ff177e87a 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/ObjectManager.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/ObjectManager.php @@ -4,17 +4,17 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager; +namespace Magento\FunctionalTestingFramework\ObjectManager; /** * Class ObjectManager */ -class ObjectManager implements \Magento\AcceptanceTestFramework\ObjectManagerInterface +class ObjectManager implements \Magento\FunctionalTestingFramework\ObjectManagerInterface { /** * Create instance with call time arguments. * - * @var \Magento\AcceptanceTestFramework\ObjectManager\FactoryInterface + * @var \Magento\FunctionalTestingFramework\ObjectManager\FactoryInterface */ protected $factory; @@ -43,7 +43,7 @@ public function __construct(FactoryInterface $factory, ConfigInterface $config, $this->config = $config; $this->factory = $factory; $this->sharedInstances = $sharedInstances; - $this->sharedInstances[\Magento\AcceptanceTestFramework\ObjectManagerInterface::class] = $this; + $this->sharedInstances[\Magento\FunctionalTestingFramework\ObjectManagerInterface::class] = $this; } /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Relations/Runtime.php similarity index 61% rename from src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/Relations/Runtime.php index d5d281256..4da8b6de0 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/Relations/Runtime.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Relations/Runtime.php @@ -3,17 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager\Relations; +namespace Magento\FunctionalTestingFramework\ObjectManager\Relations; /** * Class Runtime */ -class Runtime implements \Magento\AcceptanceTestFramework\ObjectManager\RelationsInterface +class Runtime implements \Magento\FunctionalTestingFramework\ObjectManager\RelationsInterface { /** * Class reader. * - * @var \Magento\AcceptanceTestFramework\Code\Reader\ClassReader + * @var \Magento\FunctionalTestingFramework\Code\Reader\ClassReader */ protected $classReader; @@ -26,11 +26,11 @@ class Runtime implements \Magento\AcceptanceTestFramework\ObjectManager\Relation /** * Runtime constructor. - * @param \Magento\AcceptanceTestFramework\Code\Reader\ClassReader|null $classReader + * @param \Magento\FunctionalTestingFramework\Code\Reader\ClassReader|null $classReader */ - public function __construct(\Magento\AcceptanceTestFramework\Code\Reader\ClassReader $classReader = null) + public function __construct(\Magento\FunctionalTestingFramework\Code\Reader\ClassReader $classReader = null) { - $this->classReader = $classReader ? : new \Magento\AcceptanceTestFramework\Code\Reader\ClassReader(); + $this->classReader = $classReader ? : new \Magento\FunctionalTestingFramework\Code\Reader\ClassReader(); } /** diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/RelationsInterface.php b/src/Magento/FunctionalTestingFramework/ObjectManager/RelationsInterface.php similarity index 88% rename from src/Magento/AcceptanceTestFramework/ObjectManager/RelationsInterface.php rename to src/Magento/FunctionalTestingFramework/ObjectManager/RelationsInterface.php index 4a9919b40..51245710f 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManager/RelationsInterface.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/RelationsInterface.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\ObjectManager; +namespace Magento\FunctionalTestingFramework\ObjectManager; /** * Interface RelationsInterface diff --git a/src/Magento/AcceptanceTestFramework/ObjectManager/etc/config.xsd b/src/Magento/FunctionalTestingFramework/ObjectManager/etc/config.xsd similarity index 100% rename from src/Magento/AcceptanceTestFramework/ObjectManager/etc/config.xsd rename to src/Magento/FunctionalTestingFramework/ObjectManager/etc/config.xsd diff --git a/src/Magento/FunctionalTestingFramework/ObjectManagerFactory.php b/src/Magento/FunctionalTestingFramework/ObjectManagerFactory.php new file mode 100644 index 000000000..c858a4035 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/ObjectManagerFactory.php @@ -0,0 +1,120 @@ +configClassName(); + + $factory = new Factory($diConfig); + $argInterpreter = $this->createArgumentInterpreter(new BooleanUtils()); + $argumentMapper = new \Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper\Dom($argInterpreter); + + + $sharedInstances['Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface'] = $argInterpreter; + $sharedInstances['Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper\Dom'] = $argumentMapper; + + /** @var \Magento\FunctionalTestingFramework\ObjectManager $objectManager */ + $objectManager = new $this->locatorClassName($factory, $diConfig, $sharedInstances); + + $factory->setObjectManager($objectManager); + ObjectManager::setInstance($objectManager); + + self::configure($objectManager); + + return $objectManager; + } + + /** + * Return newly created instance on an argument interpreter, suitable for processing DI arguments. + * + * @param \Magento\FunctionalTestingFramework\Stdlib\BooleanUtils $booleanUtils + * @return \Magento\FunctionalTestingFramework\Data\Argument\InterpreterInterface + */ + protected function createArgumentInterpreter( + \Magento\FunctionalTestingFramework\Stdlib\BooleanUtils $booleanUtils + ) { + $constInterpreter = new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Constant(); + $result = new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Composite( + [ + 'boolean' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Boolean($booleanUtils), + 'string' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\StringUtils($booleanUtils), + 'number' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Number(), + 'null' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\NullType(), + 'const' => $constInterpreter, + 'object' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\DataObject($booleanUtils), + 'init_parameter' => new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Argument($constInterpreter), + ], + \Magento\FunctionalTestingFramework\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE + ); + // Add interpreters that reference the composite + $result->addInterpreter('array', new \Magento\FunctionalTestingFramework\Data\Argument\Interpreter\ArrayType($result)); + return $result; + } + + /** + * Get Object Manager instance. + * + * @return ObjectManager + */ + public static function getObjectManager() + { + if (!$objectManager = ObjectManager::getInstance()) { + $objectManagerFactory = new self(); + $objectManager = $objectManagerFactory->create(); + } + + return $objectManager; + } + + /** + * Configure Object Manager. + * This method is static to have the ability to configure multiple instances of Object manager when needed. + * + * @param \Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager + * @return void + */ + public static function configure(\Magento\FunctionalTestingFramework\ObjectManagerInterface $objectManager) + { + $objectManager->configure( + $objectManager->get(\Magento\FunctionalTestingFramework\ObjectManager\ConfigLoader\Primary::class)->load() + ); + } +} diff --git a/src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php b/src/Magento/FunctionalTestingFramework/ObjectManagerInterface.php similarity index 93% rename from src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php rename to src/Magento/FunctionalTestingFramework/ObjectManagerInterface.php index ddefaf71f..4e7c9da1d 100644 --- a/src/Magento/AcceptanceTestFramework/ObjectManagerInterface.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManagerInterface.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework; +namespace Magento\FunctionalTestingFramework; /** * Interface ObjectManagerInterface diff --git a/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php b/src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php similarity index 84% rename from src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php rename to src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php index 1d3dd4ac6..46accb0a5 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Handlers/PageObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php @@ -4,12 +4,12 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Page\Handlers; +namespace Magento\FunctionalTestingFramework\Page\Handlers; -use Magento\AcceptanceTestFramework\ObjectManager\ObjectHandlerInterface; -use Magento\AcceptanceTestFramework\ObjectManagerFactory; -use Magento\AcceptanceTestFramework\Page\Objects\PageObject; -use Magento\AcceptanceTestFramework\XmlParser\PageParser; +use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface; +use Magento\FunctionalTestingFramework\ObjectManagerFactory; +use Magento\FunctionalTestingFramework\Page\Objects\PageObject; +use Magento\FunctionalTestingFramework\XmlParser\PageParser; /** * Class PageObjectHandler @@ -91,7 +91,7 @@ public function getAllObjects() private function initPageObjects() { $objectManager = ObjectManagerFactory::getObjectManager(); - /** @var $parser \Magento\AcceptanceTestFramework\XmlParser\PageParser */ + /** @var $parser \Magento\FunctionalTestingFramework\XmlParser\PageParser */ $parser = $objectManager->get(PageParser::class); foreach ($parser->getData(self::TYPE) as $pageName => $pageData) { $urlPath = $pageData[PageObjectHandler::URL_PATH_ATTR]; diff --git a/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php b/src/Magento/FunctionalTestingFramework/Page/Handlers/SectionObjectHandler.php similarity index 85% rename from src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php rename to src/Magento/FunctionalTestingFramework/Page/Handlers/SectionObjectHandler.php index bf73ba37a..5635190b6 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Handlers/SectionObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Page/Handlers/SectionObjectHandler.php @@ -4,13 +4,13 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Page\Handlers; +namespace Magento\FunctionalTestingFramework\Page\Handlers; -use Magento\AcceptanceTestFramework\ObjectManager\ObjectHandlerInterface; -use Magento\AcceptanceTestFramework\ObjectManagerFactory; -use Magento\AcceptanceTestFramework\Page\Objects\ElementObject; -use Magento\AcceptanceTestFramework\Page\Objects\SectionObject; -use Magento\AcceptanceTestFramework\XmlParser\SectionParser; +use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface; +use Magento\FunctionalTestingFramework\ObjectManagerFactory; +use Magento\FunctionalTestingFramework\Page\Objects\ElementObject; +use Magento\FunctionalTestingFramework\Page\Objects\SectionObject; +use Magento\FunctionalTestingFramework\XmlParser\SectionParser; /** * Class SectionObjectHandler @@ -94,7 +94,7 @@ public function getAllObjects() private function initSectionObjects() { $objectManager = ObjectManagerFactory::getObjectManager(); - /** @var $parser \Magento\AcceptanceTestFramework\XmlParser\SectionParser */ + /** @var $parser \Magento\FunctionalTestingFramework\XmlParser\SectionParser */ $parser = $objectManager->get(SectionParser::class); foreach ($parser->getData(self::TYPE) as $sectionName => $sectionData) { // create elements diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php b/src/Magento/FunctionalTestingFramework/Page/Objects/ElementObject.php similarity index 96% rename from src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php rename to src/Magento/FunctionalTestingFramework/Page/Objects/ElementObject.php index c9c6a0b8e..912c70583 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Objects/ElementObject.php +++ b/src/Magento/FunctionalTestingFramework/Page/Objects/ElementObject.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Page\Objects; +namespace Magento\FunctionalTestingFramework\Page\Objects; /** * Class ElementObject diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php b/src/Magento/FunctionalTestingFramework/Page/Objects/PageObject.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php rename to src/Magento/FunctionalTestingFramework/Page/Objects/PageObject.php index 3be5c5b00..ae43c3ae2 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Objects/PageObject.php +++ b/src/Magento/FunctionalTestingFramework/Page/Objects/PageObject.php @@ -4,10 +4,10 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Page\Objects; +namespace Magento\FunctionalTestingFramework\Page\Objects; -use Magento\AcceptanceTestFramework\Page\Handlers\SectionObjectHandler; +use Magento\FunctionalTestingFramework\Page\Handlers\SectionObjectHandler; /** * Class PageObject diff --git a/src/Magento/AcceptanceTestFramework/Page/Objects/SectionObject.php b/src/Magento/FunctionalTestingFramework/Page/Objects/SectionObject.php similarity index 95% rename from src/Magento/AcceptanceTestFramework/Page/Objects/SectionObject.php rename to src/Magento/FunctionalTestingFramework/Page/Objects/SectionObject.php index 04235ffbb..f9376f9d4 100644 --- a/src/Magento/AcceptanceTestFramework/Page/Objects/SectionObject.php +++ b/src/Magento/FunctionalTestingFramework/Page/Objects/SectionObject.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Page\Objects; +namespace Magento\FunctionalTestingFramework\Page\Objects; /** * Class SectionObject diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd b/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd similarity index 100% rename from src/Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd rename to src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd diff --git a/src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd b/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd similarity index 100% rename from src/Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd rename to src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd diff --git a/src/Magento/AcceptanceTestFramework/Stdlib/BooleanUtils.php b/src/Magento/FunctionalTestingFramework/Stdlib/BooleanUtils.php similarity index 96% rename from src/Magento/AcceptanceTestFramework/Stdlib/BooleanUtils.php rename to src/Magento/FunctionalTestingFramework/Stdlib/BooleanUtils.php index 17da5ab45..70f933ec6 100644 --- a/src/Magento/AcceptanceTestFramework/Stdlib/BooleanUtils.php +++ b/src/Magento/FunctionalTestingFramework/Stdlib/BooleanUtils.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Stdlib; +namespace Magento\FunctionalTestingFramework\Stdlib; /** * Utility methods for the boolean data type diff --git a/src/Magento/AcceptanceTestFramework/Step/Backend/AdminStep.php b/src/Magento/FunctionalTestingFramework/Step/Backend/AdminStep.php similarity index 58% rename from src/Magento/AcceptanceTestFramework/Step/Backend/AdminStep.php rename to src/Magento/FunctionalTestingFramework/Step/Backend/AdminStep.php index 9f10e2444..8284de253 100644 --- a/src/Magento/AcceptanceTestFramework/Step/Backend/AdminStep.php +++ b/src/Magento/FunctionalTestingFramework/Step/Backend/AdminStep.php @@ -1,10 +1,10 @@ amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLoginPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminLoginPage); $I->waitForPageLoad(); } public function goToTheAdminLogoutPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLogoutPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminLogoutPage); } // Sales public function goToTheAdminOrdersGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrdersGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrdersGrid); $I->waitForPageLoad(); } public function goToTheAdminOrderForIdPage($orderId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); $I->waitForPageLoad(); } public function goToTheAdminAddOrderPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddOrderPage); $I->waitForPageLoad(); } public function goToTheAdminAddOrderForCustomerIdPage($customerId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); $I->waitForPageLoad(); } public function goToTheAdminInvoicesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminInvoicesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminInvoicesGrid); $I->waitForPageLoad(); } public function goToTheAdminAddInvoiceForOrderIdPage($orderId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); $I->waitForPageLoad(); } public function goToTheAdminShipmentsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShipmentsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminShipmentsGrid); $I->waitForPageLoad(); } public function goToTheAdminShipmentForIdPage($shipmentId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); $I->waitForPageLoad(); } public function goToTheAdminCreditMemosGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreditMemosGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreditMemosGrid); $I->waitForPageLoad(); } public function goToTheAdminCreditMemoForIdPage($creditMemoId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); $I->waitForPageLoad(); } public function goToTheAdminBillingAgreementsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBillingAgreementsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBillingAgreementsGrid); $I->waitForPageLoad(); } public function goToTheAdminTransactionsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTransactionsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTransactionsGrid); $I->waitForPageLoad(); } @@ -218,70 +218,70 @@ public function goToTheAdminTransactionsGrid() public function goToTheAdminCatalogPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCatalogGrid); $I->waitForPageLoad(); } public function goToTheAdminProductForIdPage($productId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductForIdPage . $productId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductForIdPage . $productId)); $I->waitForPageLoad(); } public function goToTheAdminAddSimpleProductPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSimpleProductPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddSimpleProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddConfigurableProductPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddConfigurableProductPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddConfigurableProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddGroupedProductPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddGroupedProductPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddGroupedProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddVirtualProductPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddVirtualProductPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddVirtualProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddBundledProductPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddBundleProductPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddBundleProductPage); $I->waitForPageLoad(); } public function goToTheAdminAddDownloadableProductPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddDownloadableProductPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddDownloadableProductPage); $I->waitForPageLoad(); } public function goToTheAdminCategoriesPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCategoriesPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCategoriesPage); $I->waitForPageLoad(); } public function goToTheAdminCategoryForIdPage($categoryId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); $I->waitForPageLoad(); } @@ -303,28 +303,28 @@ public function goToTheAdminAddSubCategoryForStoreIdPage($storeId) public function goToTheAdminAllCustomersGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllCustomersGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAllCustomersGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomersNowOnlineGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomerForIdPage($customerId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); $I->waitForPageLoad(); } public function goToTheAdminAddCustomerPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomerPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCustomerPage); $I->waitForPageLoad(); } @@ -332,203 +332,203 @@ public function goToTheAdminAddCustomerPage() public function goToTheAdminCatalogPriceRuleGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); $I->waitForPageLoad(); } public function goToTheAdminCatalogPriceRuleForIdPage($catalogPriceRuleId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); $I->waitForPageLoad(); } public function goToTheAdminAddCatalogPriceRulePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); $I->waitForPageLoad(); } public function goToTheAdminCartPriceRulesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCartPriceRulesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCartPriceRulesGrid); $I->waitForPageLoad(); } public function goToTheAdminCartPriceRuleForIdPage($cartPriceRuleId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); $I->waitForPageLoad(); } public function goToTheAdminAddCartPriceRulePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCartPriceRulePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCartPriceRulePage); $I->waitForPageLoad(); } public function goToTheAdminEmailTemplatesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEmailTemplatesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminEmailTemplatesGrid); $I->waitForPageLoad(); } public function goToTheAdminEmailTemplateForIdPage($emailTemplateId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); $I->waitForPageLoad(); } public function goToTheAdminAddEmailTemplatePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddEmailTemplatePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddEmailTemplatePage); $I->waitForPageLoad(); } public function goToTheAdminNewsletterTemplateGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterTemplateGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterTemplateGrid); $I->waitForPageLoad(); } public function goToTheAdminNewsletterTemplateByIdPage($newsletterTemplateId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); $I->waitForPageLoad(); } public function goToTheAdminAddNewsletterTemplatePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); $I->waitForPageLoad(); } public function goToTheAdminNewsletterQueueGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterQueueGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterQueueGrid); $I->waitForPageLoad(); } public function goToTheAdminNewsletterSubscribersGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); $I->waitForPageLoad(); } public function goToTheAdminURLRewritesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminURLRewritesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminURLRewritesGrid); $I->waitForPageLoad(); } public function goToTheAdminURLRewriteForId($urlRewriteId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); $I->waitForPageLoad(); } public function goToTheAdminAddURLRewritePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddURLRewritePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddURLRewritePage); $I->waitForPageLoad(); } public function goToTheAdminSearchTermsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchTermsGrid); $I->waitForPageLoad(); } public function goToTheAdminSearchTermForIdPage($searchTermId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); $I->waitForPageLoad(); } public function goToTheAdminAddSearchTermPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSearchTermPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddSearchTermPage); $I->waitForPageLoad(); } public function goToTheAdminSearchSynonymsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchSynonymsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchSynonymsGrid); $I->waitForPageLoad(); } public function goToTheAdminSearchSynonymGroupByIdPage($searchSynonymId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); $I->waitForPageLoad(); } public function goToTheAdminAddSearchSynonymGroupPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); $I->waitForPageLoad(); } public function goToTheAdminSiteMapGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSiteMapGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSiteMapGrid); $I->waitForPageLoad(); } public function goToTheAdminSiteMapForIdPage($siteMapId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); $I->waitForPageLoad(); } public function goToTheAdminAddSiteMapPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSiteMapPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddSiteMapPage); $I->waitForPageLoad(); } public function goToTheAdminReviewsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminReviewsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminReviewsGrid); $I->waitForPageLoad(); } public function goToTheAdminReviewForIdPage($reviewId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); $I->waitForPageLoad(); } public function goToTheAdminAddReviewPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddReviewPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddReviewPage); $I->waitForPageLoad(); } @@ -536,98 +536,98 @@ public function goToTheAdminAddReviewPage() public function goToTheAdminPagesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPagesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminPagesGrid); $I->waitForPageLoad(); } public function goToTheAdminPageForIdPage($pageId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); $I->waitForPageLoad(); } public function goToTheAdminAddPagePage() { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddPagePage)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddPagePage)); $I->waitForPageLoad(); } public function goToTheAdminBlocksGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBlocksGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBlocksGrid); $I->waitForPageLoad(); } public function goToTheAdminBlockForIdPage($blockId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); $I->waitForPageLoad(); } public function goToTheAdminAddBlockPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddBlockPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddBlockPage); $I->waitForPageLoad(); } public function goToTheAdminWidgetsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWidgetsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminWidgetsGrid); $I->waitForPageLoad(); } public function goToTheAdminAddWidgetPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddWidgetPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddWidgetPage); $I->waitForPageLoad(); } public function goToTheAdminDesignConfigurationGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDesignConfigurationGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminDesignConfigurationGrid); $I->waitForPageLoad(); } public function goToTheAdminThemesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminThemesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminThemesGrid); $I->waitForPageLoad(); } public function goToTheAdminThemeByIdPage($themeId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); $I->waitForPageLoad(); } public function goToTheAdminStoreContentScheduleGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreContentScheduleGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminStoreContentScheduleGrid); $I->waitForPageLoad(); } public function goToTheAdminStoreContentScheduleForIdPage($storeContentScheduleId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); $I->waitForPageLoad(); } public function goToTheAdminAddStoreDesignChangePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddStoreDesignChangePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddStoreDesignChangePage); $I->waitForPageLoad(); } @@ -635,49 +635,49 @@ public function goToTheAdminAddStoreDesignChangePage() public function goToTheAdminProductsInCartGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductsInCartGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductsInCartGrid); $I->waitForPageLoad(); } public function goToTheAdminSearchTermsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchTermsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminAbandonedCartsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAbandonedCartsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAbandonedCartsGrid); $I->waitForPageLoad(); } public function goToTheAdminNewsletterProblemsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomerReviewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminProductReviewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductReviewsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductReviewsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminProductReviewsForProductIdPage($productId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); $I->waitForPageLoad(); } @@ -691,119 +691,119 @@ public function goToTheAdminProductReviewIdForProductIdPage($productReviewId, $p public function goToTheAdminOrdersReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrdersReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrdersReportGrid); $I->waitForPageLoad(); } public function goToTheAdminTaxReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxReportGrid); $I->waitForPageLoad(); } public function goToTheAdminInvoiceReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminInvoiceReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminInvoiceReportGrid); $I->waitForPageLoad(); } public function goToTheAdminShippingReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShippingReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminShippingReportGrid); $I->waitForPageLoad(); } public function goToTheAdminRefundsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRefundsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminRefundsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminCouponsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCouponsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCouponsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminPayPalSettlementReportsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); $I->waitForPageLoad(); } public function goToTheAdminBraintreeSettlementReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); $I->waitForPageLoad(); } public function goToTheAdminOrderTotalReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderTotalReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderTotalReportGrid); $I->waitForPageLoad(); } public function goToTheAdminOrderCountReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderCountReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderCountReportGrid); $I->waitForPageLoad(); } public function goToTheAdminNewAccountsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewAccountsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewAccountsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminProductViewsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductViewsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductViewsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminBestsellersReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBestsellersReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBestsellersReportGrid); $I->waitForPageLoad(); } public function goToTheAdminLowStockReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLowStockReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminLowStockReportGrid); $I->waitForPageLoad(); } public function goToTheAdminOrderedProductsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderedProductsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderedProductsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminDownloadsReportGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDownloadsReportGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminDownloadsReportGrid); $I->waitForPageLoad(); } public function goToTheAdminRefreshStatisticsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRefreshStatisticsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminRefreshStatisticsGrid); $I->waitForPageLoad(); } @@ -811,231 +811,231 @@ public function goToTheAdminRefreshStatisticsGrid() public function goToTheAdminAllStoresGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllStoresGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAllStoresGrid); $I->waitForPageLoad(); } public function goToTheAdminCreateStoreViewPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateStoreViewPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreateStoreViewPage); $I->waitForPageLoad(); } public function goToTheAdminCreateStorePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateStorePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreateStorePage); $I->waitForPageLoad(); } public function goToTheAdminCreateWebsitePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateWebsitePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreateWebsitePage); $I->waitForPageLoad(); } public function goToTheAdminWebsiteForIdPage($websiteId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); $I->waitForPageLoad(); } public function goToTheAdminStoreViewForIdPage($storeViewId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); $I->waitForPageLoad(); } public function goToTheAdminStoreForIdPage($storeId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); $I->waitForPageLoad(); } public function goToTheAdminConfigurationGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminConfigurationGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminConfigurationGrid); $I->waitForPageLoad(); } public function goToTheAdminTermsAndConditionsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTermsAndConditionsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTermsAndConditionsGrid); $I->waitForPageLoad(); } public function goToTheAdminTermsAndConditionForIdPage($termsAndConditionsId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); $I->waitForPageLoad(); } public function goToTheAdminAddNewTermsAndConditionsPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); $I->waitForPageLoad(); } public function goToTheAdminOrderStatusGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderStatusGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderStatusGrid); $I->waitForPageLoad(); } public function goToTheAdminAddOrderStatusPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderStatusPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddOrderStatusPage); $I->waitForPageLoad(); } public function goToTheAdminTaxRulesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxRulesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxRulesGrid); $I->waitForPageLoad(); } public function goToTheAdminTaxRuleForIdPage($taxRuleId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); $I->waitForPageLoad(); } public function goToTheAdminAddTaxRulePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddTaxRulePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddTaxRulePage); $I->waitForPageLoad(); } public function goToTheAdminTaxZonesAndRatesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); $I->waitForPageLoad(); } public function goToTheAdminTaxZoneAndRateForIdPage($taxZoneAndRateId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); $I->waitForPageLoad(); } public function goToTheAdminAddTaxZoneAndRatePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); $I->waitForPageLoad(); } public function goToTheAdminCurrencyRatesPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCurrencyRatesPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCurrencyRatesPage); $I->waitForPageLoad(); } public function goToTheAdminCurrencySymbolsPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCurrencySymbolsPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCurrencySymbolsPage); $I->waitForPageLoad(); } public function goToTheAdminProductAttributesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductAttributesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductAttributesGrid); $I->waitForPageLoad(); } public function goToTheAdminProductAttributeForIdPage($productAttributeId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); $I->waitForPageLoad(); } public function goToTheAdminAddProductAttributePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddProductAttributePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddProductAttributePage); $I->waitForPageLoad(); } public function goToTheAdminAttributeSetGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAttributeSetsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAttributeSetsGrid); $I->waitForPageLoad(); } public function goToTheAdminAttributeSetByIdPage($attributeSetId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); $I->waitForPageLoad(); } public function goToTheAdminAddAttributeSetPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddAttributeSetPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddAttributeSetPage); $I->waitForPageLoad(); } public function goToTheAdminRatingGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRatingsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminRatingsGrid); $I->waitForPageLoad(); } public function goToTheAdminRatingForIdPage($ratingId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); $I->waitForPageLoad(); } public function goToTheAdminAddRatingPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddRatingPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddRatingPage); $I->waitForPageLoad(); } public function goToTheAdminCustomerGroupsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerGroupsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomerGroupsGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomerGroupForIdPage($customerGroupId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); $I->waitForPageLoad(); } public function goToTheAdminAddCustomerGroupPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomerGroupPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCustomerGroupPage); $I->waitForPageLoad(); } @@ -1043,168 +1043,168 @@ public function goToTheAdminAddCustomerGroupPage() public function goToTheAdminImportPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminImportPage); $I->waitForPageLoad(); } public function goToTheAdminExportPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminExportPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminExportPage); $I->waitForPageLoad(); } public function goToTheAdminImportAndExportTaxRatesPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); $I->waitForPageLoad(); } public function goToTheAdminImportHistoryGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportHistoryGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminImportHistoryGrid); $I->waitForPageLoad(); } public function goToTheAdminIntegrationsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIntegrationsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminIntegrationsGrid); $I->waitForPageLoad(); } public function goToTheAdminIntegrationForIdPage($integrationId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); $I->waitForPageLoad(); } public function goToTheAdminAddIntegrationPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddIntegrationPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddIntegrationPage); $I->waitForPageLoad(); } public function goToTheAdminCacheManagementGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCacheManagementGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCacheManagementGrid); $I->waitForPageLoad(); } public function goToTheAdminBackupsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBackupsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBackupsGrid); $I->waitForPageLoad(); } public function goToTheAdminIndexManagementGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIndexManagementGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminIndexManagementGrid); $I->waitForPageLoad(); } public function goToTheAdminWebSetupWizardPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWebSetupWizardPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminWebSetupWizardPage); $I->waitForPageLoad(); } public function goToTheAdminAllUsersGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllUsersGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAllUsersGrid); $I->waitForPageLoad(); } public function goToTheAdminUserForIdPage($userId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserByIdPage . $userId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminUserByIdPage . $userId)); $I->waitForPageLoad(); } public function goToTheAdminAddUserPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewUserPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddNewUserPage); $I->waitForPageLoad(); } public function goToTheAdminLockedUsersGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLockedUsersGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminLockedUsersGrid); $I->waitForPageLoad(); } public function goToTheAdminUserRolesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserRolesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminUserRolesGrid); $I->waitForPageLoad(); } public function goToTheAdminUserRoleForIdPage($userRoleId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); $I->waitForPageLoad(); } public function goToTheAdminAddUserRolePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddUserRolePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddUserRolePage); $I->waitForPageLoad(); } public function goToTheAdminNotificationsGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNotificationsGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNotificationsGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomVariablesGrid() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomVariablesGrid); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomVariablesGrid); $I->waitForPageLoad(); } public function goToTheAdminCustomVariableForId($customVariableId) { $I = $this; - $I->amOnPage((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); + $I->amOnPage((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); $I->waitForPageLoad(); } public function goToTheAdminAddCustomVariablePage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomVariablePage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCustomVariablePage); $I->waitForPageLoad(); } public function goToTheAdminEncryptionKeyPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEncryptionKeyPage); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminEncryptionKeyPage); $I->waitForPageLoad(); } public function goToTheAdminFindPartnersAndExtensionsPage() { $I = $this; - $I->amOnPage(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminFindPartnersAndExtensions); + $I->amOnPage(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminFindPartnersAndExtensions); $I->waitForPageLoad(); } @@ -1212,104 +1212,104 @@ public function goToTheAdminFindPartnersAndExtensionsPage() public function shouldBeOnTheAdminLoginPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLoginPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminLoginPage); } public function shouldBeOnTheAdminDashboardPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDashboardPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminDashboardPage); $I->see('Dashboard', self::$adminPageTitle); } public function shouldBeOnTheAdminForgotYourPasswordPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminForgotYourPasswordPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminForgotYourPasswordPage); } // Sales public function shouldBeOnTheAdminOrdersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrdersGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrdersGrid); $I->see('Orders', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderForIdPage($orderId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderByIdPage . $orderId)); $I->see($orderId, self::$adminPageTitle); } public function shouldBeOnTheAdminAddOrderPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddOrderPage); $I->see('Create New Order', self::$adminPageTitle); } public function shouldBeOnTheAdminAddOrderForCustomerIdPage($customerId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddOrderForCustomerIdPage . $customerId)); $I->see('Create New Order', self::$adminPageTitle); } public function shouldBeOnTheAdminInvoicesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminInvoicesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminInvoicesGrid); $I->see('Invoices', self::$adminPageTitle); } public function shouldBeOnTheAdminAddInvoiceForOrderIdPage($orderId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddInvoiceForOrderIdPage . $orderId)); $I->see('New Invoice', self::$adminPageTitle); } public function shouldBeOnTheAdminShipmentsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShipmentsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminShipmentsGrid); $I->see('Shipments', self::$adminPageTitle); } public function shouldBeOnTheAdminShipmentForIdPage($shipmentId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminShipmentForIdPage . $shipmentId)); $I->see('New Shipment'); } public function shouldBeOnTheAdminCreditMemosGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreditMemosGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreditMemosGrid); $I->see('Credit Memos', self::$adminPageTitle); } public function shouldBeOnTheAdminCreditMemoForIdPage($creditMemoId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreditMemoForIdPage . $creditMemoId)); $I->see('View Memo', self::$adminPageTitle); } public function shouldBeOnTheAdminBillingAgreementsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBillingAgreementsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBillingAgreementsGrid); $I->see('Billing Agreements', self::$adminPageTitle); } public function shouldBeOnTheAdminTransactionsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTransactionsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTransactionsGrid); $I->see('Transactions', self::$adminPageTitle); } @@ -1317,70 +1317,70 @@ public function shouldBeOnTheAdminTransactionsGrid() public function shouldBeOnTheAdminCatalogGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCatalogGrid); $I->see('Catalog', self::$adminPageTitle); } public function shouldBeOnTheAdminProductForIdPage($productId, $productName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductForIdPage . $productId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductForIdPage . $productId)); $I->see($productName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddSimpleProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSimpleProductPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddSimpleProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddConfigurableProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddConfigurableProductPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddConfigurableProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddGroupedProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddGroupedProductPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddGroupedProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddVirtualProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddVirtualProductPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddVirtualProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddBundledProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddBundleProductPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddBundleProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminAddDownloadableProductPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddDownloadableProductPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddDownloadableProductPage); $I->see('New Product', self::$adminPageTitle); } public function shouldBeOnTheAdminCategoriesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCategoriesPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCategoriesPage); $I->see('Default Category', self::$adminPageTitle); } public function shouldBeOnTheAdminCategoryForIdPage($categoryId, $categoryName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCategoryForIdPage . $categoryId)); $I->see($categoryName, self::$adminPageTitle); } @@ -1402,28 +1402,28 @@ public function shouldBeOnTheAdminAddSubCategoryForStoreIdPage($storeId) public function shouldBeOnTheAdminAllCustomersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllCustomersGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAllCustomersGrid); $I->see('Customers', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomersNowOnlineGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomersNowOnlineGrid); $I->see('Customers Now Online', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomerForIdPage($customerId, $customerName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomerForCustomerIdPage . $customerId)); $I->see($customerName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCustomerPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomerPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCustomerPage); $I->see('New Customer', self::$adminPageTitle); } @@ -1431,203 +1431,203 @@ public function shouldBeOnTheAdminAddCustomerPage() public function shouldBeOnTheAdminCatalogPriceRuleGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCatalogPriceRuleGrid); $I->see('Catalog Price Rule', self::$adminPageTitle); } public function shouldBeOnTheAdminCatalogPriceRuleForIdPage($catalogPriceRuleId, $catalogPriceRuleName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCatalogPriceRuleForIdPage . $catalogPriceRuleId)); $I->see($catalogPriceRuleName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCatalogPriceRulePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCatalogPriceRulePage); $I->see('New Catalog Price Rule', self::$adminPageTitle); } public function shouldBeOnTheAdminCartPriceRulesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCartPriceRulesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCartPriceRulesGrid); $I->see('Cart Price Rules', self::$adminPageTitle); } public function shouldBeOnTheAdminCartPriceRuleForIdPage($cartPriceRuleId, $cartPriceRuleName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCartPriceRuleForIdPage . $cartPriceRuleId)); $I->see($cartPriceRuleName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCartPriceRulePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCartPriceRulePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCartPriceRulePage); $I->see('New Cart Price Rule', self::$adminPageTitle); } public function shouldBeOnTheAdminEmailTemplatesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEmailTemplatesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminEmailTemplatesGrid); $I->see('Email Templates', self::$adminPageTitle); } public function shouldBeOnTheAdminEmailTemplateForIdPage($emailTemplateId, $templateName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminEmailTemplateForIdPage . $emailTemplateId)); $I->see($templateName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddEmailTemplatePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddEmailTemplatePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddEmailTemplatePage); $I->see('New Template', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterTemplateGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterTemplateGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterTemplateGrid); $I->see('Newsletter Templates', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterTemplateByIdPage($newsletterTemplateId, $templateName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterTemplateForIdPage . $newsletterTemplateId)); $I->see($templateName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddNewsletterTemplatePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddNewsletterTemplatePage); $I->see('New Template', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterQueueGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterQueueGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterQueueGrid); $I->see('Newsletter Queue', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterSubscribersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterSubscribersGrid); $I->see('Newsletter Subscribers', self::$adminPageTitle); } public function shouldBeOnTheAdminURLRewritesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminURLRewritesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminURLRewritesGrid); $I->see('URL Rewrites', self::$adminPageTitle); } public function shouldBeOnTheAdminURLRewriteForId($urlRewriteId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminURLRewriteForIdPage . $urlRewriteId)); $I->see('Edit URL Rewrite for a', self::$adminPageTitle); } public function shouldBeOnTheAdminAddURLRewritePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddURLRewritePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddURLRewritePage); $I->see('Add New URL Rewrite', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchTermsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchTermsGrid); $I->see('Search Terms', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchTermForIdPage($searchTermId, $searchQuery) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchTermForIdPage . $searchTermId)); $I->see($searchQuery, self::$adminPageTitle); } public function shouldBeOnTheAdminAddSearchTermPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSearchTermPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddSearchTermPage); $I->see('New Search', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchSynonymsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchSynonymsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchSynonymsGrid); $I->see('Search Synonyms', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchSynonymGroupByIdPage($searchSynonymId, $synonyms) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchSynonymGroupForIdPage . $searchSynonymId)); $I->see($synonyms, self::$adminPageTitle); } public function shouldBeOnTheAdminAddSearchSynonymGroupPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddSearchSynonymGroupPage); $I->see('New Synonym Group', self::$adminPageTitle); } public function shouldBeOnTheAdminSiteMapGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSiteMapGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSiteMapGrid); $I->see('Site Map', self::$adminPageTitle); } public function shouldBeOnTheAdminSiteMapForIdPage($siteMapId, $fileName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSiteMapForIdPage . $siteMapId)); $I->see($fileName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddSiteMapPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddSiteMapPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddSiteMapPage); $I->see('New Site Map', self::$adminPageTitle); } public function shouldBeOnTheAdminReviewsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminReviewsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminReviewsGrid); $I->see('Reviews', self::$adminPageTitle); } public function shouldBeOnTheAdminReviewForIdPage($reviewId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminReviewByIdPage . $reviewId)); $I->see('Edit Review', self::$adminPageTitle); } public function shouldBeOnTheAdminAddReviewPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddReviewPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddReviewPage); $I->see('New Review', self::$adminPageTitle); } @@ -1635,98 +1635,98 @@ public function shouldBeOnTheAdminAddReviewPage() public function shouldBeOnTheAdminPagesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPagesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminPagesGrid); $I->see('Pages', self::$adminPageTitle); } public function shouldBeOnTheAdminPageForIdPage($pageId, $pageTitle) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminPageForIdPage . $pageId)); $I->see($pageTitle, self::$adminPageTitle); } public function shouldBeOnTheAdminAddPagePage() { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddPagePage)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddPagePage)); $I->see('New Page', self::$adminPageTitle); } public function shouldBeOnTheAdminBlocksGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBlocksGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBlocksGrid); $I->see('Blocks', self::$adminPageTitle); } public function shouldBeOnTheAdminBlockForIdPage($blockId, $blockTitle) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBlockForIdPage . $blockId)); $I->see($blockTitle, self::$adminPageTitle); } public function shouldBeOnTheAdminAddBlockPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddBlockPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddBlockPage); $I->see('New Block', self::$adminPageTitle); } public function shouldBeOnTheAdminWidgetsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWidgetsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminWidgetsGrid); $I->see('Widgets', self::$adminPageTitle); } public function shouldBeOnTheAdminAddWidgetPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddWidgetPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddWidgetPage); $I->see('Widgets', self::$adminPageTitle); } public function shouldBeOnTheAdminDesignConfigurationGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDesignConfigurationGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminDesignConfigurationGrid); $I->see('Design Configuration', self::$adminPageTitle); } public function shouldBeOnTheAdminThemesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminThemesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminThemesGrid); $I->see('Themes', self::$adminPageTitle); } public function shouldBeOnTheAdminThemeByIdPage($themeId, $themeTitle) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminThemeByIdPage . $themeId)); $I->see($themeTitle); } public function shouldBeOnTheAdminStoreContentScheduleGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreContentScheduleGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminStoreContentScheduleGrid); $I->see('Store Design Schedule', self::$adminPageTitle); } public function shouldBeOnTheAdminStoreContentScheduleForIdPage($storeContentScheduleId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminStoreContentScheduleForIdPage . $storeContentScheduleId)); $I->see('Edit Store Design Change', self::$adminPageTitle); } public function shouldBeOnTheAdminAddStoreDesignChangePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddStoreDesignChangePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddStoreDesignChangePage); $I->see('New Store Design Change'); } @@ -1734,49 +1734,49 @@ public function shouldBeOnTheAdminAddStoreDesignChangePage() public function shouldBeOnTheAdminProductsInCartGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductsInCartGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductsInCartGrid); $I->see('Products in Carts', self::$adminPageTitle); } public function shouldBeOnTheAdminSearchTermsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminSearchTermsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminSearchTermsReportGrid); $I->see('Search Terms Report', self::$adminPageTitle); } public function shouldBeOnTheAdminAbandonedCartsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAbandonedCartsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAbandonedCartsGrid); $I->see('Abandoned Carts', self::$adminPageTitle); } public function shouldBeOnTheAdminNewsletterProblemsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewsletterProblemsReportGrid); $I->see('Newsletter Problems Report', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomerReviewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomerReviewsReportGrid); $I->see('Customer Reviews Report', self::$adminPageTitle); } public function shouldBeOnTheAdminProductReviewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductReviewsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductReviewsReportGrid); $I->see('Product Reviews Report', self::$adminPageTitle); } public function shouldBeOnTheAdminProductReviewsForProductIdPage($productId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductReviewsForProductIdPage . $productId)); $I->see('Reviews', self::$adminPageTitle); } @@ -1790,119 +1790,119 @@ public function shouldBeOnTheAdminProductReviewIdForProductIdPage($productReview public function shouldBeOnTheAdminOrdersReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrdersReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrdersReportGrid); $I->see('Orders Report', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxReportGrid); $I->see('Tax Report', self::$adminPageTitle); } public function shouldBeOnTheAdminInvoiceReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminInvoiceReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminInvoiceReportGrid); $I->see('Invoice Report', self::$adminPageTitle); } public function shouldBeOnTheAdminShippingReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminShippingReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminShippingReportGrid); $I->see('Shipping Report', self::$adminPageTitle); } public function shouldBeOnTheAdminRefundsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRefundsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminRefundsReportGrid); $I->see('Refunds Report', self::$adminPageTitle); } public function shouldBeOnTheAdminCouponsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCouponsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCouponsReportGrid); $I->see('Coupons Report', self::$adminPageTitle); } public function shouldBeOnTheAdminPayPalSettlementReportsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminPayPalSettlementReportsGrid); $I->see('PayPal Settlement Reports', self::$adminPageTitle); } public function shouldBeOnTheAdminBraintreeSettlementReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBraintreeSettlementReportGrid); $I->see('Braintree Settlement Report', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderTotalReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderTotalReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderTotalReportGrid); $I->see('Order Total Report', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderCountReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderCountReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderCountReportGrid); $I->see('Order Count Report', self::$adminPageTitle); } public function shouldBeOnTheAdminNewAccountsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNewAccountsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNewAccountsReportGrid); $I->see('New Accounts Report', self::$adminPageTitle); } public function shouldBeOnTheAdminProductViewsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductViewsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductViewsReportGrid); $I->see('Product Views Report', self::$adminPageTitle); } public function shouldBeOnTheAdminBestsellersReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBestsellersReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBestsellersReportGrid); $I->see('Bestsellers Report', self::$adminPageTitle); } public function shouldBeOnTheAdminLowStockReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLowStockReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminLowStockReportGrid); $I->see('Low Stock Report', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderedProductsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderedProductsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderedProductsReportGrid); $I->see('Ordered Products Report', self::$adminPageTitle); } public function shouldBeOnTheAdminDownloadsReportGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminDownloadsReportGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminDownloadsReportGrid); $I->see('Downloads Report', self::$adminPageTitle); } public function shouldBeOnTheAdminRefreshStatisticsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRefreshStatisticsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminRefreshStatisticsGrid); $I->see('Refresh Statistics', self::$adminPageTitle); } @@ -1910,228 +1910,228 @@ public function shouldBeOnTheAdminRefreshStatisticsGrid() public function shouldBeOnTheAdminAllStoresGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllStoresGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAllStoresGrid); $I->see('Stores', self::$adminPageTitle); } public function shouldBeOnTheAdminCreateStoreViewPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateStoreViewPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreateStoreViewPage); $I->see('Stores', self::$adminPageTitle); } public function shouldBeOnTheAdminCreateStorePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateStorePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreateStorePage); $I->see('Stores', self::$adminPageTitle); } public function shouldBeOnTheAdminCreateWebsitePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCreateWebsitePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCreateWebsitePage); $I->see('Stores'); } public function shouldBeOnTheAdminWebsiteForIdPage($websiteId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminWebsiteByIdPage . $websiteId)); } public function shouldBeOnTheAdminStoreViewForIdPage($storeViewId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminStoreViewByIdPage . $storeViewId)); } public function shouldBeOnTheAdminStoreForIdPage($storeId) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminStoreByIdPage . $storeId)); } public function shouldBeOnTheAdminConfigurationGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminConfigurationGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminConfigurationGrid); $I->see('Configuration', self::$adminPageTitle); } public function shouldBeOnTheAdminTermsAndConditionsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTermsAndConditionsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTermsAndConditionsGrid); $I->see('Terms and Conditions', self::$adminPageTitle); } public function shouldBeOnTheAdminTermsAndConditionForIdPage($termsAndConditionsId, $conditionName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTermsAndConditionByIdPage . $termsAndConditionsId)); $I->see($conditionName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddNewTermsAndConditionsPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddNewTermsAndConditionPage); $I->see('New Condition', self::$adminPageTitle); } public function shouldBeOnTheAdminOrderStatusGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminOrderStatusGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminOrderStatusGrid); $I->see('Order Status', self::$adminPageTitle); } public function shouldBeOnTheAdminAddOrderStatusPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddOrderStatusPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddOrderStatusPage); $I->see('Create New Order Status', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxRulesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxRulesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxRulesGrid); $I->see('Tax Rules', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxRuleForIdPage($taxRuleId, $taxRuleName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxRuleByIdPage . $taxRuleId)); $I->see($taxRuleName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddTaxRulePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddTaxRulePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddTaxRulePage); $I->see('New Tax Rule', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxZonesAndRatesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxZonesAndRatesGrid); $I->see('Tax Zones and Rates', self::$adminPageTitle); } public function shouldBeOnTheAdminTaxZoneAndRateForIdPage($taxZoneAndRateId, $taxIdentifier) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminTaxZoneAndRateByIdPage . $taxZoneAndRateId)); $I->see($taxIdentifier, self::$adminPageTitle); } public function shouldBeOnTheAdminAddTaxZoneAndRatePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddTaxZoneAndRatePage); $I->see('New Tax Rate', self::$adminPageTitle); } public function shouldBeOnTheAdminCurrencyRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCurrencyRatesPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCurrencyRatesPage); $I->see('Currency Rates', self::$adminPageTitle); } public function shouldBeOnTheAdminCurrencySymbolsPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCurrencySymbolsPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCurrencySymbolsPage); $I->see('Currency Symbols', self::$adminPageTitle); } public function shouldBeOnTheAdminProductAttributesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductAttributesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductAttributesGrid); $I->see('Product Attributes', self::$adminPageTitle); } public function shouldBeOnTheAdminProductAttributeForIdPage($productAttributeId, $productAttributeDefaultLabel) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminProductAttributeForIdPage . $productAttributeId)); $I->see($productAttributeDefaultLabel, self::$adminPageTitle); } public function shouldBeOnTheAdminAddProductAttributePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddProductAttributePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddProductAttributePage); $I->see('New Product Attribute', self::$adminPageTitle); } public function shouldBeOnTheAdminAttributeSetsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAttributeSetsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAttributeSetsGrid); $I->see('Attribute Sets', self::$adminPageTitle); } public function shouldBeOnTheAdminAttributeSetByIdPage($attributeSetId, $attributeSetName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAttributeSetByIdPage . $attributeSetId)); $I->see($attributeSetName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddAttributeSetPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddAttributeSetPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddAttributeSetPage); $I->see('New Attribute Set', self::$adminPageTitle); } public function shouldBeOnTheAdminRatingsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRatingsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminRatingsGrid); $I->see('Ratings', self::$adminPageTitle); } public function shouldBeOnTheAdminRatingForIdPage($ratingId, $ratingDefaultValue) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminRatingForIdPage . $ratingId)); $I->see($ratingDefaultValue, self::$adminPageTitle); } public function shouldBeOnTheAdminAddRatingPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddRatingPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddRatingPage); $I->see('New Rating', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomerGroupsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerGroupsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomerGroupsGrid); $I->see('Customer Groups', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomerGroupForIdPage($customerGroupId, $customerGroupName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomerGroupByIdPage . $customerGroupId)); $I->see($customerGroupName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCustomerGroupPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomerGroupPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCustomerGroupPage); $I->see('New Customer Group', self::$adminPageTitle); } @@ -2139,42 +2139,42 @@ public function shouldBeOnTheAdminAddCustomerGroupPage() public function shouldBeOnTheAdminImportPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminImportPage); $I->see('Import', self::$adminPageTitle); } public function shouldBeOnTheAdminExportPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminExportPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminExportPage); $I->see('Export', self::$adminPageTitle); } public function shouldBeOnTheAdminImportAndExportTaxRatesPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminImportAndExportTaxRatesPage); $I->see('Import and Export Tax Rates', self::$adminPageTitle); } public function shouldBeOnTheAdminImportHistoryGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminImportHistoryGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminImportHistoryGrid); $I->see('Import History', self::$adminPageTitle); } public function shouldBeOnTheAdminIntegrationsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIntegrationsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminIntegrationsGrid); $I->see('Integrations', self::$adminPageTitle); } public function shouldBeOnTheAdminIntegrationForIdPage($integrationId, $integrationName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminIntegrationByIdPage . $integrationId)); $I->see('Edit', self::$adminPageTitle); $I->see($integrationName, self::$adminPageTitle); $I->see('Integration', self::$adminPageTitle); @@ -2183,125 +2183,125 @@ public function shouldBeOnTheAdminIntegrationForIdPage($integrationId, $integrat public function shouldBeOnTheAdminAddIntegrationPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddIntegrationPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddIntegrationPage); $I->see('New Integration', self::$adminPageTitle); } public function shouldBeOnTheAdminCacheManagementGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCacheManagementGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCacheManagementGrid); $I->see('Cache Management', self::$adminPageTitle); } public function shouldBeOnTheAdminBackupsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminBackupsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminBackupsGrid); $I->see('Backups', self::$adminPageTitle); } public function shouldBeOnTheAdminIndexManagementGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminIndexManagementGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminIndexManagementGrid); $I->see('Index Management', self::$adminPageTitle); } public function shouldBeOnTheAdminWebSetupWizardPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminWebSetupWizardPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminWebSetupWizardPage); $I->see('Setup Wizard', self::$adminPageTitle); } public function shouldBeOnTheAdminAllUsersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAllUsersGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAllUsersGrid); $I->see('Users', self::$adminPageTitle); } public function shouldBeOnTheAdminUserForIdPage($userId, $userFirstAndLastName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserByIdPage . $userId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminUserByIdPage . $userId)); $I->see($userFirstAndLastName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddUserPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddNewUserPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddNewUserPage); $I->see('New User', self::$adminPageTitle); } public function shouldBeOnTheAdminLockedUsersGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminLockedUsersGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminLockedUsersGrid); $I->see('Locked Users', self::$adminPageTitle); } public function shouldBeOnTheAdminUserRolesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserRolesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminUserRolesGrid); $I->see('Roles', self::$adminPageTitle); } public function shouldBeOnTheAdminUserRoleForIdPage($userRoleId, $userRoleName) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminUserRoleByIdPage . $userRoleId)); $I->see($userRoleName, self::$adminPageTitle); } public function shouldBeOnTheAdminAddUserRolePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddUserRolePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddUserRolePage); $I->see('New Role', self::$adminPageTitle); } public function shouldBeOnTheAdminNotificationsGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminNotificationsGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminNotificationsGrid); $I->see('Notifications', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomVariablesGrid() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomVariablesGrid); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomVariablesGrid); $I->see('Custom Variables', self::$adminPageTitle); } public function shouldBeOnTheAdminCustomVariableForId($customVariableId, $customVariableCode) { $I = $this; - $I->seeInCurrentUrl((\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); + $I->seeInCurrentUrl((\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminCustomVariableByIdPage . $customVariableId)); $I->see($customVariableCode, self::$adminPageTitle); } public function shouldBeOnTheAdminAddCustomVariablePage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminAddCustomVariablePage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminAddCustomVariablePage); $I->see('New Custom Variable', self::$adminPageTitle); } public function shouldBeOnTheAdminEncryptionKeyPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminEncryptionKeyPage); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminEncryptionKeyPage); $I->see('Encryption Key', self::$adminPageTitle); } public function shouldBeOnTheAdminFindPartnersAndExtensionsPage() { $I = $this; - $I->seeInCurrentUrl(\Magento\AcceptanceTestFramework\Helper\AdminUrlList::$adminFindPartnersAndExtensions); + $I->seeInCurrentUrl(\Magento\FunctionalTestingFramework\Helper\AdminUrlList::$adminFindPartnersAndExtensions); $I->see('Magento Marketplace', self::$adminPageTitle); } } diff --git a/src/Magento/AcceptanceTestFramework/System/Code/ClassReader.php b/src/Magento/FunctionalTestingFramework/System/Code/ClassReader.php similarity index 96% rename from src/Magento/AcceptanceTestFramework/System/Code/ClassReader.php rename to src/Magento/FunctionalTestingFramework/System/Code/ClassReader.php index 15c8de9ec..5f44ea104 100644 --- a/src/Magento/AcceptanceTestFramework/System/Code/ClassReader.php +++ b/src/Magento/FunctionalTestingFramework/System/Code/ClassReader.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\System\Code; +namespace Magento\FunctionalTestingFramework\System\Code; /** * Class ClassReader diff --git a/src/Magento/AcceptanceTestFramework/Test/Config/Converter/Dom/Flat.php b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php similarity index 95% rename from src/Magento/AcceptanceTestFramework/Test/Config/Converter/Dom/Flat.php rename to src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php index b193a90d1..bd53b8b5f 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Config/Converter/Dom/Flat.php +++ b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php @@ -3,10 +3,10 @@ * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Config\Converter\Dom; +namespace Magento\FunctionalTestingFramework\Test\Config\Converter\Dom; -use Magento\AcceptanceTestFramework\Config\ConverterInterface; -use Magento\AcceptanceTestFramework\Config\Dom\ArrayNodeConfig; +use Magento\FunctionalTestingFramework\Config\ConverterInterface; +use Magento\FunctionalTestingFramework\Config\Dom\ArrayNodeConfig; /** * Universal converter of any XML data to an array representation with no data loss diff --git a/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php similarity index 83% rename from src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php rename to src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php index 20d61a640..da9049a81 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php @@ -3,14 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Handlers; +namespace Magento\FunctionalTestingFramework\Test\Handlers; -use Magento\AcceptanceTestFramework\ObjectManager\ObjectHandlerInterface; -use Magento\AcceptanceTestFramework\ObjectManagerFactory; -use Magento\AcceptanceTestFramework\Test\Objects\ActionGroupObject; -use Magento\AcceptanceTestFramework\Test\Objects\TestObject; -use Magento\AcceptanceTestFramework\Test\Parsers\ActionGroupDataParser; -use Magento\AcceptanceTestFramework\Test\Util\ActionGroupObjectExtractor; +use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface; +use Magento\FunctionalTestingFramework\ObjectManagerFactory; +use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; +use Magento\FunctionalTestingFramework\Test\Objects\TestObject; +use Magento\FunctionalTestingFramework\Test\Parsers\ActionGroupDataParser; +use Magento\FunctionalTestingFramework\Test\Util\ActionGroupObjectExtractor; /** * Class ActionGroupObjectHandler diff --git a/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/CestObjectHandler.php similarity index 83% rename from src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php rename to src/Magento/FunctionalTestingFramework/Test/Handlers/CestObjectHandler.php index 6a0568843..0bb21897a 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Handlers/CestObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/CestObjectHandler.php @@ -3,13 +3,13 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Handlers; +namespace Magento\FunctionalTestingFramework\Test\Handlers; -use Magento\AcceptanceTestFramework\ObjectManager\ObjectHandlerInterface; -use Magento\AcceptanceTestFramework\ObjectManagerFactory; -use Magento\AcceptanceTestFramework\Test\Objects\CestObject; -use Magento\AcceptanceTestFramework\Test\Parsers\TestDataParser; -use Magento\AcceptanceTestFramework\Test\Util\CestObjectExtractor; +use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface; +use Magento\FunctionalTestingFramework\ObjectManagerFactory; +use Magento\FunctionalTestingFramework\Test\Objects\CestObject; +use Magento\FunctionalTestingFramework\Test\Parsers\TestDataParser; +use Magento\FunctionalTestingFramework\Test\Util\CestObjectExtractor; /** * Class CestObjectHandler diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php similarity index 92% rename from src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php rename to src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index aac693162..081505ad1 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Objects; +namespace Magento\FunctionalTestingFramework\Test\Objects; -use Magento\AcceptanceTestFramework\Test\Util\ActionMergeUtil; +use Magento\FunctionalTestingFramework\Test\Util\ActionMergeUtil; /** * Class ActionGroupObject @@ -75,7 +75,7 @@ private function getResolvedActions($entity) $resolvedActions = []; foreach ($this->parsedActions as $action) { - /**@var \Magento\AcceptanceTestFramework\Test\Objects\ActionObject $action **/ + /**@var \Magento\FunctionalTestingFramework\Test\Objects\ActionObject $action **/ if (array_key_exists('userInput', $action->getCustomActionAttributes())) { $regexPattern = '/{{.[\w]+}}/'; preg_match_all($regexPattern, $action->getCustomActionAttributes()['userInput'], $matches); diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php similarity index 95% rename from src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php rename to src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index 99eb435e7..c5bbf807c 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -3,15 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Objects; - -use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; -use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; -use Magento\AcceptanceTestFramework\ObjectManager\ObjectHandlerInterface; -use Magento\AcceptanceTestFramework\Page\Objects\PageObject; -use Magento\AcceptanceTestFramework\Page\Objects\SectionObject; -use Magento\AcceptanceTestFramework\Page\Handlers\PageObjectHandler; -use Magento\AcceptanceTestFramework\Page\Handlers\SectionObjectHandler; +namespace Magento\FunctionalTestingFramework\Test\Objects; + +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler; +use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject; +use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface; +use Magento\FunctionalTestingFramework\Page\Objects\PageObject; +use Magento\FunctionalTestingFramework\Page\Objects\SectionObject; +use Magento\FunctionalTestingFramework\Page\Handlers\PageObjectHandler; +use Magento\FunctionalTestingFramework\Page\Handlers\SectionObjectHandler; /** * Class ActionObject diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/CestHookObject.php similarity index 95% rename from src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php rename to src/Magento/FunctionalTestingFramework/Test/Objects/CestHookObject.php index 567d1b12f..3837aaf69 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/CestHookObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/CestHookObject.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Objects; +namespace Magento\FunctionalTestingFramework\Test\Objects; /** * Class CestHookObject diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/CestObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/CestObject.php similarity index 96% rename from src/Magento/AcceptanceTestFramework/Test/Objects/CestObject.php rename to src/Magento/FunctionalTestingFramework/Test/Objects/CestObject.php index 236bf4920..5b7018657 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/CestObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/CestObject.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Objects; +namespace Magento\FunctionalTestingFramework\Test\Objects; /** * Class CestObject diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php similarity index 93% rename from src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php rename to src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php index 1d99db4e2..398926077 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php @@ -4,10 +4,10 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Objects; +namespace Magento\FunctionalTestingFramework\Test\Objects; -use Magento\AcceptanceTestFramework\Test\Handlers\ActionGroupObjectHandler; -use Magento\AcceptanceTestFramework\Test\Util\ActionMergeUtil; +use Magento\FunctionalTestingFramework\Test\Handlers\ActionGroupObjectHandler; +use Magento\FunctionalTestingFramework\Test\Util\ActionMergeUtil; /** * Class TestObject diff --git a/src/Magento/AcceptanceTestFramework/Test/Parsers/ActionGroupDataParser.php b/src/Magento/FunctionalTestingFramework/Test/Parsers/ActionGroupDataParser.php similarity index 83% rename from src/Magento/AcceptanceTestFramework/Test/Parsers/ActionGroupDataParser.php rename to src/Magento/FunctionalTestingFramework/Test/Parsers/ActionGroupDataParser.php index 459439279..4709d3aa8 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Parsers/ActionGroupDataParser.php +++ b/src/Magento/FunctionalTestingFramework/Test/Parsers/ActionGroupDataParser.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Parsers; +namespace Magento\FunctionalTestingFramework\Test\Parsers; -use Magento\AcceptanceTestFramework\Config\DataInterface; +use Magento\FunctionalTestingFramework\Config\DataInterface; /** * Class ActionGroupDataParser diff --git a/src/Magento/AcceptanceTestFramework/Test/Parsers/TestDataParser.php b/src/Magento/FunctionalTestingFramework/Test/Parsers/TestDataParser.php similarity index 82% rename from src/Magento/AcceptanceTestFramework/Test/Parsers/TestDataParser.php rename to src/Magento/FunctionalTestingFramework/Test/Parsers/TestDataParser.php index 9b1af3fc1..d78e737b7 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Parsers/TestDataParser.php +++ b/src/Magento/FunctionalTestingFramework/Test/Parsers/TestDataParser.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Parsers; +namespace Magento\FunctionalTestingFramework\Test\Parsers; -use Magento\AcceptanceTestFramework\Config\DataInterface; +use Magento\FunctionalTestingFramework\Config\DataInterface; /** * Class TestDataParser diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php similarity index 90% rename from src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php rename to src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php index 1bfa4e3a1..e093df909 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; -use Magento\AcceptanceTestFramework\Test\Objects\ActionGroupObject; +use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; /** * Class ActionGroupObjectExtractor diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionMergeUtil.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php similarity index 97% rename from src/Magento/AcceptanceTestFramework/Test/Util/ActionMergeUtil.php rename to src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php index 67a2fcdf7..92ee032b3 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/ActionMergeUtil.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; -use Magento\AcceptanceTestFramework\Test\Objects\ActionObject; +use Magento\FunctionalTestingFramework\Test\Objects\ActionObject; /** * Class ActionMergeUtil diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php rename to src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php index 4bb799451..c6e28dba0 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php @@ -4,10 +4,10 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; -use Magento\AcceptanceTestFramework\Exceptions\XmlException; -use Magento\AcceptanceTestFramework\Test\Objects\ActionObject; +use Magento\FunctionalTestingFramework\Exceptions\XmlException; +use Magento\FunctionalTestingFramework\Test\Objects\ActionObject; /** * Class ActionObjectExtractor diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/AnnotationExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php similarity index 95% rename from src/Magento/AcceptanceTestFramework/Test/Util/AnnotationExtractor.php rename to src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php index 3730929c1..be9ce9cbe 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/AnnotationExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; /** * Class AnnotationExtractor diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/BaseCestObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/BaseCestObjectExtractor.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Test/Util/BaseCestObjectExtractor.php rename to src/Magento/FunctionalTestingFramework/Test/Util/BaseCestObjectExtractor.php index 00c7a86a1..41b0c3439 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/BaseCestObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/BaseCestObjectExtractor.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; /** * Class BaseCestObjectExtractor diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/CestHookObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/CestHookObjectExtractor.php similarity index 92% rename from src/Magento/AcceptanceTestFramework/Test/Util/CestHookObjectExtractor.php rename to src/Magento/FunctionalTestingFramework/Test/Util/CestHookObjectExtractor.php index 6c54b2ec1..47fb15fe5 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/CestHookObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/CestHookObjectExtractor.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; -use Magento\AcceptanceTestFramework\Test\Objects\CestHookObject; +use Magento\FunctionalTestingFramework\Test\Objects\CestHookObject; /** * Class CestHookObjectExtractor diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/CestObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/CestObjectExtractor.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Test/Util/CestObjectExtractor.php rename to src/Magento/FunctionalTestingFramework/Test/Util/CestObjectExtractor.php index 78cee7785..7582d520e 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/CestObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/CestObjectExtractor.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; -use Magento\AcceptanceTestFramework\Test\Objects\CestObject; +use Magento\FunctionalTestingFramework\Test\Objects\CestObject; /** * Class CestObjectExtractor diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/TestEntityExtractor.php similarity index 96% rename from src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php rename to src/Magento/FunctionalTestingFramework/Test/Util/TestEntityExtractor.php index a0dc0f575..cd72af604 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/TestEntityExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/TestEntityExtractor.php @@ -6,7 +6,7 @@ * Time: 11:11 AM */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; use Robo\Exception\TaskExitException; diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/TestObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/TestObjectExtractor.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Test/Util/TestObjectExtractor.php rename to src/Magento/FunctionalTestingFramework/Test/Util/TestObjectExtractor.php index 8fbc797ce..2948059e2 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/TestObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/TestObjectExtractor.php @@ -4,9 +4,9 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Test\Util; +namespace Magento\FunctionalTestingFramework\Test\Util; -use Magento\AcceptanceTestFramework\Test\Objects\TestObject; +use Magento\FunctionalTestingFramework\Test\Objects\TestObject; /** * Class TestObjectExtractor diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml b/src/Magento/FunctionalTestingFramework/Test/etc/sampleActions.xml similarity index 100% rename from src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml rename to src/Magento/FunctionalTestingFramework/Test/etc/sampleActions.xml diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml b/src/Magento/FunctionalTestingFramework/Test/etc/sampleCest.xml similarity index 100% rename from src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml rename to src/Magento/FunctionalTestingFramework/Test/etc/sampleCest.xml diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd similarity index 100% rename from src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd rename to src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd diff --git a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php b/src/Magento/FunctionalTestingFramework/Util/ApiClientUtil.php similarity index 98% rename from src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php rename to src/Magento/FunctionalTestingFramework/Util/ApiClientUtil.php index 523f2cc0e..0db7075b8 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ApiClientUtil.php +++ b/src/Magento/FunctionalTestingFramework/Util/ApiClientUtil.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Util; +namespace Magento\FunctionalTestingFramework\Util; class ApiClientUtil { diff --git a/src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php b/src/Magento/FunctionalTestingFramework/Util/Iterator/AbstractIterator.php similarity index 97% rename from src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php rename to src/Magento/FunctionalTestingFramework/Util/Iterator/AbstractIterator.php index 6a2f1775e..0b95a4ca7 100644 --- a/src/Magento/AcceptanceTestFramework/Util/Iterator/AbstractIterator.php +++ b/src/Magento/FunctionalTestingFramework/Util/Iterator/AbstractIterator.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Util\Iterator; +namespace Magento\FunctionalTestingFramework\Util\Iterator; /** * Class AbstractIterator diff --git a/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php b/src/Magento/FunctionalTestingFramework/Util/Iterator/File.php similarity index 93% rename from src/Magento/AcceptanceTestFramework/Util/Iterator/File.php rename to src/Magento/FunctionalTestingFramework/Util/Iterator/File.php index e3a8bacf8..e019e5683 100644 --- a/src/Magento/AcceptanceTestFramework/Util/Iterator/File.php +++ b/src/Magento/FunctionalTestingFramework/Util/Iterator/File.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Util\Iterator; +namespace Magento\FunctionalTestingFramework\Util\Iterator; /** * Class File diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php b/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php similarity index 94% rename from src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php rename to src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php index b3eb6da1b..19c541f10 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver.php +++ b/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ -namespace Magento\AcceptanceTestFramework\Util; +namespace Magento\FunctionalTestingFramework\Util; /** * Class ModuleResolver, resolve module path based on enabled modules of target Magento instance. @@ -35,7 +35,7 @@ class ModuleResolver /** * Configuration instance. * - * @var \Magento\AcceptanceTestFramework\Config\DataInterface + * @var \Magento\FunctionalTestingFramework\Config\DataInterface */ protected $configuration; @@ -92,9 +92,9 @@ public static function getInstance() */ private function __construct() { - $objectManager = \Magento\AcceptanceTestFramework\ObjectManagerFactory::getObjectManager(); + $objectManager = \Magento\FunctionalTestingFramework\ObjectManagerFactory::getObjectManager(); $this->sequenceSorter = $objectManager->get( - \Magento\AcceptanceTestFramework\Util\ModuleResolver\SequenceSorterInterface::class + \Magento\FunctionalTestingFramework\Util\ModuleResolver\SequenceSorterInterface::class ); } diff --git a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php b/src/Magento/FunctionalTestingFramework/Util/ModuleResolver/SequenceSorter.php similarity index 81% rename from src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php rename to src/Magento/FunctionalTestingFramework/Util/ModuleResolver/SequenceSorter.php index a0f7bfbc4..c8a0d7530 100644 --- a/src/Magento/AcceptanceTestFramework/Util/ModuleResolver/SequenceSorter.php +++ b/src/Magento/FunctionalTestingFramework/Util/ModuleResolver/SequenceSorter.php @@ -1,5 +1,5 @@ Date: Thu, 7 Sep 2017 14:21:54 +0300 Subject: [PATCH 143/149] MQE-279: Create repositories in magento organization - fix static tests --- README.md | 2 +- .../FunctionalTestingFramework/Helper/Acceptance.php | 10 ++++++---- .../ObjectManager/Config/Config.php | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 98287e5b3..d0c43f1a5 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Magento Acceptance Test Framework +# Magento2 Functional Testing Framework Customized codeception modules, helpers, page objects and step objects for Magento 2.2.x. This library package can be used as dependency for Magento Acceptance Test projects for Magento 2 Community Edition ([magento/acceptance-test-ce](https://github.com/magento-pangolin/acceptance-test-ce/)) or Magento 2 Enterprise Edition in ([magento/acceptance-test-ee](https://github.com/magento-pangolin/acceptance-test-ee/)) or acceptance test projects for Magento 2 extensions. diff --git a/src/Magento/FunctionalTestingFramework/Helper/Acceptance.php b/src/Magento/FunctionalTestingFramework/Helper/Acceptance.php index 7f71dd9cb..fafe167af 100644 --- a/src/Magento/FunctionalTestingFramework/Helper/Acceptance.php +++ b/src/Magento/FunctionalTestingFramework/Helper/Acceptance.php @@ -6,13 +6,16 @@ namespace Magento\FunctionalTestingFramework\Helper; +use Magento\FunctionalTestingFramework\Module\MagentoWebDriver; +use Codeception\Module; + /** * Class Acceptance * * Define global actions * All public methods declared in helper class will be available in $I */ -class Acceptance extends \Codeception\Module +class Acceptance extends Module { /** * Reconfig WebDriver. @@ -23,8 +26,7 @@ class Acceptance extends \Codeception\Module */ public function changeConfiguration($config, $value) { - $this->getModule(\Magento\FunctionalTestingFramework\Module\MagentoWebDriver::class) - ->_reconfigure([$config => $value]); + $this->getModule(MagentoWebDriver::class)->_reconfigure([$config => $value]); } /** @@ -35,6 +37,6 @@ public function changeConfiguration($config, $value) */ public function getConfiguration($config) { - return $this->getModule(\Magento\FunctionalTestingFramework\Module\MagentoWebDriver::class)->_getConfig($config); + return $this->getModule(MagentoWebDriver::class)->_getConfig($config); } } diff --git a/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Config.php b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Config.php index 8003f557c..502dba0c0 100644 --- a/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Config.php +++ b/src/Magento/FunctionalTestingFramework/ObjectManager/Config/Config.php @@ -7,6 +7,8 @@ use Magento\FunctionalTestingFramework\ObjectManager\DefinitionInterface; use Magento\FunctionalTestingFramework\ObjectManager\RelationsInterface; +use Magento\FunctionalTestingFramework\ObjectManager\Definition\Runtime as DefinitionRuntime; +use Magento\FunctionalTestingFramework\ObjectManager\Relations\Runtime as RelationsRuntime; /** * Class Config @@ -76,8 +78,8 @@ class Config implements \Magento\FunctionalTestingFramework\ObjectManager\Config */ public function __construct(RelationsInterface $relations = null, DefinitionInterface $definitions = null) { - $this->relations = $relations ? : new \Magento\FunctionalTestingFramework\ObjectManager\Relations\Runtime(); - $this->definitions = $definitions ? : new \Magento\FunctionalTestingFramework\ObjectManager\Definition\Runtime(); + $this->relations = $relations ? : new RelationsRuntime(); + $this->definitions = $definitions ? : new DefinitionRuntime(); } /** From 1c7be1b0f9bb50f0bdd8a33b773fbe6b6a33828e Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Thu, 7 Sep 2017 14:32:41 -0500 Subject: [PATCH 144/149] MQE-293 Bug-Fix Incorrect Copy-Paste while rearranging some code, fixed in local 293, tested, and merged to sprint-develop. --- .../AcceptanceTestFramework/Test/Objects/ActionObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php index a24be1844..d3490af72 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionObject.php @@ -293,8 +293,8 @@ private function stripAndReturnParameters($reference) private function findAndReplaceReferences($objectHandler, $inputString) { //Determine if there are Parethesis and parameters. If not, use strict regex. If so, use nested regex. - preg_match_all(ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN, $inputString, $variableMatches); - if (!empty($variableMatches[0])) { + preg_match_all(ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER, $inputString, $variableMatches); + if (empty($variableMatches[0])) { $regex = ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN; } else { $regex = ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_NESTED; From fd8c278b349f292594f97012b4ec37c65b77f7e0 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 11 Sep 2017 10:41:49 -0500 Subject: [PATCH 145/149] Fixed quotes issue. --- .../Util/TestGenerator.php | 41 ++++++------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index aa468d196..d0988a1c8 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -293,30 +293,6 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $button = null; $parameter = null; - //Resolve $input$ and $$input$$ replacement in url, selector, and userInput. - if (isset($customActionAttributes['url'])) { - $customActionAttributes['url'] = $this->resolveTestVariable( - $customActionAttributes['url'], - true - ); - } - - if (isset($customActionAttributes['userInput'])) { - $customActionAttributes['userInput'] = $this->resolveTestVariable( - $customActionAttributes['userInput'], - true - ); - } - - if (isset($customActionAttributes['selector'])) { - $customActionAttributes['selector'] = $this->resolveTestVariable( - $customActionAttributes['selector'], - true - ); - } - - //Resume step building - if (isset($customActionAttributes['returnVariable'])) { $returnVariable = $customActionAttributes['returnVariable']; } @@ -754,7 +730,7 @@ private function resolveTestVariable($inputString, $quoteBreak = false) } $replacement = sprintf("\$this->%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); if ($quoteBreak) { - $replacement = "' . " . $replacement . " . '"; + $replacement = '" . ' . $replacement . ' . "'; } $outputString = str_replace($match, $replacement, $outputString); $replaced = true; @@ -773,7 +749,7 @@ private function resolveTestVariable($inputString, $quoteBreak = false) } $replacement = sprintf("$%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); if ($quoteBreak) { - $replacement = "' . " . $replacement . " . '"; + $replacement = '" . ' . $replacement . ' . "'; } $outputString = str_replace($match, $replacement, $outputString); $replaced = true; @@ -1002,7 +978,8 @@ private function addUniquenessFunctionCall($input) */ private function wrapWithSingleQuotes($input) { - return sprintf("'%s'", $input); + $input = addslashes($input); + return sprintf('"%s"', $input); } /** @@ -1057,7 +1034,10 @@ private function wrapFunctionCall($actor, $action, ...$args) $isFirst = false; } $output .= ");\n"; - return $output; + + // TODO put in condiional to prevent unncessary quote break (i.e. there are no strings to be appended to + // variable call. + return $this->resolveTestVariable($output, true); } /** @@ -1084,7 +1064,10 @@ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $actio $isFirst = false; } $output .= ");\n"; - return $output; + + // TODO put in condiional to prevent unncessary quote break (i.e. there are no strings to be appended to + // variable call. + return $output = $this->resolveTestVariable($output, true); } // @codingStandardsIgnoreEnd } From e6108dc7b9a55c73865323ac08034ce87a22656e Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Mon, 11 Sep 2017 10:59:25 -0500 Subject: [PATCH 146/149] MQE-300:[Customizability] Update action groups to use multiple arguments rather than specific entities - add argument support to schema and object model --- etc/di.xml | 16 ++-- .../Handlers/ActionGroupObjectHandler.php | 2 +- .../Test/Objects/ActionGroupObject.php | 87 +++++++++++++------ .../Test/Objects/TestObject.php | 9 +- .../Test/Util/ActionGroupObjectExtractor.php | 35 +++++++- .../Test/Util/ActionObjectExtractor.php | 35 +++++++- ...ampleActions.xml => sampleActionGroup.xml} | 12 ++- .../Test/etc/sampleCest.xml | 4 +- .../Test/etc/testSchema.xsd | 41 ++++++--- 9 files changed, 180 insertions(+), 61 deletions(-) rename src/Magento/AcceptanceTestFramework/Test/etc/{sampleActions.xml => sampleActionGroup.xml} (90%) diff --git a/etc/di.xml b/etc/di.xml index e72404039..757eab756 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -224,6 +224,7 @@ name key key + name name mergeKey @@ -249,6 +250,7 @@ key key name + name /config/cest/annotations/env @@ -298,19 +300,21 @@ Magento\AcceptanceTestFramework\Config\ActionGroupDataConverter Magento\AcceptanceTestFramework\Config\SchemaLocator\TestData - name - mergeKey + name + name + mergeKey - *-action_group.xml - Cest + *ActionGroup.xml + ActionGroup - mergeKey - name + mergeKey + name + name diff --git a/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php b/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php index 20d61a640..5d67e21db 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/Test/Handlers/ActionGroupObjectHandler.php @@ -19,7 +19,7 @@ class ActionGroupObjectHandler implements ObjectHandlerInterface { const BEFORE_AFTER_ERROR_MSG = "Merge Error - Steps cannot have both before and after attributes.\tTestStep='%s'"; const ACTION_GROUP_ROOT = 'config'; - const ACTION_GROUP = 'actions'; + const ACTION_GROUP = 'actionGroup'; /** * Single instance of class var diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php index aac693162..b1290804e 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/ActionGroupObject.php @@ -13,6 +13,8 @@ */ class ActionGroupObject { + const VAR_ATTRIBUTES = ['userInput', 'selector', 'page']; + /** * The name of the action group * @@ -28,70 +30,79 @@ class ActionGroupObject private $parsedActions = []; /** - * A string used as the default entity if the user does not specify one + * An array used to store the default entities if the user does not specify any * - * @var string + * @var array */ - private $defaultEntity; + private $arguments; /** * ActionGroupObject constructor. * * @param string $name - * @param string $defaultEntity + * @param string $arguments * @param array $actions */ - public function __construct($name, $defaultEntity, $actions) + public function __construct($name, $arguments, $actions) { $this->name = $name; - $this->defaultEntity = $defaultEntity; + $this->arguments = $arguments; $this->parsedActions = $actions; } /** * Gets the ordered steps including merged waits * - * @param string $entity + * @param array $arguments * @return array */ - public function getSteps($entity) + public function getSteps($arguments) { $mergeUtil = new ActionMergeUtil(); - if (!$entity) { - $entity = $this->defaultEntity; + $args = $this->arguments; + + if ($arguments) { + $args = array_merge($args, $arguments); } - return $mergeUtil->mergeStepsAndInsertWaits($this->getResolvedActions($entity)); + + return $mergeUtil->mergeStepsAndInsertWaits($this->getResolvedActionsWithArgs($args)); } /** - * Function which takes the name of the entity object to be appended to an action objects fields returns resulting - * action objects with proper entity.field references. + * Function which takes a set of arguments to be appended to an action objects fields returns resulting + * action objects with proper argument.field references. * - * @param string $entity + * @param array $arguments * @return array */ - private function getResolvedActions($entity) + private function getResolvedActionsWithArgs($arguments) { $resolvedActions = []; + $regexPattern = '/{{([\w]+)/'; foreach ($this->parsedActions as $action) { - /**@var \Magento\AcceptanceTestFramework\Test\Objects\ActionObject $action **/ - if (array_key_exists('userInput', $action->getCustomActionAttributes())) { - $regexPattern = '/{{.[\w]+}}/'; - preg_match_all($regexPattern, $action->getCustomActionAttributes()['userInput'], $matches); - - $userInputString = $action->getCustomActionAttributes()['userInput']; - foreach ($matches[0] as $match) { - $search = str_replace('}}', '', str_replace('{{', '', $match)); - $userInputString = str_replace($search, $entity . $search, $userInputString); - } + $varAttributes = array_intersect(self::VAR_ATTRIBUTES, array_keys($action->getCustomActionAttributes())); + if (!empty($varAttributes)) { + $newActionAttributes = []; + // 1 check to see if we have pertinent var + foreach ($varAttributes as $varAttribute) { + $attributeValue = $action->getCustomActionAttributes()[$varAttribute]; + preg_match_all($regexPattern, $attributeValue, $matches); + if (empty($matches[0]) & empty($matches[1])) { + continue; + } - $attribute['userInput'] = $userInputString; + $newActionAttributes[$varAttribute] = $this->resolveNewAttribute( + $arguments, + $attributeValue, + $matches + ); + } $resolvedActions[$action->getMergeKey()] = new ActionObject( $action->getMergeKey(), $action->getType(), - array_merge($action->getCustomActionAttributes(), $attribute), + array_merge($action->getCustomActionAttributes(), $newActionAttributes), $action->getLinkedAction(), $action->getOrderOffset() ); @@ -99,8 +110,30 @@ private function getResolvedActions($entity) // add action here if we do not see any userInput in this particular action $resolvedActions[$action->getMergeKey()] = $action; } + } return $resolvedActions; } + + /** + * Function which takes an array of arguments to use for replacement of var name, the string which contains + * the variable for replacement, an array of matching vars. + * + * @param array $arguments + * @param string $attributeValue + * @param array $matches + * @return string + */ + private function resolveNewAttribute($arguments, $attributeValue, $matches) + { + $newAttributeVal = $attributeValue; + foreach ($matches[1] as $var) { + if (array_key_exists($var, $arguments)) { + $newAttributeVal = str_replace($var, $arguments[$var], $newAttributeVal); + } + } + + return $newAttributeVal; + } } diff --git a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php index 1d99db4e2..eaff5ea19 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php +++ b/src/Magento/AcceptanceTestFramework/Test/Objects/TestObject.php @@ -8,6 +8,7 @@ use Magento\AcceptanceTestFramework\Test\Handlers\ActionGroupObjectHandler; use Magento\AcceptanceTestFramework\Test\Util\ActionMergeUtil; +use Magento\AcceptanceTestFramework\Test\Util\ActionObjectExtractor; /** * Class TestObject @@ -114,12 +115,12 @@ private function extractActionGroups($mergedSteps) foreach ($mergedSteps as $key => $mergedStep) { /**@var ActionObject $mergedStep**/ - if ($mergedStep->getType() == 'actions') { + if ($mergedStep->getType() == ActionObjectExtractor::ACTION_GROUP_TAG) { $actionGroup = ActionGroupObjectHandler::getInstance()->getObject( - $mergedStep->getCustomActionAttributes()['ref'] + $mergedStep->getCustomActionAttributes()[ActionObjectExtractor::ACTION_GROUP_REF] ); - $entity = $mergedStep->getCustomActionAttributes()['entity'] ?? null; - $actionsToMerge = $actionGroup->getSteps($entity); + $args = $mergedStep->getCustomActionAttributes()[ActionObjectExtractor::ACTION_GROUP_ARGUMENTS] ?? null; + $actionsToMerge = $actionGroup->getSteps($args); $newOrderedList = $newOrderedList + $actionsToMerge; } else { $newOrderedList[$key] = $mergedStep; diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php index 1bfa4e3a1..19be1e46a 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php +++ b/src/Magento/AcceptanceTestFramework/Test/Util/ActionGroupObjectExtractor.php @@ -13,7 +13,8 @@ */ class ActionGroupObjectExtractor extends BaseCestObjectExtractor { - const DEFAULT_ENTITY = 'defaultEntity'; + const DEFAULT_VALUE = 'defaultValue'; + const ACTION_GROUP_ARGUMENTS = 'arguments'; /** * Action Object Extractor for converting actions into objects @@ -38,19 +39,47 @@ public function __construct() */ public function extractActionGroup($actionGroupData) { + $arguments = []; + $actionData = $this->stripDescriptorTags( $actionGroupData, self::NODE_NAME, - self::DEFAULT_ENTITY, + self::ACTION_GROUP_ARGUMENTS, self::NAME ); $actions = $this->actionObjectExtractor->extractActions($actionData); + if (array_key_exists(self::ACTION_GROUP_ARGUMENTS, $actionGroupData)) { + $arguments = $this->extractArguments($actionGroupData[self::ACTION_GROUP_ARGUMENTS]); + } + return new ActionGroupObject( $actionGroupData[self::NAME], - $actionGroupData[self::DEFAULT_ENTITY], + $arguments, $actions ); } + + /** + * Method which extract argument declarations from an action group and returns an array of default values indexed + * by argument name. + * + * @param array $arguments + * @return array + */ + private function extractArguments($arguments) + { + $parsedArguments = []; + $argData = $this->stripDescriptorTags( + $arguments, + self::NODE_NAME + ); + + foreach ($argData as $argName => $argValue) { + $parsedArguments[$argName] = $argValue[self::DEFAULT_VALUE]; + } + + return $parsedArguments; + } } diff --git a/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php index 4bb799451..9897e37b8 100644 --- a/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php +++ b/src/Magento/AcceptanceTestFramework/Test/Util/ActionObjectExtractor.php @@ -17,6 +17,10 @@ class ActionObjectExtractor extends BaseCestObjectExtractor const TEST_ACTION_BEFORE = 'before'; const TEST_ACTION_AFTER = 'after'; const TEST_STEP_MERGE_KEY = 'mergeKey'; + const ACTION_GROUP_TAG = 'actionGroup'; + const ACTION_GROUP_REF = 'ref'; + const ACTION_GROUP_ARGUMENTS = 'arguments'; + const ACTION_GROUP_ARG_VALUE = 'value'; const BEFORE_AFTER_ERROR_MSG = "Merge Error - Steps cannot have both before and after attributes.\tTestStep='%s'"; /** @@ -53,6 +57,10 @@ public function extractActions($testActions) $linkedAction = null; $order = null; + if ($actionData[self::NODE_NAME] === self::ACTION_GROUP_TAG) { + $actionAttributes = $this->processActionGroupArgs($actionAttributes); + } + if (array_key_exists(self::TEST_ACTION_BEFORE, $actionData) and array_key_exists(self::TEST_ACTION_AFTER, $actionData)) { throw new XmlException(sprintf(self::BEFORE_AFTER_ERROR_MSG, $actionName)); @@ -60,10 +68,10 @@ public function extractActions($testActions) if (array_key_exists(self::TEST_ACTION_BEFORE, $actionData)) { $linkedAction = $actionData[self::TEST_ACTION_BEFORE]; - $order = "before"; + $order = self::TEST_ACTION_BEFORE; } elseif (array_key_exists(self::TEST_ACTION_AFTER, $actionData)) { $linkedAction = $actionData[self::TEST_ACTION_AFTER]; - $order = "after"; + $order = self::TEST_ACTION_AFTER; } // TODO this is to be implemented later. Currently the schema does not use or need return var. /*if (array_key_exists(ActionGroupObjectHandler::TEST_ACTION_RETURN_VARIABLE, $actionData)) { @@ -82,6 +90,29 @@ public function extractActions($testActions) return $actions; } + /** + * Takes the action group reference and parses out arguments as an array that can be passed to override defaults + * defined in the action group xml. + * + * @param array $actionAttributeData + * @return array + */ + private function processActionGroupArgs($actionAttributeData) + { + $actionAttributeArgData = []; + foreach ($actionAttributeData as $attributeDataKey => $attributeDataValues) { + if ($attributeDataKey == self::ACTION_GROUP_REF) { + $actionAttributeArgData[self::ACTION_GROUP_REF] = $attributeDataValues; + continue; + } + + $actionAttributeArgData[self::ACTION_GROUP_ARGUMENTS][$attributeDataKey] = + $attributeDataValues[self::ACTION_GROUP_ARG_VALUE]; + } + + return $actionAttributeArgData; + } + /** * Function which checks an entity definition for type array and strips this key out (as data is not stores in this * type of object). diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml b/src/Magento/AcceptanceTestFramework/Test/etc/sampleActionGroup.xml similarity index 90% rename from src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml rename to src/Magento/AcceptanceTestFramework/Test/etc/sampleActionGroup.xml index aaa1a130c..285be1f58 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/sampleActions.xml +++ b/src/Magento/AcceptanceTestFramework/Test/etc/sampleActionGroup.xml @@ -1,11 +1,15 @@ - + + + + + - - + + @@ -79,5 +83,5 @@ - + diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml b/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml index b02b90a86..8bcec49ae 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml +++ b/src/Magento/AcceptanceTestFramework/Test/etc/sampleCest.xml @@ -9,7 +9,9 @@ - + + + diff --git a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd index a9aba6a46..945f2e133 100644 --- a/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd +++ b/src/Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd @@ -8,7 +8,7 @@ - + @@ -24,9 +24,21 @@ + + + + + + + + + + + + - + @@ -52,7 +64,7 @@ - + @@ -168,16 +180,19 @@ - - - - - - - - - - + + + + + + + + + + + + + From bc1c77a674f2c9a53e0372d468bb4d52b681adb9 Mon Sep 17 00:00:00 2001 From: KevinBKozan Date: Mon, 11 Sep 2017 11:27:51 -0500 Subject: [PATCH 147/149] Additional Quote Fix Quote fix did nto include necessary changes to entity definition. --- src/Magento/AcceptanceTestFramework/Util/TestGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index d0988a1c8..398d6d63b 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -485,12 +485,12 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $entityData = '['; foreach ($stepsData[$customActionAttributes['name']] as $dataKey => $dataValue) { $variableReplace = $this->resolveTestVariable($dataValue, true); - $entityData .= sprintf("'%s' => '%s', ", $dataKey, $variableReplace); + $entityData .= sprintf("\"%s\" => \"%s\", ", $dataKey, $variableReplace); } $entityData .= ']'; if ($hookObject) { $testSteps .= sprintf( - "\t\t\$this->%s = new EntityDataObject('%s','%s',%s,null);\n", + "\t\t\$this->%s = new EntityDataObject(\"%s\",\"%s\",%s,null);\n", $customActionAttributes['name'], $customActionAttributes['name'], $customActionAttributes['type'], @@ -498,7 +498,7 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) ); } else { $testSteps .= sprintf( - "\t\t$%s = new EntityDataObject('%s','%s',%s,null);\n", + "\t\t$%s = new EntityDataObject(\"%s\",\"%s\",%s,null);\n", $customActionAttributes['name'], $customActionAttributes['name'], $customActionAttributes['type'], From 803c744401e30210f6f533f53f52398b6e424f02 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 5 Sep 2017 09:43:15 -0500 Subject: [PATCH 148/149] MQE-307: Added ability to persist same entity data multiple times. --- .../DataGenerator/Api/ApiExecutor.php | 74 +++++++++--- .../DataGenerator/Api/EntityApiHandler.php | 13 ++- .../Handlers/DataObjectHandler.php | 2 +- .../Objects/EntityDataObject.php | 107 +++++++++++++++++- .../Exceptions/TestFrameworkException.php | 22 ++++ .../Test/Objects/ActionObject.php | 33 +----- .../Util/TestGenerator.php | 74 +++++++----- 7 files changed, 244 insertions(+), 81 deletions(-) create mode 100644 src/Magento/AcceptanceTestFramework/Exceptions/TestFrameworkException.php diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php index 4d5bb8635..aa8c26d1d 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/ApiExecutor.php @@ -29,12 +29,14 @@ class ApiExecutor /** * The entity object data being created, updated, or deleted. + * * @var EntityDataObject $entityObject */ private $entityObject; /** * The json definitions used to map the operation. + * * @var JsonDefinition $jsonDefinition */ private $jsonDefinition; @@ -42,10 +44,19 @@ class ApiExecutor /** * The array of dependentEntities this class can be given. When finding linked entities, APIExecutor * uses this repository before looking for static data. + * * @var array */ private $dependentEntities = []; + /** + * The array of entity name and number of objects being created, + * we don't need to track objects in update and delete operations. + * + * @var array + */ + private static $entitySequences = []; + /** * ApiSubObject constructor. * @param string $operation @@ -82,7 +93,10 @@ public function executeRequest() if (!empty($matchedParams)) { foreach ($matchedParams[0] as $paramKey => $paramValue) { - $param = $this->entityObject->getDataByName($matchedParams[1][$paramKey]); + $param = $this->entityObject->getDataByName( + $matchedParams[1][$paramKey], + EntityDataObject::CEST_UNIQUE_VALUE + ); $apiClientUrl = str_replace($paramValue, $param, $apiClientUrl); } } @@ -139,6 +153,7 @@ private function getAuthorizationHeader($authUrl) private function convertJsonArray($entityObject, $jsonArrayMetadata) { $jsonArray = []; + self::incrementSequence($entityObject->getName()); foreach ($jsonArrayMetadata as $jsonElement) { if ($jsonElement->getType() == JsonObjectExtractor::JSON_OBJECT_OBJ_NAME) { @@ -149,23 +164,21 @@ private function convertJsonArray($entityObject, $jsonArrayMetadata) $jsonElementType = $jsonElement->getValue(); if (in_array($jsonElementType, ApiExecutor::PRIMITIVE_TYPES)) { - $elementData = $entityObject->getDataByName($jsonElement->getKey()); - $elementUniquenessData = $entityObject->getUniquenessDataByName($jsonElement->getKey()); - if ($elementUniquenessData) { - if ($elementUniquenessData == 'prefix') { - if (DataObjectHandler::UNIQUENESS_FUNCTION == 'msq') { - $elementData = msq($entityObject->getName().'.' . $jsonElement->getKey()).$elementData; - } elseif (DataObjectHandler::UNIQUENESS_FUNCTION == 'msqs') { - $elementData = msqs($entityObject->getName().'.' . $jsonElement->getKey()).$elementData; - } - } elseif ($elementUniquenessData == 'suffix') { - if (DataObjectHandler::UNIQUENESS_FUNCTION == 'msq') { - $elementData .= msq($entityObject->getName() . '.'. $jsonElement->getKey()); - } elseif (DataObjectHandler::UNIQUENESS_FUNCTION == 'msqs') { - $elementData .= msqs($entityObject->getName() . '.'. $jsonElement->getKey()); - } + $elementData = $entityObject->getDataByName( + $jsonElement->getKey(), + EntityDataObject::CEST_UNIQUE_VALUE + ); + + if (array_key_exists($jsonElement->getKey(), $entityObject->getUniquenessData())) { + $uniqueData = $entityObject->getUniquenessDataByName($jsonElement->getKey()); + if ($uniqueData === 'suffix') { + $elementData .= (string)self::getSequence($entityObject->getName()); + } else { + $elementData = (string)self::getSequence($entityObject->getName()) + . $elementData; } } + $jsonArray[$jsonElement->getKey()] = $this->castValue($jsonElementType, $elementData); } else { $entityNamesOfType = $entityObject->getLinkedEntitiesOfType($jsonElementType); @@ -242,6 +255,35 @@ public function getEncodedJsonString() return json_encode($jsonMetadataArray, JSON_PRETTY_PRINT); } + /** + * Increment an entity's sequence number by 1. + * + * @param string $entityName + * @return void + */ + private static function incrementSequence($entityName) + { + if (array_key_exists($entityName, self::$entitySequences)) { + self::$entitySequences[$entityName]++; + } else { + self::$entitySequences[$entityName] = 1; + } + } + + /** + * Get the current sequence number for an entity. + * + * @param string $entityName + * @return int + */ + private static function getSequence($entityName) + { + if (array_key_exists($entityName, self::$entitySequences)) { + return self::$entitySequences[$entityName]; + } + return 0; + } + // @codingStandardsIgnoreStart /** * This function takes a string value and its corresponding type and returns the string cast diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php index 12f1200ea..96af4dd2e 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Api/EntityApiHandler.php @@ -6,12 +6,10 @@ namespace Magento\AcceptanceTestFramework\DataGenerator\Api; -use Codeception\Test\Cest; use Magento\AcceptanceTestFramework\Config\Data; use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; use Magento\AcceptanceTestFramework\Test\Handlers\CestObjectHandler; -use Magento\AcceptanceTestFramework\Test\Managers\CestArrayProcessor; use Magento\AcceptanceTestFramework\Util\TestGenerator; class EntityApiHandler @@ -57,10 +55,11 @@ public function createEntity() $result = $apiExecutor->executeRequest(); $this->createdObject = new EntityDataObject( - '__created' . $this->entityObject->getName(), + $this->entityObject->getName(), $this->entityObject->getType(), json_decode($result, true), - null + null, + null // No uniqueness data is needed to be further processed. ); } @@ -93,7 +92,11 @@ public function getCreatedObject() */ public function getCreatedDataByName($dataName) { - return $this->createdObject->getDataByName($dataName); + $data = $this->createdObject->getDataByName($dataName, EntityDataObject::NO_UNIQUE_PROCESS); + if (empty($data)) { + $data = $this->entityObject->getDataByName($dataName, EntityDataObject::CEST_UNIQUE_VALUE); + } + return $data; } // TODO add update function diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php index 8b4430705..e2758ef6d 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Handlers/DataObjectHandler.php @@ -37,7 +37,6 @@ class DataObjectHandler implements ObjectHandlerInterface const DATA_ELEMENT_UNIQUENESS_ATTR = 'unique'; const DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX = 'prefix'; const DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX = 'suffix'; - const UNIQUENESS_FUNCTION = 'msq'; const ARRAY_VALUES = 'array'; const ARRAY_ELEMENT_KEY = 'key'; @@ -130,6 +129,7 @@ private function parseEnvVariables() self::ENV_DATA_OBJECT_NAME, 'environment', $envData, + null, null ); $this->data[$envDataObject->getName()] = $envDataObject; diff --git a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php index e9390a5b0..eeef5e12d 100644 --- a/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php +++ b/src/Magento/AcceptanceTestFramework/DataGenerator/Objects/EntityDataObject.php @@ -6,6 +6,8 @@ namespace Magento\AcceptanceTestFramework\DataGenerator\Objects; +use Magento\AcceptanceTestFramework\Exceptions\TestFrameworkException; + /** * Class EntityDataObject */ @@ -39,6 +41,14 @@ class EntityDataObject */ private $data = []; + const NO_UNIQUE_PROCESS = 0; + const SUITE_UNIQUE_VALUE = 1; + const CEST_UNIQUE_VALUE = 2; + const SUITE_UNIQUE_NOTATION = 3; + const CEST_UNIQUE_NOTATION = 4; + const SUITE_UNIQUE_FUNCTION = 'msqs'; + const CEST_UNIQUE_FUNCTION = 'msq'; + /** * Array of data name and its uniqueness attribute value. * @@ -54,7 +64,7 @@ class EntityDataObject * @param array $linkedEntities * @param array $uniquenessData */ - public function __construct($entityName, $entityType, $data, $linkedEntities, $uniquenessData = null) + public function __construct($entityName, $entityType, $data, $linkedEntities, $uniquenessData) { $this->name = $entityName; $this->type = $entityType; @@ -108,14 +118,72 @@ public function getData() * This function retrieves data from an entity defined in xml. * * @param string $dataName + * @param int $uniDataFormat * @return string|null + * @throws TestFrameworkException */ - public function getDataByName($dataName) + public function getDataByName($dataName, $uniDataFormat) { + if (!$this->isValidUniqueDataFormat($uniDataFormat)) { + throw new TestFrameworkException( + sprintf('Invalid unique data format value: %s \n', $uniDataFormat) + ); + } + $name = strtolower($dataName); - if ($this->data != null && array_key_exists($name, $this->data)) { - return $this->data[$name]; + if ($this->data !== null && array_key_exists($name, $this->data)) { + $uniData = $this->getUniquenessDataByName($dataName); + if (null === $uniData || $uniDataFormat == self::NO_UNIQUE_PROCESS) { + return $this->data[$name]; + } + + switch ($uniDataFormat) { + case self::SUITE_UNIQUE_VALUE: + if (!function_exists(self::SUITE_UNIQUE_FUNCTION)) { + throw new TestFrameworkException( + sprintf( + 'Unique data format value: %s can only be used when running cests.\n', + $uniDataFormat + ) + ); + } elseif ($uniData == 'prefix') { + return msqs($this->getName()) . $this->data[$name]; + } else { // $uniData == 'suffix' + return $this->data[$name] . msqs($this->getName()); + } + break; + case self::CEST_UNIQUE_VALUE: + if (!function_exists(self::CEST_UNIQUE_FUNCTION)) { + throw new TestFrameworkException( + sprintf( + 'Unique data format value: %s can only be used when running cests.\n', + $uniDataFormat + ) + ); + } elseif ($uniData == 'prefix') { + return msq($this->getName()) . $this->data[$name]; + } else { // $uniData == 'suffix' + return $this->data[$name] . msq($this->getName()); + } + break; + case self::SUITE_UNIQUE_NOTATION: + if ($uniData == 'prefix') { + return self::SUITE_UNIQUE_FUNCTION . '("' . $this->getName() . '")' . $this->data[$name]; + } else { // $uniData == 'suffix' + return $this->data[$name] . self::SUITE_UNIQUE_FUNCTION . '("' . $this->getName() . '")'; + } + break; + case self::CEST_UNIQUE_NOTATION: + if ($uniData == 'prefix') { + return self::CEST_UNIQUE_FUNCTION . '("' . $this->getName() . '")' . $this->data[$name]; + } else { // $uniData == 'suffix' + return $this->data[$name] . self::CEST_UNIQUE_FUNCTION . '("' . $this->getName() . '")'; + } + break; + default: + break; + } } return null; @@ -157,4 +225,35 @@ public function getUniquenessDataByName($dataName) return null; } + + /** + * This function retrieves uniqueness data. + * + * @return array|null + */ + public function getUniquenessData() + { + return $this->uniquenessData; + } + + /** + * Validate if input value is a valid unique data format. + * + * @param int $uniDataFormat + * @return bool + */ + private function isValidUniqueDataFormat($uniDataFormat) + { + return in_array( + $uniDataFormat, + [ + self::NO_UNIQUE_PROCESS, + self::SUITE_UNIQUE_VALUE, + self::CEST_UNIQUE_VALUE, + self::SUITE_UNIQUE_NOTATION, + self::CEST_UNIQUE_NOTATION + ], + true + ); + } } diff --git a/src/Magento/AcceptanceTestFramework/Exceptions/TestFrameworkException.php b/src/Magento/AcceptanceTestFramework/Exceptions/TestFrameworkException.php new file mode 100644 index 000000000..7a4c5da6e --- /dev/null +++ b/src/Magento/AcceptanceTestFramework/Exceptions/TestFrameworkException.php @@ -0,0 +1,22 @@ +getDataByName($name)[$index]; + $replacement = $obj->getDataByName( + $name, + EntityDataObject::CEST_UNIQUE_NOTATION + )[$index]; } else { // Access - $replacement = $obj->getDataByName($objField); + $replacement = $obj->getDataByName($objField, EntityDataObject::CEST_UNIQUE_NOTATION); } - - $replacement = $this->resolveEntityDataUniquenessReference($replacement, $obj, $objField); - break; } @@ -360,28 +359,6 @@ private function findAndReplaceReferences($objectHandler, $inputString) return $outputString; } - /** - * Method which resolves data references requiring uniqueness for test idempotentcy - * - * @param string $reference - * @param EntityDataObject $entityDataObject - * @param string $entityKey - * @return string - */ - private function resolveEntityDataUniquenessReference($reference, $entityDataObject, $entityKey) - { - $uniquenessData = $entityDataObject->getUniquenessDataByName($entityKey); - $entityName = $entityDataObject->getName(); - - if ($uniquenessData == DataObjectHandler::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_PREFIX) { - $reference = - DataObjectHandler::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")' . $reference; - } elseif ($uniquenessData == DataObjectHandler::DATA_ELEMENT_UNIQUENESS_ATTR_VALUE_SUFFIX) { - $reference .= DataObjectHandler::UNIQUENESS_FUNCTION . '("' . $entityName . '.' . $entityKey . '")'; - } - return $reference; - } - /** * Finds all {{var}} occurrences in reference, and replaces them in sequence with parameters list given. * Parameter list given is also resolved, attempting to match {{data.field}} references. diff --git a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php index 398d6d63b..2b3862982 100644 --- a/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php +++ b/src/Magento/AcceptanceTestFramework/Util/TestGenerator.php @@ -6,6 +6,7 @@ namespace Magento\AcceptanceTestFramework\Util; +use Magento\AcceptanceTestFramework\DataGenerator\Objects\EntityDataObject; use Magento\AcceptanceTestFramework\Test\Handlers\CestObjectHandler; use Magento\AcceptanceTestFramework\Test\Objects\ActionObject; use Magento\AcceptanceTestFramework\DataGenerator\Handlers\DataObjectHandler; @@ -317,8 +318,17 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } if (isset($customActionAttributes['parameterArray'])) { - $parameterArray = $customActionAttributes['parameterArray']; + $paramsWithUniqueness = []; + $params = explode( + ',', + $this->stripWrappedQuotes(rtrim(ltrim($customActionAttributes['parameterArray'], '['), ']')) + ); + foreach ($params as $param) { + $paramsWithUniqueness[] = $this->addUniquenessFunctionCall($param); + } + $parameterArray = '[' . implode(',', $paramsWithUniqueness) .']'; } + if (isset($customActionAttributes['requiredAction'])) { $requiredAction = $customActionAttributes['requiredAction']; } @@ -425,13 +435,14 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) if (!empty($requiredEntities)) { $testSteps .= sprintf( "\t\t$%s = new EntityDataObject($%s->getName(), $%s->getType(), $%s->getData() - , array_merge($%s->getLinkedEntities(), [%s]));\n", + , array_merge($%s->getLinkedEntities(), [%s]), $%s->getUniquenessData());\n", $entity, $entity, $entity, $entity, $entity, - implode(", ", $requiredEntities) + implode(", ", $requiredEntities), + $entity ); if ($hookObject) { @@ -489,16 +500,18 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } $entityData .= ']'; if ($hookObject) { + // no uniqueness attributes for data allowed within entity defined in cest. $testSteps .= sprintf( - "\t\t\$this->%s = new EntityDataObject(\"%s\",\"%s\",%s,null);\n", + "\t\t\$this->%s = new EntityDataObject(\"%s\",\"%s\",%s,null,null);\n", $customActionAttributes['name'], $customActionAttributes['name'], $customActionAttributes['type'], $entityData ); } else { + // no uniqueness attributes for data allowed within entity defined in cest. $testSteps .= sprintf( - "\t\t$%s = new EntityDataObject(\"%s\",\"%s\",%s,null);\n", + "\t\t$%s = new EntityDataObject(\"%s\",\"%s\",%s,null,null);\n", $customActionAttributes['name'], $customActionAttributes['name'], $customActionAttributes['type'], @@ -602,13 +615,17 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) case "grabAttributeFrom": case "grabMultiple": case "grabFromCurrentUrl": - $testSteps .= $this->wrapFunctionCallWithReturnValue( - $returnVariable, - $actor, - $actionName, - $selector, - $input - ); + if (isset($returnVariable)) { + $testSteps .= $this->wrapFunctionCallWithReturnValue( + $returnVariable, + $actor, + $actionName, + $selector, + $input + ); + } else { + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input); + } break; case "grabValueFrom": if (isset($returnVariable)) { @@ -639,6 +656,7 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) ); break; case "seeLink": + case "dontSeeLink": $testSteps .= $this->wrapFunctionCall($actor, $actionName, $input, $url); break; case "setCookie": @@ -666,7 +684,6 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) case "loadSessionSnapshot": case "seeInField": case "seeOptionIsSelected": - case "dontSeeLink": case "unselectOption": $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input); break; @@ -947,21 +964,18 @@ private function addUniquenessFunctionCall($input) { $output = ''; - preg_match('/' . DataObjectHandler::UNIQUENESS_FUNCTION .'\("[\w]+.[\w]+"\)/', $input, $matches); + preg_match('/' . EntityDataObject::CEST_UNIQUE_FUNCTION .'\("[\w]+"\)/', $input, $matches); if (!empty($matches)) { - $parts = preg_split('/' . DataObjectHandler::UNIQUENESS_FUNCTION . '\("[\w]+.[\w]+"\)/', $input, -1); - foreach ($parts as $part) { - if (!$part) { - if (!empty($output)) { - $output .= '.'; - } - $output .= $matches[0]; - } else { - if (!empty($output)) { - $output .= '.'; - } - $output .= sprintf("\"%s\"", $part); - } + $parts = preg_split('/' . EntityDataObject::CEST_UNIQUE_FUNCTION . '\("[\w]+"\)/', $input, -1); + for ($i = 0; $i < count($parts); $i++) { + $parts[$i] = $this->stripWrappedQuotes($parts[$i]); + } + if (!empty($parts[0])) { + $output = $this->wrapWithSingleQuotes($parts[0]); + } + $output .= $output === '' ? $matches[0] : '.' . $matches[0]; + if (!empty($parts[1])) { + $output .= '.' . $this->wrapWithSingleQuotes($parts[1]); } } else { $output = $this->wrapWithSingleQuotes($input); @@ -978,6 +992,9 @@ private function addUniquenessFunctionCall($input) */ private function wrapWithSingleQuotes($input) { + if (empty($input)) { + return ''; + } $input = addslashes($input); return sprintf('"%s"', $input); } @@ -990,6 +1007,9 @@ private function wrapWithSingleQuotes($input) */ private function stripWrappedQuotes($input) { + if (empty($input)) { + return ''; + } if (substr($input, 0, 1) === '"' || substr($input, 0, 1) === "'") { $input = substr($input, 1); } From 920472414ccb124f6559325b327e6570c10f779a Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Tue, 12 Sep 2017 16:01:46 +0300 Subject: [PATCH 149/149] MQE-279: Create repositories in magento organization --- README.md | 4 ++-- etc/_envs/chrome.yml | 6 +++--- etc/_envs/firefox.yml | 6 +++--- etc/_envs/phantomjs.yml | 6 +++--- etc/di.xml | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d0c43f1a5..f93325c42 100755 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ Add the package into your acceptance test project composer.json: ``` { "require": { - "magento/acceptance-test-framework": "dev-master" + "magento/acceptance-test-framework": "dev-develop" } } ``` Then run: ``` - php composer.phar update + composer update ``` diff --git a/etc/_envs/chrome.yml b/etc/_envs/chrome.yml index c606d764e..3793a2d27 100644 --- a/etc/_envs/chrome.yml +++ b/etc/_envs/chrome.yml @@ -1,9 +1,9 @@ # `chrome` environment config goes here modules: enabled: - - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver - - \Magento\AcceptanceTestFramework\Helper\Acceptance + - \Magento\FunctionalTestingFramework\Module\MagentoWebDriver + - \Magento\FunctionalTestingFramework\Helper\Acceptance config: - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver: + \Magento\FunctionalTestingFramework\Module\MagentoWebDriver: browser: chrome window_size: maximize \ No newline at end of file diff --git a/etc/_envs/firefox.yml b/etc/_envs/firefox.yml index 83ee9f944..e8565283a 100644 --- a/etc/_envs/firefox.yml +++ b/etc/_envs/firefox.yml @@ -1,9 +1,9 @@ # `firefox` environment config goes here modules: enabled: - - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver - - \Magento\AcceptanceTestFramework\Helper\Acceptance + - \Magento\FunctionalTestingFramework\Module\MagentoWebDriver + - \Magento\FunctionalTestingFramework\Helper\Acceptance config: - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver: + \Magento\FunctionalTestingFramework\Module\MagentoWebDriver: browser: firefox window_size: maximize \ No newline at end of file diff --git a/etc/_envs/phantomjs.yml b/etc/_envs/phantomjs.yml index aae0ebfca..a7a65e6b5 100644 --- a/etc/_envs/phantomjs.yml +++ b/etc/_envs/phantomjs.yml @@ -1,8 +1,8 @@ # `phantomjs` environment config goes here modules: enabled: - - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver - - \Magento\AcceptanceTestFramework\Helper\Acceptance + - \Magento\FunctionalTestingFramework\Module\MagentoWebDriver + - \Magento\FunctionalTestingFramework\Helper\Acceptance config: - \Magento\AcceptanceTestFramework\Module\MagentoWebDriver: + \Magento\FunctionalTestingFramework\Module\MagentoWebDriver: browser: phantomjs \ No newline at end of file diff --git a/etc/di.xml b/etc/di.xml index bffdccc85..0539a31ea 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -82,12 +82,12 @@ - Magento/AcceptanceTestFramework/Page/etc/PageObject.xsd + Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd - Magento/AcceptanceTestFramework/Page/etc/SectionObject.xsd + Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd @@ -155,7 +155,7 @@ - Magento/AcceptanceTestFramework/DataGenerator/etc/dataProfileSchema.xsd + Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd @@ -188,7 +188,7 @@ - Magento/AcceptanceTestFramework/DataGenerator/etc/dataOperation.xsd + Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd @@ -211,7 +211,7 @@ - Magento/AcceptanceTestFramework/Test/etc/testSchema.xsd + Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd