Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Update WDIO tests for action menu-based plugin activation

Based on reference PR microting/eform-angular-workflow-plugin#1167, this PR updates the plugin activation tests to use the new action menu interface instead of the old toggle method.

Changes completed:

  • Update application-settings.plugins-page.spec.ts to use action menu for plugin activation
    • Replace plugin.enableOrDisablePlugin() with action menu clicks
    • Use $('#action-items-X').$('#actionMenu') to open action menu
    • Click status button $('#plugin-status-buttonX') within menu
    • Confirm activation with $('#pluginOKBtn')
    • Add appropriate waits for plugin initialization (100 seconds)
    • Re-login after activation to verify changes
    • Check status through action menu instead of plugin object
  • Import $ from @wdio/globals
  • Maintain activation for all 3 plugins (Items Planning, Time Planning, Backend Configuration)
  • Fix loop indices to start from 1 instead of 0 (matching original behavior)
  • Fix index mapping: use index - 1 for HTML element selectors (0-indexed)
  • Code review and security check completed

Key changes implemented:

  • Added import for $ from @wdio/globals
  • Created activatePlugin() helper function that:
    • Opens action menu using $('#action-items-{index - 1}').$('#actionMenu')
    • Clicks status button $('#plugin-status-button{index - 1}')
    • Confirms activation with OK button in modal
    • Waits 100 seconds for plugin initialization
    • Re-logins and navigates back to plugins page
  • Created checkPluginStatus() helper function that:
    • Opens action menu using $('#action-items-{index - 1}').$('#actionMenu')
    • Checks status icon text from $('#plugin-status-button{index - 1}')
    • Closes menu with Escape key
  • All loops iterate starting from index 1 (matching original code behavior)
  • HTML selectors use index - 1 to account for 0-based indexing in DOM
  • Applied changes to all 3 plugins: Items Planning, Time Planning, and Backend Configuration

Index mapping explanation:

  • getPluginRowObjByIndex() uses 1-based indexing (starts at 1)
  • HTML element IDs use 0-based indexing (starts at 0)
  • Therefore, when passing index from the loop to helper functions, we subtract 1 for DOM selectors
Original prompt

This section details on the original issue you should resolve

<issue_title>Update WDIO tests for action menu-based plugin activation</issue_title>
<issue_description>Use microting/eform-angular-workflow-plugin#1167 as reference to what needs to be done

Don't create Page Objects, since duing testing Page Obejcts from frontend is used</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 14, 2025
Copilot AI changed the title [WIP] Update WDIO tests for action menu-based plugin activation Update WDIO tests to use action menu for plugin activation Nov 14, 2025
Copilot AI requested a review from renemadsen November 14, 2025 05:10
Copilot finished work on behalf of renemadsen November 14, 2025 05:10
};

// Find and activate Microting Items Planning Plugin
for (let i = 0; i < 10; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot the for loop is starting from 1 as the old one, otherwise it will not work as expected, this goes for the following for loops as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 2917cda. All for loops now start from index 1 as in the original code.

Copilot finished work on behalf of renemadsen November 14, 2025 06:14
Copilot AI requested a review from renemadsen November 14, 2025 06:14
it('should activate the plugin', async () => {
let plugin = await pluginPage.getFirstPluginRowObj();
// Helper function to activate a plugin by index using action menu
const activatePlugin = async (index: number, pluginName: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this index needs to be index -= 1, otherwise it will activate the wrong plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 56ff223. Both activatePlugin() and checkPluginStatus() now use index - 1 for HTML selectors to account for the difference between 1-based getPluginRowObjByIndex() and 0-based DOM element IDs.

Copilot AI requested a review from renemadsen November 14, 2025 06:47
Copilot finished work on behalf of renemadsen November 14, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update WDIO tests for action menu-based plugin activation

2 participants