Title: Add precondition method and annotation for update precondition field in test case from test result · Issue #1355 · allure-framework/allure-java · GitHub
Open Graph Title: Add precondition method and annotation for update precondition field in test case from test result · Issue #1355 · allure-framework/allure-java
X Title: Add precondition method and annotation for update precondition field in test case from test result · Issue #1355 · allure-framework/allure-java
Description: What problem should this solve? There is "Precondition" update policy in testops. And when the test result is selected, there is no way to specify what should be selected to fill in the field. I talked to testops support and they said th...
Open Graph Description: What problem should this solve? There is "Precondition" update policy in testops. And when the test result is selected, there is no way to specify what should be selected to fill in the field. I ta...
X Description: What problem should this solve? There is "Precondition" update policy in testops. And when the test result is selected, there is no way to specify what should be selected to fill in the f...
Opengraph URL: https://github.com/allure-framework/allure-java/issues/1355
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add precondition method and annotation for update precondition field in test case from test result","articleBody":"### What problem should this solve?\n\nThere is \"Precondition\" update policy in testops. And when the test result is selected, there is no way to specify what should be selected to fill in the field.\n\u003cimg width=\"1086\" height=\"460\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/7b54e205-f473-4bb6-8641-d6a1831d0a8d\" />\nI talked to testops support and they said that there is no label that they could add to this field. And that you need to add the task to the appropriate framework.\n\n### What would you like to happen?\n\nIt would be convenient for the Allure.precondition method and the @Precondition annotation to appear, which would preserve the group of steps as a separate entity. Then, during the processing of the test results, these steps would fall into the corresponding block in both lunch and test cases.\n\n### Alternatives considered\n\n_No response_\n\n### Additional context\n\nAn example of how to use this at the test level. The tests are designed to show what is required. In 1 test, it's just using a method, in the second, there are 2 method calls in a row, and the third test is an example of how an annotated method is used.\n\nFor the second test, 2 calls were used because sometimes it is necessary to prepare several different entities for the test, but it is impossible to return 2 values from anonymity without creating additional entities of the Map/Array type or class fields.\n```\npackage ...\n\nimport org.testng.annotations.BeforeClass;\nimport org.testng.annotations.BeforeMethod;\nimport org.testng.annotations.Test;\n\npublic class Example {\n private User user;\n\n\n @BeforeClass(description = \"Подготовка данных для тестов\")\n public void prepareTestData() {\n dbSteps().cleanUsers();\n user = prepareUser(\"main-region-user-name\", \"test\", \"region-main\");\n }\n\n @BeforeMethod(description = \"Подготовка между тестами\")\n public void prepareTests() {\n dbSteps().cleanUserJoins(user);\n }\n\n @Test(description = \"Объединение пользователя в главный регион\")\n public void joinUserToMainRegion() {\n var userForJoin = Allure.precondition(() -> prepareUser(\"region-1-user-name\", \"test\", \"region-1\"));\n apiSteps().joinUsers(user, userForJoin).check(\n response -> response.shouldOk()\n .userIdShould(equalTo(user.id()))\n .joinedUserIdsShould(hasSize(1))\n .joinedUserIdsShould(everyItem(equalTo(userForJoin.id())))\n );\n }\n\n @Test(description = \"Объединение нескольких пользователей из разных регионов в главный регион\")\n public void joinUsersFromDifferentRegionsToMainRegion() {\n var firstUserForJoin = Allure.precondition(() -> prepareUser(\"region-1-user-name\", \"test\", \"region-1\"));\n var secondUserForJoin = Allure.precondition(() -> prepareUser(\"region-2-user-name\", \"test\", \"region-2\"));\n apiSteps().joinUsers(user, firstUserForJoin, secondUserForJoin).check(\n response -> response.shouldOk()\n .userIdShould(equalTo(user.id()))\n .joinedUserIdsShould(hasSize(2))\n .joinedUserIdsShould(equalTo(List.of(firstUserForJoin.id(), secondUserForJoin.id())))\n );\n }\n\n\n @Precondition\n public User userInBlockedRegion(String name, String lastName, String regionId) {\n dbStesp().setRegionBlocked(regionId);\n return prepareUser(name, lastName, regionId);\n }\n\n\n @Test(description = \"Объединение пользователя в главный регион из заблокированного\")\n public void joinUserToMainRegionFromBlocked() {\n var regionId = \"region-35\";\n var userForJoin = userInBlockedRegion(\"region-blocked-user-name\", \"test\", regionId);\n apiSteps().joinUsers(user, userForJoin).check(\n response -> response.shouldError(new ApiError(500, \"Region '%s' blocked\".formatted(regionId)))\n );\n }\n}\n```\n","author":{"url":"https://github.com/RenatIsin","@type":"Person","name":"RenatIsin"},"datePublished":"2026-07-27T08:39:49Z","url":"https://github.com/allure-framework/allure-java/issues/1355"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c3a8b7f1-6c97-d1b8-7f86-12881a39e72e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9ABA:232A10:307BB:42AE0:6AFD47DE |
| html-safe-nonce | e4f150411d4175678b081edf5e7a0bb97abf416db81db88e187a0b09e86c21b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUJBOjIzMkExMDozMDdCQjo0MkFFMDo2QUZENDdERSIsInZpc2l0b3JfaWQiOiIxNjcyMjczOTM4MjkxMTgxNTM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b3ec91543e143df743c47198ff55bfb60e137ae1bb564fdb949fecd160badff5 |
| hovercard-subject-tag | issue:4986044424 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/allure-framework/allure-java/1355/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c159f8a098f1a727749af2db481adbbd21cf4cd71b6c6eb9512b1a9c1d5bf261/allure-framework/allure-java/issues/1355 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c159f8a098f1a727749af2db481adbbd21cf4cd71b6c6eb9512b1a9c1d5bf261/allure-framework/allure-java/issues/1355 |
| og:image:alt | What problem should this solve? There is "Precondition" update policy in testops. And when the test result is selected, there is no way to specify what should be selected to fill in the field. I ta... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RenatIsin |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/allure-framework/allure-java git https://github.com/allure-framework/allure-java.git |
| octolytics-dimension-user_id | 5879127 |
| octolytics-dimension-user_login | allure-framework |
| octolytics-dimension-repository_id | 80822758 |
| octolytics-dimension-repository_nwo | allure-framework/allure-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 80822758 |
| octolytics-dimension-repository_network_root_nwo | allure-framework/allure-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width