Results 1 to 3 of 3

Thread: Unable to test button click action in ST2.3.0

  1. #1
    Sencha Premium User
    Join Date
    Oct 2014
    Posts
    4

    Default Answered: Unable to test button click action in ST2.3.0

    I am having a terrible timing getting the click method on the ST.button future to do anything in my tests of a real application. It seems I may be missing something.

    So I have distilled it down to the simplest of test apps with the simplest of tests to try to figure out what is going on. But I still do not see anything happen when the click() method is called on the button future in the test.

    Modern Application created with Ext 6.7.0

    Code:
    Ext.application({
        name: 'ButtonTest',
    
    
       launch: function () {
           let p = Ext.create('Ext.Panel', {
               fullscreen: true,
               items: [
               {
                   xtype: 'button',
                   text: 'click',
                   handler: function(){
                       Ext.ComponentQuery.query('#textFieldItemId')[0].setValue('Button was clicked');
                   }
               },
               {
                   xtype: 'textfield',
                   itemId: 'textFieldItemId',
                   value: 'button was not clicked yet'
               }
               ]
           });
           p.show();
        }
    });
    WebDriver test, which I am running against the above Sencha app watch with embedded Chrome

    Code:
    describe("ClickTest", function() {
        it("button is visible", function() {
            
            ST.button('button[text="click"]').visible();
            
        });
        it("updates text when button is clicked", function() {
            
            
            ST.button('button[text="click"]').click();
            
            ST.textField('#textFieldItemId').valueLike('Button was clicked');
            
        });
    });
    The first test passes--button is visible.
    The second test fails. If I step through it with the debugger on, nothing happens onscreen after the click() call.

    If I run the application and click the button the text changes.

    If anyone can help me identify what I am doing wrong I would much appreciate it.

  2. Unfortunately there's a bug in Sencha Test 2.3.0 (bug id ORION-2576) that prevents the "click" action from executing against various Ext JS components in a WebDriver scenario.

    For now, I'd recommend either switching back to Sencha Test 2.2.1 temporarily while we fix the issue, or you can workaround the issue in 2.3.0 by specifying x/y coordinates in the click method, e.g:

    Code:
    ST.button('mybutton').click(3, 3);

  3. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    338
    Answers
    55

    Default

    Unfortunately there's a bug in Sencha Test 2.3.0 (bug id ORION-2576) that prevents the "click" action from executing against various Ext JS components in a WebDriver scenario.

    For now, I'd recommend either switching back to Sencha Test 2.2.1 temporarily while we fix the issue, or you can workaround the issue in 2.3.0 by specifying x/y coordinates in the click method, e.g:

    Code:
    ST.button('mybutton').click(3, 3);
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  4. #3
    Sencha Premium User
    Join Date
    Oct 2014
    Posts
    4

    Default

    Thank you Daniel.
    Specifying the coordinates works great.

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
  •