How to reuse some steps from one yaml to another in Opentest - automation

Lets suppose we have 2 yaml for android app containing:
Login
Performing some operation after Login
I want to reuse the Login yaml in yaml 2 , is it possible to achieve this in opentest somehow.

The proper way to reuse the same logic in multiple tests is to create a macro action and call that macro in all the tests that need to run that logic. For more information on creating and using macros, please see the OpenTest documentation.

Related

Genexus test REST API

I am brand new to Genexus and I come over some basic tasks. Now I try to access and test external API-s. I have import API-s over Import OpenAPI process which build API folder and Model folder. I want to test simpe API-s ( list Merchants ) but I cant find the right way to do it. Can somebody help me with that?
TIA
Stane
After importing YAML a folder named API is created containing procedures (Genexus objects) that call each service imported.
So, you need to call the procedure that in turn calls the REST service.
Something like:
Merchanlist(Parameters)
Check this document for further information: https://wiki.genexus.com/commwiki/servlet/wiki?31864,OpenAPI%20import%20tool#Sample+consumer+code

Add multiple files using IDE or task runner

Working with component in angular is great, but each time we have to create a component we have to add multiple files:
js/ts
less/sass/scss...
html
...
I wonder if it's possible to define somewhere (IDE or gulp, webpack ...) the set of files to create according to a unique user input?
ex: I would like to create a user component.
I will have to enter only one time user and it will create: user.js, user.css, user.html...
Not currently possible using WebStorm; please vote for IDEA-141225 to be notified on any progress with this feature.
I'd suggest using existing node modules for generating components; for example, you can use angular-1.5-cli package to create AngularJS components. Cli can be integrated with WebStorm as an external tool

Using Background title as Background in cucumber

Let's say I use Background feature which has the below steps:
Background: My pre-requisites
Given Step one
When Step Two
Then Step Three
....
Then Step Fifteen
So basically my Background has 15 common steps that is required for a set of scenario to run.
My question is : Is it possible to use the Background title My pre-requisites in other feature files, instead of writing down all the 15 steps as Background? Or is there any other way to handle this more gracefully.
You can create a before hook to code the background logic and reuse it across any feature file. Even tag the hook so u can filter out scenarios where u do not want the before hook to run.
Alongside the existing answer, you could also write a new step that compresses the functionality of the 15 steps into one or two steps that express what you are setting up.
The questions revolving around it are these:
Does the business need to know how the user will interact with the site to get to the point where you are ready to begin the test?
Can you bypass how the user will interact with the site to get there without information surrounding the test getting lost in translation between the dev team and the business?
For the former, I would go with a Background. The latter, I would go with a Hook.
For example:
I need to register a user in order to log in as them in my test. The Givens will start at me logging in, so I'll register the user through an API in a Hook.
I need to register a user in order to test the functionality of a new user on exiting the form, and various items surrounding registration, so I'll register the user, starting with some Background steps.

Seapine Surround SCM ticket creation

I'm relatively new with Seapines SurroundSCM API, so I might just be missing something obvious. Is there a way to generate a ticket that is then sent to TestTrack whenever a file is checked in using the SurroundSCM API? I'm being told there is a way to do it, but I can't find anything in the documentation or their site.
It is not possible to perform this action from the Surround SCM API because creating a defect/ticket is a TestTrack operation. Here are two potential approaches to take.
(1) Your application can use the addDefect function in the TestTrack API to create a new defect/ticket. So your application would use the Surround SCM API to check in the file and the TestTrack API to create the defect/ticket.
(2) You could create a second application to create a new defect/ticket via the TestTrack API. This second application could be run as the result of a Surround SCM trigger event. You could configure the preconditions of the SCM trigger to be limited to a specific group of users or specific repository.

make a request to other site from the rake task

I'm trying to automate my database population with sample objects, so I use rake tasks. I would like to use some data from other website pages.
I created txt file with url list from where that information supposed to be read and ran into problem: I don't know how to make requests outside from rake task. I need to get response, extract some selectord as RSPEC allows to do. Thank you, guys!
For custom rake tasks, you can always create your own plugin. Refer rails guide - plugins section.
In the plugin, you can use get method to get the data from an external URL. Refer ActionDispatch::Integration::RequestHelpers methods for the details.
You can add your own extraction logic and seed the database.