UNPKG

nightwatch

Version:

Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.

18 lines (17 loc) 811 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const { WebElement } = require('selenium-webdriver'); const Factory = require('./factory.js'); module.exports.active = function (nightwatchInstance) { const { transportActions } = nightwatchInstance; const node = nightwatchInstance.queue.add(function findActiveElement() { return transportActions.getActiveElement(); }); const instance = new WebElement(nightwatchInstance.transport.driver, node.deferred.promise); return Factory.create(instance, null, nightwatchInstance); }; module.exports.root = function (nightwatchInstance) { return Factory.create(null, null, nightwatchInstance); }; module.exports.createScopedWebElements = Factory.createScopedWebElements; module.exports.create = Factory.create;