Results 1 to 4 of 4

Thread: Playable - fn config

  1. #1
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    452
    Answers
    19

    Default Answered: Playable - fn config

    What's the proper way of using the fn config on ST.playable.Playable? I tried to use it for executing some arbitrary code before I knew how to do it with ST.element, but it would always give a JavaScript error.

    Also, what is the difference between an injectable and a non-injectable event?

  2. To execute arbitrary code in the browser use ST.execute(fn) or ST.element(locator).execute(fn). With the second option the fn you provide can get the element or component as a parameter. You can return simple javascript objects and then use an and() function to make assertions on them.

    Code:
    ST.button('@futureCmp')
        .press()
        .execute(function (button) {
            return ST.isClassic ? button.pressed : button.getPressed();
        })
        .and(function () {
            expect(this.future.data.executeResult).toBeTruthy();
        })

  3. #2
    Sencha User
    Join Date
    Mar 2016
    Posts
    59
    Answers
    6

    Default

    To execute arbitrary code in the browser use ST.execute(fn) or ST.element(locator).execute(fn). With the second option the fn you provide can get the element or component as a parameter. You can return simple javascript objects and then use an and() function to make assertions on them.

    Code:
    ST.button('@futureCmp')
        .press()
        .execute(function (button) {
            return ST.isClassic ? button.pressed : button.getPressed();
        })
        .and(function () {
            expect(this.future.data.executeResult).toBeTruthy();
        })

  4. #3
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    452
    Answers
    19

    Default

    Perfect! That's exactly what I was looking for - thanks.

    Great work on this tool - I really like what I've seen so far.

  5. #4
    Sencha User
    Join Date
    Mar 2016
    Posts
    59
    Answers
    6

    Default

    Injectable events are generally "native browser" events such as click, mouse movement, etc... currently only click/tap and type are supported in the EA release when using a webdriver Scenario. All events are supported for in-browser Scenarios as in 1.0.

Similar Threads

  1. Sync futures and playable
    By Wilky in forum Q&A
    Replies: 2
    Last Post: 12 Sep 2016, 12:23 AM
  2. Replies: 0
    Last Post: 17 Aug 2012, 4:03 AM
  3. Panel subclassing problem (Default Config and Hardcoded Config)
    By Johny Joe in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 15 Sep 2009, 11:22 AM
  4. Replies: 7
    Last Post: 15 Dec 2008, 9:16 AM

Posting Permissions

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