Auto-tools/Projects/CrossWeave/Test Format/History: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:
For example:
For example:


  "history1": [
history1:
    { "uri": "http://www.google.com/", "title": "Google",
  * uri: http://www.google.com/
      "visits": [
    title: Google
        { "type": 1, "date": 0 },
    visits:
        { "type": 2, "date": -1 } ] },
      * type: 1
    { "uri": "http://www.cnn.com/", "title": "CNN",
        date: 0
      "visits": [
      * type: 2
        { "type": 1, "date": -1 },
        date: -1
        { "type": 2, "date": -36 } ] }
  * uri: http://www.cnn.com/
  ]
    title: CNN
    visits:
      * type: 1
        date: -1
      * type: 2
        date: -36


The history list used for deletions looks different.  It's an array of objects, each of which represents a type of history to delete.  There are three different types:
The history list used for deletions looks different.  It's an array of objects, each of which represents a type of history to delete.  There are three different types:
Line 32: Line 37:
For example:
For example:


  "history-to-delete": [
history-to-delete:
    { "uri": "http://www.cnn.com/" },
  * uri: http://www.cnn.com/
    { "begin": -24, "end": -1 },
  * begin: -24
    { "host": "www.google.com" }
    end: -1
  ]
  * host: www.google.com


== Actions ==
== Actions ==

Revision as of 00:03, 25 June 2010

Test Format

There are two types of history asset lists, one used for adding/modiyfing/verifying history, and the other for deleting history.

The history list used for operations other than delete has the following properties:

  • uri: required.
  • title: optional. The page title for this uri.
  • visits: required. An array of objects representing visits to the page, each object has the following properties:

For example:

history1:
  * uri: http://www.google.com/
    title: Google
    visits:
      * type: 1
        date: 0
      * type: 2
        date: -1
  * uri: http://www.cnn.com/
    title: CNN
    visits:
      * type: 1
        date: -1
      * type: 2
        date: -36

The history list used for deletions looks different. It's an array of objects, each of which represents a type of history to delete. There are three different types:

  • to delete all references to a specific page from history, use an object with a uri property
  • to delete all references to all pages from a specific host, use an object with a host property
  • to delete all history in a certain time period, use an object with begin and end properties, which should have integer values that express time since the present in hours (see date above)

For example:

history-to-delete:
 * uri: http://www.cnn.com/
 * begin: -24
   end: -1
 * host: www.google.com

Actions

History can only be added, verified, and deleted by CrossWeave. There is no support for modifying existing history entries.

Example

For a more detailed example, see the CrossWeave history unit test.