I am new to both Automation and selenium. I am planning to write an automated tests for the UI using selenium web drivers in the py.test. I would like to know what is the best architecture (not the code) for designing the whole automation. The structure I am considering is
Framework level - contains modules for getting the page object, and functions like getItem, logout, login,logging, exceptions, startbrowser, getClickableObject, sendkeysandenter, generate report, waitforresponse, getting and releasing testbeds, loading the webdriver, Global test properties connections or any other generic functions etc
Tests - get the page object, get the item by id, click,sendkeys,verify etc. Basically I want developing the tests to be as simple as possible and anyone can get aboard and write the tests without needing to know the details of implemenation.
Is this a good way for long term maintenance and ease of writing? Any other suggestions are welcome.
Additionally, two more questions.
- Do I have to store all the pages (something like page map) statically somewhere to verify the pages are loaded correctly. For example, an enter loads a particular page. My main concern with this way is what if the resultant page change? Does the corresponding test cases have to rewritten again?
- Any action in the UI sends a command to a particular device and changes it properties. The device has a Rest API which returns its properties and this can be used if the changes in the UI is reflected on the device. Ideally, it would be better if this comparison is made for every test. If this might cause too much overhead, this can be made optional. Any better way to carry on this particular aspect?