Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 4, 2025

This PR adds support for the workerEmail field to the BackendConfigurationPropertyWorkers page objects to enable testing of the new required WorkerEmail attribute on selectedDeviceUser.

Changes Made

PropertyWorker Interface Updates

  • Added optional workerEmail?: string; field to PropertyWorker interfaces in both e2e and Cypress versions
  • Maintains backward compatibility - existing tests continue to work without the email field

New Methods Added

  • createEmailInput() - Targets #workerEmail element for creation modal
  • editEmailInput() - Targets #workerEmail element for edit modal
  • Both methods follow the same pattern as existing input methods (firstName, lastName)

Modal Logic Updates

  • Updated openCreateModal() method to set email field when propertyWorker.workerEmail is provided
  • Updated openEditModal() method in PropertyWorkerRowObject to handle email during editing
  • Email field is processed after surname and before language, maintaining logical flow

Consistency Across Test Frameworks

  • Identical implementation in both WebDriverIO (e2e) and Cypress versions
  • Same method names, same element targeting (#workerEmail), same optional behavior

Usage Example

Tests can now include email when creating workers:

const workerWithEmail = {
  name: 'John',
  surname: 'Doe',
  language: 'Dansk',
  workerEmail: '[email protected]', // New optional field
  properties: [0]
};

// This will now set the email field in the create modal
await backendConfigurationPropertyWorkersPage.create(workerWithEmail);

The implementation is fully backward compatible - tests without the workerEmail field continue to work exactly as before.

Fixes #488.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Sep 4, 2025

@renemadsen 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI changed the title [WIP] Add workerEmail to BackendConfigurationPropertyWorkers.page.ts Add workerEmail support to BackendConfigurationPropertyWorkers page objects Sep 4, 2025
Copilot AI requested a review from renemadsen September 4, 2025 06:20
Copilot finished work on behalf of renemadsen September 4, 2025 06:20
@renemadsen renemadsen marked this pull request as ready for review September 4, 2025 07:20
@renemadsen renemadsen merged commit 91fc8c6 into master Sep 4, 2025
15 of 25 checks passed
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.

Add workerEmail to BackendConfigurationPropertyWorkers.page.ts

2 participants