-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathLocatorFunctionTest.txt
43 lines (41 loc) · 2.08 KB
/
LocatorFunctionTest.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
<?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;
/**
* @Description("<h3>Test files</h3>verification/TestModule/Test/LocatorFunctionTest.xml<br>")
*/
class LocatorFunctionTestCest
{
/**
* @Features({"TestModule"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
* @throws \Exception
*/
public function LocatorFunctionTest(AcceptanceTester $I)
{
$I->createEntity("data", "test", "ReplacementPerson", [], []); // stepKey: data
$I->click(Locator::contains("'label'", "'Name'")); // stepKey: SimpleLocator
$I->click(Locator::contains("'label'", "'Name'")); // stepKey: SimpleLocatorNonShorthand
$I->click(Locator::find("'img'", ['title' => 'diagram'])); // stepKey: ArrayLocator
$I->click(Locator::contains("string", "'Name'")); // stepKey: OneParamLiteral
$I->click(Locator::contains("John", "'Name'")); // stepKey: OneParamData
$I->click(Locator::contains($I->retrieveEntityField('data', 'key', 'test'), "'Name'")); // stepKey: OneParamPersisted
$I->click(Locator::contains("string1", "string2")); // stepKey: TwoParamLiteral
$I->click(Locator::contains("John", "Doe")); // stepKey: TwoParamData
$I->click(Locator::contains($I->retrieveEntityField('data', 'key1', 'test'), $I->retrieveEntityField('data', 'key2', 'test'))); // stepKey: TwoParamPersisted
$I->click(Locator::contains("string1", "John")); // stepKey: TwoParamMix1
$I->click(Locator::contains("string1", $I->retrieveEntityField('data', 'key1', 'test'))); // stepKey: TwoParamMix2
$I->click(Locator::contains("John", $I->retrieveEntityField('data', 'key1', 'test'))); // stepKey: TwoParamMix3
}
}