Closed Bug 1431490 Opened 7 years ago Closed 7 years ago

Can't load prepopulated test DB in XCUITest

Categories

(Firefox for iOS :: Build & Test, enhancement)

Other
iOS
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios + ---

People

(Reporter: njpark, Assigned: garvan)

References

Details

Attachments

(1 file)

55 bytes, text/x-github-pull-request
njpark
: review+
Details | Review
One can download and save the application data from ios app, and load it next time the app is launched, to prepopulate the app with the data when running xcuitest. This would enable us to do many things, including performance and endurance test. But currently browser.db is stored in the shared container folder, so reloading the .xcappdata would only show the last visited page on the browser, and nothing else. If we can save the db inside the app data (at least for certain test schemes) it would be great.
I believe we have discussed moving the db out of this location. It is there for app extensions to access it and IIRC there is interest in ensuring DB access goes through the main app.
Summary: .xcappdata does not contain browser database → Can't load prepopulated test DB in XCUITest
Assignee: nobody → gkeeley
Attached file Pull request
This creates a folder in the source called 'test-fixtures', and test schemes will copy the contents of this folder into the Client app bundle. Then by adding launch arguments, we can tell the Client.app to load files from its bundle. In this case, I implemented loading a browser.db that is pre-populated. The test case is called `testDatabaseFixture()` and the corresponding test DB is `text-fixtures/testDatabaseFixture-browser.db`. Note that regardless of what the test database is called, it will always be copied to profile/browser.db, and becomes the BrowserProfile for the running app. Any test can now have a `text-fixtures/<testname>-browser.db` if needed.
Attachment #8950447 - Flags: review?(npark)
Comment on attachment 8950447 [details] [review] Pull request Looks good to me, so should we create a separate bug about creating the db from device/simulator for future use? Since most of the data is under shared directory, downloading the container of device/simulator won't save bookmarks or history.
Attachment #8950447 - Flags: review?(npark) → review+
See Also: → 1438110
See Also: → 1438128
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: