CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

can we save the passed test case screenshot automatic

Open tony204 opened this issue 10 years ago • 2 comments

now we need to write I. savescreenshot to save the screenshot on the every test case. So can we save the passed test case screenshot automatic?

tony204 avatar Nov 08 '16 02:11 tony204

I think you can develop a custom Helper which will do this. You can use _after hook, access the WebDriveIO || Protractor || Nightmare and call saveScreenshot:

_after() {
    return this.helpers['WebDriverIO'].saveScreenshot(name);
}

Unfortunately due to technical reasons there is no good way to obtain test name inside a Helper :( So you can store it globally or generate a unique names for screenshots...

Anyway, what you ask for is a customization which can't be a built in feature.

DavertMik avatar Nov 12 '16 22:11 DavertMik

Any idea to do the same in nightmare?

wahengchang avatar Aug 29 '18 10:08 wahengchang