File tree Expand file tree Collapse file tree 4 files changed +56
-5
lines changed
app/code/Magento/Cms/view/adminhtml/web/js
dev/tests/acceptance/tests
functional/Magento/FunctionalTest/Cms/ActionGroup Expand file tree Collapse file tree 4 files changed +56
-5
lines changed Original file line number Diff line number Diff line change @@ -77,18 +77,28 @@ define([
77
77
treeLoaded : function ( ) {
78
78
var path = this . options . currentPath ,
79
79
tree = this . element ,
80
+ lastExistentFolderEl ,
80
81
81
82
/**
82
- * Recursive open.
83
+ * Recursively open folders specified in path array .
83
84
*/
84
85
recursiveOpen = function ( ) {
85
- var el = $ ( '[data-id="' + path . pop ( ) + '"]' ) ;
86
+ var folderEl = $ ( '[data-id="' + path . pop ( ) + '"]' ) ;
87
+
88
+ // if folder doesn't exist, select the last opened folder
89
+ if ( ! folderEl . length ) {
90
+ tree . jstree ( 'select_node' , lastExistentFolderEl ) ;
91
+
92
+ return ;
93
+ }
94
+
95
+ lastExistentFolderEl = folderEl ;
86
96
87
97
if ( path . length > 1 ) {
88
- tree . jstree ( 'open_node' , el , recursiveOpen ) ;
98
+ tree . jstree ( 'open_node' , folderEl , recursiveOpen ) ;
89
99
} else {
90
- tree . jstree ( 'open_node' , el , function ( ) {
91
- tree . jstree ( 'select_node' , el ) ;
100
+ tree . jstree ( 'open_node' , folderEl , function ( ) {
101
+ tree . jstree ( 'select_node' , folderEl ) ;
92
102
} ) ;
93
103
}
94
104
} ;
Original file line number Diff line number Diff line change
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
+ <actionGroups xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" ../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd" >
10
+ <actionGroup name =" DeleteImageFromStorageActionGroup" >
11
+ <arguments >
12
+ <argument name =" Image" defaultValue =" " />
13
+ </arguments >
14
+ <click selector =" //small[contains(text(),'{{Image.value}}')]" stepKey =" selectImage" />
15
+ <see selector =" {{MediaGallerySection.DeleteSelectedBtn}}" userInput =" Delete Selected" stepKey =" seeDeleteBtn" />
16
+ <click selector =" {{MediaGallerySection.DeleteSelectedBtn}}" stepKey =" clickDeleteSelected" />
17
+ <waitForText userInput =" OK" stepKey =" waitForConfirm" />
18
+ <click selector =" {{MediaGallerySection.confirmDelete}}" stepKey =" confirmDelete" />
19
+ <waitForElementNotVisible selector =" {{MediaGallerySection.image(ImageUpload.file)}}" stepKey =" waitForImageDeleted" />
20
+ <dontSeeElement selector =" {{MediaGallerySection.image(ImageUpload.file)}}" stepKey =" dontSeeImage" />
21
+ </actionGroup >
22
+ </actionGroups >
Original file line number Diff line number Diff line change
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
+ <actionGroups xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" ../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd" >
10
+ <actionGroup name =" NavigateToMediaFolderActionGroup" >
11
+ <arguments >
12
+ <argument name =" FolderName" type =" string" defaultValue =" " />
13
+ </arguments >
14
+ <conditionalClick selector =" {{MediaGallerySection.StorageRootArrow}}" dependentSelector =" {{MediaGallerySection.checkIfArrowExpand}}" stepKey =" clickArrowIfClosed" visible =" true" />
15
+ <waitForText userInput =" {{FolderName}}" stepKey =" waitForNewFolder" />
16
+ <click userInput =" {{FolderName}}" stepKey =" clickOnCreatedFolder" />
17
+ <waitForLoadingMaskToDisappear stepKey =" waitForLoading5" />
18
+ </actionGroup >
19
+ </actionGroups >
You can’t perform that action at this time.
0 commit comments