Skip to content

Commit cd75811

Browse files
kavita.joshiManjusha.S
authored andcommitted
MC-27419 : Modal window for Sign In is shown if Guest checkout is disabled. Flow from Shopping Cart
1 parent 610f7f5 commit cd75811

File tree

7 files changed

+168
-1
lines changed

7 files changed

+168
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AdminConfigurationAllowGuestCheckoutNoNavigateActionGroup">
12+
<annotations>
13+
<description>Open Stores>Configuration; Sales>Checkout; Checkout Options section; Allow Guest Checkout= No.</description>
14+
</annotations>
15+
<!-- click on store tab page-->
16+
<click selector="{{StoreConfigSection.StoreTab}}" stepKey="clickOnStorePage"/>
17+
<click selector="{{StoreConfigSection.ConfigurationPage}}" stepKey="clickOnConfigurationPage"/>
18+
<!-- click on sales tab page-->
19+
<click selector="{{StoreConfigSection.SalesTab}}" stepKey="clickOnSalesPage"/>
20+
<!--Click on checkout and Expand Checkout Options tab -->
21+
<click selector="{{SalesConfigSection.CheckoutTab}}" stepKey="clickOnCheckoutPage"/>
22+
<click selector="{{SalesConfigSection.ExpandCheckoutOptions}}" stepKey="clickToExpandCheckoutOptions"/>
23+
<!--Click on Use system value checkbox and save the configuration -->
24+
<click selector="{{SalesConfigSection.UseSystemValue}}" stepKey="uncheckUseSystemValue"/>
25+
<selectOption selector="{{SalesConfigSection.AllowGuestCheckout}}" userInput="No" stepKey="selectAllowGuestCheckoutNo"/>
26+
</actionGroup>
27+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminConfigurationAllowGuestCheckoutYesNavigateActionGroup">
12+
<annotations>
13+
<description>Open Stores>Configuration; Sales>Checkout; Checkout Options section; Allow Guest Checkout= Yes.</description>
14+
</annotations>
15+
<click selector="{{StoreConfigSection.StoreTab}}" stepKey="clickOnStorePage1"/>
16+
<click selector="{{StoreConfigSection.ConfigurationPage}}" stepKey="clickOnConfigurationPage1"/>
17+
<click selector="{{StoreConfigSection.SalesTab}}" stepKey="clickOnSalesPage1"/>
18+
<click selector="{{SalesConfigSection.CheckoutTab}}" stepKey="clickOnCheckoutPage1"/>
19+
<selectOption selector="{{SalesConfigSection.AllowGuestCheckout}}" userInput="Yes" stepKey="selectAllowGuestCheckoutYes"/>
20+
<click selector="{{SalesConfigSection.UseSystemValue}}" stepKey="checkUseSystemValue"/>
21+
<click selector="{{SalesConfigSection.ExpandCheckoutOptions}}" stepKey="clickToMinimizeCheckoutOptions"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="StorefrontGuestSignInActionGroup">
12+
<annotations>
13+
<description>Enter email id and password, click on sign in button and validate functionality.</description>
14+
</annotations>
15+
<arguments>
16+
<!--<argument name="username" type="string" defaultValue=""/>-->
17+
<argument name="email" type="string" defaultValue=""/>
18+
<argument name="password" type="string" defaultValue=""/>
19+
</arguments>
20+
21+
<fillField selector="{{StorefrontGuestSignInSection.email}}" userInput="{{email}}" stepKey="fillEmailId"/>
22+
<fillField selector="{{StorefrontGuestSignInSection.password}}" userInput="{{password}}" stepKey="fillPassword"/>
23+
<waitForElementVisible selector="{{StorefrontGuestSignInSection.CreateAnAccount}}" stepKey="seeCreateAnAccount"/>
24+
<waitForElementVisible selector="{{StorefrontGuestSignInSection.ForgotYourPassword}}" stepKey="seeForgotYourPassword"/>
25+
<click selector="{{StorefrontGuestSignInSection.SignIn}}" stepKey="clickOnSignIn"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontGuestSignInSection">
12+
<element name="email" type="input" selector="//input[@name='username']" timeout="30"/>
13+
<element name="password" type="input" selector="//input[@name='password']" timeout="30"/>
14+
<element name="SignIn" type="button" selector="//button[@id='send2']" timeout="30"/>
15+
<element name="ForgotYourPassword" type="button" selector="//a[@class='action']//span[contains(text(),'Forgot Your Password?')]" timeout="30"/>
16+
<element name="CreateAnAccount" type="button" selector="//a[@class='action action-register primary']//span[contains(text(),'Create an Account')]" timeout="30"/>
17+
</section>
18+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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="StorefrontShoppingCartGuestCheckoutDisabledTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Modal window for Sign In is shown if Guest checkout is disabled. "/>
15+
<title value="Modal window for Sign In is shown if Guest checkout is disabled."/>
16+
<description value="Modal window for Sign In is shown if Guest checkout is disabled. Flow from Shopping Cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-27419"/>
19+
<group value="module-checkout"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
<!-- create category and simple product -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="SimpleProduct" stepKey="createProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
<!--Goto Admin Configuration page and Allow Guest Checkout is No-->
29+
<actionGroup ref="AdminConfigurationAllowGuestCheckoutNoNavigateActionGroup" stepKey="storeConfigurationAllowGuestCheckoutNo"/>
30+
<actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="clickOnSaveConfig"/>
31+
<!-- create customer and clean the cache and index-->
32+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
33+
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/>
34+
<comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/>
35+
</before>
36+
<!-- Goto storefront and add product to cart-->
37+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/>
38+
<waitForPageLoad stepKey="waitForPageLoad6"/>
39+
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/>
40+
<actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/>
41+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
42+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
43+
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
44+
<!-- Checkout form mini cart-->
45+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMiniCart"/>
46+
<!-- click on Place Order and Guest sing in -->
47+
<actionGroup ref="StorefrontGuestSignInActionGroup" stepKey="singInForPlaceOrder">
48+
<argument name="email" value="$$createCustomer.email$$"/>
49+
<argument name="password" value="$$createCustomer.password$$"/>
50+
</actionGroup>
51+
<amOnPage url="{{AdminLoginPage.url}}" stepKey="onLoginPage"/>
52+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingPage"/>
53+
54+
<after>
55+
<!--Goto Admin Configuration page and Allow Guest Checkout is Yes-->
56+
<actionGroup ref="AdminConfigurationAllowGuestCheckoutYesNavigateActionGroup" stepKey="storeConfigurationAllowGuestCheckoutYes"/>
57+
<actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="clickOnSaveConfigAgain"/>
58+
<!-- Delete created category, product and customer-->
59+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
60+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
61+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
62+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
63+
</after>
64+
</test>
65+
</tests>

