         test.recordFailure(withDescription: description, inFile: file, atLine: line, expected: false)
 
         if automaticScreenshotsBehaviour.contains(.onFailure) {
-            test.attachScreenshot(name: "Failed \"\(currentStepName)\"")
+            test.attachScreenshot()
         }
     }
 

        automaticScreenshotsLifetime = lifetime
    }

    func attachScreenshot(name: String) {
        // if tests have no host app there is no point in making screenshots
        guard Bundle.main.bundlePath.hasSuffix(".app") else { return }

        let screenshot = XCUIScreen.main.screenshot()
        let attachment = XCTAttachment(screenshot: screenshot, quality: automaticScreenshotsQuality)
        attachment.name = name
        attachment.lifetime = automaticScreenshotsLifetime
        add(attachment)
    }

            state.currentStepDepth += 1
            state.currentStepLocation = (file, line)
            if automaticScreenshotsBehaviour.contains(.beforeStep) {
                attachScreenshot()
            }
            step.function(matchStrings)
            if automaticScreenshotsBehaviour.contains(.afterStep) {
                attachScreenshot()
            }
            state.currentStepLocation = nil
            state.currentStepDepth -= 1
