Skip to content

Commit 25b2a08

Browse files
committed
Merge remote-tracking branch 'origin/PR-765' into migration-pr
2 parents b62f82f + 7877776 commit 25b2a08

10 files changed

+174
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAllowResourcesAccessIntegrationActionGroup">
12+
<click stepKey="clickAllowButton" selector="{{AdminNewIntegrationSection.allow}}"/>
13+
<waitForPageLoad stepKey="waitForLoading"/>
14+
</actionGroup>
15+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminIntegrationClickReauthoriseLinkOnGridActionGroup">
12+
<click stepKey="clickReauthoriseLink" selector="{{AdminIntegrationsGridSection.activate}}"/>
13+
<waitForPageLoad stepKey="waitForPopupLoading"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
12+
<actionGroup name="AdminIntegrationOpenExistingEntityActionGroup">
13+
<click stepKey="clickEditIcon" selector="{{AdminIntegrationsGridSection.edit}}"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminIntegrationSaveAndActivateActionGroup">
11+
<click stepKey="clickIntegrationToggle" selector="{{AdminNewIntegrationFormSection.integrationToggle}}"/>
12+
<waitForElementVisible selector="{{AdminNewIntegrationFormSection.saveAndActivate}}" stepKey="waitForSaveAndActivateButton"/>
13+
<click stepKey="clickSaveAndActivateButton" selector="{{AdminNewIntegrationFormSection.saveAndActivate}}"/>
14+
<waitForPageLoad stepKey="waitForPageLoad"/>
15+
</actionGroup>
16+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminIntegrationDetailsSection">
12+
<element name="consumerKey" type="input" selector=".admin__field-control.control #integration_properties_consumer_key"/>
13+
<element name="consumerSecret" type="input" selector=".admin__field-control.control #integration_properties_consumer_secret"/>
14+
<element name="accessToken" type="input" selector=".admin__field-control.control #integration_properties_token"/>
15+
<element name="accessTokenSecret" type="input" selector=".admin__field-control.control #integration_properties_token_secret"/>
16+
</section>
17+
</sections>

app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<element name="submitButton" type="button" selector=".action-primary.action-accept" timeout="30"/>
1818
<element name="rowByIndex" type="text" selector="tr[data-role='row']:nth-of-type({{var1}})" parameterized="true" timeout="30"/>
1919
<element name="edit" type="button" selector=".data-grid .edit"/>
20+
<element name="activate" type="button" selector="#integrationGrid_table>tbody>tr:nth-child(1)>td.col-activate>a"/>
2021
</section>
2122
</sections>

app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationFormSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818
<element name="resourceTree" type="block" selector="[data-ui-id='integration-edit-tabs-tab-content-api-section'] [data-role='resource-tree']"/>
1919

2020
<element name="save" type="button" selector="#save-split-button-button"/>
21+
<element name="integrationToggle" type="button" selector=".page-actions-buttons .action-toggle.primary"/>
22+
<element name="saveAndActivate" type="button" selector="#save-split-button-activate"/>
2123
</section>
2224
</sections>

