-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathBasicFunctionalTest.txt
187 lines (180 loc) · 10.4 KB
/
BasicFunctionalTest.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?php
namespace Magento\AcceptanceTest\_default\Backend;
use Magento\FunctionalTestingFramework\AcceptanceTester;
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
* @Description("<h3>Test files</h3>verification/TestModule/Test/BasicFunctionalTest/BasicFunctionalTest.xml<br>")
*/
class BasicFunctionalTestCest
{
/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _before(AcceptanceTester $I)
{
$I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey
}
/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _after(AcceptanceTester $I)
{
$I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey
}
/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _failed(AcceptanceTester $I)
{
$I->saveScreenshot(); // stepKey: 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->comment("seeComment");
$someVarDefinition = $I->grabValueFrom(); // stepKey: someVarDefinition
$I->acceptPopup(); // stepKey: acceptPopupKey1
$I->amOnPage("/test/url"); // stepKey: amOnPageKey1
$I->appendField(".functionalTestSelector"); // stepKey: appendFieldKey1
$I->attachFile(".functionalTestSelector", "testFileAttachment"); // stepKey: attachFileKey1
$I->cancelPopup(); // stepKey: cancelPopupKey1
$I->checkOption(".functionalTestSelector"); // stepKey: checkOptionKey1
$I->click(".functionalTestSelector"); // stepKey: clickKey1
$I->clickWithLeftButton(".functionalTestSelector"); // stepKey: clickWithLeftButtonKey1
$I->clickWithRightButton(".functionalTestSelector"); // stepKey: clickWithRightButtonKey1
$I->clickWithLeftButton("#element#element .200", 200, 300); // stepKey: clickWithLeftButtonKeyXY1
$I->clickWithRightButton("#element .4123#element", 200, 300); // stepKey: clickWithRightButtonKeyXY1
$I->closeTab(); // stepKey: closeTabKey1
$I->conditionalClick(".functionalTestSelector", ".functionalDependentTestSelector", true); // stepKey: conditionalClickKey1
$I->deleteEntity("createKey1", "test"); // stepKey: deleteKey1
$I->deleteEntityByUrl("/V1/categories{$grabbedData}"); // stepKey: deleteKey2
$I->dontSee("someInput", ".functionalTestSelector"); // stepKey: dontSeeKey1
$I->dontSeeCheckboxIsChecked(".functionalTestSelector"); // stepKey: dontSeeCheckboxIsCheckedKey1
$I->dontSeeCookie("someInput"); // stepKey: dontSeeCookieKey1
$I->dontSeeCurrentUrlEquals("/functionalUrl"); // stepKey: dontSeeCurrentUrlEqualsKey1
$I->dontSeeCurrentUrlMatches("/[0-9]+/"); // stepKey: dontSeeCurrentUrlMatchesKey1
$I->dontSeeElement(".functionalTestSelector"); // stepKey: dontSeeElementKey1
$I->dontSeeElementInDOM(".functionalTestSelector"); // stepKey: dontSeeElementInDOMKey1
$I->dontSeeInCurrentUrl("/functionalUrl"); // stepKey: dontSeeInCurrentUrlKey1
$I->dontSeeInField(".functionalTestSelector"); // stepKey: dontSeeInFieldKey1
$I->dontSeeInPageSource("Cosmo Kramer"); // stepKey: dontSeeInPageSourceKey1
$I->dontSeeInPageSource("<p>Jerry Seinfeld</p>"); // stepKey: dontSeeInPageSourceKey2
$I->dontSeeInPageSource("Cosmo Kramer"); // stepKey: dontSeeInPageSourceKey3
$I->dontSeeInPageSource("<p>Jerry Seinfeld</p>"); // stepKey: dontSeeInPageSourceKey4
$I->dontSeeInPageSource("foo"); // stepKey: dontSeeInPageSourceKey5
$I->dontSeeInPageSource("<p>foo</p>"); // stepKey: dontSeeInPageSourceKey6
$I->dontSeeInSource("Cosmo Kramer"); // stepKey: dontSeeInSourceKey1
$I->dontSeeInSource("<p>Jerry Seinfeld</p>"); // stepKey: dontSeeInSourceKey2
$I->dontSeeInTitle("someInput"); // stepKey: dontSeeInTitleKey1
$I->dontSeeLink("someInput", "/functionalUrl"); // stepKey: dontSeeLinkKey1
$I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput"); // stepKey: dontSeeOptionIsSelectedKey1
$I->doubleClick(".functionalTestSelector"); // stepKey: doubleClickKey1
$I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2"); // stepKey: dragAndDropKey1
$I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2", 100, 900); // stepKey: dragAndDropKey2
$executeJSKey1 = $I->executeJS("someJSFunction"); // stepKey: executeJSKey1
$I->fillField(".functionalTestSelector", "someInput"); // stepKey: fillFieldKey1
$I->fillField(".functionalTestSelector", "0"); // stepKey: fillFieldKey2
$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");
$getOtp = $I->getOTP(); // stepKey: getOtp
$grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput"); // stepKey: grabAttributeFromKey1
$grabCookieKey1 = $I->grabCookie("grabCookieInput", ['domain' => 'www.google.com']); // stepKey: grabCookieKey1
$grabFromCurrentUrlKey1 = $I->grabFromCurrentUrl("/grabCurrentUrl"); // stepKey: grabFromCurrentUrlKey1
$grabMultipleKey1 = $I->grabMultiple(".functionalTestSelector"); // stepKey: grabMultipleKey1
$grabTextFromKey1 = $I->grabTextFrom(".functionalTestSelector"); // stepKey: grabTextFromKey1
$grabValueFromKey1 = $I->grabValueFrom(".functionalTestSelector"); // stepKey: grabValueFromKey1
$magentoCli1 = $I->magentoCLI("maintenance:enable", 60, "\"stuffHere\""); // stepKey: magentoCli1
$I->comment($magentoCli1);
$magentoCli2 = $I->magentoCLI("maintenance:enable", 120, "\"stuffHere\""); // stepKey: magentoCli2
$I->comment($magentoCli2);
$magentoCli3 = $I->magentoCLISecret("config:set somePath " . $I->getSecret("someKey"), 60); // stepKey: magentoCli3
$I->comment($magentoCli3); // stepKey: magentoCli3
$magentoCli4 = $I->magentoCLISecret("config:set somePath " . $I->getSecret("someKey"), 120); // stepKey: magentoCli4
$I->comment($magentoCli4); // stepKey: magentoCli4
$cronAllGroups = $I->magentoCron("", 70); // stepKey: cronAllGroups
$I->comment($cronAllGroups);
$cronSingleGroup = $I->magentoCron("index", 70); // stepKey: cronSingleGroup
$I->comment($cronSingleGroup);
$cronMultipleGroups = $I->magentoCron("a b c", 70); // stepKey: cronMultipleGroups
$I->comment($cronMultipleGroups);
$I->makeScreenshot("screenShotInput"); // stepKey: makeScreenshotKey1
$I->maximizeWindow(); // stepKey: maximizeWindowKey1
$I->moveBack(); // stepKey: moveBackKey1
$I->moveForward(); // stepKey: moveForwardKey1
$I->moveMouseOver(".functionalTestSelector"); // stepKey: moveMouseOverKey1
$I->openNewTab(); // stepKey: openNewTabKey1
$I->pause(); // stepKey: pauseKey1
$I->pressKey("#page", "a"); // stepKey: pressKey1
$I->pressKey("#page", ['ctrl', 'a'],'new'); // stepKey: pressKey2
$I->pressKey("#page", ['shift', '111'],'1','x'); // stepKey: pressKey3
$I->pressKey("#page", ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE); // stepKey: pressKey4
$I->reloadPage(); // stepKey: reloadPageKey1
$I->resetCookie("cookieInput"); // stepKey: resetCookieKey1
$I->resizeWindow(0, 0); // stepKey: resizeWindowKey1
$I->scrollTo(".functionalTestSelector"); // stepKey: scrollToKey1
$I->see("someInput", ".functionalTestSelector"); // stepKey: seeKey1
$I->seeCheckboxIsChecked(".functionalTestSelector"); // stepKey: seeCheckboxIsCheckedKey1
$I->seeCookie("someInput"); // stepKey: seeCookieKey1
$I->seeCurrentUrlEquals("/functionalUrl"); // stepKey: seeCurrentUrlEqualsKey1
$I->seeCurrentUrlMatches("/[0-9]+/"); // stepKey: seeCurrentUrlMatchesKey1
$I->seeElement(".functionalTestSelector"); // stepKey: seeElementKey1
$I->seeElementInDOM(".functionalTestSelector"); // stepKey: seeElementInDOMKey1
$I->seeInCurrentUrl("/functionalUrl"); // stepKey: seeInCurrentUrlKey1
$I->seeInField(".functionalTestSelector", "someInput"); // stepKey: seeInFieldKey1
$I->seeInPageSource("Home Page"); // stepKey: seeInPageSourceKey1
$I->seeInPageSource("<h1 class=\"page-title\">"); // stepKey: seeInPageSourceKey2
$I->seeInPopup("someInput"); // stepKey: seeInPopupKey1
$I->seeInSource("Home Page"); // stepKey: seeInSourceKey1
$I->seeInSource("<h1 class=\"page-title\">"); // stepKey: seeInSourceKey2
$I->seeInTitle("someInput"); // stepKey: seeInTitleKey1
$I->seeLink("someInput", "/functionalUrl"); // stepKey: seeLinkKey1
$I->seeNumberOfElements(".functionalTestSelector"); // stepKey: seeNumberOfElementsKey1
$I->seeOptionIsSelected(".functionalTestSelector", "someInput"); // stepKey: seeOptionIsSelectedKey1
$I->selectOption(".functionalTestSelector"); // stepKey: selectOptionKey1
$I->selectMultipleOptions(".filter", ".option", ['opt1', 'opt2']); // stepKey: selectMultipleOpts1
$I->setCookie("someInput", "someCookieValue"); // stepKey: setCookieKey1
$I->switchToIFrame("someInput"); // stepKey: switchToIFrameKey1
$I->switchToNextTab(); // stepKey: switchToNextTabKey1
$I->switchToPreviousTab(); // stepKey: switchToPreviousTabKey1
$I->switchToWindow(); // stepKey: switchToWindowKey1
$I->typeInPopup("someInput"); // stepKey: typeInPopupKey1
$I->uncheckOption(".functionalTestSelector"); // stepKey: uncheckOptionKey1
$I->unselectOption(".functionalTestSelector", "someInput"); // stepKey: unselectOptionKey1
$I->wait(30); // stepKey: waitKey1
$I->waitForElement(".functionalTestSelector", 30); // stepKey: waitForElementKey1
$I->waitForElementNotVisible(".functionalTestSelector", 30); // stepKey: waitForElementNotVisibleKey1
$I->waitForElementVisible(".functionalTestSelector", 30); // stepKey: waitForElementVisibleKey1
$I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); // stepKey: waitForElementChangeKey1
$I->waitForJS("someJsFunction", 30); // stepKey: waitForJSKey1
$I->waitForText("someInput", 30, ".functionalTestSelector"); // stepKey: waitForText1
}
}