Results 1 to 9 of 9

Thread: Ext.create is not a function

    Success! Looks like we've fixed this one. According to our records the fix was applied for ORION-792 in 1.0.2.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2015
    Posts
    7

    Default Ext.create is not a function

    I am trying to explore Sencha Test trial version before we go for it with our existing project (ExtJS 4.2.0), added a login page validation test, after running the test I am getting "Ext.create is not a function" error. What is missing here?
    Code:
    describe("formBind true", function() {
        it("should disable button if email is not valid", function(done) {
    
    
            // Create and reference the WindowEditor and then 
            // get reference to the button and textfield
            var loginView = Ext.create('MyApp.view.LoginView'),
                loginformview = loginView.down('loginformview'),
                button = loginformview.down('button'),      
                field  = loginformview.query('textfield'),
                panelField  = loginformview.query('combo');
    
    
            // Set the field's value to a valid email address
            // in order to have the button fire an enable event
            field[0].setValue('User Name');
            field[1].setValue('test123');
            field[2].setValue('1');
            panelField.setValue('India');
            field[3].setValue('1');
    
    
            button.on('enable', function() {
    
    
                // Set the field's value to an invalid email address (nothing)
                // in order to have the button fire a disable event
                field.setValue('');
    
    
                button.on('disable', function() {
    
    
                    //  Once the disable event has been called after setting a 
                    //  bad value, we can safely say that the button is properly 
                    //  hooked into the form's validity.  Thusly, we can 
                    //  alert the spec to return by calling the done function.
                    done();    
                });
            });
        });
    });
    ST Version: 1.0.1.38

  2. #2
    Sencha Premium Member
    Join Date
    Jul 2015
    Posts
    7

    Exclamation

    Since our code base is using Ext 4.2.0.663 and Sencha CMD version 5.0.0.160 to build the application, is there any restriction with this Sencha Test is not recognizing it As it uses Sencha CMD Version 6+

    On my system both the versions of Sencha CMDs are installed but ST doesn't have option to select version less than 6.

    Need your urgent attention on this before our trial version gets expires

  3. #3
    Sencha User
    Join Date
    Jun 2015
    Location
    Ostrava, Czech republic
    Posts
    52

    Default

    Hi kakasab.havale,
    try move your object initialize to block beforeAll(function(){ }) before block it();

    SenchaTest is able test ExtJS frameworks version 4.2 and higher.
    SenchaTest supports Cmd 6.x, but you can test remote app.

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2015
    Posts
    7

    Default

    Hi vojtech.cerveny,

    Thanks for your reply, I tried creating like an application which is given in this below URL:

    http://docs.sencha.com/sencha_test/g...lications.html

    As per your suggestion tried moving the object creation before it block but still same issue.

    Code:
    describe("loginValidation", function() {
        loginView = Ext.create('MyApp.view.LoginView') ;
        it("should pass", function() {
        ...............
        });
    });

  5. #5
    Sencha User
    Join Date
    Jun 2015
    Location
    Ostrava, Czech republic
    Posts
    52

    Default

    Hi,
    I think that problem is in sync in your code.

    Try this - it() waits for executing beforeAll and beforeEach (not this case) and then run itself. So try put creating your object to beforeAll as I have. Look on doc http://jasmine.github.io/2.4/introdu...tml#section-11 , I hope that will help.
    Code:
      describe('Some suite', function () {
            beforeAll(function () {
                Ext.create('Ext.Button', {
                    text: 'Click me',
                    renderTo: Ext.getBody(),
                    id: 'senchaButton'
                });
            });
            it('some test', function () {
                ST.button('#senchaButton')
                    .visible()
                    .and(function(button){
                        expect(button).toBeDefined();
                    })
                    .click();
            });
        });

  6. #6
    Sencha Premium Member
    Join Date
    Jul 2015
    Posts
    7

    Default

    Thanks vojtech.cerveny for your reply.

    Looks like some problem in initializing ExtJS (Not very sure, is there anything I can try to check here?)

    When I tried using your approach and ran the test then its keep on loading (running) for infinite times, even I tried with your code as well then also same loading issue!!!

    When I try to refresh the Frameworks/Ext JS, i see there is some log getting generated which I have attached herewith, please find it.


    sencha-error-20160510.log.txt

    Request your help in this regard to move further...

    Thanks in Advance!!!

  7. #7
    Sencha User
    Join Date
    Jun 2015
    Location
    Ostrava, Czech republic
    Posts
    52

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  8. #8
    Sencha Premium Member
    Join Date
    Jul 2015
    Posts
    7

    Default

    Good to know that you have fixed this in "1.0.2" version.

    Can you please tell us by when we can get this version for download? As we are completely blocked and can't proceed without this fix....

  9. #9
    Sencha User
    Join Date
    Jun 2015
    Location
    Ostrava, Czech republic
    Posts
    52

    Default

    I don't know a date, maybe some developers can provide some date.Can you test your working app? It is not unittest, but still better than nothing

Similar Threads

  1. How to create function in store and call it?
    By korndeang in forum Ext: Q&A
    Replies: 2
    Last Post: 12 May 2013, 7:17 PM
  2. Need a function call in Ext.Create
    By nitinkalra2000 in forum Ext: Discussion
    Replies: 3
    Last Post: 7 May 2013, 9:28 PM
  3. [4.0.1] Create function interceptor
    By ap in forum Ext:Bugs
    Replies: 1
    Last Post: 7 Jun 2011, 12:02 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
  •