This PR adds the types for the custom commands that are made available directly over the page object sections.
It should be noted NOT all custom commands are made available directly on the section object. All the custom commands are only available on the section.api object while the section object directly contains all the custom commands EXCEPT those having a namespace. This behaviour has been accounted for in the type definition.
For example, let's say the structure of the custom-commands folder is as follows:
The above custom commands would be available on the various APIs as follows (assuming a page-object named myPage with a mySection section):
// all commands are available on the `browser` object
browser.command1();
browser.command2();
browser.namespace1.command(); // WORKS
// only non-namespaced custom commands are available on the `mySection` object directly
const mySection = myPage.section.mySection;
mySection.api.command1();
mySection.command2();
mySection.namespace1.command(); // !!!ERROR
// all commands are available on the `mySection.api` object
mySection.api.command1();
mySection.command2();
mySection.namespace1.command(); // WORKS
The above is also true for the page-objects -- only non-namespaced custom commands are made directly available on the page object.
The types for custom commands on page-objects should also be fixed at some later time (after making sure that the newly added type definition is working correctly).
Fixes: #4292
This PR adds the types for the custom commands that are made available directly over the page object sections.
It should be noted NOT all custom commands are made available directly on the section object. All the custom commands are only available on the
section.api
object while thesection
object directly contains all the custom commands EXCEPT those having a namespace. This behaviour has been accounted for in the type definition.For example, let's say the structure of the
custom-commands
folder is as follows:The above custom commands would be available on the various APIs as follows (assuming a page-object named
myPage
with amySection
section):The above is also true for the page-objects -- only non-namespaced custom commands are made directly available on the page object.
The types for custom commands on page-objects should also be fixed at some later time (after making sure that the newly added type definition is working correctly).