Skip to content

Commit

Permalink
MFTF test action groups modified
Browse files Browse the repository at this point in the history
  • Loading branch information
ajithkumar-maragathavel committed Jan 19, 2021
1 parent 0fa58ee commit 9677540
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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="AssertCustomerEditFormPasswordFieldActionGroup">
<annotations>
<description>Validate the password is visible as plain text in customer account edit form.</description>
</annotations>
<arguments>
<argument name="passwordFieldType" type="string" defaultValue="text"/>
</arguments>

<assertElementContainsAttribute stepKey="assertCurrentPasswordFieldType">
<expectedResult selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
</assertElementContainsAttribute>
<assertElementContainsAttribute stepKey="assertNewPasswordFieldType">
<expectedResult selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
</assertElementContainsAttribute>
<assertElementContainsAttribute stepKey="assertConfirmNewPasswordFieldType">
<expectedResult selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
</assertElementContainsAttribute>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertPasswordFieldActionGroup">
<actionGroup name="AssertLoginFormPasswordFieldActionGroup">
<annotations>
<description>Validate the password is visible as plain text.</description>
<description>Validate the password is visible as plain text in login form.</description>
</annotations>
<arguments>
<argument name="fieldSelector" type="string"/>
<argument name="passwordFieldType" type="string" defaultValue="text"/>
</arguments>

<assertElementContainsAttribute stepKey="assertPasswordFieldType">
<expectedResult selector="{{fieldSelector}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
<expectedResult selector="{{StorefrontCustomerSignInFormSection.passwordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
</assertElementContainsAttribute>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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="AssertRegistrationFormPasswordFieldActionGroup">
<annotations>
<description>Validate the password is visible as plain text on customer registration form.</description>
</annotations>
<arguments>
<argument name="passwordFieldType" type="string" defaultValue="text"/>
</arguments>

<assertElementContainsAttribute stepKey="assertPasswordFieldType">
<expectedResult selector="{{StorefrontCustomerCreateFormSection.passwordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
</assertElementContainsAttribute>
<assertElementContainsAttribute stepKey="assertConfirmPasswordFieldType">
<expectedResult selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
</assertElementContainsAttribute>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontClickShowPasswordActionGroup">
<actionGroup name="StorefrontCustomerEditFormClickShowPasswordActionGroup">
<annotations>
<description>Click on the show password checkbox</description>
<description>Click on the show password checkbox in customer account information form</description>
</annotations>
<arguments>
<argument name="fieldSelector" type="string"/>
</arguments>

<click stepKey="clickShowPasswordCheckbox" selector="{{fieldSelector}}"/>

<click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerAccountInformationSection.showPasswordCheckbox}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="StorefrontLoginFormClickShowPasswordActionGroup">
<annotations>
<description>Click on the show password checkbox in login form</description>
</annotations>

<click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerSignInFormSection.showPasswordCheckbox}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="StorefrontRegistrationFormClickShowPasswordActionGroup">
<annotations>
<description>Click on the show password checkbox in registration form</description>
</annotations>

<click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerCreateFormSection.showPasswordCheckbox}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,7 @@
<actionGroup ref="StorefrontFillChangePasswordFormActionGroup" stepKey="fillChangePasswordForm">
<argument name="customer" value="Simple_US_Customer"/>
</actionGroup>
<actionGroup ref="StorefrontClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox">
<argument name="fieldSelector" value="{{StorefrontCustomerAccountInformationSection.showPasswordCheckbox}}"/>
</actionGroup>
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertCurrentPasswordField">
<argument name="fieldSelector" value="{{StorefrontCustomerAccountInformationSection.currentPassword}}" />
</actionGroup>
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertNewPasswordField">
<argument name="fieldSelector" value="{{StorefrontCustomerAccountInformationSection.newPassword}}" />
</actionGroup>
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertNewConfirmPasswordField">
<argument name="fieldSelector" value="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" />
</actionGroup>
<actionGroup ref="StorefrontCustomerEditFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/>
<actionGroup ref="AssertCustomerEditFormPasswordFieldActionGroup" stepKey="AssertCurrentPasswordField"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm">
<argument name="customer" value="Simple_US_Customer"/>
</actionGroup>
<actionGroup ref="StorefrontClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox">
<argument name="fieldSelector" value="{{StorefrontCustomerCreateFormSection.showPasswordCheckbox}}"/>
</actionGroup>
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertPasswordField">
<argument name="fieldSelector" value="{{StorefrontCustomerCreateFormSection.passwordField}}" />
</actionGroup>
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertConfirmPasswordField">
<argument name="fieldSelector" value="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}" />
</actionGroup>
<actionGroup ref="StorefrontRegistrationFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/>
<actionGroup ref="AssertRegistrationFormPasswordFieldActionGroup" stepKey="AssertPasswordField"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
<actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormWithCustomerData">
<argument name="customer" value="$$customer$$"/>
</actionGroup>
<actionGroup ref="StorefrontClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox">
<argument name="fieldSelector" value="{{StorefrontCustomerSignInFormSection.showPasswordCheckbox}}"/>
</actionGroup>
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertPasswordField">
<argument name="fieldSelector" value="{{StorefrontCustomerSignInFormSection.passwordField}}" />
</actionGroup>
<actionGroup ref="StorefrontLoginFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/>
<actionGroup ref="AssertLoginFormPasswordFieldActionGroup" stepKey="AssertPasswordField"/>
</test>
</tests>

0 comments on commit 9677540

Please sign in to comment.