How to use the gemini-core.BrowserAgent.create 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 / gemini / test / unit / runner / suite-runner / stateless-suite-runner.js View on Github external
describe('runner/suite-runner/stateless-suite-runner', () => {
    const sandbox = sinon.sandbox.create();
    const suite = util.makeSuiteStub();
    const browserAgent = BrowserAgent.create('default-browser');
    const runner = new StatelessSuiteRunner(suite, browserAgent);

    beforeEach(() => {
        sandbox.stub(BrowserAgent.prototype, 'getBrowser');
        sandbox.stub(BrowserAgent.prototype, 'freeBrowser');
    });

    afterEach(() => sandbox.restore());

    it('should emit `beginSuite` event', () => {
        const onBeginSuite = sinon.spy().named('onBeginSuite');

        runner.on('beginSuite', onBeginSuite);

        return runner.run()
            .then(() => assert.calledOnce(onBeginSuite));
github gemini-testing / hermione / test / lib / runner / test-runner / insistant-test-runner.js View on Github external
it('should run test in regular test runner', async () => {
            const test = makeTest();
            const config = makeConfigStub();
            const browserAgent = BrowserAgent.create();

            const runner = InsistantTestRunner.create(test, config, browserAgent);
            const workers = mkWorkers_();

            await runner.run(workers);

            assert.calledOnceWith(RegularTestRunner.create, test, browserAgent);
            assert.calledOnceWith(RegularTestRunner.prototype.run, workers);
        });
github gemini-testing / hermione / test / lib / runner / test-runner / index.js View on Github external
it('should create insistant test runner for regular test', () => {
        sandbox.spy(InsistantTestRunner, 'create');

        const test = makeTest();
        const config = makeConfigStub();
        const browserAgent = BrowserAgent.create();

        TestRunner.create(test, config, browserAgent);

        assert.calledOnceWith(InsistantTestRunner.create, test, config, browserAgent);
    });
});
github gemini-testing / hermione / test / lib / runner / test-runner / insistant-test-runner.js View on Github external
const mkRunner_ = (opts = {}) => {
        const test = opts.test || makeTest({title: 'defaultTest'});
        const config = opts.config || makeConfigStub();

        const browserId = Object.keys(config.browsers)[0];
        const browserAgent = opts.browserAgent || BrowserAgent.create();
        browserAgent.browserId = browserId;

        return InsistantTestRunner.create(test, config, browserAgent);
    };
github gemini-testing / gemini / lib / runner / browser-runner / index.js View on Github external
_runSuite(suite, stateProcessor) {
        const browserAgent = BrowserAgent.create(this._browserId, this._browserPool);
        const runner = SuiteRunner.create(suite, browserAgent, this._config);

        this.passthroughEvent(runner, [
            Events.BEGIN_SUITE,
            Events.END_SUITE,
            Events.SKIP_STATE,
            Events.BEGIN_STATE,
            Events.END_STATE,
            Events.TEST_RESULT,
            Events.UPDATE_RESULT,
            Events.ERROR,
            Events.RETRY
        ]);

        this._suiteRunners.push(runner);
        return runner.run(stateProcessor);
github gemini-testing / hermione / test / lib / runner / test-runner / regular-test-runner.js View on Github external
const mkRunner_ = (opts = {}) => {
        const test = opts.test || makeTest({title: 'defaultTest'});
        const browserAgent = opts.browserAgent || BrowserAgent.create();

        return RegularTestRunner.create(test, browserAgent);
    };
github gemini-testing / hermione / lib / runner / mocha-runner / mocha-builder.js View on Github external
_createMocha() {
        const browserAgent = BrowserAgent.create(this._browserId, this._browserPool);
        const mocha = MochaAdapter.create(browserAgent, this._config);

        eventsUtils.passthroughEvent(mocha, this, [
            RunnerEvents.BEFORE_FILE_READ,
            RunnerEvents.AFTER_FILE_READ
        ]);

        return mocha.applySkip(this._testSkipper);
    }
};
github gemini-testing / gemini / lib / runner / browser-runner / index.js View on Github external
_runSuite(suite, stateProcessor) {
        const browserAgent = BrowserAgent.create(this._browserId, this._browserPool);
        const runner = SuiteRunner.create(suite, browserAgent, this._config);

        this.passthroughEvent(runner, [
            Events.BEGIN_SUITE,
            Events.END_SUITE,
            Events.SKIP_STATE,
            Events.BEGIN_STATE,
            Events.END_STATE,
            Events.TEST_RESULT,
            Events.CAPTURE,
            Events.UPDATE_RESULT,
            Events.WARNING,
            Events.ERROR,
            Events.RETRY
        ]);