Confirmed users
1,905
edits
| Line 26: | Line 26: | ||
The easiest way to understand this is to look at a simple CrossWeave test file. | The easiest way to understand this is to look at a simple CrossWeave test file. | ||
setup: | |||
profiles: | |||
* profile1 | |||
* profile2 | |||
bookmark-list-1: | |||
menu: | |||
* uri: http://www.google.com | |||
title: google.com | |||
changes: | |||
title: Google | |||
* folder: foldera | |||
* folder: folderb | |||
menu/foldera: | |||
* uri: http://www.yahoo.com | |||
title: testing Yahoo | |||
changes: | |||
location: menu/folderb | |||
bookmark-list-2: | |||
menu: | |||
* uri: http://www.google.com | |||
title: Google | |||
* folder: foldera | |||
* folder: folderb | |||
menu/folderb: | |||
* uri: http://www.yahoo.com | |||
title: testing Yahoo | |||
phase1: | |||
profile: profile1 | |||
actions: | |||
* add: | |||
bookmarks: bookmark-list-1 | |||
* sync: all | |||
wipe-server: true | |||
phase2: | |||
profile: profile2 | |||
actions: | |||
* sync: all | |||
* verify: | |||
bookmarks: bookmark-list-1 | |||
* modify: | |||
bookmarks: bookmark-list-1 | |||
* sync: all | |||
phase3: | |||
profile: profile1 | |||
actions: | |||
* sync: all | |||
* verify: | |||
bookmarks: bookmark-list-2 | |||
The effects of this test file will be: | The effects of this test file will be: | ||
# Firefox is launched with profile1, the CrossWeave extension adds the two bookmarks specified in the "bookmarks-initial" array, then they are synced to the Weave server. The "wipe-server" property causes CrossWeave to set the firstSync=wipeServer pref, in case the Weave account already contains data. Firefox closes. | # Firefox is launched with profile1, the CrossWeave extension adds the two bookmarks specified in the "bookmarks-initial" array, then they are synced to the Weave server. The "wipe-server" property causes CrossWeave to set the firstSync=wipeServer pref, in case the Weave account already contains data. Firefox closes. | ||
# Firefox is launched with profile2, and all data is synced from the Weave server. The CrossWeave extension verifies that all bookmarks in the "bookmarks- | # Firefox is launched with profile2, and all data is synced from the Weave server. The CrossWeave extension verifies that all bookmarks in the "bookmarks-list-1" list are present. Then it modifies those bookmarks by applying the "changes" property to each of them. E.g., the title of the first bookmark is changed from "google.com" to "Google". Next, the changes are synced to the Weave server. Finally, Firefox closes. | ||
# Firefox is launched with profile1 again, and data is synced from the Weave server. The CrossWeave extension verifies that the bookmarks in "bookmarks- | # Firefox is launched with profile1 again, and data is synced from the Weave server. The CrossWeave extension verifies that the bookmarks in "bookmarks-list-2" list are present; i.e., all the changes performed in profile2 have successfully been synced to profile1. Lastly, Firefox closes and the tests ends. | ||
This is a simple case, but CrossWeave will support tests of greater complexity, involving an arbitrary number of phases, actions and clients. Test actions will allow interaction with all types of data supported by Weave. | This is a simple case, but CrossWeave will support tests of greater complexity, involving an arbitrary number of phases, actions and clients. Test actions will allow interaction with all types of data supported by Weave. | ||
For a more complex example, see: http://hg.mozilla.org/automation/crossweave/file/c3b36bd20a08/test.json | For a more complex example, see: http://hg.mozilla.org/automation/crossweave/file/c3b36bd20a08/test.json | ||