microsoft / PowerApps-TestEngine

MIT License
108 stars 33 forks source link

[Feature]: Canvas Application / Custom Pages - Global Variables and Collections as Power FX #377

Open Grant-Archibald-MS opened 1 month ago

Grant-Archibald-MS commented 1 month ago

Is your feature request related to a problem? Please describe.

For Canvas Applications and Model Driven Application there are global variables and collections. Allow these collections and variables to be part of the test state so that values and collection values can read and updated to control the state of the application.

Describe the solution you'd like

Consider the adding support for the following:

Describe alternatives you've considered

No response

Additional context?

Adding some examples from the CoE Kit Setup Install Wiard as an examples for this request:

Grant-Archibald-MS commented 1 month ago

Propose the following approach:

  1. Existing functionality in Test Engine to load the YAML Test Cases
  2. Before each test case create new PowerFx Engine state
  3. Before test case starts ask provider for initial state (NEW)
  4. Provider queries the current state
  5. Provider passes state back so that Controls, Variables and Collections can be set in Power FX
  6. For each step:
    • Execute the Power FX action.
    • Executing a Power FX step could call Power FX function that changes the state of the Application
    • Detect if and changes to Power FX state, if changes update provider with changes (NEW)
    • After the action is completed ask the provider to refresh the state (NEW)
    • Use the new state to add or update Controls, Variables and Collections
image
Grant-Archibald-MS commented 4 weeks ago

Added description of how using this feature for the CoE Kit in https://github.com/Grant-Archibald-MS/powerfuldev-testing/blob/main/examples/custom-page-variables-and-collections.md

Grant-Archibald-MS commented 4 days ago

Work in progress implementation now part of https://github.com/microsoft/PowerApps-TestEngine/tree/integration for Custom pages of Model Driven Applications.

Leaving feature request open as consider Canvas applications.