How to use the gemini-core.ScreenShooter.prototype function in gemini-core

To help you get started, we’ve selected a few gemini-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gemini-testing / gemini / test / unit / capture-session.js View on Github external
it('should throw if capture fails', () => {
            ScreenShooter.prototype.capture.rejects(new Error('capture fails'));

            return assert.isRejected(capture(), /capture fails/);
        });
github gemini-testing / hermione / test / lib / browser / commands / assert-view / index.js View on Github external
it('should capture a screenshot image', async () => {
            const browser = stubBrowser_();
            browser.prepareScreenshot.resolves({foo: 'bar'});

            await browser.publicAPI.assertView();

            assert.calledOnceWith(ScreenShooter.prototype.capture, {foo: 'bar'});
        });
github gemini-testing / gemini / test / unit / capture-session.js View on Github external
beforeEach(() => {
        sandbox.stub(temp);

        sandbox.spy(ScreenShooter, 'create');
        sandbox.stub(ScreenShooter.prototype, 'capture').resolves();
    });
github gemini-testing / hermione / test / lib / browser / commands / assert-view / index.js View on Github external
beforeEach(() => {
        sandbox.stub(Image, 'create').returns(Object.create(Image.prototype));
        sandbox.stub(Image, 'compare').resolves(true);
        sandbox.stub(Image.prototype, 'getSize');

        sandbox.stub(fs, 'readFileSync');
        sandbox.stub(fs, 'existsSync').returns(true);

        sandbox.stub(temp, 'path');
        sandbox.stub(temp, 'attach');

        sandbox.stub(RuntimeConfig, 'getInstance').returns({tempOpts: {}});

        sandbox.spy(ScreenShooter, 'create');
        sandbox.stub(ScreenShooter.prototype, 'capture').resolves(stubImage_());

        sandbox.stub(updateRefs, 'handleNoRefImage').resolves();
        sandbox.stub(updateRefs, 'handleImageDiff').resolves();
    });