1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default PhantomJS selenium tests?

    PhantomJS selenium tests?


    Has anyone gotten phantomjs selenium tests working with Sencha Touch?

    I can run my cucumber tests with chrome, but if I switch to PhantomJS, it looks like nothing ever loads. The ext components aren't written to the dom, so I don't know what's going on.

    I'd love to switch my test run over to phantom, so it would be great if anyone has gotten this working.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    How are you creating the components?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    71
    Vote Rating
    6
    cyee is on a distinguished road

      0  

    Default


    We used phantom and selenium in Sencha 1, but we haven't had time to rewrite them for ST2. I imagine it should work though.

  4. #4
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default


    I have an Ext.Application which uses Ext.create to instantiate a number of components, which either add components in their constructor() or in their initialize listener callbacks.

    Everything works great in Safari, Mobile Safari, Chrome, and Dolphin, but the app never loads with phantom.

    I'll create a minimal failing github project and post it here.

  5. #5
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default


    A simple app with just a button looks like it works. I'm not sure why my app never loads. I rely on localstorage proxies to load data, so perhaps that is related.

  6. #6
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    13
    Vote Rating
    1
    brettAV is on a distinguished road

      0  

    Default


    I'm having the same problem. PhantomJS/CasperJS works when the app is built with "sencha app build production" but it doesn't work in "development" mode. For some reason in development mode it never gets past the loading indicator.

    I'm not sure what's the difference between the two but it's a real PITA.

  7. #7
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    13
    Vote Rating
    1
    brettAV is on a distinguished road

      0  

    Default


    I got around it by looking at the development.js microloader and more or less manually doing what it does. The key was to add the sencha-touch-all-debug.js script to my index.html. Now I keep an index-debug.html for testing and an index.html for building.

    This is what I added to index-debug.html:
    <link rel="stylesheet" type="text/css" href="resources/css/app.css">
    <script type="text/javascript" src="touch/sencha-touch-all-debug.js"></script>
    <script type="text/javascript" src="app.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">