Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Grant-Archibald-MS opened this issue Oct 3, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Grant-Archibald-MS
Copy link
Contributor

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:

  • Provide the ability to refresh the page state so that global variables and global collections are reset to default state
  • Provide the ability to reset the Power Fx test state between each test case for
  • Update the Power Fx test state after each test step so that changes in global variables and collections are reflected in the Power Fx test state
  • Provide the ability to update the global variables and collections to change the state of the Power App
  • Provide the ability for Test Engine providers to optionally get a callback to handle update of the Power Fx state in the following conditions (Before test case, before test step, after test step, after test case)

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:

  • CoE Starter Kit Setup Update Wizard is a Model Driven Application with Custom Pages
  • In the App.OnStart Set(configStep, If(!IsBlank(lastConfig),lastConfig,1)
  • The configStep global variable is used to control the screen to display to the user and the visibility of controls
  • The colSetupSteps global collection is used to determine information passed to control
  • The CoE Kit include PCF controls where the internal state or controls of the PCf control could be represented in the Power FX state to use Select() or Assert() functions
@Grant-Archibald-MS Grant-Archibald-MS added the enhancement New feature or request label Oct 3, 2024
@Grant-Archibald-MS Grant-Archibald-MS changed the title [Feature]: Canvas Application - Global Variables and Collections [Feature]: Canvas Application / Custom Pages - Global Variables and Collections as Power FX Oct 3, 2024
@Grant-Archibald-MS
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant