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

Unable to take a screenshot and match on the first test run #133

Open
NetanelH2 opened this issue Dec 4, 2022 · 1 comment
Open

Unable to take a screenshot and match on the first test run #133

NetanelH2 opened this issue Dec 4, 2022 · 1 comment

Comments

@NetanelH2
Copy link

When Im trying to run:
const screen = await takeScreenshot('something')
expect(screen).toMatchBaseline()

I get this error again and again:

Screenshot 2022-12-04 at 18 18 12

Additional info:
Im able to press a button with testID in my app and moving forward to the next screen.

@muhammadkhan0009
Copy link

Hey @NetanelH2
This is not the fix but setting jest timeout might help.

jest.setTimeout(50000);

describe('<Login/>', () => {
    it('takes a screenshot of the Login screen', async () => {
        await toExist('LoginWithEmailButton');
        await press('LoginWithEmailButton');
        const screen = await takeScreenshot('login');
        await toExist('goBackTestID');
        await press('goBackTestID');
        expect(screen).toMatchBaseline();
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants