11import { expect , it } from "vitest" ;
22import { Stage , Status } from "allure-js-commons" ;
3+ import { md5 } from "allure-js-commons/sdk/reporter" ;
34import { runCodeceptJsInlineTest } from "../utils.js" ;
45
56it ( "handles simple scenarios" , async ( ) => {
@@ -22,35 +23,45 @@ it("handles simple scenarios", async () => {
2223 expect . objectContaining ( {
2324 status : Status . PASSED ,
2425 name : "logout-scenario1" ,
25- fullName : "logout.test.js: logout-feature > logout-scenario1" ,
26- testCaseId : "b1cbd7e3cf91f03aa08b912903a297a0 " ,
27- historyId : "b1cbd7e3cf91f03aa08b912903a297a0 :d41d8cd98f00b204e9800998ecf8427e" ,
26+ fullName : "dummy: logout.test.js: logout-feature > logout-scenario1" ,
27+ testCaseId : "eda0335a13829baf445a25f7f3183813 " ,
28+ historyId : "eda0335a13829baf445a25f7f3183813 :d41d8cd98f00b204e9800998ecf8427e" ,
2829 } ) ,
2930
3031 expect . objectContaining ( {
3132 status : Status . PASSED ,
3233 stage : Stage . FINISHED ,
3334 name : "logout-scenario2" ,
34- fullName : "logout.test.js: logout-feature > logout-scenario2" ,
35- testCaseId : "cf2fc4ae2f9143145a3ee3bae6dff66b " ,
36- historyId : "cf2fc4ae2f9143145a3ee3bae6dff66b :d41d8cd98f00b204e9800998ecf8427e" ,
35+ fullName : "dummy: logout.test.js: logout-feature > logout-scenario2" ,
36+ testCaseId : "bf828e36674defe3995294bf2aa475d7 " ,
37+ historyId : "bf828e36674defe3995294bf2aa475d7 :d41d8cd98f00b204e9800998ecf8427e" ,
3738 } ) ,
3839 expect . objectContaining ( {
3940 status : Status . PASSED ,
4041 stage : Stage . FINISHED ,
4142 name : "login-scenario1" ,
42- fullName : "nested/login.test.js: login-feature > login-scenario1" ,
43- testCaseId : "157be92d422d04e9b79d6d2fbb5020de " ,
44- historyId : "157be92d422d04e9b79d6d2fbb5020de :d41d8cd98f00b204e9800998ecf8427e" ,
43+ fullName : "dummy: nested/login.test.js: login-feature > login-scenario1" ,
44+ testCaseId : "090a2afe525cb9897eed2ea2543913a1 " ,
45+ historyId : "090a2afe525cb9897eed2ea2543913a1 :d41d8cd98f00b204e9800998ecf8427e" ,
4546 } ) ,
4647 expect . objectContaining ( {
4748 status : Status . PASSED ,
4849 stage : Stage . FINISHED ,
4950 name : "login-scenario2" ,
50- fullName : "nested/login.test.js: login-feature > login-scenario2" ,
51- testCaseId : "fbb987bcdcd21440bb0a4f4d79711387 " ,
52- historyId : "fbb987bcdcd21440bb0a4f4d79711387 :d41d8cd98f00b204e9800998ecf8427e" ,
51+ fullName : "dummy: nested/login.test.js: login-feature > login-scenario2" ,
52+ testCaseId : "7f8a96c5d7ea3db2f75c8dee77f732c2 " ,
53+ historyId : "7f8a96c5d7ea3db2f75c8dee77f732c2 :d41d8cd98f00b204e9800998ecf8427e" ,
5354 } ) ,
5455 ] ) ,
5556 ) ;
57+
58+ const logoutScenario = tests . find ( ( test ) => test . name === "logout-scenario1" ) ;
59+ expect ( logoutScenario ?. labels ) . toEqual (
60+ expect . arrayContaining ( [
61+ {
62+ name : "_fallbackTestCaseId" ,
63+ value : md5 ( JSON . stringify ( [ "logout.test.js" , "logout-feature" , "logout-scenario1" ] ) ) ,
64+ } ,
65+ ] ) ,
66+ ) ;
5667} ) ;
0 commit comments