Skip to content

Commit 0810477

Browse files
Copilotrenemadsen
andcommitted
Fix Cypress test structure: update activate-plugin to match b directory and rename absence-requests test for proper alphabetical ordering
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
1 parent 99ff6c7 commit 0810477

2 files changed

Lines changed: 31 additions & 10 deletions

File tree

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,43 @@
11
import loginPage from '../../../Login.page';
22
import pluginPage from '../../../Plugin.page';
33

4-
describe('Time Planning Plugin Activation for Absence Requests Tests', () => {
4+
describe('Enable Backend Config plugin', () => {
55
beforeEach(() => {
66
cy.visit('http://localhost:4200');
77
loginPage.login();
8+
pluginPage.Navbar.goToPluginsPage();
89
});
910

10-
it('should activate time-planning plugin', () => {
11-
pluginPage.Navbar.goToPluginsPage();
12-
cy.intercept('GET', '**/api/plugins-management/plugins').as('getPlugins');
13-
cy.wait('@getPlugins', { timeout: 30000 });
14-
15-
pluginPage.getEnableBtn('time-planning-pn').then((enableBtn) => {
16-
if (enableBtn.is(':visible')) {
17-
enableBtn.click();
18-
cy.wait(1000);
11+
it('should enabled Time registration plugin', () => {
12+
const pluginName = 'Microting Time Planning Plugin';
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
1927
}
2028
});
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
2142
});
2243
});

eform-client/cypress/e2e/plugins/time-planning-pn/l/absence-requests.spec.cy.ts renamed to eform-client/cypress/e2e/plugins/time-planning-pn/l/time-planning-absence-requests.spec.cy.ts

File renamed without changes.

0 commit comments

Comments
 (0)