Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of parameterized test #96

Open
NitroTamagotschi opened this issue Nov 16, 2023 · 3 comments
Open

Support of parameterized test #96

NitroTamagotschi opened this issue Nov 16, 2023 · 3 comments

Comments

@NitroTamagotschi
Copy link

It would be nice if parameterized tests would be supported as well.
So that tests which got executed in multiple iterations with different parameters as documented here.
An example you'll find below under key iterations

	"id": 10603,
	"status": "EXECUTING",
	"color": "#F1E069",
	"testKey": "ID-59",
	"testExecKey": "ID-60",
	"assignee": "User1",
	"executedBy": "User1",
	"startedOn": "2023-11-16T08:00:21+01:00",
	"startedOnIso": "2023-11-16T08:00:21+01:00",
	"defects": [],
	"evidences": [],
	"testEnvironments": [],
	"fixVersions": [],
	"customFields": [],
	"iterations": [
		{
			"id": 3,
			"status": "PASS",
			"color": "#95C160",
			"parameters": [
				{
					"name": "Param1",
					"value": "1"
				},
				{
					"name": "Param2",
					"value": "A"
				}
			]
		},
		{
			"id": 4,
			"status": "TODO",
			"color": "#A2A6AE",
			"parameters": [
				{
					"name": "Param1",
					"value": "2"
				},
				{
					"name": "Param2",
					"value": "B"
				}
			]
		}
	]
}
@fundakol
Copy link
Owner

JSON format used to import Test results does not have iterations field.
https://docs.getxray.app/display/XRAY/v2.0#/Import/post-import-execution

@NitroTamagotschi
Copy link
Author

Yes you're right. Its only supported for manual tests until today
image

@akyekth
Copy link

akyekth commented Mar 12, 2024

Hi i can able to import results to jira by using below pytest hook.
test_input.json has test_key: "JIRA-1"
my tests created through parameterized /pytest_generate_tests hook

conftest.py:

def pytest_runtest_call(self, item): 
        inputdict= item.callspec.params["test_case"]
        test_key=inputdict.test_key
        if not test_key == "":
            item.add_marker(pytest.mark.xray(f'{test_key}'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants