Novari-QA's avatar
Novari-QA
Frequent Contributor
7 years ago
Status:
New Idea

Have Script Routine identify functions inside of objects

We would love for the ability for keyword tests to have the ability to run functions found inside of objects.


For example: 

var Login = {
  Positive: function(username, password) {
    //Run code here
  }
}

However, the script routine can not find the Login.Positive function.

It would be extremely useful for us if it could.

1 Comment

  • Novari-QA's avatar
    Novari-QA
    Frequent Contributor

    Another example I have is;

    Within my application I have objects duplicated in multiple locations throughout.  Since I cannot name a class the same thing twice I am forced to predefine the class or postdefine the class with a unique name.

    For example, in multiple locations on our website we have a feature called PrivacyModal. It is the same modal, but acts differently depending on its state and location in the application. 

    Preferably for someone coming from a non-coders perspective, I would like to identify the feature via the page i would be testing it on. So I would drag the object "[page].js" into my keyword test. Then I would presented with actions to perform on that page.

    Currently since I cannot build my scripts this way, I have to organize the scripts a different way. My new method has me creating a folder called [page] with sub classes which are the actions on the page. 

    In the example of logging into the system.

    What I want:
    LoginPage.js

    With an object called PrivacyModal
    - and this object has functions; PrivacyModal.Close, PrivacyModal.Open, PrivacyModal.Toggle
    However since we cannot do this I have to bring everything up one level

    What I have
    Folder called LoginPage

    Class called PrivacyModal.js
    Functions called; Close, Open, Toggle.

    This works, until i get to another page that has that function. we can call it splashpage.js

    since PrivacyModal.js already exsists, we cannot call it that. So i am forced to give it a unique name



    I hope this makes my issue clear.