I recently started working with robot framework for api test development. Gherkin is completely new to me.
How to manage the dependency between the Given and When and Then? For ex:
If I say that
Given create account is successful ( which may have the ability to return account no)
When I update my address (this keyword needs the account no set by Given)
Then account should be updated.
Now for When to work successfully, it should know account id or transaction id or something similar which Given has created. How will Given pass data to When and so on.
How data persists between these keywords? I do not see any examples or BDD is not meant for such kind of examples? Please refer me related links if any.
Your keywords can store data in test variables using set test variable. Test variables are visible to all keywords run during a test.
See Using Set Test/Suite/Global Variable keywords in the robot framework user guide for more information.
For example,
*** Keywords ***
create account is successful
${account number}= Create the account
set test variable ${account number}
Related
I have an endpoint which tells me the status of a given adf pipeline from .NET. For that purpose I use the .NET sdk for ADF, specifically I run PipelineRun pipelineRun = client.PipelineRuns.Get(resourceGroup, dataFactoryName, runId); and then I retrieve the status from pipelineRun.Status. The only thing I get from an user here is runId. However, I have a scenario where I need to send a list of runIds. From what I've seen, reading the official documentation, I noticed that most of their apis work with runId of type str which means it works only per runId? Has any of you ever stumbled upon a scenario like this and how did you manage to get status of multiple runIds? Did you use an already built function from the SDK or you just for-looped the PipelineRun pipelineRun = client.PipelineRuns.Get(resourceGroup, dataFactoryName, runId); for listSize times?
For a client I am building a static website rendered with nextjs and deployed on vercel. Everything on this website is static, so I don't need any database. However, this client wants to use the instagram API to show a gallery of their photos on two of their pages. This is with a custom design, so I can't use any embed code, but to the best of my knowledge I have to use the Instagram basic display API
To the problem at hand: I was wondering if there is some way to store a single variable without creating a whole database for it in vercel. I know I can use Environment Variables, but the problem is that the instagram api needs to change the access token every 2 months. To renew the access token for instagram, I was planning to write a CRON job that runs about every month to update this value.
I was wondering if it is possible to somehow store this single value on the deployed site without creating a database just for this single value. For example, is it somehow possible to change an environment variable from within a serverless function?
Any help in the right direction is appreciated!
Thanks
You go to Vercel: settings-> environment variables -> add your variable. In this variable you can store your Instagram API variable and in the code you use process.env.{variable}
Example:
you defined name of variable as instagramAPI in your local files (next.config.js or .env.local)
module.exports = {
env:{
instagramAPI : 'https://instagramapiexample.com'
},
}
you define instagramAPI (exactly the same name of the variable as in the code) on your vercel settings
In your code (local files) you call process.env.instagramAPI variable to have the value of the string.
Your code works as expected.
!IMPORTANT! if you have some secrets or passwords in your process.env.variables you newer saves it in next.config.js. For this purpose you saves your instagramAPI to .env.local (described in point 1). More info here
First, thanks Hasura for incredible good product! I love it.
I have issue with derive action with Hasura Console. My use case:
I enable anonymous role for subscribe function (everybody can send email to subscribe)
I have configured permission on my subscribe table, everything is fine.
I want to validate the user input on server side, for example, validate email format. I have followed by this guide about derive action. I found no mistake here.
But I got the error "Type query_root must define one or more fields." when I hit "Derive action" at the first time.
According to this question, as I understand, I need to have object type for root query.
Of course, I will have object type for root query eventually. I can work around by giving some dummy queries for anonymous role. But I do not like that cheat anyway.
Any idea on that? Any help will be highly appreciated.
Edited:
My related current version:
Hasura 1.3.2
One click deployment using Docker on Digital Ocean.
I'm using Symfony with functional test.
I have a login controller where the user sends user&password. The controller checks if the user and password are exist (and if the password is right by password hash).
I wish to test it by php unit
The problem I don't know where to store the real user and password for the tests. I don't wish to write every time them and I don't wish to store on the code (and after on the public repository).
The test are done in local (localhost) and on the real server.
Have you some idea what it is the better solution?
Using mod-sec before the prod-server and to remove it during the test session.
You can use different database for test environment in env.test file database env. Before tests use fixture for init data like user ...
How can I modify process variables in Alfresco's workflows? (embedded Activiti)
I know that they are created when the process is initiated but I'm unable to change them in the Java/JavaScript/process code. (unless I use REST API directly)
I can successfully change local and execution variables ( execution.setVariable("san_value", "1000"); ) but I am unable to change variables which are shown in the Workflow details page.
For the workflow details, data fetched from start-task . Please how you've added the process variables and how you're accessing it ?
Instead of using process variable, you can add new property(using aspect) in the workflow model and you should be able to access and fetch the variable across all the tasks in the workflow process.