Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note about capturing screenshots for caught assertion errors #6316

Open
miherlosev opened this issue Jun 17, 2021 · 0 comments
Open

Add a note about capturing screenshots for caught assertion errors #6316

miherlosev opened this issue Jun 17, 2021 · 0 comments
Labels
AREA: docs An issue related to the product documentation. TYPE: enhancement The accepted proposal for future implementation.

Comments

@miherlosev
Copy link
Collaborator

A customer sets the takeScreenshotOnFails option.

The screenshot will be captured even the error is caught.

import fs from 'fs';

fixture `Fixture`;

test('Test', async t => {
    if(!fs.existsSync('screenshots'))
        fs.mkdirSync('screenshots');
    
    try {
        await t.expect(false).ok();
    }
    catch (e) {
    }

    await t.expect(fs.readdirSync('screenshots').length).eql(0);
});

See more information in #5157 issue.

@miherlosev miherlosev added TYPE: enhancement The accepted proposal for future implementation. AREA: docs An issue related to the product documentation. labels Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: docs An issue related to the product documentation. TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

1 participant