@@ -12,8 +12,12 @@ describe('Navigation menu - Create item', function () {
1212
1313 it ( 'element must be moved from templates to list' , ( ) => {
1414 // Get initial count
15- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'initialCount' ) ;
16- cy . get ( '@initialCount' ) . then ( ( initialCount ) => {
15+ let initialCount : number ;
16+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
17+ initialCount = length ;
18+ } ) ;
19+
20+ cy . then ( ( ) => {
1721 navigationMenuPage . collapseTemplates ( 0 ) ;
1822 navigationMenuPage . createMenuItemFromTemplate ( 0 ) ;
1923
@@ -54,8 +58,12 @@ describe('Navigation menu - Create item', function () {
5458 translations : [ 'test1' , 'test2' , 'test3' ]
5559 } ;
5660
57- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'initialCount' ) ;
58- cy . get ( '@initialCount' ) . then ( ( initialCount ) => {
61+ let initialCount : number ;
62+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
63+ initialCount = length ;
64+ } ) ;
65+
66+ cy . then ( ( ) => {
5967 navigationMenuPage . collapseTemplates ( 1 ) ;
6068 navigationMenuPage . createCustomLink ( customLink ) ;
6169
@@ -71,17 +79,24 @@ describe('Navigation menu - Create item', function () {
7179 cy . wait ( '@saveMenu' , { timeout : 30000 } ) ;
7280
7381 // Open last item for editing
74- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'count' ) ;
75- cy . get ( '@count' ) . then ( ( count ) => {
82+ let count : number ;
83+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
84+ count = length ;
85+ } ) ;
86+
87+ cy . then ( ( ) => {
7688 navigationMenuPage . openEditMenuItem ( count - 1 ) ;
7789
7890 // Verify link
7991 cy . get ( '#editLinkInput' ) . should ( 'have.value' , customLink . link ) ;
8092
8193 // Verify translations
8294 customLink . translations . forEach ( ( translation , i ) => {
83- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'itemCount' ) ;
84- cy . get ( '@itemCount' ) . then ( ( itemCount ) => {
95+ let itemCount : number ;
96+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
97+ itemCount = length ;
98+ } ) ;
99+ cy . then ( ( ) => {
85100 cy . get ( `#editItemTranslation${ itemCount - 1 } _0_${ i } ` ) . should ( 'have.value' , translation ) ;
86101 } ) ;
87102 } ) ;
@@ -100,8 +115,12 @@ describe('Navigation menu - Create item', function () {
100115 translations : [ 'test1' , 'test2' , 'test3' ]
101116 } ;
102117
103- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'initialCount' ) ;
104- cy . get ( '@initialCount' ) . then ( ( initialCount ) => {
118+ let initialCount : number ;
119+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
120+ initialCount = length ;
121+ } ) ;
122+
123+ cy . then ( ( ) => {
105124 navigationMenuPage . collapseTemplates ( 1 ) ;
106125 navigationMenuPage . createCustomDropdown ( dropdown ) ;
107126
@@ -117,14 +136,21 @@ describe('Navigation menu - Create item', function () {
117136 cy . wait ( '@saveMenu' , { timeout : 30000 } ) ;
118137
119138 // Open last item for editing
120- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'count' ) ;
121- cy . get ( '@count' ) . then ( ( count ) => {
139+ let count : number ;
140+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
141+ count = length ;
142+ } ) ;
143+
144+ cy . then ( ( ) => {
122145 navigationMenuPage . openEditMenuItem ( count - 1 ) ;
123146
124147 // Verify translations
125148 dropdown . translations . forEach ( ( translation , i ) => {
126- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'itemCount' ) ;
127- cy . get ( '@itemCount' ) . then ( ( itemCount ) => {
149+ let itemCount : number ;
150+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
151+ itemCount = length ;
152+ } ) ;
153+ cy . then ( ( ) => {
128154 cy . get ( `#editItemTranslation${ itemCount - 1 } _0_${ i } ` ) . should ( 'have.value' , translation ) ;
129155 } ) ;
130156 } ) ;
@@ -143,8 +169,12 @@ describe('Navigation menu - Create item', function () {
143169 translations : [ 'test1' , 'test2' , 'test3' ]
144170 } ;
145171
146- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'initialCount' ) ;
147- cy . get ( '@initialCount' ) . then ( ( initialCount ) => {
172+ let initialCount : number ;
173+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
174+ initialCount = length ;
175+ } ) ;
176+
177+ cy . then ( ( ) => {
148178 navigationMenuPage . collapseTemplates ( 1 ) ;
149179 navigationMenuPage . createCustomDropdown ( dropdown ) ;
150180
@@ -160,8 +190,12 @@ describe('Navigation menu - Create item', function () {
160190 cy . wait ( '@saveMenu' , { timeout : 30000 } ) ;
161191
162192 // Open last item for editing
163- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'count' ) ;
164- cy . get ( '@count' ) . then ( ( count ) => {
193+ let count : number ;
194+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
195+ count = length ;
196+ } ) ;
197+
198+ cy . then ( ( ) => {
165199 navigationMenuPage . openEditMenuItem ( count - 1 ) ;
166200
167201 // Verify security groups
@@ -171,8 +205,11 @@ describe('Navigation menu - Create item', function () {
171205
172206 // Verify translations
173207 dropdown . translations . forEach ( ( translation , i ) => {
174- navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . as ( 'itemCount' ) ;
175- cy . get ( '@itemCount' ) . then ( ( itemCount ) => {
208+ let itemCount : number ;
209+ navigationMenuPage . getMenuItems ( ) . its ( 'length' ) . then ( ( length ) => {
210+ itemCount = length ;
211+ } ) ;
212+ cy . then ( ( ) => {
176213 cy . get ( `#editItemTranslation${ itemCount - 1 } _0_${ i } ` ) . should ( 'have.value' , translation ) ;
177214 } ) ;
178215 } ) ;
0 commit comments