Results 1 to 7 of 7

Thread: PhantomJS selenium tests?

  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    How are you creating the components?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    71
    Vote Rating
    6
      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
      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
      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
      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
      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">

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •