Auto-tools/Projects/CrossWeave: Difference between revisions

Jump to navigation Jump to search
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:
   "setup": {
   profiles:
     "profile": ["profile1", "profile2"],
     * profile1
    "weaveaccount": "crossweave",
    * profile2
   },
bookmark-list-1:
  "bookmarks-initial": [
   menu:
     { "uri": "http://www.google.com", "location": "menu", "title": "google.com",
     * uri: http://www.google.com
       "changes": { "title": "Google" } },
      title: google.com
     { "uri": "http://www.yahoo.com", "location": "menu/foldera", "title": "testing Yahoo",
       changes:
       "changes": { "location": "menu/folderb" } },
        title: Google
    ],
     * folder: foldera
    "bookmarks-post-change": [
    * folder: folderb
     { "uri": "http://www.google.com", "title": "Google", "location": "menu" },
  menu/foldera:
     { "uri": "http://www.yahoo.com", "location": "menu/folderb", "title": "testing Yahoo" },
    * uri: http://www.yahoo.com
    ],
      title: testing Yahoo
  "phase1": {
       changes:  
    "profile": "profile1",
        location: menu/folderb
    "actions": [
bookmark-list-2:
      { "add": { "bookmarks": "bookmarks-initial" } },
  menu:
      { "sync": "all", "wipe-server": true },
     * uri: http://www.google.com
    ],
      title: Google
  },
    * folder: foldera
  "phase2": {
    * folder: folderb
    "profile": "profile2",
  menu/folderb:
    "actions": [
     * uri: http://www.yahoo.com
      { "sync": "all" },
      title: testing Yahoo
      { "verify": { "bookmarks": "bookmarks-initial" } },
phase1:
      { "modify": { "bookmarks": "bookmarks-initial" } },
  profile: profile1
      { "sync": "all" },
  actions:
    ],
    * add:
  },
        bookmarks: bookmark-list-1
  "phase3": {
    * sync: all
    "profile": "profile1",
      wipe-server: true
     "actions": [
phase2:
       { "sync": "all" },
  profile: profile2
       { "verify": { "bookmarks": "bookmarks-post-change" } },
  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-initial" array 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 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-post-change" array are present; i.e., all the changes performed in profile2 have successfully been synced to profile1.  Lastly, Firefox closes and the tests ends.
# 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
Confirmed users
1,905

edits

Navigation menu