@@ -3,101 +3,101 @@ import { NightwatchBrowser } from 'nightwatch'
33import init from '../helpers/init'
44
55const checkBrowserIsChrome = function ( browser : NightwatchBrowser ) {
6- return browser . browserName . indexOf ( 'chrome' ) > - 1
6+ return browser . browserName . indexOf ( 'chrome' ) > - 1
77}
88
99
1010module . exports = {
11- '@disabled' : true ,
12- before : function ( browser : NightwatchBrowser , done : VoidFunction ) {
13- init ( browser , done )
14- } ,
15- 'drag and drop file from root to contracts #group1 ' : function ( browser : NightwatchBrowser ) {
16- if ( checkBrowserIsChrome ( browser ) ) {
17- browser
18- . clickLaunchIcon ( 'filePanel' )
19- . waitForElementVisible ( '*[data-id="treeViewLitreeViewItemcontracts"]' )
20- . findElement ( '*[data-id="treeViewLitreeViewItemcontracts"]' , ( el ) => {
21- console . log ( ( el as any ) . value . getId ( ) )
22- const id = ( el as any ) . value . getId ( )
23- browser
24- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemREADME.txt"]' )
25- . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemREADME.txt"]' , id )
26- . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
27- . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
28- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]' )
29- } )
30- }
31- } ,
11+ '@disabled' : true ,
12+ before : function ( browser : NightwatchBrowser , done : VoidFunction ) {
13+ init ( browser , done )
14+ } ,
15+ 'drag and drop file from root to contracts #group1 ' : function ( browser : NightwatchBrowser ) {
16+ if ( checkBrowserIsChrome ( browser ) ) {
17+ browser
18+ . clickLaunchIcon ( 'filePanel' )
19+ . waitForElementVisible ( '*[data-id="treeViewLitreeViewItemcontracts"]' )
20+ . findElement ( '*[data-id="treeViewLitreeViewItemcontracts"]' , ( el ) => {
21+ console . log ( ( el as any ) . value . getId ( ) )
22+ const id = ( el as any ) . value . getId ( )
23+ browser
24+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemREADME.txt"]' )
25+ . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemREADME.txt"]' , id )
26+ . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
27+ . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
28+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]' )
29+ } )
30+ }
31+ } ,
3232
33- 'drag and drop file from contracts to root #group1' : function ( browser : NightwatchBrowser ) {
34- if ( checkBrowserIsChrome ( browser ) ) {
35- browser . findElement ( '*[data-id="treeViewUltreeViewMenu"]' , ( el ) => {
36- console . log ( ( el as any ) . value . getId ( ) )
37- const id = ( el as any ) . value . getId ( )
38- browser
39- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]' )
40- . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]' , id )
41- . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
42- . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
43- } )
44- browser . pause ( 1000 )
45- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItem1_Storage.sol"]' )
46- }
47- } ,
48- 'drag and drop scripts from root to contracts #group1' : function ( browser : NightwatchBrowser ) {
49- if ( checkBrowserIsChrome ( browser ) ) {
50- browser
51- . waitForElementVisible ( '*[data-id="treeViewLitreeViewItemcontracts"]' )
52- . findElement ( '*[data-id="treeViewLitreeViewItemcontracts"]' , ( el ) => {
53- console . log ( ( el as any ) . value . getId ( ) )
54- const id = ( el as any ) . value . getId ( )
55- browser
56- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemscripts"]' )
57- . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemscripts"]' , id )
58- . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
59- . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
60- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]' )
61- } )
62- }
63- } ,
64- 'drag scripts from contracts to root #group1' : function ( browser : NightwatchBrowser ) {
65- if ( checkBrowserIsChrome ( browser ) ) {
66- browser . findElement ( '*[data-id="treeViewUltreeViewMenu"]' , ( el ) => {
67- console . log ( ( el as any ) . value . getId ( ) )
68- const id = ( el as any ) . value . getId ( )
69- browser
70- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]' )
71- . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]' , id )
72- . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
73- . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
74- } )
75- browser . pause ( 1000 )
76- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemscripts"]' )
77- }
78- } ,
79- 'drag into nested folder' : function ( browser : NightwatchBrowser ) {
80- if ( checkBrowserIsChrome ( browser ) ) {
81- browser . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemscripts"]' )
82- . rightClick ( 'li[data-id="treeViewLitreeViewItemscripts"]' )
83- . waitForElementPresent ( '[data-id="contextMenuItemnewFolder' )
84- . click ( '[data-id="contextMenuItemnewFolder' )
85- . waitForElementVisible ( '*[data-id$="fileExplorerTreeItemInput"]' )
86- . sendKeys ( '*[data-id$="fileExplorerTreeItemInput"]' , 'nested' )
87- . sendKeys ( '*[data-id$="fileExplorerTreeItemInput"]' , browser . Keys . ENTER )
88- . findElement ( '*[data-id="treeViewLitreeViewItemscripts/nested"]' , ( el ) => {
89- console . log ( ( el as any ) . value . getId ( ) )
90- const id = ( el as any ) . value . getId ( )
91- browser
92- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]' )
93- . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]' , id )
94- . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
95- . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
96- . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemscripts/nested/README.txt"]' )
97- } )
98- }
33+ 'drag and drop file from contracts to root #group1' : function ( browser : NightwatchBrowser ) {
34+ if ( checkBrowserIsChrome ( browser ) ) {
35+ browser . findElement ( '*[data-id="treeViewUltreeViewMenu"]' , ( el ) => {
36+ console . log ( ( el as any ) . value . getId ( ) )
37+ const id = ( el as any ) . value . getId ( )
38+ browser
39+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]' )
40+ . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]' , id )
41+ . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
42+ . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
43+ } )
44+ browser . pause ( 1000 )
45+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItem1_Storage.sol"]' )
46+ }
47+ } ,
48+ 'drag and drop scripts from root to contracts #group1' : function ( browser : NightwatchBrowser ) {
49+ if ( checkBrowserIsChrome ( browser ) ) {
50+ browser
51+ . waitForElementVisible ( '*[data-id="treeViewLitreeViewItemcontracts"]' )
52+ . findElement ( '*[data-id="treeViewLitreeViewItemcontracts"]' , ( el ) => {
53+ console . log ( ( el as any ) . value . getId ( ) )
54+ const id = ( el as any ) . value . getId ( )
55+ browser
56+ . waitForElementVisible ( 'div[data-id="treeViewDivDraggableItemscripts"]' )
57+ . dragAndDrop ( 'div[data-id="treeViewDivDraggableItemscripts"]' , id )
58+ . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
59+ . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
60+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]' )
61+ } )
62+ }
63+ } ,
64+ 'drag scripts from contracts to root #group1' : function ( browser : NightwatchBrowser ) {
65+ if ( checkBrowserIsChrome ( browser ) ) {
66+ browser . findElement ( '*[data-id="treeViewUltreeViewMenu"]' , ( el ) => {
67+ console . log ( ( el as any ) . value . getId ( ) )
68+ const id = ( el as any ) . value . getId ( )
69+ browser
70+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]' )
71+ . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]' , id )
72+ . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
73+ . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
74+ } )
75+ browser . pause ( 1000 )
76+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemscripts"]' )
9977 }
78+ } ,
79+ 'drag into nested folder' : function ( browser : NightwatchBrowser ) {
80+ if ( checkBrowserIsChrome ( browser ) ) {
81+ browser . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemscripts"]' )
82+ . rightClick ( 'li[data-id="treeViewLitreeViewItemscripts"]' )
83+ . waitForElementPresent ( '[data-id="contextMenuItemnewFolder' )
84+ . click ( '[data-id="contextMenuItemnewFolder' )
85+ . waitForElementVisible ( '*[data-id$="fileExplorerTreeItemInput"]' )
86+ . sendKeys ( '*[data-id$="fileExplorerTreeItemInput"]' , 'nested' )
87+ . sendKeys ( '*[data-id$="fileExplorerTreeItemInput"]' , browser . Keys . ENTER )
88+ . findElement ( '*[data-id="treeViewLitreeViewItemscripts/nested"]' , ( el ) => {
89+ console . log ( ( el as any ) . value . getId ( ) )
90+ const id = ( el as any ) . value . getId ( )
91+ browser
92+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]' )
93+ . dragAndDrop ( 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]' , id )
94+ . waitForElementPresent ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' )
95+ . execute ( function ( ) { ( document . querySelector ( '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok' ) as HTMLElement ) . click ( ) } )
96+ . waitForElementVisible ( 'li[data-id="treeViewLitreeViewItemscripts/nested/README.txt"]' )
97+ } )
98+ }
99+ }
100100
101101
102102
103- }
103+ }
0 commit comments