Cucumber tags chaining - testing

I was thinking about chaining tags
base example from https://cucumber.io/docs/cucumber/api/
#billing
Feature: Verify billing
#important
Scenario: Missing product description
Given hello
Scenario: Several products
Given hello
what I would like to do is
#billing
Feature: Verify billing
#important
Scenario: Missing product description
Given hello
Scenario: Several products
Given hello please run #important tag
and all the steps from #important would execute, is that possible? I didn't find any examples in google :(
if yes could you help me find some materials?
Stack:
JS with cypress-cucumber-preprocessor https://github.com/TheBrainFamily/cypress-cucumber-preprocessor
I also looked over all the examples and didn't see anything like that
Thanks for the help :)

It sounds like you're saying that you'd like to be able to re-use the steps from an existing scenario in another one, is that correct?
Instead of trying to organise the re-use at the Gherkin level (which is not a programming language, but a specification language) I would do it a level down in the code in your step definitions.
A really nice pattern to help you organise your step def code is the screenplay pattern, which would allow you to create composable "chunks" of automation code that you can re-use.
Here's a blog post I wrote about that pattern: https://cucumber.io/blog/bdd/understanding-screenplay-(part-1)/

Related

How do I stop the execution of a .feature file with cucumber

I have the following scenario:
Scenario Outline: Searching for something on Google
Given user goes to google.com
When user search for "<something>"
Then <somethingHappens>
I would like to prevent Then <somethingHappens> from being executed if a condition in When user search for "<something>" is not met.
Let say that google does not find something, how do I stop the execution of the test?
I found some post saying that this is not the way Cucumber works. Instead, I'd rather create another scenario that would match what I'm looking for. Is that correct?
Thanks in advance for your help
There are few ways you gan go:
The correct way is to have two scenarios. Because the behavior (aka logic) is not defined for the case that notheing has been found. I would rework your scenario to:
Scenario Outline: Searching for something on Google
Given user goes to google.com
When user search for "<something>"
And there are results returned
Then <somethingHappens>
and
Scenario Outline: Searching for something on Google
Given user goes to google.com
When user search for "<something>"
And there are no results returned
Then <nothingHappens>
Hence your logic would look more like a test..
You can use the capabilities of unit-test framework that is currenty driving your Cucumber test. For example if you are using JUnit you coud have the step definition like this:
#When("user search for something")
public void when(){
boolean condition = testForConditionMet();
Assume.assumeTrue(condition)
}
The above code would make your test skip if condition is false.
If you would like to fail the test then use Assert.assertTrue(condition) instead of Assume.
I would not recommend to use the second approach since you are stuck to unit-test framework in that case.

Karate integration with type config

can we use any config framework like type config for java in karate? it can be used to pick up the values of keys mentioned in configuration file as per requirement.we have been using rest assured and type config.
One word of advice is you need to un-learn a lot of "Java things" when you start with Karate. There is no need for type-config. Please see the documentation: https://github.com/intuit/karate#configuration
Also see this example for a example of "picking up keys" like you say: https://stackoverflow.com/a/49693808/143475
If you have a specific need, please ask a new question, and provide good examples. Anything is possible in Karate.

Has anyone come across issue[]?

issue[] in UiPath.
So I downloaded an extension / package from UiPath GO! named as "Jira Integrating Software". This Packages comes with several APIs to access Jira tickets.
I was working with one of these APIs called "Search by JQL". JQL is Jira Query Language comes in handy for Advance searching. The output type of this "Search by JQL" activity is issues[].
Now when I am Iterating this array it gives me an output of "UiPath.JiraSoftware.Models.Issue"
You should use a For Each activity iterating the ResultArray Array you got from the Search JQL.
The following is just pseudo code! But it should work like this. Maybe the name of the property is not IssueId. That was not completely told in the document. But this you can when you inspect it by using the debug mode:
You should also have a look on the official Jira UiPath page. This resource contains all of the concepts you will need.

API Blueprint - How to perform a simple UPDATE

I have went through the documentation of Apiary but did not find out how to create a blue print to update a resource.
What I am trying to achieve here is a simple scenario such as having a list of users, being able to list them, retrieve a single user by id, define different attributes for that user, modify one-n attributes of that user (updating that user), and delete that user.
Could someone redirect me to some clear documentation or to a stackoverflow question that I have missed during my research and that would help me achieve this?
I think you have to use PUT or PATCH method for update resource. Look into this blog post here are some examples.

Dynamically building a URL in QTP

I've been taking a quick look at QTP with one of our test team.
We've figured out some basics like recording a test, capturing text using output values, putting in check points, etc.
However, I can't figure out how to do the following...
We have a web form which a user fills in and submits. This will create an item and assign it an ID in the database. We can capture this ID.
A subsequent page then shows a list of all items, with a link available to open a specific item. This is a simple hyperlink on a web page.
How do I:
Check that a link exists on the page with the ID assigned from the creation step?
Click that link?
I'm sure that this must be possible, but I've been struggling grokking the tool so far, so this is a shameless cry for help to save me from having to study the docs.
Thanks.
Quickly look on Web GUI recognition principles in QTP. Get to the descriptive programming part.
Find Help for Link object in QTP.
Define your target Link object using descriptive programming.
It should be something like
Set objTargetLink = Browser("title:=...").Page("title:=...").Frame("title:=...").Link("id:=target_id")
Use
boolRC = objTargetLink.Exist(0)
To check if your link exists.
Use
sURL = objTargetLink.GetTOProperty("url")
to retrieve the actual url. You may get other properties the same way.
Use objTargetLink.Click to click on the link.
PS. Functional Test Automation is something different, though.
Ask your testing team to read about automation frameworks and automation requirements.
I have some stuff on my blog.
http://automation-beyond.com/2009/06/06/qa-test-automation-requirements-usability/
Thank you,
Albert Gareev
http://automation-beyond.com/