Giter VIP home page Giter VIP logo

testcafe-browser-provider-android's People

Contributors

bradley-energyaustralia avatar bsmithb2 avatar cityreader avatar htho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

testcafe-browser-provider-android's Issues

Screenshot fails: Error: EXDEV: cross-device link not permitted, rename ...

Screenshots can not be taken if the target directory is in another filesystem than the cwd.

Was unable to take a screenshot due to an error.

Error: EXDEV: cross-device link not permitted, rename 'screen.png' -> '/home/testsystem/network/share/test/android_chrome/master/0_Start.png'
    at renameSync (fs.js:598:3)
    at BrowserProviderPluginHost._callee6$ (/home/testsystem/TestSuite/node_modules/testcafe-browser-provider-android/lib/index.js:581:48)
    at tryCatch (/home/testsystem/TestSuite/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/testsystem/TestSuite/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/home/testsystem/TestSuite/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/home/testsystem/TestSuite/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/testsystem/TestSuite/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

This can be resolved by switching from rename to copy&unlink
https://stackoverflow.com/questions/37153666/error-exdev-cross-device-link-not-permitted-rename-tmp-on-ubuntu-16-04-lts#44146825

Better Error Messages: Browser not installed?

There should be better error messages.

  1. No devices listed by adb devices (exception)
  2. For each device: Chrome or Firefox not installed (info)
  3. None of the devices has Chrome or Firefox installed (exception)

This would also help debug #11

Devices connected via tcpip dont work

When connected via tcpip (https://developer.android.com/studio/command-line/adb#wireless) testcafe-browser-provider throws an exception:

[android] init()
[android] ---- Device/Browser List ----
[android] SM-T580:tablet:5555:chrome
[android] SM-T580:tablet:5555:firefox
[android] isValidBrowserName(browserName='SM-T580:tablet:5555:chrome')
[android] openBrowser(id='D78uKdY', url='http://172.16.120.9:34415/browser/connect/D78uKdY', browserName='SM-T580:tablet:5555:chrome')
[android] closeBrowser(id='D78uKdY(SM-T580:tablet:5555:chrome)')
Error: Was unable to open the browser "android:SM-T580:tablet:5555:chrome" due to error.
TypeError: Cannot read property 'packageName' of undefined
    at BrowserProviderPluginHost._callee10$ (/home/testsystem/test/node_modules/testcafe-browser-provider-android/lib/index.js:711:102)
    at tryCatch (/home/testsystem/test/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/testsystem/test/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/home/testsystem/test/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/home/testsystem/test/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/testsystem/test/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/home/testsystem/test/node_modules/core-js/library/modules/_export.js:36:28)
    at /home/testsystem/test/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
    at BrowserProviderPluginHost._kill (/home/testsystem/test/node_modules/testcafe-browser-provider-android/lib/index.js:719:12)
    at /home/testsystem/test/node_modules/testcafe/src/browser/connection/index.js:87:32
    at Generator.throw (<anonymous>)
    at step (/home/testsystem/test/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/testsystem/test/node_modules/babel-runtime/helpers/asyncToGenerator.js:30:13
    at process._tickCallback (internal/process/next_tick.js:68:7)

This is because of the naiive assumption that the browserName always has exactly two colons (:) ${model}:${deviceId}:${browser.name}. But this is not true for devices that are connected via tcpip. They have four colons: ${model}:${deviceHostname}:${port}:${browser.name}

Start Chrome in incognito mode

Although the current solution makes sure that each run starts with a clean browser, it is still undesireble to reset the complete browser. Some users might test on devices that are not exclusively used for testing. The current approach deletes all user data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.