Skip to content

Commit 4a754c7

Browse files
committed
Changing the navigation to plugin settings to the new actions menu path.
1 parent 94da85d commit 4a754c7

File tree

3 files changed

+75
-19
lines changed

3 files changed

+75
-19
lines changed

eform-client/cypress/e2e/plugins/time-planning-pn/i/activate-plugin.spec.cy.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,36 @@ describe('Enable Backend Config plugin', () => {
88
pluginPage.Navbar.goToPluginsPage();
99
});
1010

11-
it('should activate the plugin', () => {
11+
it('should enabled Time registration plugin', () => {
1212
const pluginName = 'Microting Time Planning Plugin';
13-
pluginPage.enablePluginByName(pluginName);
13+
14+
// Open action menu for the plugin
15+
cy.contains('.mat-mdc-row', pluginName).first().find('#actionMenu').click();
16+
cy.wait(500);
17+
18+
// Click the status button inside the menu to enable the plugin
19+
cy.get('#plugin-status-button0').should('be.visible').click();
20+
cy.wait(500);
21+
22+
// Confirm activation in the modal if present
23+
cy.get('body').then(($body) => {
24+
if ($body.find('#pluginOKBtn').length > 0) {
25+
cy.get('#pluginOKBtn').click();
26+
cy.wait(100000); // Wait for plugin activation
27+
}
28+
});
29+
30+
cy.visit('http://localhost:4200');
31+
loginPage.login();
32+
pluginPage.Navbar.goToPluginsPage();
33+
34+
// Verify the plugin is enabled by checking the status
35+
// Re-open the action menu to check the status
36+
cy.contains('.mat-mdc-row', pluginName).first().find('#actionMenu').click();
37+
cy.wait(500);
38+
39+
cy.get('#plugin-status-button0')
40+
.find('mat-icon')
41+
.should('contain.text', 'toggle_on'); // plugin is enabled
1442
});
1543
});

eform-client/cypress/e2e/plugins/time-planning-pn/j/activate-plugin.spec.cy.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,36 @@ describe('Enable Backend Config plugin', () => {
88
pluginPage.Navbar.goToPluginsPage();
99
});
1010

11-
it('should activate the plugin', () => {
11+
it('should enabled Time registration plugin', () => {
1212
const pluginName = 'Microting Time Planning Plugin';
13-
pluginPage.enablePluginByName(pluginName);
13+
14+
// Open action menu for the plugin
15+
cy.contains('.mat-mdc-row', pluginName).first().find('#actionMenu').click();
16+
cy.wait(500);
17+
18+
// Click the status button inside the menu to enable the plugin
19+
cy.get('#plugin-status-button0').should('be.visible').click();
20+
cy.wait(500);
21+
22+
// Confirm activation in the modal if present
23+
cy.get('body').then(($body) => {
24+
if ($body.find('#pluginOKBtn').length > 0) {
25+
cy.get('#pluginOKBtn').click();
26+
cy.wait(100000); // Wait for plugin activation
27+
}
28+
});
29+
30+
cy.visit('http://localhost:4200');
31+
loginPage.login();
32+
pluginPage.Navbar.goToPluginsPage();
33+
34+
// Verify the plugin is enabled by checking the status
35+
// Re-open the action menu to check the status
36+
cy.contains('.mat-mdc-row', pluginName).first().find('#actionMenu').click();
37+
cy.wait(500);
38+
39+
cy.get('#plugin-status-button0')
40+
.find('mat-icon')
41+
.should('contain.text', 'toggle_on'); // plugin is enabled
1442
});
1543
});

eform-client/cypress/e2e/plugins/time-planning-pn/j/dashboard-edit-a.spec.cy.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import loginPage from '../../../Login.page';
2+
import pluginPage from '../../../Plugin.page';
23

34
describe('Dashboard edit values', () => {
45
let storedValues = {};
@@ -7,15 +8,13 @@ describe('Dashboard edit values', () => {
78
cy.visit('http://localhost:4200');
89
loginPage.login();
910

10-
cy.get('mat-nested-tree-node').contains('Admin').click();
11-
cy.get('mat-nested-tree-node').contains('Plugins').click();
12-
13-
cy.contains('div.plugin-name', 'Microting Time Planning Plugin')
14-
.closest('tr')
15-
.find('a#plugin-settings-link')
16-
.click();
17-
18-
cy.url().should('include', '/plugins/time-planning-pn/settings');
11+
pluginPage.Navbar.goToPluginsPage();
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 });
1918

2019
cy.get('#autoBreakCalculationActiveToggle button[role="switch"]')
2120
.then(($btn) => {
@@ -149,12 +148,13 @@ describe('Dashboard edit values', () => {
149148
cy.get('mat-dialog-container', {timeout: 500}).should('not.exist');
150149
cy.wait(500);
151150

152-
cy.get('mat-nested-tree-node').contains('Plugins').click();
153-
154-
cy.contains('div.plugin-name', 'Microting Time Planning Plugin')
155-
.closest('tr')
156-
.find('a#plugin-settings-link')
157-
.click();
151+
pluginPage.Navbar.goToPluginsPage();
152+
cy.get('#actionMenu')
153+
.should('be.visible')
154+
.click({ force: true });
155+
cy.intercept('GET', '**/api/time-planning-pn/settings').as('settings-get');
156+
cy.get('#plugin-settings-link0').click();
157+
cy.wait('@settings-get', { timeout: 60000 });
158158

159159
cy.url().should('include', '/plugins/time-planning-pn/settings');
160160

0 commit comments

Comments
 (0)