Many a times, in modern web applications, you may have an Action that may be applicable across multiple pages.
For example, in the QBank application, "Logout" functionality is applicable in several pages. Similarly, on an e-commerce application, “Navigate to Home Page” or "Verify Footer Links" Actions may be applicable on all the application pages.
In such cases, you can define the Action in one Context and share it with other applicable Contexts thereby avoiding duplication of Action logic. When you are building Scenario steps, this Action will be presented as "Relevant" across all the Contexts with which the Action is shared.
Origin Context of Action
Origin Context of an Action indicates the page where an Action initiates in. For example, for the Action "Login to QBank", the Origin is "QBank Login Page". You achieve Action sharing by adding to the list of "Origin Contexts" for the Action.
How to share an Action
On the Action entity page, click "Applicability" tab on the sidebar.
Click the edit icon besides "Available in Contexts" field values.
You can decide to either share with a list of given context names or share across the Project with all contexts in the Project.
Note on "All Contexts" sharing:
It is important to carefully consider the sharing needs. If not done judiciously, it could create confusion downstream, when you are building Scenarios. Especially with the share-all option, pay attention to make sure it is really necessary.
Note on Owner Context:
When an Action is shared with multiple Contexts, as far as Scenario development is concerned, there is no distinction of which Context the Action is actually defined in. The Context where the Action is actually defined in is called the "Owner Context". Action derives resources such as Elements, called Actions etc. from this Context.
Please sign in to leave a comment.