@@ -9,20 +9,12 @@ describe('Enable Backend Config plugin', () => {
99 } ) ;
1010
1111 it ( 'should validate default Time registration plugin settings' , ( ) => {
12- const pluginName = 'Microting Time Planning Plugin' ;
13- // pluginPage.enablePluginByName(pluginName);
14- let row = cy . contains ( '.mat-mdc-row' , pluginName ) . first ( ) ;
15- row . find ( '.mat-column-actions button' )
16- . should ( 'contain.text' , 'toggle_on' ) ; // plugin is enabled
17- row = cy . contains ( '.mat-mdc-row' , pluginName ) . first ( ) ;
18- row . find ( '.mat-column-actions a' )
19- . should ( 'contain.text' , 'settings' ) ; // plugin is enabled
20- row = cy . contains ( '.mat-mdc-row' , pluginName ) . first ( ) ;
21- let settingsElement = row
22- . find ( '.mat-column-actions a' )
23- // .should('be.enabled')
24- . should ( 'be.visible' ) ;
25- settingsElement . click ( ) ;
12+ cy . get ( '#actionMenu' )
13+ . should ( 'be.visible' )
14+ . click ( { force : true } ) ;
15+ cy . intercept ( 'GET' , '**/api/time-planning-pn/settings' ) . as ( 'settings-get' ) ;
16+ cy . get ( '#plugin-settings-link0' ) . click ( ) ;
17+ cy . wait ( '@settings-get' , { timeout : 60000 } ) ;
2618
2719 const googleSheetIdInputField = cy . get ( '.flex-cards.mt-3 mat-form-field' ) ;
2820 googleSheetIdInputField
@@ -127,20 +119,12 @@ describe('Enable Backend Config plugin', () => {
127119 } ) ;
128120
129121 it ( 'should activate auto calculation break times' , ( ) => {
130- const pluginName = 'Microting Time Planning Plugin' ;
131- // pluginPage.enablePluginByName(pluginName);
132- let row = cy . contains ( '.mat-mdc-row' , pluginName ) . first ( ) ;
133- row . find ( '.mat-column-actions button' )
134- . should ( 'contain.text' , 'toggle_on' ) ; // plugin is enabled
135- row = cy . contains ( '.mat-mdc-row' , pluginName ) . first ( ) ;
136- row . find ( '.mat-column-actions a' )
137- . should ( 'contain.text' , 'settings' ) ; // plugin is enabled
138- row = cy . contains ( '.mat-mdc-row' , pluginName ) . first ( ) ;
139- let settingsElement = row
140- . find ( '.mat-column-actions a' )
141- // .should('be.enabled')
142- . should ( 'be.visible' ) ;
143- settingsElement . click ( ) ;
122+ cy . get ( '#actionMenu' )
123+ . should ( 'be.visible' )
124+ . click ( { force : true } ) ;
125+ cy . intercept ( 'GET' , '**/api/time-planning-pn/settings' ) . as ( 'settings-get' ) ;
126+ cy . get ( '#plugin-settings-link0' ) . click ( ) ;
127+ cy . wait ( '@settings-get' , { timeout : 60000 } ) ;
144128
145129 const googleSheetIdInputField = cy . get ( '.flex-cards.mt-3 mat-form-field' ) ;
146130 googleSheetIdInputField
@@ -280,13 +264,13 @@ describe('Enable Backend Config plugin', () => {
280264 } ) ;
281265 cy . visit ( 'http://localhost:4200' ) ;
282266 pluginPage . Navbar . goToPluginsPage ( ) ;
283- row = cy . contains ( '.mat-mdc-row' , pluginName ) . first ( ) ;
284- // row = cy.contains('.mat-mdc-row', pluginName).first();
285- settingsElement = row
286- . find ( '.mat-column-actions a' ) ;
287- // .should('be.enabled')
288- // .should('be.visible' );
289- settingsElement . click ( ) ;
267+
268+ cy . get ( '#actionMenu' )
269+ . should ( 'be.visible' )
270+ . click ( { force : true } ) ;
271+ cy . intercept ( 'GET' , '**/api/time-planning-pn/settings' ) . as ( 'settings-get' ) ;
272+ cy . get ( '#plugin-settings-link0' ) . click ( ) ;
273+ cy . wait ( '@settings-get' , { timeout : 60000 } ) ;
290274
291275 // const daysOfWeek = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];
292276 daysOfWeek . forEach ( ( day , index ) => {
0 commit comments