无法加载 Intern/Leadfoot 中已安装的模块
Failed to load module an installed module in Intern/Leadfoot
元-
OS: Ubuntu 14.
硒版本:2.53
浏览器:Chrome。
浏览器版本:51.0.2704.103(64 位)
预期行为 -
已导入 selenium 驱动程序。
实际行为 -
未导入 selenium 驱动程序。
Got following parameters:
seleniumserver.port: 4444
chrome.driver.path: selenium/chromedriver/linux64/chromedriver
kibi.url: http://192.168.50.10
kibi.shield.password: undefined
kibi.shield.username: undefined
Running "intern:community" (intern) task
Error: Failed to load module node_modules/selenium-webdriver from /home/trex/Development/Siren/kibi-integration/node_modules/selenium-webdriver.js (parent: tests/functional/support/page/Datasource)
at ReadFileContext.callback <node_modules/intern/node_modules/dojo/loader.ts:831:119>
at FSReqWrap.readFileAfterOpen [as oncomplete] <fs.js:303:13>
Warning: Test failure; check output above for details. Use --force to continue.
重现步骤 -
我用Intern写了一个测试。
我的一段代码。
cat tests/functional/community/index.js
/*global define*/
define([
'intern!object',
'intern/chai!assert',
'require',
'../support/page/EnhSearchTable',
'../support/page/KibiDashboard',
'../support/page/Datasource'
], function (registerSuite, assert, require, EnhSearchTable, KibiDashboard, Datasource) {
var intern = require('intern');
var args = intern.args;
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().build();
...
...
...
});
node_modules中selenium-driver的内容:
tree -L 1 /home/trex/Development/Siren/kibi-integration/node_modules/sel
enium-webdriver/
/home/trex/Development/Siren/kibi-integration/node_modules/selenium-webdriver/
├── builder.js
├── CHANGES.md
├── chrome.js
├── edge.js
├── error.js
├── example
├── executors.js
├── firefox
├── http
├── ie.js
├── index.js
├── io
├── lib
├── LICENSE
├── net
├── node_modules
├── NOTICE
├── opera.js
├── package.json
├── phantomjs.js
├── proxy.js
├── README.md
├── remote
├── safari.js
├── test
└── testing
要在 AMD 测试中加载 Node 模块,您需要使用 intern/dojo/node
加载程序插件。尝试:
var webdriver = require('intern/dojo/node!selenium-webdriver')
元-
OS: Ubuntu 14.
硒版本:2.53
浏览器:Chrome。
浏览器版本:51.0.2704.103(64 位)
预期行为 -
已导入 selenium 驱动程序。
实际行为 -
未导入 selenium 驱动程序。
Got following parameters:
seleniumserver.port: 4444
chrome.driver.path: selenium/chromedriver/linux64/chromedriver
kibi.url: http://192.168.50.10
kibi.shield.password: undefined
kibi.shield.username: undefined
Running "intern:community" (intern) task
Error: Failed to load module node_modules/selenium-webdriver from /home/trex/Development/Siren/kibi-integration/node_modules/selenium-webdriver.js (parent: tests/functional/support/page/Datasource)
at ReadFileContext.callback <node_modules/intern/node_modules/dojo/loader.ts:831:119>
at FSReqWrap.readFileAfterOpen [as oncomplete] <fs.js:303:13>
Warning: Test failure; check output above for details. Use --force to continue.
重现步骤 -
我用Intern写了一个测试。
我的一段代码。
cat tests/functional/community/index.js
/*global define*/
define([
'intern!object',
'intern/chai!assert',
'require',
'../support/page/EnhSearchTable',
'../support/page/KibiDashboard',
'../support/page/Datasource'
], function (registerSuite, assert, require, EnhSearchTable, KibiDashboard, Datasource) {
var intern = require('intern');
var args = intern.args;
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().build();
...
...
...
});
node_modules中selenium-driver的内容:
tree -L 1 /home/trex/Development/Siren/kibi-integration/node_modules/sel
enium-webdriver/
/home/trex/Development/Siren/kibi-integration/node_modules/selenium-webdriver/
├── builder.js
├── CHANGES.md
├── chrome.js
├── edge.js
├── error.js
├── example
├── executors.js
├── firefox
├── http
├── ie.js
├── index.js
├── io
├── lib
├── LICENSE
├── net
├── node_modules
├── NOTICE
├── opera.js
├── package.json
├── phantomjs.js
├── proxy.js
├── README.md
├── remote
├── safari.js
├── test
└── testing
要在 AMD 测试中加载 Node 模块,您需要使用 intern/dojo/node
加载程序插件。尝试:
var webdriver = require('intern/dojo/node!selenium-webdriver')