Skip to content

Commit dbc1fce

Browse files
committed
Adding Tokens Comparing After Rauthorizing
1 parent ce5f934 commit dbc1fce

File tree

2 files changed

+14
-36
lines changed

2 files changed

+14
-36
lines changed

app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminIntegrationTokensAfterReauthorizeActionGroup.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/code/Magento/Integration/Test/Mftf/Test/AdminReAuthorizeTokensIntegrationEntityTest.xml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
<!-- Click Save And Activate Button -->
3636
<actionGroup ref="AdminIntegrationSaveAndActivateActionGroup" stepKey="clickSaveAndActivateButton"/>
3737
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="allowAccess"/>
38-
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="clickDoneButton"/>
3938
</before>
4039
<after>
4140
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="returnToIntegrationsPage">
@@ -48,17 +47,21 @@
4847
<actionGroup ref="AdminDeleteIntegrationEntityActionGroup" stepKey="deleteCreatedIntegration"/>
4948
<actionGroup ref="logout" stepKey="logout"/>
5049
</after>
51-
5250
<!-- TEST BODY -->
51+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerKey}}" stepKey="grabConsumerKey"/>
52+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerSecret}}" stepKey="grabConsumerSecret"/>
53+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessToken}}" stepKey="grabAccessToken"/>
54+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessTokenSecret}}" stepKey="grabAccessTokenSecret"/>
55+
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="clickDoneButton"/>
5356
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findCreatedIntegration">
5457
<argument name="name" value="{{defaultIntegrationData.name}}"/>
5558
</actionGroup>
5659
<actionGroup ref="AdminIntegrationClickReauthoriseLinkOnGridActionGroup" stepKey="clickReauthoriseLink"/>
5760
<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"/>
61+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerKey}}" stepKey="grabAfterReauthorizeConsumerKey"/>
62+
<grabValueFrom selector="{{AdminNewIntegrationSection.consumerSecret}}" stepKey="grabAfterReauthorizeConsumerSecret"/>
63+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessToken}}" stepKey="grabReauthorizedAccessToken"/>
64+
<grabValueFrom selector="{{AdminNewIntegrationSection.accessTokenSecret}}" stepKey="grabReauthorizedAccessTokenSecret"/>
6265
<actionGroup ref="AdminAllowResourcesAccessIntegrationActionGroup" stepKey="finishTheProcess"/>
6366
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage">
6467
<argument name="message" value="The integration '{{defaultIntegrationData.name}}' has been re-authorized."/>
@@ -67,11 +70,10 @@
6770
<argument name="name" value="{{defaultIntegrationData.name}}"/>
6871
</actionGroup>
6972
<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>
73+
<!-- Compare Tokens After Reauthorizing -->
74+
<assertEquals stepKey="assertConsumerKey" expected="($grabConsumerKey)" actual="$grabAfterReauthorizeConsumerKey" actualType="string"/>
75+
<assertEquals stepKey="assertConsumerSecret" expected="($grabConsumerSecret)" actual="$grabAfterReauthorizeConsumerSecret" actualType="string"/>
76+
<assertNotEquals stepKey="assertNotEqualsToken" expected="($grabAccessToken)" actual="$grabReauthorizedAccessToken" actualType="string"/>
77+
<assertNotEquals stepKey="assertNotEqualsTokenSecret" expected="($grabAccessTokenSecret)" actual="$grabReauthorizedAccessTokenSecret" actualType="string"/>
7678
</test>
7779
</tests>

0 commit comments

Comments
 (0)