Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide DOM Properties extensions mechanism - snapshot methods #1212

Closed
kirovboris opened this issue Feb 7, 2017 · 3 comments
Closed

Provide DOM Properties extensions mechanism - snapshot methods #1212

kirovboris opened this issue Feb 7, 2017 · 3 comments
Assignees
Labels
AREA: client AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: API TYPE: enhancement The accepted proposal for future implementation.
Milestone

Comments

@kirovboris
Copy link
Collaborator

kirovboris commented Feb 7, 2017

We should add .addCustomMethods() method for extending snapshot with the following API:

var getEl = Selector('.el').addCustomMethods({
    method1: (node, param1, ..., paramN) => {
        
    },
    ....
    methodN: (node, param1, ..., paramN) => {
        
    }
});

await getEl.addCustomMethods({
    method: (node, param1, param2) => {...}
}).method(param1, param2);

OR

var getEl = Selector('.el').addCustomMethods({
    method1: (param1, ..., paramN) => {
        
    },
    ....
    methodN: (param1, ..., paramN) => {
        
    }
});

await getEl.addCustomMethods({
    method: (param1, param2) => {
        //This way means we always have global selector function in custom method
       return fnCode( selector() );
    }
}).method(param1, param2);

What do you think @DevExpress/testcafe-docs ?

@kirovboris kirovboris self-assigned this Feb 7, 2017
@kirovboris
Copy link
Collaborator Author

I'm working on this.

@inikulin
Copy link
Contributor

inikulin commented Feb 7, 2017

I vote for the first one

@inikulin inikulin added this to the Planned features milestone Feb 7, 2017
@inikulin inikulin added AREA: client AREA: server SYSTEM: API TYPE: enhancement The accepted proposal for future implementation. labels Feb 7, 2017
kirovboris added a commit to kirovboris/testcafe-phoenix that referenced this issue Feb 13, 2017
kirovboris added a commit to kirovboris/testcafe-phoenix that referenced this issue Feb 14, 2017
kirovboris added a commit to kirovboris/testcafe-phoenix that referenced this issue Feb 21, 2017
kirovboris added a commit to kirovboris/testcafe-phoenix that referenced this issue Feb 22, 2017
AlexanderMoskovkin pushed a commit to AlexanderMoskovkin/testcafe that referenced this issue Mar 15, 2017
@AlexanderMoskovkin AlexanderMoskovkin modified the milestones: Sprint #5, Planned features Mar 15, 2017
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris added a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
)

* Added .addCustomMethods method (closes DevExpress#1212)

* Fixed remarks

* Fixed callsite

* Add custom functions via ClientFunctionBuilder

* Fixed remarks

* Move argument validation tests to unit
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: API TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

4 participants