123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <?php
- namespace Magento\AcceptanceTest\_default\Backend;
- use Magento\FunctionalTestingFramework\AcceptanceTester;
- use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
- use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
- use \Codeception\Util\Locator;
- 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;
- use Yandex\Allure\Adapter\Annotation\TestCaseId;
- /**
- * @Title("[NO TESTCASEID]: A Functional Cest")
- * @group functional
- */
- class BasicFunctionalTestCest
- {
- /**
- * @param AcceptanceTester $I
- * @throws \Exception
- */
- public function _before(AcceptanceTester $I)
- {
- $I->amOnPage("/beforeUrl");
- }
- /**
- * @param AcceptanceTester $I
- * @throws \Exception
- */
- public function _after(AcceptanceTester $I)
- {
- $I->amOnPage("/afterUrl");
- }
- /**
- * @param AcceptanceTester $I
- * @throws \Exception
- */
- public function _failed(AcceptanceTester $I)
- {
- $I->saveScreenshot();
- }
- /**
- * @Severity(level = SeverityLevel::CRITICAL)
- * @Features({"TestModule"})
- * @Stories({"MQE-305"})
- * @Parameter(name = "AcceptanceTester", value="$I")
- * @param AcceptanceTester $I
- * @return void
- * @throws \Exception
- */
- public function BasicFunctionalTest(AcceptanceTester $I)
- {
- $I->comment("");
- $I->comment("");
- $I->skipReadinessCheck(true);
- $I->comment("skipReadiness");
- $I->skipReadinessCheck(false);
- $someVarDefinition = $I->grabValueFrom();
- $I->acceptPopup();
- $I->amOnPage("/test/url");
- $I->appendField(".functionalTestSelector");
- $I->attachFile(".functionalTestSelector", "testFileAttachment");
- $I->cancelPopup();
- $I->checkOption(".functionalTestSelector");
- $I->click(".functionalTestSelector");
- $I->clickWithLeftButton(".functionalTestSelector");
- $I->clickWithRightButton(".functionalTestSelector");
- $I->clickWithLeftButton("#element#element .200", 200, 300);
- $I->clickWithRightButton("#element .4123#element", 200, 300);
- $I->closeTab();
- $I->conditionalClick(".functionalTestSelector", ".functionalDependentTestSelector", true);
- $I->amGoingTo("delete entity that has the createDataKey: createKey1");
- PersistedObjectHandler::getInstance()->deleteEntity(
- "createKey1",
- "test"
- );
- $I->deleteEntityByUrl("/V1/categories{$grabbedData}");
- $I->dontSee("someInput", ".functionalTestSelector");
- $I->dontSeeCheckboxIsChecked(".functionalTestSelector");
- $I->dontSeeCookie("someInput");
- $I->dontSeeCurrentUrlEquals("/functionalUrl");
- $I->dontSeeCurrentUrlMatches("/[0-9]+/");
- $I->dontSeeElement(".functionalTestSelector");
- $I->dontSeeElementInDOM(".functionalTestSelector");
- $I->dontSeeInCurrentUrl("/functionalUrl");
- $I->dontSeeInField(".functionalTestSelector");
- $I->dontSeeInPageSource("someInput");
- $I->dontSeeInSource("<myHtmlHere>");
- $I->dontSeeInTitle("someInput");
- $I->dontSeeLink("someInput", "/functionalUrl");
- $I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput");
- $I->doubleClick(".functionalTestSelector");
- $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2");
- $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2", 100, 900);
- $executeJSKey1 = $I->executeJS("someJSFunction");
- $I->fillField(".functionalTestSelector", "someInput");
- $I->fillField(".functionalTestSelector", "0");
- $date = new \DateTime();
- $date->setTimestamp(strtotime("Now"));
- $date->setTimezone(new \DateTimeZone("America/Los_Angeles"));
- $generateDateKey = $date->format("H:i:s");
- $date = new \DateTime();
- $date->setTimestamp(strtotime("Now"));
- $date->setTimezone(new \DateTimeZone("UTC"));
- $generateDateKey2 = $date->format("H:i:s");
- $grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput");
- $grabCookieKey1 = $I->grabCookie("grabCookieInput", ['domain' => 'www.google.com']);
- $grabFromCurrentUrlKey1 = $I->grabFromCurrentUrl("/grabCurrentUrl");
- $grabMultipleKey1 = $I->grabMultiple(".functionalTestSelector");
- $grabTextFromKey1 = $I->grabTextFrom(".functionalTestSelector");
- $grabValueFromKey1 = $I->grabValueFrom(".functionalTestSelector");
- $magentoCli1 = $I->magentoCLI("maintenance:enable", "\"stuffHere\"");
- $I->comment($magentoCli1);
- $I->makeScreenshot("screenShotInput");
- $I->maximizeWindow();
- $I->moveBack();
- $I->moveForward();
- $I->moveMouseOver(".functionalTestSelector");
- $I->openNewTab();
- $I->pauseExecution();
- $I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10);
- $I->pressKey("#page", "a");
- $I->pressKey("#page", ['ctrl', 'a'],'new');
- $I->pressKey("#page", ['shift', '111'],'1','x');
- $I->pressKey("#page", ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE);
- $I->reloadPage();
- $I->resetCookie("cookieInput");
- $I->resizeWindow(0, 0);
- $I->scrollTo(".functionalTestSelector");
- $I->see("someInput", ".functionalTestSelector");
- $I->seeCheckboxIsChecked(".functionalTestSelector");
- $I->seeCookie("someInput");
- $I->seeCurrentUrlEquals("/functionalUrl");
- $I->seeCurrentUrlMatches("/[0-9]+/");
- $I->seeElement(".functionalTestSelector");
- $I->seeElementInDOM(".functionalTestSelector");
- $I->seeInCurrentUrl("/functionalUrl");
- $I->seeInField(".functionalTestSelector", "someInput");
- $I->seeInPageSource("<myHtmlHere>");
- $I->seeInPopup("someInput");
- $I->seeInSource("<myHtmlHere>");
- $I->seeInTitle("someInput");
- $I->seeLink("someInput", "/functionalUrl");
- $I->seeNumberOfElements(".functionalTestSelector");
- $I->seeOptionIsSelected(".functionalTestSelector", "someInput");
- $I->selectOption(".functionalTestSelector");
- $I->selectMultipleOptions(".filter", ".option", ['opt1', 'opt2']);
- $I->setCookie("someInput", "someCookieValue");
- $I->switchToIFrame("someInput");
- $I->switchToNextTab();
- $I->switchToPreviousTab();
- $I->switchToWindow();
- $I->typeInPopup("someInput");
- $I->uncheckOption(".functionalTestSelector");
- $I->unselectOption(".functionalTestSelector", "someInput");
- $I->wait(30);
- $I->waitForElement(".functionalTestSelector", 30);
- $I->waitForElementNotVisible(".functionalTestSelector", 30);
- $I->waitForElementVisible(".functionalTestSelector", 30);
- $I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10);
- $I->waitForJS("someJsFunction", 30);
- $I->waitForText("someInput", 30, ".functionalTestSelector");
- }
- }
|