app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
<element name="endpoint" type="input" selector="#integration_properties_endpoint"/>
1515
<element name="linkUrl" type="input" selector="#integration_properties_identity_link_url"/>
1616
<element name="save" type="button" selector=".page-actions-buttons .save"/>
17+
<element name="allow" type="button" selector=".page-actions-buttons .action-primary"/>
18+
<element name="resourcesPopup" type="block" selector="#modal-content-17 #integration-popup-container"/>
19+
<element name="consumerKey" type="input" selector=".admin__field-control.control #integration_token_consumer_key"/>
20+
<element name="consumerSecret" type="input" selector=".admin__field-control.control #integration_token_consumer_secret"/>
21+
<element name="accessToken" type="input" selector=".admin__field-control.control #integration_token_token"/>
22+
<element name="accessTokenSecret" type="input" selector=".admin__field-control.control #integration_token_token_secret"/>
1723
</section>
1824
</sections>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminReAuthorizeTokensIntegrationEntityTest">
12+
<annotations>
13+
<features value="Integration"/>
14+
<stories value="System Integration"/>
15+
<title value="Reauthorise Integration's Tokens"/>
16+
<description value="ReAuthorising Tokens For Created Integration"/>
17+
<group value="integration"/>
18+
<group value="mtf_migrated"/>
19+
<testCaseId value="MC-14397"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIntegrationsPage">
24+
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
25+
<argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/>
26+
</actionGroup>
27+
<actionGroup ref="AdminNavigateToCreateIntegrationPageActionGroup" stepKey="clickAddNewIntegrationButton"/>
28+
<actionGroup ref="AdminFillIntegrationFormActionGroup" stepKey="createIntegration">
29+
<argument name="integration" value="defaultIntegrationData"/>
30+
<argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminIntegrationSaveAndActivateActionGroup" stepKey="clickSaveAndActivateButton"/>
33+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="allowAccess"/>
34+
</before>
35+
<after>
36+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="returnToIntegrationsPage">
37+
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
38+
<argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="searchForReAuthorizedIntegration">
41+
<argument name="name" value="{{defaultIntegrationData.name}}"/>
42+
</actionGroup>
43+
<actionGroup ref="AdminDeleteIntegrationEntityActionGroup" stepKey="deleteCreatedIntegration"/>
44+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
45+
</after>
46+
47+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerKey}}" stepKey="grabConsumerKey"/>
48+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerSecret}}" stepKey="grabConsumerSecret"/>
49+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessToken}}" stepKey="grabAccessToken"/>
50+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessTokenSecret}}" stepKey="grabAccessTokenSecret"/>
51+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="clickDoneButton"/>
52+
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findCreatedIntegration">
53+
<argument name="name" value="{{defaultIntegrationData.name}}"/>
54+
</actionGroup>
55+
<actionGroup ref="AdminIntegrationClickReauthoriseLinkOnGridActionGroup" stepKey="clickReauthoriseLink"/>
56+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="clickReauthoriseButton"/>
57+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerKey}}" stepKey="grabAfterReauthorizeConsumerKey"/>
58+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerSecret}}" stepKey="grabAfterReauthorizeConsumerSecret"/>
59+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessToken}}" stepKey="grabReauthorizedAccessToken"/>
60+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessTokenSecret}}" stepKey="grabReauthorizedAccessTokenSecret"/>
61+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="finishTheProcess"/>
62+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage">
63+
<argument name="message" value="The integration '{{defaultIntegrationData.name}}' has been re-authorized."/>
64+
</actionGroup>
65+
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findReAuthorizedIntegration">
66+
<argument name="name" value="{{defaultIntegrationData.name}}"/>
67+
</actionGroup>
68+
<actionGroup ref="AdminIntegrationOpenExistingEntityActionGroup" stepKey="openIntegrationEntity"/>
69+
<assertEquals stepKey="assertConsumerKey">
70+
<actualResult type="string">$grabAfterReauthorizeConsumerKey</actualResult>
71+
<expectedResult type="const">($grabConsumerKey)</expectedResult>
72+
</assertEquals>
73+
<assertEquals stepKey="assertConsumerSecret">
74+
<actualResult type="string">$grabAfterReauthorizeConsumerSecret</actualResult>
75+
<expectedResult type="const">($grabConsumerSecret)</expectedResult>
76+
</assertEquals>
77+
<assertNotEquals stepKey="assertNotEqualsToken">
78+
<actualResult type="string">$grabReauthorizedAccessToken</actualResult>
79+
<expectedResult type="const">($grabAccessToken)</expectedResult>
80+
</assertNotEquals>
81+
<assertNotEquals stepKey="assertNotEqualsTokenSecret">
82+
<actualResult type="string">$grabReauthorizedAccessTokenSecret</actualResult>
83+
<expectedResult type="const">($grabAccessTokenSecret)</expectedResult>
84+
</assertNotEquals>
85+
</test>
86+
</tests>

dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ReAuthorizeTokensIntegrationEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<testCase name="Magento\Integration\Test\TestCase\ReAuthorizeTokensIntegrationEntityTest" summary="Re-Authorize Tokens for the Integration" ticketId="MAGETWO-29648">
1010
<variation name="ReAuthorizeTokensIntegrationEntityTestVariation1">
1111
<data name="description" xsi:type="string">Re-authorize integration</data>
12+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1213
<constraint name="Magento\Integration\Test\Constraint\AssertIntegrationSuccessReauthorizeMessage" />
1314
<constraint name="Magento\Integration\Test\Constraint\AssertIntegrationTokensAfterReauthorize" />
1415
</variation>

0 commit comments

Comments
 (0)