Skip to content

Commit 51fc626

Browse files
CABPI-39: Fix MFTF tests according to the latest changes
1 parent 360f142 commit 51fc626

File tree

5 files changed

+33
-22
lines changed

5 files changed

+33
-22
lines changed

app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminAdobeImsSignInActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<click selector="{{AdminAdobeImsSignInSection.AdobeImsUsernameContinueButton}}" stepKey="clickUsernameContinue"/>
2525

2626
<click selector="{{AdminAdobeImsSignInSection.AdobeImsProfileSelect}}" stepKey="clickProfile"/>
27-
27+
<wait time="10" stepKey="waitTenSeconds"/>
2828
<fillField selector="{{AdminAdobeImsSignInSection.password}}" userInput="{{password}}" stepKey="fillPassword"/>
2929
<click selector="{{AdminAdobeImsSignInSection.AdobeImsPasswordContinueButton}}" stepKey="clickPasswordContinue"/>
3030
<waitForPageLoad stepKey="waitForLoginToFinish"/>

app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminCreateUserWithoutPasswordActionGroup.xml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,32 @@
1515
<arguments>
1616
<argument name="role"/>
1717
<argument name="user" defaultValue="newAdmin"/>
18+
<argument name="password" type="string" defaultValue="{{_ENV.ADOBE_IMS_PASSWORD}}"/>
1819
</arguments>
1920

20-
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/>
21-
<waitForPageLoad stepKey="waitForUsersPage"/>
22-
<fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/>
23-
<fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName"/>
24-
<fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName"/>
25-
<fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail"/>
26-
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
27-
<click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/>
28-
<click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/>
29-
<click stepKey="clickInfoRole" selector="{{AdminCreateUserSection.userInfoTab}}"/>
21+
<!--Open New Admin User Page. -->
22+
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewAdminUser"/>
23+
<waitForPageLoad stepKey="waitForNewAdminUserPage"/>
24+
<!-- Fill admin user data. -->
25+
<fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterAdminUserName"/>
26+
<fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterAdminFirstName"/>
27+
<fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterAdminLastName"/>
28+
<fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterAdminEmail"/>
29+
<!-- Verify Current Admin User Identity via Adobe IMS. -->
3030
<click selector="{{AdminCreateUserSection.confirmIdentity}}" stepKey="clickConfirmIdentity"/>
31-
<wait time="10" stepKey="waitTenSeconds"/>
32-
<switchToWindow userInput="Adobe ID" stepKey="switchToWindow"/>
33-
<wait time="10" stepKey="waitTenSeconds"/>
31+
<wait time="10" stepKey="waitNewTabToLoad"/>
32+
<!-- Switch to the New tab. -->
33+
<switchToNextTab stepKey="switchToNextTab"/>
34+
<fillField selector="{{AdminCreateUserSection.password}}" userInput="{{password}}" stepKey="fillPassword"/>
35+
<click selector="{{AdminAdobeImsSignInSection.AdobeImsPasswordContinueButton}}" stepKey="clickPasswordContinue"/>
36+
<wait time="10" stepKey="waitTabToDisappear"/>
37+
<!-- Switch to the previous tab. -->
38+
<switchToPreviousTab userInput="1" stepKey="switchPreviousTab"/>
39+
<!-- Select Admin User Role. -->
40+
<click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole"/>
41+
<click selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}" stepKey="chooseRole"/>
42+
<!-- Save admin user. -->
3443
<click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/>
3544
<waitForPageLoad stepKey="waitForSaveTheUser"/>
36-
<see userInput="You saved the user." stepKey="seeSuccessMessage"/>
3745
</actionGroup>
3846
</actionGroups>

app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminAdobeImsSignInSection.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<section name="AdminAdobeImsSignInSection">
1212
<element name="username" type="input" selector="#EmailPage-EmailField"/>
1313
<element name="password" type="input" selector="#PasswordPage-PasswordField"/>
14-
<element name="AdminAdobeImsSignInButton" type="button" selector=".adobe-ims-button button" timeout="30"/>
15-
<element name="AdobeImsUsernameContinueButton" type="button" selector="//button[@data-id='EmailPage-ContinueButton']" timeout="30"/>
14+
<element name="AdminAdobeImsSignInButton" type="button" selector=".adobe-ims-button button" timeout="15"/>
15+
<element name="AdobeImsUsernameContinueButton" type="button" selector="//button[@data-id='EmailPage-ContinueButton']" timeout="15"/>
1616
<element name="AdobeImsPasswordContinueButton" type="button" selector="//button[@data-id='PasswordPage-ContinueButton']"/>
17-
<element name="AdobeImsProfileSelect" type="text" selector="//div[contains(text(),'Personal Account')]" timeout="30"/>
17+
<element name="AdobeImsProfileSelect" type="text" selector="//div[contains(text(),'Personal Account')]" timeout="15"/>
1818
</section>
1919
</sections>

app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminCreateUserSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCreateUserSection">
1212
<element name="confirmIdentity" type="button" selector="#user_ims_verification"/>
13+
<element name="password" type="input" selector="#PasswordPage-PasswordField"/>
1314
</section>
1415
</sections>

app/code/Magento/AdminAdobeIms/Test/Mftf/Test/CreateNewUserWithoutPasswordTest.xml renamed to app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminCreateNewAdminUserWithAdobeImsTest.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10-
<test name="CreateNewUserWithoutPasswordTest">
10+
<test name="AdminCreateNewAdminUserWithAdobeImsTest">
1111
<annotations>
1212
<features value="Backend"/>
13-
<stories value="Create a new admin user without password"/>
14-
<title value="Create a new admin user without password"/>
15-
<description value="Create a new admin user without password when AdminAdobeImsModule is enabled"/>
13+
<stories value="Create a new admin user with enabled Adobe IMS integration"/>
14+
<title value="Create a new admin user with enabled Adobe IMS integration"/>
15+
<description value="Create a new admin user when AdminAdobeImsModule is enabled"/>
1616
<severity value="CRITICAL"/>
1717
<group value="admin_ims"/>
1818
<testCaseId value="CABPI-227"/>
@@ -30,5 +30,7 @@
3030
<argument name="user" value="activeAdmin"/>
3131
<argument name="role" value="roleDefaultAdministrator"/>
3232
</actionGroup>
33+
34+
<see userInput="You saved the user." stepKey="seeSuccessMessage"/>
3335
</test>
3436
</tests>

0 commit comments

Comments
 (0)