javascript - Protractor E2E Testing - E/launcher - Error: Error: Cannot find module 'wd' -


i'm trying exuceted automated test protractor, when app open , try write in input field, return message:

c:\projetos\pessoal\ionic_app\tests (master)

protractor conf.js

[09:23:42] i/launcher - running 1 instances of webdriver [09:23:42] i/hosted - using selenium server @ http://localhost:4723/wd/hub [09:25:07] e/launcher - error: error: cannot find module 'wd'     @ function.module._resolvefilename (module.js:469:15)     @ function.module._load (module.js:417:25)     @ module.require (module.js:497:17)     @ require (internal/module.js:20:19)     @ onprepare (c:\projetos\pessoal\ionic_app\tests\conf.js:18:18)     @ q_1.promise (c:\users\c1401314\appdata\roaming\npm\node_modules\protractor\lib\util.ts:48:39)     @ function.promise (c:\users\c1401314\appdata\roaming\npm\node_modules\protractor\node_modules\q\q.js:682:9)     @ object.runfilenameorfn_ (c:\users\c1401314\appdata\roaming\npm\node_modules\protractor\lib\util.ts:39:10)     @ plugins_.onprepare.then (c:\users\c1401314\appdata\roaming\npm\node_modules\protractor\lib\runner.ts:103:21)     @ _fulfilled (c:\users\c1401314\appdata\roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54) [09:25:07] e/launcher - process exited error code 100enter code here 

i'm used appium , genymotion emulated android device

