Skip to content

Commit 787897e

Browse files
committed
MQE-1799: Throw exception during generation when leaving out .url for amOnPage
1 parent 32e7600 commit 787897e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ private function __construct()
6767

6868
$module = $pageData[self::MODULE] ?? null;
6969
$sectionNames = array_keys($pageData[self::SECTION] ?? []);
70-
$parameterized = $pageData[self::PARAMETERIZED] ?? false;
70+
$urlContainsMustaches = strpos($url, "{{") !== false && strpos($url, "}}") !== false;
71+
$parameterized = $pageData[self::PARAMETERIZED] ?? $urlContainsMustaches ?? false;
7172
$filename = $pageData[self::FILENAME] ?? null;
7273
$deprecated = $pageData[self::OBJ_DEPRECATED] ?? null;
7374

src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ private function resolveUrlReference()
420420
$allPages = PageObjectHandler::getInstance()->getAllObjects();
421421
if ($replacement === $url && array_key_exists(trim($url, "{}"), $allPages)
422422
) {
423-
LoggingUtil::getInstance()->getLogger(ActionObject::class)->warning(
423+
throw new TestReferenceException(
424424
"page url attribute not found and is required",
425425
["action" => $this->type, "url" => $url, "stepKey" => $this->stepKey]
426426
);

0 commit comments

Comments
 (0)