Skip to content

Commit ce5f934

Browse files
committed
Re-Authorize Tokens Integration Entity
1 parent fa00ff7 commit ce5f934

11 files changed

+190
-0
lines changed
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+
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="AdminAllowResourcesAccessIntegrationActionGroup">
13+
<click stepKey="clickAllowButton" selector="{{AdminNewIntegrationSection.allow}}"/>
14+
<waitForPageLoad stepKey="waitForLoading"/>
15+
</actionGroup>
16+
</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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AssertAdminIntegrationTokensAfterReauthoriseActionGroup">
13+
<arguments>
14+
<argument name="consumerKey" type="string"/>
15+
<argument name="consumerSecret" type="string"/>
16+
<argument name="accessToken" type="string"/>
17+
<argument name="accessTokenSecret" type="string"/>
18+
</arguments>
19+
<seeInField stepKey="seeConsumerKey" selector="{{AdminIntegrationDetailsSection.consumerKey}}" userInput="{{consumerKey}}"/>
20+
<seeInField stepKey="seeConsumerSecret" selector="{{AdminIntegrationDetailsSection.consumerSecret}}" userInput="{{consumerSecret}}"/>
21+
<seeInField stepKey="seeAccessToken" selector="{{AdminIntegrationDetailsSection.accessToken}}" userInput="{{accessToken}}"/>
22+
<seeInField stepKey="seeAccessTokenSecret" selector="{{AdminIntegrationDetailsSection.accessTokenSecret}}" userInput="{{accessTokenSecret}}"/>
23+
</actionGroup>
24+
</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: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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+
</annotations>
20+
<before>
21+
<!-- Login As Admin -->
22+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
23+
<!-- Navigate To Integrations Page -->
24+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIntegrationsPage">
25+
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
26+
<argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/>
27+
</actionGroup>
28+
<!-- Click the "Add New Integration" button -->
29+
<actionGroup ref="AdminNavigateToCreateIntegrationPageActionGroup" stepKey="clickAddNewIntegrationButton"/>
30+
<!-- Create New Integration -->
31+
<actionGroup ref="AdminFillIntegrationFormActionGroup" stepKey="createIntegration">
32+
<argument name="integration" value="defaultIntegrationData"/>
33+
<argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
34+
</actionGroup>
35+
<!-- Click Save And Activate Button -->
36+
<actionGroup ref="AdminIntegrationSaveAndActivateActionGroup" stepKey="clickSaveAndActivateButton"/>
37+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="allowAccess"/>
38+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="clickDoneButton"/>
39+
</before>
40+
<after>
41+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="returnToIntegrationsPage">
42+
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
43+
<argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/>
44+
</actionGroup>
45+
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="searchForReAuthorizedIntegration">
46+
<argument name="name" value="{{defaultIntegrationData.name}}"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminDeleteIntegrationEntityActionGroup" stepKey="deleteCreatedIntegration"/>
49+
<actionGroup ref="logout" stepKey="logout"/>
50+
</after>
51+
52+
<!-- TEST BODY -->
53+
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findCreatedIntegration">
54+
<argument name="name" value="{{defaultIntegrationData.name}}"/>
55+
</actionGroup>
56+
<actionGroup ref="AdminIntegrationClickReauthoriseLinkOnGridActionGroup" stepKey="clickReauthoriseLink"/>
57+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="clickReauthoriseButton"/>
58+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerKey}}" stepKey="grabConsumerKey"/>
59+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerSecret}}" stepKey="grabConsumerSecret"/>
60+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessToken}}" stepKey="grabAccessToken"/>
61+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessTokenSecret}}" stepKey="grabAccessTokenSecret"/>
62+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="finishTheProcess"/>
63+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage">
64+
<argument name="message" value="The integration '{{defaultIntegrationData.name}}' has been re-authorized."/>
65+
</actionGroup>
66+
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findReAuthorizedIntegration">
67+
<argument name="name" value="{{defaultIntegrationData.name}}"/>
68+
</actionGroup>
69+
<actionGroup ref="AdminIntegrationOpenExistingEntityActionGroup" stepKey="openIntegrationEntity"/>
70+
<actionGroup ref="AssertAdminIntegrationTokensAfterReauthoriseActionGroup" stepKey="assertTokens">
71+
<argument name="consumerKey" value="{$grabConsumerKey}"/>
72+
<argument name="consumerSecret" value="{$grabConsumerSecret}"/>
73+
<argument name="accessToken" value="{$grabAccessToken}"/>
74+
<argument name="accessTokenSecret" value="{$grabAccessTokenSecret}"/>
75+
</actionGroup>
76+
</test>
77+
</tests>

0 commit comments

Comments
 (0)