testproject-io / javascript-opensdk

TestProject OpenSDK for Node.js
Apache License 2.0
24 stars 16 forks source link

Cannot read property 'createSession' of undefined #42

Closed lareinamarieyu closed 2 years ago

lareinamarieyu commented 2 years ago

Hello, I'm getting this error below while trying to initialize MobileBuilder(AndroidDriver). There's not much documentation on how to use it, so I figured to just post here instead.

describe("Basic Android Test", () => {
  let driver = AndroidDriver;

  before(async () => {
    driver = await new MobileBuilder(AndroidDriver)
    .withProjectName('My first Project')
    .withReportName("My first Project")
    .withCapabilities(
      {capabilities: {
        udid: android.udid,
        appPackage: testProject.appPackage,
        appActivity: testProject.appActivityUrl
      }})
    .withToken(testProject.developerToken)
    .withRemoteAgent(testProject.remoteAgentUrl)
    .build();
  });
});

TypeError: Cannot read property 'createSession' of undefined

  at MobileBuilder.<anonymous> (node_modules/@tpio/javascript-opensdk/dist/src/sdk/drivers/mobileBuilder.js:24:36)
  at Generator.next (<anonymous>)
  at /home/iamgroot/Documents/repo/testproject_js/node_modules/@tpio/javascript-opensdk/dist/src/sdk/drivers/mobileBuilder.js:8:71
  at new Promise (<anonymous>)
  at __awaiter (node_modules/@tpio/javascript-opensdk/dist/src/sdk/drivers/mobileBuilder.js:4:12)
  at MobileBuilder.build (node_modules/@tpio/javascript-opensdk/dist/src/sdk/drivers/mobileBuilder.js:22:16)
  at Context.<anonymous> (file:///home/iamgroot/Documents/repo/testproject_js/tests/login_nonSubscriber.js:23:6)
  at processImmediate (internal/timers.js:464:21)
s-glatshtein commented 2 years ago

Thank you for opening this issue. We will investigate it and get back to you

vitalybu commented 2 years ago

@lareinamarieyu, did you have a look at the basic Android test example: https://github.com/testproject-io/javascript-opensdk/blob/master/tests/mobile/basicAndroid.spec.ts? Can you try duplicating it and use it in your project?

lareinamarieyu commented 2 years ago

hi @vitalybu, yup. i also spoke to Tal from TestProject and he has informed me that the javascript sdk is in beta mode and the mobile driver with this sdk doesn't work and that the dev team is currently working on fixing this issue