- Novari-QAFrequent 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.
Related Content
- 8 months ago
- 2 years ago
- 3 years ago