Code Monkey home page Code Monkey logo

karate-maven-gradle's People

Contributors

dependabot[bot] avatar kirksl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

karate-maven-gradle's Issues

After Scenario Method in RP class to modify things in Report Portal

Hi @kirksl

Can we have the After Scenario Method in the RP class, I want to modify some things at the Scenario level in Report Portal, I know we have an after scenario in Hook Class, but wanted an After Scenario like we have after feature at Report Portal class.

Sometimes users might want to change attributes or like for me I want to integrate with Zephyr (I have already modified at launch level and other details, but I want to get test case id from scenario (@testcaseid=xxxx) and XXXX would be zephyr ticket which will update the status of that id ) I have implemented this in Report Portal Cucumber plugin and it works pretty well.

Cucumber plugin after scenario (Modified to update Zephyr with that test case)
protected void afterScenario(TestCaseFinished event) throws JSONException, IOException, InterruptedException {

	RunningContext.ScenarioContext context = getCurrentScenarioContext();
	URI featureUri = context.getFeatureUri();
	currentScenarioContextMap.remove(Pair.of(context.getLine(), featureUri));
	Date endTime = finishTestItem(context.getId(), event.getResult().getStatus());		
	featureEndTime.put(featureUri, endTime);
	
	Collection<String> tags = event.getTestCase().getTags();
	if (tags.isEmpty()) {
		testCaseId = null;
	}
	for (String i : tags) {
		testCaseId = i;
		if ((testCaseId).contains("@testcase=")) {
			testCaseId = testCaseId.substring("@testcase=".length());
			break;
		} else {
			testCaseId = null;
		}
	}		

	if (testCaseId != null && launcName!=null)
		try {
			{
				ZapiIntegration zapi = ZapiIntegration.getInstance();
				zapi.UpdateZephyrStatus(testCaseId, event.getResult().getStatus().toString());

			}
		} catch (Exception e) {
			
			e.printStackTrace();
		}
	else {
		System.out.println("TestCase id is not added to Scenario in feature file, or Zephyr Test Cycle is not provided");
		System.out.println("Zephyr Test execution will not get updated: Please update Test case id or add Test Cycle");
	}
	
	currentScenarioContext.set(null);
	removeFromTree(currentFeatureContextMap.get(context.getFeatureUri()), context);
}

Please suggest what you think about this?

Setting up attribute values at test level in RP

Hi @kirksl @ptrthomas

I have a use case where I need to set attribute values at the test level. As we all know we can set attribute values at the launch level in RP easily but to set attribute values at the test level dynamically it's a little tricky.

Use Case :

Scenario Outline: Google login and input values

Given URL
When the input ()
Then Do something

Example
CSV file

CSV file contents
Test1
Test2
Test3

So This test will run three times looping the contents in CSV file which is correct and we see results in Report Portal at Test level as
Google login and input values --Pass
Google login and input values -- Fail
Google login and input values -- Pass

So my use case is How I would differentiate between these test cases (Name is same in RP ) So setting up attribute values the same as CSV file values will help us to understand that this particular test is for this input.

I think we can do it "After Scenario" Hook in RP hook class extracting the contents somehow.

Adding screenshot to Report Portal via Karate 1.0.1

Hi @kirksl

Thanks for the work you did to integrate Report Portal with Karate 1.0.1. It works absolutely fine but I have a use case where I need to see attachments in the report portal as well ( Screenshots are attached fine with customer reports ).

Is there a way to achieve this in RPReporter class or KarateHook class?

Multiple Scenarios in Report Portal If we call a Scenario in another Feature

Hi @kirksl

When we run our tests, we see called scenarios ( Scenarios called from another feature file ) also in Report Portal. But I want to see only Scenarios that I have run ( not the called scenarios, that should be steps inside the test scenario)

Hierarchy in Report Portal should be :

Launches > Features > Scenarios (Main Test Scenario) > steps and steps of reusable (Called scenario steps)

In the below Image,
Roadster Store Login
and other scenarios below that are called scenarios from another feature file and
the main scenario is "Quotes Comparison for Cash"

image

This is the code
* def login = read('classpath:com/cdk/reusable_hooks/roadsterStore_Login.feature@login')

@Basic_Cash
Scenario Outline: Cash with Basic Test
* call login
* delay(2000)

What changes Should we have to make?

Thanks
Shivin Saraf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.