Skip to content

Commit 48b124b

Browse files
committed
Js static test fix & cove with mftf test
1 parent 378bcd2 commit 48b124b

6 files changed

+133
-1
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
12+
<actionGroup name="AdminAssertProductEditPageCreateAttributeSaveInAttributeSetPopUpShownActionGroup">
13+
<annotations>
14+
<description>Asserts that after click on "Save In New Attribute Set" poup shown .</description>
15+
</annotations>
16+
<see userInput="Enter Name for New Attribute Set" stepKey="seeContent"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminClickAddAttributeOnProductEditPageActionGroup">
13+
<annotations>
14+
<description>Clicks on 'Add Attribute'. Admin Product creation/edit page .</description>
15+
</annotations>
16+
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/>
17+
<waitForPageLoad stepKey="waitForSidePanel"/>
18+
<see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminClickCreateNewAttributeFromProductEditPageActionGroup">
13+
<annotations>
14+
<description>Clicks on 'Create New Attribute'. Admin Product creation/edit page .</description>
15+
</annotations>
16+
<click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/>
17+
<waitForPageLoad stepKey="waitForSidePanel"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AdminFillAttributeDataProductFormNewAttributeActionGroup">
13+
<arguments>
14+
<argument name="attributeName" type="string" defaultValue="TestAttributeName"/>
15+
<argument name="attributeType" type="string" defaultValue="Text Field"/>
16+
</arguments>
17+
<annotations>
18+
<description>Fill attribute data on 'Create New Attribute' page Admin Product creation/edit page .</description>
19+
</annotations>
20+
<fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}"
21+
stepKey="fillAttributeLabel"/>
22+
<selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}"
23+
stepKey="selectAttributeType"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="AdminCreateNewAttributeFromProductPageTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="We should validate the form when the user click Save in New Attribute Set"/>
15+
<title value="We should validate the form when the user click Save in New Attribute Set"/>
16+
<description
17+
value="Admin should be able to create product attribute and validate the form when the user click Save in New Attribute Set"/>
18+
<testCaseId value="https://github.com/magento/magento2/pull/25132"/>
19+
<severity value="CRITICAL"/>
20+
<group value="Catalog"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
29+
<actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/>
30+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct">
31+
<argument name="product" value="SimpleProduct"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminClickAddAttributeOnProductEditPageActionGroup" stepKey="clickAddAttribute"/>
34+
<actionGroup ref="AdminClickCreateNewAttributeFromProductEditPageActionGroup" stepKey="clickCreateNewAttribute1" />
35+
<actionGroup ref="AdminFillAttributeDataProductFormNewAttributeActionGroup" stepKey="fillAttributeData" />
36+
37+
<click selector="{{AdminProductFormNewAttributeSection.saveInNewSet}}" stepKey="saveAttributeInSet"/>
38+
<actionGroup ref="AdminAssertProductEditPageCreateAttributeSaveInAttributeSetPopUpShownActionGroup" stepKey="assertPopUp"/>
39+
<click selector="{{ModalConfirmationSection.CancelButton}}" stepKey="cancelButton"/>
40+
41+
<actionGroup ref="AdminFillAttributeDataProductFormNewAttributeActionGroup" stepKey="emptyAttributeData" >
42+
<argument name="attributeName" value=" "/>
43+
<argument name="attributeType" value=" "/>
44+
</actionGroup>
45+
46+
<click selector="{{AdminProductFormNewAttributeSection.saveInNewSet}}" stepKey="clickSaveInSet"/>
47+
<see userInput="This is a required field." stepKey="seeThisIsRequiredField"/>
48+
<dontSee userInput="Enter Name for New Attribute Set" stepKey="dontSeePopUp" />
49+
50+
</test>
51+
</tests>

app/code/Magento/Catalog/view/adminhtml/web/js/components/new-attribute-form.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ define([
99
'Magento_Ui/js/modal/prompt',
1010
'Magento_Ui/js/modal/alert'
1111
], function ($, Form, prompt, alert) {
12-
'use strict';
1312

1413
return Form.extend({
1514
defaults: {

0 commit comments

Comments
 (0)