Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions dev/tests/verification/Resources/ActionGroupReturningValueTest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?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;

/**
* @group functional
* @Description("<h3>Test files</h3>verification/TestModule/Test/ActionGroupFunctionalTest/ActionGroupReturningValueTest.xml<br>")
*/
class ActionGroupReturningValueTestCest
{
/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _before(AcceptanceTester $I)
{
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup
$I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup");
}

/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _after(AcceptanceTester $I)
{
$I->comment("Entering Action Group [afterGroup] FunctionalActionGroup");
$I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup
$I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup
$I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup");
}

/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _failed(AcceptanceTester $I)
{
$I->saveScreenshot(); // stepKey: saveScreenshot
}

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"TestModule"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
* @throws \Exception
*/
public function ActionGroupReturningValueTest(AcceptanceTester $I)
{
$I->amOnPage("/someUrl"); // stepKey: step1
$I->comment("Entering Action Group [actionGroupWithReturnValue1] FunctionalActionGroupWithReturnValueActionGroup");
$grabTextFrom1ActionGroupWithReturnValue1 = $I->grabTextFrom("#foo"); // stepKey: grabTextFrom1ActionGroupWithReturnValue1
$actionGroupWithReturnValue1 = $I->return($grabTextFrom1ActionGroupWithReturnValue1); // stepKey: returnActionGroupWithReturnValue1
$I->comment("Exiting Action Group [actionGroupWithReturnValue1] FunctionalActionGroupWithReturnValueActionGroup");
$I->comment("Entering Action Group [actionGroupWithStringUsage1] actionGroupWithStringUsage");
$I->see($actionGroupWithReturnValue1, "#element .{$actionGroupWithReturnValue1}"); // stepKey: see1ActionGroupWithStringUsage1
$I->comment("Exiting Action Group [actionGroupWithStringUsage1] actionGroupWithStringUsage");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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]: Extended ActionGroup Returning Value Test")
* @Description("<h3>Test files</h3>verification/TestModule/Test/ActionGroupTest/ExtendedActionGroupReturningValueTest.xml<br>")
*/
class ExtendedActionGroupReturningValueTestCest
{
/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"TestModule"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
* @throws \Exception
*/
public function ExtendedActionGroupReturningValueTest(AcceptanceTester $I)
{
$I->comment("Entering Action Group [actionGroupReturningValue] ActionGroupReturningValueActionGroup");
$grabProducts1ActionGroupReturningValue = $I->grabMultiple("selector"); // stepKey: grabProducts1ActionGroupReturningValue
$I->assertCount(99, $grabProducts1ActionGroupReturningValue); // stepKey: assertCountActionGroupReturningValue
$actionGroupReturningValue = $I->return($grabProducts1ActionGroupReturningValue); // stepKey: returnProducts1ActionGroupReturningValue
$I->comment("Exiting Action Group [actionGroupReturningValue] ActionGroupReturningValueActionGroup");
$I->comment("Entering Action Group [actionGroupWithStringUsage1] actionGroupWithStringUsage");
$I->see($actionGroupReturningValue, "#element .{$actionGroupReturningValue}"); // stepKey: see1ActionGroupWithStringUsage1
$I->comment("Exiting Action Group [actionGroupWithStringUsage1] actionGroupWithStringUsage");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,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;

/**
* @Title("[NO TESTCASEID]: Extended Child ActionGroup Returning Value Test")
* @Description("<h3>Test files</h3>verification/TestModule/Test/ActionGroupTest/ExtendedChildActionGroupReturningValueTest.xml<br>")
*/
class ExtendedChildActionGroupReturningValueTestCest
{
/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"TestModule"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
* @throws \Exception
*/
public function ExtendedChildActionGroupReturningValueTest(AcceptanceTester $I)
{
$I->comment("Entering Action Group [extendedActionGroupReturningValue] ExtendedActionGroupReturningValueActionGroup");
$grabProducts1ExtendedActionGroupReturningValue = $I->grabMultiple("selector"); // stepKey: grabProducts1ExtendedActionGroupReturningValue
$I->assertCount(99, $grabProducts1ExtendedActionGroupReturningValue); // stepKey: assertCountExtendedActionGroupReturningValue
$extendedActionGroupReturningValue = $I->return($grabProducts1ExtendedActionGroupReturningValue); // stepKey: returnProducts1ExtendedActionGroupReturningValue
$grabProducts2ExtendedActionGroupReturningValue = $I->grabMultiple("otherSelector"); // stepKey: grabProducts2ExtendedActionGroupReturningValue
$I->assertCount(8000, $grabProducts2ExtendedActionGroupReturningValue); // stepKey: assertSecondCountExtendedActionGroupReturningValue
$extendedActionGroupReturningValue = $I->return($grabProducts2ExtendedActionGroupReturningValue); // stepKey: returnProducts2ExtendedActionGroupReturningValue
$I->comment("Exiting Action Group [extendedActionGroupReturningValue] ExtendedActionGroupReturningValueActionGroup");
$I->comment("Entering Action Group [actionGroupWithStringUsage1] actionGroupWithStringUsage");
$I->see($extendedActionGroupReturningValue, "#element .{$extendedActionGroupReturningValue}"); // stepKey: see1ActionGroupWithStringUsage1
$I->comment("Exiting Action Group [actionGroupWithStringUsage1] actionGroupWithStringUsage");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?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;

/**
* @group functional
* @Description("<h3>Test files</h3>verification/TestModule/Test/MergeFunctionalTest/MergedActionGroupReturningValueTest.xml<br>")
*/
class MergedActionGroupReturningValueTestCest
{
/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _before(AcceptanceTester $I)
{
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup
$I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup");
}

/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _after(AcceptanceTester $I)
{
$I->comment("Entering Action Group [afterGroup] FunctionalActionGroup");
$I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup
$I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup
$I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup");
}

/**
* @param AcceptanceTester $I
* @throws \Exception
*/
public function _failed(AcceptanceTester $I)
{
$I->saveScreenshot(); // stepKey: saveScreenshot
}

/**
* @Severity(level = SeverityLevel::CRITICAL)
* @Features({"TestModule"})
* @Stories({"MQE-433"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
* @throws \Exception
*/
public function MergedActionGroupReturningValueTest(AcceptanceTester $I)
{
$I->amOnPage("/someUrl"); // stepKey: step1
$I->comment("Entering Action Group [actionGroupWithReturnValue1] MergeActionGroupReturningValueActionGroup");
$I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1ActionGroupWithReturnValue1
$I->click(".merge .Jane"); // stepKey: myMergedClickActionGroupWithReturnValue1
$grabMultiple1ActionGroupWithReturnValue1 = $I->grabMultiple("#foo"); // stepKey: grabMultiple1ActionGroupWithReturnValue1
$actionGroupWithReturnValue1 = $I->return($grabMultiple1ActionGroupWithReturnValue1); // stepKey: returnValueActionGroupWithReturnValue1
$I->comment("Exiting Action Group [actionGroupWithReturnValue1] MergeActionGroupReturningValueActionGroup");
$I->comment("Entering Action Group [actionGroupWithStringUsage1] actionGroupWithStringUsage");
$I->see($actionGroupWithReturnValue1, "#element .{$actionGroupWithReturnValue1}"); // stepKey: see1ActionGroupWithStringUsage1
$I->comment("Exiting Action Group [actionGroupWithStringUsage1] actionGroupWithStringUsage");
}
}
29 changes: 24 additions & 5 deletions dev/tests/verification/Resources/functionalSuiteHooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,33 @@ class functionalSuiteHooks extends \Codeception\GroupObject
$webDriver->_initializeSession();
}
$webDriver->amOnPage("some.url"); // stepKey: before
$createFields['someKey'] = "dataHere";
$createOneFields['someKey'] = "dataHere";
PersistedObjectHandler::getInstance()->createEntity(
"create",
"createOne",
"suite",
"createThis",
$createFields
"createEntityOne",
[],
$createOneFields
);
$webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); // stepKey: clickWithData
PersistedObjectHandler::getInstance()->createEntity(
"createTwo",
"suite",
"createEntityTwo",
["createEntityOne"]
);
PersistedObjectHandler::getInstance()->createEntity(
"createThree",
"suite",
"createEntityThree",
[]
);
PersistedObjectHandler::getInstance()->createEntity(
"createFour",
"suite",
"createEntityFour",
["createEntityTwo", "createEntityThree"]
);
$webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('createTwo', 'data', 'suite')); // stepKey: clickWithData
print("Entering Action Group [AC] actionGroupWithTwoArguments");
$webDriver->see("John", msq("uniqueData") . "John"); // stepKey: seeFirstNameAC
print("Exiting Action Group [AC] actionGroupWithTwoArguments");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class functionalSuiteWithComments extends \Codeception\GroupObject
"create",
"suite",
"createThis",
$createFields
[],
$createFields
);
print("<click stepKey=\"comment with element\" userInput=\"helloworld\"/>");
$webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); // stepKey: clickWithData
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="ActionGroupReturningValueActionGroup">
<arguments>
<argument name="count" type="string"/>
</arguments>
<grabMultiple selector="selector" stepKey="grabProducts1"/>
<assertCount stepKey="assertCount">
<expectedResult type="int">{{count}}</expectedResult>
<actualResult type="variable">grabProducts1</actualResult>
</assertCount>
<return value="{$grabProducts1}" stepKey="returnProducts1"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="ExtendedActionGroupReturningValueActionGroup" extends="ActionGroupReturningValueActionGroup">
<arguments>
<argument name="otherCount" type="string"/>
</arguments>
<grabMultiple selector="otherSelector" stepKey="grabProducts2"/>
<assertCount stepKey="assertSecondCount">
<expectedResult type="int">{{otherCount}}</expectedResult>
<actualResult type="variable">grabProducts2</actualResult>
</assertCount>
<return value="{$grabProducts2}" stepKey="returnProducts2"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="FunctionalActionGroupWithReturnValueActionGroup">
<grabTextFrom selector="#foo" stepKey="grabTextFrom1"/>
<return value="{$grabTextFrom1}" stepKey="return"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="MergeActionGroupReturningValueActionGroup">
<arguments>
<argument name="myArg"/>
</arguments>
<fillField userInput="Please delete me" selector="#delete" stepKey="deleteMe"/>
<amOnPage url="{{SamplePage.url(myArg.firstname,myArg.lastname)}}" stepKey="amOnPage1"/>
<grabMultiple selector="#foo" stepKey="grabMultiple1"/>
<return value="{$grabMultiple1}" stepKey="returnValue"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="MergeActionGroupReturningValueActionGroup">
<click stepKey="myMergedClick" selector=".merge .{{myArg.firstname}}" after="amOnPage1"/>
<remove keyForRemoval="deleteMe"/>
</actionGroup>
</actionGroups>
Loading