Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Ext.create is not a function

  1. #11
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    772
    Vote Rating
    57
      0  
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  2. #12
    Sencha - Test Dev Team
    Join Date
    Mar 2016
    Posts
    51
    Vote Rating
    1
      0  

    Default

    There may be some state problem with your Scenario Runner and the browser. Try closing the Running and re-opening it when problems occur.

    In your workspace opened in Studio do you have your Application? I notice that the URL for your test seems to be an locally hosted app. If your workspace doesn't include your App then you will have to use "Launch application" since Studio can't make a build with no app sources.

    When your test completes the web browser should be taken to a "parked" page with the text "Sencha Test Session" and "This browser window is available for work from Sencha Studio."

    Normally for application unit tests the workspace opened by Studio will contain the Application code and Studio can make a special build which does not require the app to load but rather makes available all classes in the app for instantiation in tests for unit testing.

    Sorry about the attachment. I'll try again.

  3. #13
    Sencha - Test Dev Team
    Join Date
    Mar 2016
    Posts
    51
    Vote Rating
    1
      0  

    Default

    I think I fixed up that previous attachment about a "Development Build" dialog. Take a look.

  4. #14
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    772
    Vote Rating
    57
      0  

    Default

    Quote Originally Posted by craigcomstock View Post
    There may be some state problem with your Scenario Runner and the browser. Try closing the Running and re-opening it when problems occur.
    Yes I've been doing this.

    Quote Originally Posted by craigcomstock View Post
    In your workspace opened in Studio do you have your Application? I notice that the URL for your test seems to be an locally hosted app. If your workspace doesn't include your App then you will have to use "Launch application" since Studio can't make a build with no app sources.
    I don't have the app. Yes the url comes from localhost which points to testing build.


    Quote Originally Posted by craigcomstock View Post
    When your test completes the web browser should be taken to a "parked" page with the text "Sencha Test Session" and "This browser window is available for work from Sencha Studio."
    Yep I can see that page. So here's how I found it how to run it with less problems. So I check first them the browser, I wait for the app to be loaded, once is loaded I run the tests,
    they pass, then the browser page is redirected to parking. Then:

    - If I hit run, the app loads for 2 seconds, the load is not finished, tests fail, and then redirect to parking
    - If I uncheck and check again, then wait for app to load, and hit run, the tests pass, then redirect to parking.

    That's a weird behavior of running.


    Quote Originally Posted by craigcomstock View Post
    Normally for application unit tests the workspace opened by Studio will contain the Application code and Studio can make a special build which does not require the app to load but rather makes available all classes in the app for instantiation in tests for unit testing.

    Sorry about the attachment. I'll try again.
    Ok, got it, I'm going to add the login (login from other page, it's a multi page app) scenario into unit test also, so then try to run the app as you say. Since the ST1 the login data was hardcoded into the bulding/index.html page, with migration to ST2 I haven't changed that for unit tests, just for functional.
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  5. #15
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    772
    Vote Rating
    57
      0  

    Default

    Ok, I can see your attachment now, thanks.
    So how to add the App code in the Studio ? Through the Files Tab ? Also what folders to add (see attachments)

    Btw, I've looked through the doc guides but couldn't find anything about how to setup and run Unit Tests, unless I missed something.

    Screen Shot 2017-04-19 at 11.46.18 PM.png
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  6. #16
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    772
    Vote Rating
    57
      0  

    Default

    I really would need an answer to last comment. Thanks.
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  7. #17
    Sencha - Test Dev Team
    Join Date
    Mar 2016
    Posts
    51
    Vote Rating
    1
      0  

    Default

    Ah. If you wish to test against the app source and do unit testing you should create a workspace that includes the application code. According to your directory listing the workspace (workspace.json) is at the level of the tests directory and so won't include the application source code above it. Do you already have a workspace.json file in the directory above tests? If you do open that with Open Project menu item.

    There are some good getting started docs at

    http://docs.sencha.com/sencha_test/2...g_started.html

    which include a section on unit tests:

    http://docs.sencha.com/sencha_test/2...nal_tests.html

    Some of the docs are a bit out of date but the basic principles remain the same.

    Let me know how it goes. Thanks.

  8. #18
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    772
    Vote Rating
    57
      1  

    Default

    Thanks man, went well.
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

Page 2 of 2 FirstFirst 12

Similar Threads

  1. How do I create a global function
    By stay-linked in forum Sencha Architect 4.x: Q&A
    Replies: 1
    Last Post: 29 Mar 2017, 2:23 PM
  2. [FIXED] Ext.create is not a function
    By kakasab.havale in forum Bugs
    Replies: 8
    Last Post: 19 May 2016, 4:25 AM
  3. Need a function call in Ext.Create
    By nitinkalra2000 in forum Ext: Discussion
    Replies: 3
    Last Post: 7 May 2013, 9:28 PM
  4. How to create our own Ext.function in Extjs?
    By yagi in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 4 Jul 2010, 12:08 PM

Tags for this Thread

Posting Permissions

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