进口了硒驱动剂。
不会导入硒驱动程序。
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
答案 0 :(得分:1)
要在AMD测试中加载Node模块,您需要使用intern/dojo/node
加载器插件。尝试:
var webdriver = require('intern/dojo/node!selenium-webdriver')