app/code/Magento/Config/Test/Mftf/Section/SalesConfigSection.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@
1313
<element name="CheckIfTaxClassesTabExpand" type="button" selector="#tax_classes-head:not(.open)"/>
1414
<element name="ShippingTaxClass" type="select" selector="#tax_classes_shipping_tax_class"/>
1515
<element name="EnableTaxClassForShipping" type="checkbox" selector="#tax_classes_shipping_tax_class_inherit"/>
16+
<element name="AllowGuestCheckout" type="select" selector="//select[@id='checkout_options_guest_checkout']" timeout="30"/>
17+
<element name="CheckoutTab" type="button" selector="//a[@class='admin__page-nav-link item-nav']//span[contains(text(),'Checkout')]" timeout="30"/>
18+
<element name="ExpandCheckoutOptions" type="text" selector="//a[@id='checkout_options-head']" timeout="30"/>
19+
<element name="UseSystemValue" type="checkbox" selector="//input[@id='checkout_options_guest_checkout_inherit']" timeout="30"/>
1620
</section>
17-
</sections>
21+
</sections>

app/code/Magento/Config/Test/Mftf/Section/StoreConfigSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
<element name="Country" type="select" selector="#general_store_information_country_id"/>
1717
<element name="fillVATNumber" type="input" selector="#general_store_information_merchant_vat_number"/>
1818
<element name="validateVATNumber" type="button" selector="#general_store_information_validate_vat_number" timeout="30"/>
19+
<element name="StoreTab" type="button" selector="//a[@href='#']//span[contains(text(),'Stores')]" timeout="30"/>
20+
<element name="ConfigurationPage" type="button" selector="//li[@class='item-system-config level-2']//span[contains(text(),'Configuration')]" timeout="30"/>
21+
<element name="SalesTab" type="button" selector="//div[@class='admin__page-nav-title title _collapsible']//strong[contains(text(),'Sales')]" timeout="30"/>
1922
</section>
2023
</sections>

0 commit comments

Comments
 (0)