status-im / desktop-qa-automation

Legacy desktop tests
6 stars 12 forks source link

User data is always None #616

Closed anastasiyaig closed 3 months ago

anastasiyaig commented 3 months ago

All the tests with predefined user data are not working with this data. New accounts are created instead. That has to be fixed.

Examples:

https://github.com/status-im/desktop-qa-automation/blob/229471cee3e6c006880457c526617414c67e454f/tests/messages/test_messaging_group_chat.py

Screenshot 2024-03-27 at 11 31 19

https://github.com/status-im/desktop-qa-automation/blob/229471cee3e6c006880457c526617414c67e454f/tests/communities/test_communities_pin_and_unpin_messages.py

The local db for account is stored in local_run_results folder (when running tests locally) This is being taken from this -d parameter here https://github.com/status-im/desktop-qa-automation/blob/229471cee3e6c006880457c526617414c67e454f/driver/aut.py#L118

So, if we want to start application with existing data folder, this data folder should be present in the location in advance, before the test starts

I think , a solution here could be that we mark tests that use predefined data somehow, and then we create if condition for startaut function to recognise some flag - if the tests do need data in advance (we create it and put into repository), then execute command with certain hardcoded path (where the data folder lives) , else create new account (new data folder with random name as we have now)

maybe we can fix something here

if user_data is not None:
            user_data.copy_to(self.app_data / 'data')

https://github.com/status-im/desktop-qa-automation/blob/229471cee3e6c006880457c526617414c67e454f/driver/aut.py#L27

anastasiyaig commented 3 months ago

okay, i think i found the issue.

https://github.com/status-im/desktop-qa-automation/blob/229471cee3e6c006880457c526617414c67e454f/fixtures/aut.py#L49

multiple instances fixture is not taking any arguments, when it should take user_data