async testConnection() { return ( await this.getConnectionFromPool() ).execute('SELECT 1 FROM DUAL'); }
async _mockRequestForWebDriver(method, oneOrMoreUrls, dataOrStatusCode, additionalData) { const webDriverIOConfigUrl = this.helpers.WebDriver && this.helpers.WebDriver.options.url; await this.browser.execute( pollyWebDriver.mockRequest, method, oneOrMoreUrls, dataOrStatusCode, additionalData || undefined, this.options.url || webDriverIOConfigUrl, ); }
new _RestQuery.default(this.config, Auth.master(this.config), '_Session', { user: { __type: 'Pointer', className: '_User', objectId: this.objectId() } }).execute().then(results => { results.results.forEach(session => this.config.cacheController.user.del(session.sessionToken)); })
push(request) { if (this.busy) { this.queue.push(request); return this.run(); } else { return this.execute(request); } }
tests.add([ { title: project.name, task: () => execute(project) } ]);
// Returns a promise for an object with optional keys 'results' and 'count'. function find(config, auth, className, restWhere, restOptions, clientSDK, context) { enforceRoleSecurity('find', className, auth); return triggers.maybeRunQueryTrigger(triggers.Types.beforeFind, className, restWhere, restOptions, config, auth, context).then(result => { restWhere = result.restWhere || restWhere; restOptions = result.restOptions || restOptions; const query = new RestQuery(config, auth, className, restWhere, restOptions, clientSDK); return query.execute(); }); }
const bench = async () => { const start = process.hrtime(); for (let i = 0; i < NUMBER_OF_SCENE_TO_REGISTER; i += 1) { sceneManager.execute(String(i)); } sceneManager.queue.start(() => { displayNumberOfEventProcessedBySeconds(start); bench(); }); }
enqueue(payload) { debug('Enqueue event in worker queue'); if (this.running < this.concurrency) { this.running++; this.execute(payload); } else { this.queue.unshift(payload); } }
/** * {{> executeScript }} * * * Wraps [execute](http://webdriver.io/api/protocol/execute.html) command. */ executeScript(fn) { return this.browser.execute.apply(this.browser, arguments); }
this.api.execute(function (selector) { return document.querySelectorAll(selector).length }, [selector], function (res) { cb.call(self, res) })
pop() { debug('Pop worker queue and execute'); const payload = this.queue.pop(); if (payload) { this.execute(payload); } else { this.running--; } }
/** * {{> executeScript }} * Appium: support only web testing * * Wraps [execute](http://webdriver.io/api/protocol/execute.html) command. */ executeScript(fn) { return this.browser.execute.apply(this.browser, arguments).then(res => res.value); }
/** * {{> scrollPageToTop }} */ scrollPageToTop() { const client = this.browser; /* eslint-disable prefer-arrow-callback */ return client.execute(function () { window.scrollTo(0, 0); }); /* eslint-enable */ }
// Returns a promise for a {response, status, location} object. function create(config, auth, className, restObject, clientSDK, context) { enforceRoleSecurity('create', className, auth); var write = new RestWrite(config, auth, className, null, restObject, null, clientSDK, context); return write.execute(); }
/** * {{> scrollPageToTop }} */ scrollPageToTop() { const client = this.browser; /* eslint-disable prefer-arrow-callback */ return client.execute(function () { window.scrollTo(0, 0); }); /* eslint-enable */ }