appium return:

    [appium] welcome appium v1.6.5     [appium] appium rest http interface listener started on 0.0.0.0:4723     [http] --> post /wd/hub/session {"desiredcapabilities":{"platformname":"android","platformversion":"7.0","devicename":"nexus","browsername":"","autowebview":true,"app":"c:\\appium_drivers\\apks\\android-release.apk","count":1}}     [debug] [mjsonwp] calling appiumdriver.createsession() args: [{"platformname":"android","platformversion":"7.0","devicename":"nexus","browsername":"","autowebview":true,"app":"c:\\appium_drivers\\apks\\android-release.apk","count":1},null,null]     [debug] [basedriver] event 'newsessionrequested' logged @ 1503057934342 (09:05:34 gmt-0300 (hora oficial brasil))     [appium] creating new androiddriver (v1.24.3) session     [appium] capabilities:     [appium]   platformname: 'android'     [appium]   platformversion: '7.0'     [appium]   devicename: 'nexus'     [appium]   browsername: ''     [appium]   autowebview: true     [appium]   app: 'c:\\appium_drivers\\apks\\android-release.apk'     [appium]   count: 1 [debug] [chromedriver] changed state 'online' [appium] new androiddriver session created successfully, session 967301ea-6ced-4801-9f5a-e3d6b68c2e7f added master session list [debug] [basedriver] event 'newsessionstarted' logged @ 1503059100927 (09:25:00 gmt-0300 (hora oficial brasil)) [debug] [mjsonwp] responding client driver.createsession() result: {"platform":"linux","webstorageenabled":false,"takesscreenshot":true,"javascriptenabled":true,"databaseenabled":false,"networkconnectionenabled":true,"locationcontextenabled":false,"warnings":{},"desired":{"platformname":"android","platformversion":"7.0","devicename":"nexus","browsername":"","autowebview":true,"app":"c:\\appium_drivers\\apks\\android-release.apk","count":1},"platformname":"android","platformversion":"7.0","devicename":"192.168.104.101:5555","browsername":"","autowebview":true,"app":"c:\\appium_drivers\\apks\\android-release.apk","count":1,"deviceudid":"192.168.104.101:5555","devicescreensize":"1200x1920","devicemodel":"nexus","devicemanufacturer":"genymotion","apppackage":"br.com.bematech.staff","appwaitpackage":"br.com.bematech.staff","appactivity":"br.com.bematech.staff.mainactivity","appwaitactivity":"br.com.bematech.staff.mainactivity"} [http] <-- post /wd/hub/session 200 78056 ms - 941 [http] --> post /wd/hub/session/967301ea-6ced-4801-9f5a-e3d6b68c2e7f/timeouts {"type":"script","ms":11000} [mjsonwp] driver proxy active, passing request on via http proxy [debug] [jsonwp proxy] proxying [post /wd/hub/session/967301ea-6ced-4801-9f5a-e3d6b68c2e7f/timeouts] [post http://127.0.0.1:8000/wd/hub/session/98599620f036c57ea39d899794f9b5c0/timeouts] body: {"type":"script","ms":11000} [debug] [jsonwp proxy] got response status 200: {"sessionid":"98599620f036c57ea39d899794f9b5c0","status":0,"value":null} [jsonwp proxy] replacing sessionid 98599620f036c57ea39d899794f9b5c0 967301ea-6ced-4801-9f5a-e3d6b68c2e7f [http] <-- post /wd/hub/session/967301ea-6ced-4801-9f5a-e3d6b68c2e7f/timeouts 200 8 ms - 76 [http] --> delete /wd/hub/session/967301ea-6ced-4801-9f5a-e3d6b68c2e7f {} [debug] [mjsonwp] calling appiumdriver.deletesession() args: ["967301ea-6ced-4801-9f5a-e3d6b68c2e7f"] [debug] [basedriver] event 'quitsessionrequested' logged @ 1503059101119 (09:25:01 gmt-0300 (hora oficial brasil)) [debug] [androiddriver] shutting down android driver [debug] [androiddriver] stopping chromedriver context webview_br.com.bematech.staff [debug] [chromedriver] changed state 'stopping' [debug] [jsonwp proxy] proxying [delete /] [delete http://127.0.0.1:8000/wd/hub/session/98599620f036c57ea39d899794f9b5c0] no body [debug] [jsonwp proxy] got response status 200: "{\"sessionid\":\"98599620f036c57ea39d899794f9b5c0\",\"status\":0,\"value\":null}" [debug] [chromedriver] changed state 'stopped' [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android-sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","192.168.104.101:5555","shell","am","force-stop","br.com.bematech.staff"] [debug] [adb] pressing home button [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android-sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","192.168.104.101:5555","shell","input","keyevent",3] [debug] [androidbootstrap] sending command android: {"cmd":"shutdown"} [debug] [androidbootstrap] [bootstrap log] [debug] got data client: {"cmd":"shutdown"} [debug] [androidbootstrap] [bootstrap log] [debug] got command of type shutdown [debug] [androidbootstrap] [bootstrap log] [debug] returning result: {"status":0,"value":"ok, shutting down"} [debug] [androidbootstrap] received command result bootstrap [debug] [uiautomator] shutting down uiautomator [debug] [uiautomator] moving state 'stopping' [debug] [uiautomator] uiautomator shut down [debug] [uiautomator] moving state 'stopped' [debug] [adb] attempting kill uiautomator processes 

this folder structure:

--tests conf.js spec.js

conf.js

 exports.config={     seleniumaddress:'http://localhost:4723/wd/hub',     specs:['spec.js'],     capabilities: {         platformname: 'android',         platformversion: '7.0',         devicename: 'nexus',         browsername: "",         autowebview: true,          app: 'c:\\appium_drivers\\apks\\android-release.apk'     },     baseurl: '127.0.0.1:4723',      onprepare: function () {         let wd = require('wd'),             protractor = require('protractor'),             wdbridge = require('wd-bridge')(protractor,wd);         wdbridge.initfromprotractor(exports.config);     } }; 

spec.js

  describe('firstspecstaff',function () {            browsername = onprepare('0.0.0.0', port);           it('makelogin',function () {           element(by.id('user')).sendkeys('admin@admin');           element(by.id('password')).sendkeys('admin');         });  }); 

have installed wd npm module?? e.g npm wd --save-dev


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -