we have several Test components grouped. I'd like to do some parameter validation at the beginning and skip the component altogether when certain conditions are met. I wanted to use ExitComponent for this, however I figured this does not only leave the component but the whole group.
I really do not want to use extensive if-else statement ranging over my whole component, which is the only solution I can see now.
Example:
'Skip component if value is empty
if Parameter("Par1) = "" Then
'Cannot use ExitComponent as I do not want to leave the whole component group
?????
endif
'Start processing data in the component
Does anyone have an idea?
The approach from BPT is to use the ALM Wizards and Forms in order to create and configure almost all Aspects of your Tests. If you select a flow or a Test Case you can configure the Run Condition of each Subcomponent / flow in the Test Script Tab. As the Linked documentation tells, you can do it based on Parameters.
Here is the tutorial for setting Run Conditions.
P.S: In case you have to check complex things and not simple parameters, well:
Create a component that checks the complex stuff (the relation of stellar objects regarding the sun - just kidding, of course some AUT specific condition) and shares the info with the world via an Output Parameter. The subsequent components can of course then react to the Parameter.
Related
I want to build Elsa workflow for the below requirement:
Can be trigger from database table trigger when new row inserted.
Can execute exe file to get some information.
To read data from the database.
I agree with #fatihyildizhan and #vahidnaderi, but if I interpret the question as "How to do these 3 steps with Elsa from a high-level overview - can someone give me any pointers?" then I can answer as follows:
If all you really need are the 3 steps you mentioned, then don't use Elsa; it is overkill for what you want to do.
Here's why:
Although you can achieve all of this with Elsa, you can't do it with Elsa out of the box; you will have to write custom activities and support services to trigger your workflows, which is a little bit more work than simply doing your thing from your "row inserted" application handler.
If, on the other hand, you are planning on implementing multiple workflows that are potentially more complicated and perhaps even long-running, then it might be worthwhile to consider Elsa after all.
Doing this with Elsa requires you the following up-front work:
1. Trigger Workflow When New Row Inserted
To trigger a workflow when a new row is inserted, you need to implement a handler that responds to that event (this you would need to do regardless of whether you use Elsa or not).
Next, you need to implement a custom activity that represents the "row inserted" event as a trigger, e.g. called RowInserted. You can then use that activity as a starting point in any of your workflows or even as a resumption point (e.g. for workflows where you began some work that might insert some eventual addition of a database row, which is the event you want to handle), which would be triggered whenever a new row is inserted. You probably want to be able to configure for which database table to trigger this event, so you might add a TableName property to your activity.
Then, in order to make Elsa actually trigger workflows with your custom activity, you will need to do the following:
Implement a bookmark model and provider for Elsa to index and invoke. E.g.
NewRowBookmark : IBookmark with a single property called TableName. Bookmarks are Elsa's way of starting & resuming workflows.
Update your "row inserted" handler described earlier to invoke IWorkflowLaunchpad.CollectAndDispatchWorkflowsAsync, passing in the appropriate bookmark/trigger model containing the table name into which the row was inserted, and provide the inserted row as input (assuming you want the workflow to do something with the inserted row).
2. Execute File
To execute a file, you need to create another custom activity that does this. You can make this activity as specific or generic as you need.
3. Read From Database
Same as with #2, you need to create another custom activity that reads from the database. You can make this activity as specific or generic as you need.
The above should give you a rough idea of the work involved to implement this with Elsa. And as mentioned earlier, this might be overkill if all you are looking to do is do the 3 steps mentioned.
With Karate, I'm looking to simulate an end-to-end test structure where I do the following:
Make a GET request to specific data
Store a value as a def variable
Use that information for a separate scenario
This is what I have so far:
Scenario: Search for asset
Given url "https://foo.bar.buzz"
When method get
Then status 200
* def responseItem = $.items[0].id // variable initialized from the response
Scenario: Modify asset found
Given url "https://foo.bar.buzz/" + responseItem
// making request payload
When method put.....
I tried reading the documentation for reusing information, but that seemed to be for more in-depth testing.
Thoughts?
It is highly recommended to model flows like this as one scenario. Please refer to the documentation: https://github.com/intuit/karate#script-structure
Variables set using def in the Background will be re-set before every
Scenario. If you are looking for a way to do something only once per
Feature, take a look at callonce. On the other hand, if you are
expecting a variable in the Background to be modified by one Scenario
so that later ones can see the updated value - that is not how you
should think of them, and you should combine your 'flow' into one
scenario. Keep in mind that you should be able to comment-out a
Scenario or skip some via tags without impacting any others. Note that
the parallel runner will run Scenario-s in parallel, which means they
can run in any order.
That said, maybe the Background or hooks is what you are looking for: https://github.com/intuit/karate#hooks
I wanted to modify my problem and broke it down to some groups.
None of the groups have solvers attached to it. So they are just groups (composed of few components) that make it easy for the user to
differentiate various parts of the product. (each being a group).
I am confused with the IndepVarComp() and Metadata (declared in the initialization)
So far I have always used a single group and a single IndepVarComp() where the outputs were always the design variables.
If I continue this approach I could use metadata and pass large dictionaries i.e self.options.declare('aa', types=dict).
But looking at other codes based on openmdao, they seem to use indepvarcomp as if it is the metadata (ie. they dont change during iterations.and they are used as a component inside that group)
Could you guide me if one or the other is right way to
IndepVarComp outputs should be used for any output that could conceivably be a design variable or a parameter that you might wish to change in your run script.
Metadata should be used for anything that is explicitly intended to be constant. It is intended to be set once during instantiation and then not changed after the fact.
First let's understand the app:
The sample app mocks grabbing data from 2 sources: an array of available objects, and an array of objects being used.
The app also displays new objects (available ones not being used).
Finally, it also allows you to use (register) one of the new objects
Requirements:
The app needs to display the list of New objects first
The app needs to minimize the number of API calls to the bare minimum and only make calls when strictly necessary
Calls to produce changes in API data (register) should be reactive and display changes in UI immediately
The code I have implemented meets these 3 requirements. However, I'm really unhappy with this implementation, and I'm sure that's not the way the Vuex store is supposed to be used.
For starters, my implementation only works for the specific order in which the components are displayed in the screen:
<new name="New" :selected="true"></new>
<available name="Available"></available>
<using name="Using"></using>
If I, for example, want to move <available> to the last tab, the code will break.
This happens because I haven't been able to simply call dispatch('getNews') once and have everything else fall into place, without at the same time duplicating one or to API calls, and thus not meeting the requirements...
I tried using dispatch('...').then().then() but I haven't been able to make it work and meet the requirements.
I would greatly appreciate anyone with experience in similar situations with Vuex tell me how they'd do this.
Bonus if you can do it without adding extra mutations.
We have a Direct Call Rule in a report suite. Among other stuff, it is supposed to track a variable belonging to another report suite.
Is there a special function which allows something like:
_doStuff(reportSuite, prop,...)
I was intending to place it inside the Sequential Javascript in the Third Party Tags.
Thanks