JBehave - Passing parameters to parent stories - parameter-passing

I am able to call few stories from a given story as they are pre-requisite for the current story to proceed.
Want to know if there is anyway that I can pass the parameters to the parent stories from the current story.
Any inputs appreciated.

Related

Single parameter for multiple intent dialogflow

I'm just learning to make a chatbot for the first time I can make parameters name and dress size which can be recalled in welcome intent
please guide the masters, seniors in this forum, how to call the parameters that I have made in the welcome intent in other intents that I have made for more attractive conversations
I want to make an intent about conclusion.intent which can display parameters that are already in the welcome intent

Restricting multi category to set number according to select package

I am helping a client build a wordpress directory. The theme in use is ListingPro. My client is wanting to restrict the number of categories allowed according to the package selected.
for example:
Gold package - No. of catergories allowed: 5
Platinum package - No. of catergories allowed: 10
At the moment, the theme allows for all categories to be selected.
I dont have the coding knowledge to make this happen. I am looking for advice, help or a direction I should look at for help.
I can't say for sure without digging into this plugin's code, but I'd start by looking through and seeing where and how it stores the information of listings.
Basically, you're looking to intercept the function that posts a listing, and you'll want to do a get_posts (https://developer.wordpress.org/reference/functions/get_posts/) request that sees how many posts attributed to the logged in user has made with any given category.

Riot Api - Rest call for items and images

I am started to work with the riot api and so far I love riot for offering this possibility.
Can someone please help me how to write a rest call to get
- not the item parts but only the full item (like athene's unholy grail and not fiendish codex and chalice of harmony)
- the images for the items
- the item name
Here ist the website: https://developer.riotgames.com/api-methods/#static-data-v3
Or do I have to get all items and have to filter them by myself? Highly appreciate your help!
Thanks and see you on summoner's rift
You either need to query all items and filter from there or query an item by its ID if you know it beforehand.
For both of these options, you'll need to include the itemListData=image parameter.
Example: https://na1.api.riotgames.com/lol/static-data/v3/items?itemListData=image&api_key=YOUR_RIOT_API_KEY
I'd also suggest caching/storing the items object after the first request for faster access and rate limit efficiency.
If you use NodeJS, take a look at this (the source is available here).
Note that if you use the package above, your first request will go to the Riot Games API and the rest will be served from cache, that is until you restart your server. You may wanna implement permanent storage if you would like to frequently restart your server.

Chamilo LMS How to link to a test from a learning path?

In chamilo LMS, if you put a test in a learning path, it doesn't use the grade as passing, it uses completion as passing. So if you want the scores to count you have to tell users in a learning path, "Hey go find such and such a test in the exams section." I am trying to find a way to at least provide a link that will take the user directly to a specific test.
The chamilo forum is being hopeless spammed by a bot right now, so I cant get help there.
The reason why tests are graded by completion in learning paths is because learning paths are a teaching tool, by opposition to evaluation tool. As such, including tests there should only be used as a way to control whether you are good to move to the next chapter (using prerequisites) or not.
Teal exams should be taken apart for two reasons:
to allow the student to prepare reasonnably (study on one side then, when (s)he's ready, enter the exam as if it was something formal
to reduce possible interferences of JavaScript that is generated in the learning path context (you never know what other JS a teacher might add ti his/her tests)
In either case, you can still see the results of the tests from the user's tracking page (there's a column showing through which learning path it was graded, to make it clear).
You can use the URL of the test, then create a link to the test, then include the link in the learning path (this will open it as a content page but should track the results (not sure about that, you'll have to try it out) as if it was taken from out of a learning path.
Or you can also just put the link in an HTML document with a small explanation at the end of your learning path. This should send the user directly out of the learning path context and into the exercise context.

Unit testing function which calls external async API

I really want to grasp TDD approach and integrate it into my coding behaviors, but I have really hard time to understand how do people test some complicated cases. For example, consider this situation: I have a game, consisting of levels. When the user passes the level, I should display a dialog, informing him of his current position amongst his friends. The dialog can show only 3 places, amongst which the current user should have the highest place and score. If the user has less than 2 friends, I must display "fake" friends in this dialog.
So, I have a function, which receives a vector of objects, containing UIDs of users (by which they are represented in some social network) and their scores and places in the leaderboard for the given level. The function should be called after the game level ends and it should marshal those users in right order in the dialog (view) which displays the users in proper order, according to their place, scores etc. So this function looks like this in pseudocode:
public function marshallUsers(users:Vector.<User>):void {
// Add necessary fake users, if the vector length less than 3
// Compute social network request for users's photos
// basically it just a string with comma-separated user ids
// Enquiry social network API asynchronously, calling callback
// function when the request succeeds. This is singleton.
}
private function callback(users:Array):void
{
// fill the user portraits in the dialog
}
So how can I extract what exactly should I test in the marshallUsers function? Inner object state changes? How can I test the function which not only relies on external global object, but also logically continues after the asynchronous call succeeds? How can I avoid that?
If your case is "too complicated" that is often because it is too broad.
From your description, marshallUsers doesn't really seem to perform much logic internally (except perhaps adding fake friends?). It just calls a sequence of other objects? If so then there isn't much to test. You should be testing the individual components that marshallUsers calls upon in their own tests.
What you could be testing is whether marshallUsers correctly handles various output states from each of the components it uses (such as a valid set of users, less than 3 users, unable to get a response etc). You would mock the various components to provide these dummy responses.
Remember, you are ideally only testing the logic within marshallUsers, everything else should be isolated from it.
For what it's worth, in the tests we do for similar cases to yours, we do them firstly as I have described, but then normally also have at least one "end-to-end" test which calls an API just to make sure it all fits together correctly. The argument is of course that with well thought out tests you shouldn't need to - but the real world is not always well thought out.