How to use the gemini-core.BrowserAgent.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.

github gemini-testing / hermione / test / lib / runner / test-runner / regular-test-runner.js View on Github external
it('should be emitted even on browser get fail', async () => {
                const onTestBegin = sinon.stub().named('onTestBegin');
                const runner = mkRunner_()
                    .on(Events.TEST_BEGIN, onTestBegin);

                BrowserAgent.prototype.getBrowser.rejects();

                await run_({runner});

                assert.calledOnce(onTestBegin);
            });
        });
github gemini-testing / hermione / test / lib / runner / test-runner / insistant-test-runner.js View on Github external
it('should create test runner with high priority browser agent', async () => {
                    onFirstTestRun_((innerRunner) => innerRunner.emit(Events.TEST_FAIL, makeFailedTest_()));

                    const browserAgent = Object.create(BrowserAgent.prototype);
                    const highPriorityBrowserAgent = Object.create(HighPriorityBrowserAgent.prototype);
                    HighPriorityBrowserAgent.create
                        .withArgs(browserAgent).returns(highPriorityBrowserAgent);
                    const runner = mkRunnerWithRetries_({browserAgent});

                    await run_({runner});

                    assert.calledWith(RegularTestRunner.create, sinon.match.any, highPriorityBrowserAgent);
                });
github gemini-testing / gemini / test / unit / runner / suite-runner / skipped-suite-runner.js View on Github external
beforeEach(() => {
        sandbox.stub(BrowserAgent.prototype, 'getBrowser');
        sandbox.stub(BrowserAgent.prototype, 'freeBrowser');
        runner = mkRunner_();
    });
github gemini-testing / gemini / test / unit / runner / suite-runner / regular-suite-runner.js View on Github external
.then(() => {
                        assert.calledWith(BrowserAgent.prototype.freeBrowser, sinon.match.any, {force: false});
                    });
            });
github gemini-testing / gemini / test / unit / runner / suite-runner / stateless-suite-runner.js View on Github external
.then(() => {
                assert.notCalled(BrowserAgent.prototype.getBrowser);
                assert.notCalled(BrowserAgent.prototype.freeBrowser);
            });
    });
github gemini-testing / hermione / test / lib / runner / test-runner / regular-test-runner.js View on Github external
beforeEach(() => {
        sandbox.stub(BrowserAgent.prototype, 'getBrowser').resolves(stubBrowser_());
        sandbox.stub(BrowserAgent.prototype, 'freeBrowser').resolves();

        sandbox.stub(WorkersRegistry.prototype, 'register').returns(mkWorkers_());

        sandbox.stub(AssertViewResults, 'fromRawObject').returns(Object.create(AssertViewResults.prototype));
        sandbox.stub(AssertViewResults.prototype, 'get').returns({});

        sandbox.stub(logger, 'warn');
    });
github gemini-testing / gemini / test / unit / runner / suite-runner / stateless-suite-runner.js View on Github external
beforeEach(() => {
        sandbox.stub(BrowserAgent.prototype, 'getBrowser');
        sandbox.stub(BrowserAgent.prototype, 'freeBrowser');
    });
github gemini-testing / gemini / test / unit / runner / suite-runner / regular-suite-runner.js View on Github external
beforeEach(() => {
        browser = util.browserWithId('default-browser');
        sandbox.stub(browser, 'openRelative');
        browser.openRelative.returns(Promise.resolve());

        sandbox.stub(BrowserAgent.prototype, 'getBrowser');
        sandbox.stub(BrowserAgent.prototype, 'freeBrowser');

        BrowserAgent.prototype.getBrowser.returns(Promise.resolve(browser));
        BrowserAgent.prototype.freeBrowser.returns(Promise.resolve());

        sandbox.stub(CaptureSession.prototype);
        CaptureSession.prototype.runActions.returns(Promise.resolve());
        CaptureSession.prototype.browser = browser;

        stateRunner = sinon.createStubInstance(StateRunner);
        stateRunnerFactory = sandbox.stub(StateRunnerFactory);
        stateRunnerFactory.create.returns(stateRunner);
    });
github gemini-testing / gemini / test / unit / runner / suite-runner / skipped-suite-runner.js View on Github external
beforeEach(() => {
        sandbox.stub(BrowserAgent.prototype, 'getBrowser');
        sandbox.stub(BrowserAgent.prototype, 'freeBrowser');
        runner = mkRunner_();
    });