-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathReferenceReplacementGenerationTest.php
81 lines (73 loc) · 2.61 KB
/
ReferenceReplacementGenerationTest.php
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
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace tests\verification\Tests;
use Magento\FunctionalTestingFramework\Exceptions\TestReferenceException;
use tests\util\MftfTestCase;
class ReferenceReplacementGenerationTest extends MftfTestCase
{
const DATA_REPLACEMENT_TEST = 'DataReplacementTest';
const PERSISTED_REPLACEMENT_TEST = 'PersistedReplacementTest';
const PAGE_REPLACEMENT_TEST = 'PageReplacementTest';
const ADMIN_PAGE_TEST = 'AdminPageTest';
const SECTION_REPLACEMENT_TEST = 'SectionReplacementTest';
const RESOURCES_PATH = __DIR__ . '/../Resources';
/**
* Tests replacement of {{data.key}} references.
*
* @throws \Exception
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
*/
public function testDataReferenceReplacementCest()
{
$this->generateAndCompareTest(self::DATA_REPLACEMENT_TEST);
}
/**
* Tests replacement of $data.key$ references.
*
* @throws \Exception
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
*/
public function testPersistedeferenceReplacementCest()
{
$this->generateAndCompareTest(self::PERSISTED_REPLACEMENT_TEST);
}
/**
* Tests replacement of {{page.url}} references. Includes parameterized urls.
*
* @throws \Exception
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
*/
public function testPageReferenceReplacementCest()
{
$this->generateAndCompareTest(self::PAGE_REPLACEMENT_TEST);
}
/**
* Tests replacement of {{page.url}} reference for external page and incompatible action
*/
public function testExternalPageBadReference()
{
$this->expectException(TestReferenceException::class);
$this->generateAndCompareTest("ExternalPageTestBadReference");
}
/**
* Tests replacement of {{Section.Element}} references. Includes parameterized elements.
*
* @throws \Exception
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
*/
public function testSectionReferenceReplacementCest()
{
$this->generateAndCompareTest(self::SECTION_REPLACEMENT_TEST);
}
/**
* Tests replacement of all characters into string literal references.
* Used to ensure users can input everything but single quotes into 'stringLiteral' in parameterized selectors
*/
public function testCharacterReplacementCest()
{
$this->generateAndCompareTest("CharacterReplacementTest");
}
}