Skip to content

Commit c7a8180

Browse files
authored
fix(ios): save statuses of steps (#9)
1 parent 52c99d6 commit c7a8180

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/steps/wrapWithSteps.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@ export function wrapWithSteps(detox: typeof import('detox'), worker: any, allure
2525

2626
if (device.getPlatform() === 'ios') {
2727
const ws = worker._client._asyncWebSocket;
28-
const send = ws.send.bind(ws);
28+
const send = ws.send.bind(ws) as (...args: any[]) => Promise<{ type?: string }>;
2929
ws.send = async (...args: any[]) => {
3030
const desc = iosDescriptionMaker(args[0]);
3131
return desc
3232
? allure.step(desc.message, () => {
3333
if (desc.args) allure.parameters(desc.args);
34-
return send(...args);
34+
return send(...args).then((result: { type?: string }) => {
35+
if (result?.type === 'testFailed') {
36+
allure.status('failed');
37+
}
38+
39+
return result;
40+
});
3541
})
3642
: send(...args);
3743
};

0 commit comments

Comments
 (0)