main.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import WebDriverIO, {remote} from "webdriverio";
  2. const capabilities = {
  3. platformName: 'android',
  4. deviceName: 'ZY226TBLVN',
  5. automationName: 'UiAutomator2',
  6. appPackage: "com.clicknpush.mobile",
  7. appActivity: ".MainActivity",
  8. app: "C:\\Users\\cdmos\\Desktop\\cnp\\atlas-mobile-ts\\android\\app\\build\\outputs\\apk\\debug\\app-debug.apk",
  9. appWaitForLaunch: false, // false needed to run with expo
  10. newCommandTimeout: 3000,
  11. }
  12. jest.setTimeout(120000)
  13. const options = {
  14. path: '/wd/hub/',
  15. port: 4723,
  16. };
  17. let driver: WebDriverIO.Browser<"async">;
  18. // beforeAll(async () => {
  19. // console.log('creating driver')
  20. // driver = await remote({ ...options, capabilities});
  21. // console.log('driver created')
  22. // });
  23. // afterAll(async () => {
  24. // if (driver) {
  25. // }
  26. // });
  27. it('shows the root view', async () => {
  28. console.log('creating driver')
  29. const driver = await remote({ ...options, capabilities});
  30. console.log('driver created')
  31. const rootView = await driver.$('rootView').isDisplayed()
  32. console.log(rootView)
  33. expect(rootView).toBe(true)
  34. await driver.deleteSession();
  35. })
  36. // describe('app load', () => {
  37. // // Add tests here
  38. // });