Script capture

0 views
Skip to first unread message

William la Forge

unread,
Oct 26, 2009, 8:27:10 AM10/26/09
to AgileWikiDevelopers
Alex has enhanced the cometd code on the server side to capture incoming messages in a form that can be used by the test framework he developed. You then run the script in update mode and the test framework creates a nice regression test. (Regression tests being run in verify mode.)

Below is a sample of a simple regression test created by first running the desktop with capture turned on and then running the test framework in update mode. It is all JSON encoded and quite readable, though not something I would want to create by hand!

Bill

{
  "email": "Tester", 
  "name": "RegressionTester",
  "testAction": "createUser"
}
{
  "email": "Tester", 
  "client": "t1",
  "testAction": "subscription"
}
{
  "email": "Tester", 
  "client": "t1",
  "testAction": "send",
  "message": 
  {
    "target": "~/", 
    "userEvent": 
    {
      "action": "OpenDesktop"
    }
  }
}
{
  "testAction": "pause",
  "seconds": 3
}
{
  "email": "Tester", 
  "client": "t1",
  "testAction": "disconnect"
}

William la Forge

unread,
Oct 26, 2009, 8:37:45 AM10/26/09
to AgileWikiDevelopers
Whoops! Wrong script! I've corrected this inline. Such an easy system for regression test creation! --b

On Mon, Oct 26, 2009 at 5:57 PM, William la Forge <lafo...@gmail.com> wrote:
Alex has enhanced the cometd code on the server side to capture incoming messages in a form that can be used by the test framework he developed. You then run the script in update mode and the test framework creates a nice regression test. (Regression tests being run in verify mode.)

Below is a sample of a simple regression test created by first running the desktop with capture turned on and then running the test framework in update mode. It is all JSON encoded and quite readable, though not something I would want to create by hand!

Bill


{
  "email":"Tester",
  "name":"q",
  "testAction":"createUser"
}

{
  "client":"1fij84ftkkatfhck3n",
  "email":"Tester",
  "testAction":"subscription"
}

{
  "message":
  {
    "userEvent":
    {
      "action":"OpenDesktop"
    },
    "target":"~/"
  },
  "client":"1fij84ftkkatfhck3n",
  "email":"Tester",
  "testAction":"send",
  "expect":
  [
    {
      "toClient":
      {
        "timestamp":"*",
        "message":"LoadIcon",
        "id":"*",
        "isSelected":false,
        "name":"Database",
        "xPosition":"80",
        "image":"/images/Ark32.png",
        "yPosition":"80",
        "tagline":"The Database"
      }
    },
    {
      "toClient":
      {
        "timestamp":"*",
        "message":"LoadIcon",
        "id":"*",
        "isSelected":false,
        "name":"My Home",
        "xPosition":"0",
        "image":"/images/Rolon32.png",
        "yPosition":"80",
        "tagline":""
      }
    },
    {
      "toClient":
      {
        "timestamp":"*",
        "message":"LoadIcon",
        "id":"*",
        "isSelected":false,
        "name":"Test",
        "xPosition":"0",
        "image":"/images/Rolon32.png",
        "yPosition":"0",
        "tagline":"Shared Test Realm for web desktop."
      }
    },
    {
      "toClient":
      {
        "timestamp":"*",
        "message":"LoadIcon",
        "id":"*",
        "isSelected":false,
        "name":"Test(1)",
        "xPosition":"80",
        "image":"/images/Rolon32.png",
        "yPosition":"0",
        "tagline":"Shared Test Realm for web desktop."
      }
    },
    {
      "toClient":
      {
        "timestamp":"*",
        "message":"LoadIcon",
        "id":"*",
        "isSelected":false,
        "name":"Test(2)",
        "xPosition":"160",
        "image":"/images/Rolon32.png",
        "yPosition":"0",
        "tagline":"Shared Test Realm for web desktop."
      }
    }
  ]
}

{
  "message":
  {
    "userEvent":
    {
      "action":"Select"
    },
    "target":"~/Desktop/My Home"
  },
  "client":"1fij84ftkkatfhck3n",
  "email":"Tester",
  "testAction":"send",
  "expect":
  [
    {
      "toChannel":
      {
        "timestamp":"*",
        "message":"UpdateIcon",
        "id":"*",
        "isSelected":true,
        "name":"My Home"
      }
    }
  ]
}

{
  "message":
  {
    "userEvent":
    {
      "action":"Select"
    },
    "target":"~/Desktop/My Home"
  },
  "client":"1fij84ftkkatfhck3n",
  "email":"Tester",
  "testAction":"send",
  "expect":
  [
    {
      "toChannel":
      {
        "timestamp":"*",
        "message":"UpdateIcon",
        "id":"*",
        "isSelected":true,
        "name":"My Home"
      }
    }
  ]
}

{
  "message":
  {
    "userEvent":
    {
      "action":"MoveIcon",
      "xPosition":40,
      "yPosition":88
    },
    "target":"~/Desktop/My Home"
  },
  "client":"1fij84ftkkatfhck3n",
  "email":"Tester",
  "testAction":"send",
  "expect":
  [
    {
      "toChannel":
      {
        "timestamp":"*",
        "message":"UpdateIcon",
        "id":"*",
        "isSelected":true,
        "name":"My Home",
        "xPosition":"0",
        "yPosition":"80"
      }
    }
  ]
}
Reply all
Reply to author
Forward
0 new messages