{"action":"opened","number":986,"pull_request":{"url":"https://api.github.com/repos/craftyjs/Crafty/pulls/986","id":52082671,"html_url":"https://github.com/craftyjs/Crafty/pull/986","diff_url":"https://github.com/craftyjs/Crafty/pull/986.diff","patch_url":"https://github.com/craftyjs/Crafty/pull/986.patch","issue_url":"https://api.github.com/repos/craftyjs/Crafty/issues/986","number":986,"state":"open","locked":false,"title":"Add WebDriver tests","user":{"login":"mucaho","id":3935691,"avatar_url":"https://avatars.githubusercontent.com/u/3935691?v=3","gravatar_id":"","url":"https://api.github.com/users/mucaho","html_url":"https://github.com/mucaho","followers_url":"https://api.github.com/users/mucaho/followers","following_url":"https://api.github.com/users/mucaho/following{/other_user}","gists_url":"https://api.github.com/users/mucaho/gists{/gist_id}","starred_url":"https://api.github.com/users/mucaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mucaho/subscriptions","organizations_url":"https://api.github.com/users/mucaho/orgs","repos_url":"https://api.github.com/users/mucaho/repos","events_url":"https://api.github.com/users/mucaho/events{/privacy}","received_events_url":"https://api.github.com/users/mucaho/received_events","type":"User","site_admin":false},"body":"Add example tests that showcase controlling a browser in order to test expected effect of inputs and expected visual output from Crafty.\r\nSave permanent test fixtures to tests/assets/webdriver and temporary test results to build/webdriver.\r\nUploads screenshots of failed tests to Crafty-Distro/regression-tests.\r\nStreamline Gruntfile.\r\nChanges all open sauce (in the cloud) tests to only work on pre-release `testing` branch.\r\n\r\nI will add a wiki entry giving explanations to all three different testing methods (browser, node, webdriver).\r\nStill doesn't work as expected for all browsers on Open Sauce.\r\nThis PR just includes some templates, not all tests covering every functionality.\r\n\r\nLong story short: Given this (hopefully intuitive test file)\r\n```js\r\nmodule.exports = function(client, capabilities) {\r\n\r\n  var testScript = function(Crafty, signalBarrier) {\r\n    Crafty.init();\r\n    Crafty.background('rgb(127,127,127)');\r\n\r\n    // green floor - #ent1\r\n    Crafty.e(\"2D, DOM, Color, ground\")\r\n      .attr({ x: 0, y: 239, w: 320, h: 1 })\r\n      .color('rgb(0,255,0)');\r\n\r\n    // green platform - #ent2\r\n    Crafty.e(\"2D, DOM, Color, ground\")\r\n      .attr({ x: 250, y: 120, w: 60, h: 1 })\r\n      .color('rgb(0,255,0)');\r\n\r\n    // cyan drag&drop target - #ent3\r\n    Crafty.e('2D, DOM, Color')\r\n      .attr({ x: 10, y: 90, w: 30, h: 30 })\r\n      .color('rgb(0,63,63)');\r\n\r\n    // blue player - #ent4\r\n    var landedCount = 0;\r\n    Crafty.e(\"2D, DOM, Color, Gravity, Twoway, Button, Draggable\")\r\n      .attr({ x: 265, y: 140, w: 30, h: 30 })\r\n      .color('rgb(0,0,255)')\r\n      .gravityConst(1 * 50 * 50)\r\n      .twoway(5 * 50,17 * 50)\r\n      .gravity(\"ground\")\r\n      .bind(\"StartDrag\", function() {\r\n        this.antigravity();\r\n      })\r\n      .bind(\"StopDrag\", function() {\r\n        this.gravity();\r\n      })\r\n      .bind(\"LandedOnGround\", function(ground) {\r\n        landedCount++;\r\n        signalBarrier(\"landed\" + landedCount);\r\n      });\r\n  };\r\n\r\n\r\n  asyncTest(\"Multi test template part 0: Navigate to test page\", function() {\r\n    expect(0);\r\n    client\r\n      .testUrl()\r\n      .then(start);\r\n  });\r\n\r\n  asyncTest(\"Multi test template part 1: Player lands on ground floor automatically\", function() {\r\n    client\r\n      .waitBarrier(\"landed1\")\r\n      .assertResemble(\"firstLand\")\r\n      .then(start);\r\n  });\r\n\r\n  asyncTest(\"Multi test template part 2: Player lands on platform after jump key pressed\", function() {\r\n    client\r\n      .keys('W').keys('W')\r\n      .waitBarrier(\"landed2\", 2000)\r\n      .assertResemble(\"secondLand\")\r\n      .then(start);\r\n  });\r\n\r\n  asyncTest(\"Multi test template part 3: Player lands on floor after being drag & dropped\", function() {\r\n    client\r\n      .dragAndDrop(\"#ent4\",\"#ent3\")\r\n      .waitBarrier(\"landed3\", 2000)\r\n      .assertResemble(\"thirdLand\")\r\n      .then(start);\r\n  });\r\n\r\n  return testScript;\r\n};\r\n```\r\nProduces in step 1 this screenshot\r\n![template-multi-firstland-expected](https://cloud.githubusercontent.com/assets/3935691/11463002/781e0920-971c-11e5-8336-7bd1182ec249.png)\r\nProduces in step 2 this screenshot\r\n![template-multi-secondland-expected](https://cloud.githubusercontent.com/assets/3935691/11463022/9b7d458e-971c-11e5-8d8f-5aad7d79c7e2.png)\r\nProduces in step 3 this screenshot\r\n![template-multi-thirdland-expected](https://cloud.githubusercontent.com/assets/3935691/11463029/b02d703a-971c-11e5-938e-47e1189eb335.png)\r\nAnd **checks** if the new screenshots match the previously recorded ones within margin of error.\r\n\r\nWhat do you think? This should give us much needed confidence when doing changes to graphics stuff.\r\n","created_at":"2015-11-30T03:43:54Z","updated_at":"2015-11-30T03:43:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/craftyjs/Crafty/pulls/986/commits","review_comments_url":"https://api.github.com/repos/craftyjs/Crafty/pulls/986/comments","review_comment_url":"https://api.github.com/repos/craftyjs/Crafty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/craftyjs/Crafty/issues/986/comments","statuses_url":"https://api.github.com/repos/craftyjs/Crafty/statuses/1cb8a7fbaf76ca138b4a90d6b3a5ec463b9e57fd","head":{"label":"mucaho:webdriver","ref":"webdriver","sha":"1cb8a7fbaf76ca138b4a90d6b3a5ec463b9e57fd","user":{"login":"mucaho","id":3935691,"avatar_url":"https://avatars.githubusercontent.com/u/3935691?v=3","gravatar_id":"","url":"https://api.github.com/users/mucaho","html_url":"https://github.com/mucaho","followers_url":"https://api.github.com/users/mucaho/followers","following_url":"https://api.github.com/users/mucaho/following{/other_user}","gists_url":"https://api.github.com/users/mucaho/gists{/gist_id}","starred_url":"https://api.github.com/users/mucaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mucaho/subscriptions","organizations_url":"https://api.github.com/users/mucaho/orgs","repos_url":"https://api.github.com/users/mucaho/repos","events_url":"https://api.github.com/users/mucaho/events{/privacy}","received_events_url":"https://api.github.com/users/mucaho/received_events","type":"User","site_admin":false},"repo":{"id":14079672,"name":"Crafty","full_name":"mucaho/Crafty","owner":{"login":"mucaho","id":3935691,"avatar_url":"https://avatars.githubusercontent.com/u/3935691?v=3","gravatar_id":"","url":"https://api.github.com/users/mucaho","html_url":"https://github.com/mucaho","followers_url":"https://api.github.com/users/mucaho/followers","following_url":"https://api.github.com/users/mucaho/following{/other_user}","gists_url":"https://api.github.com/users/mucaho/gists{/gist_id}","starred_url":"https://api.github.com/users/mucaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mucaho/subscriptions","organizations_url":"https://api.github.com/users/mucaho/orgs","repos_url":"https://api.github.com/users/mucaho/repos","events_url":"https://api.github.com/users/mucaho/events{/privacy}","received_events_url":"https://api.github.com/users/mucaho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mucaho/Crafty","description":"JavaScript Game Engine","fork":true,"url":"https://api.github.com/repos/mucaho/Crafty","forks_url":"https://api.github.com/repos/mucaho/Crafty/forks","keys_url":"https://api.github.com/repos/mucaho/Crafty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mucaho/Crafty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mucaho/Crafty/teams","hooks_url":"https://api.github.com/repos/mucaho/Crafty/hooks","issue_events_url":"https://api.github.com/repos/mucaho/Crafty/issues/events{/number}","events_url":"https://api.github.com/repos/mucaho/Crafty/events","assignees_url":"https://api.github.com/repos/mucaho/Crafty/assignees{/user}","branches_url":"https://api.github.com/repos/mucaho/Crafty/branches{/branch}","tags_url":"https://api.github.com/repos/mucaho/Crafty/tags","blobs_url":"https://api.github.com/repos/mucaho/Crafty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mucaho/Crafty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mucaho/Crafty/git/refs{/sha}","trees_url":"https://api.github.com/repos/mucaho/Crafty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mucaho/Crafty/statuses/{sha}","languages_url":"https://api.github.com/repos/mucaho/Crafty/languages","stargazers_url":"https://api.github.com/repos/mucaho/Crafty/stargazers","contributors_url":"https://api.github.com/repos/mucaho/Crafty/contributors","subscribers_url":"https://api.github.com/repos/mucaho/Crafty/subscribers","subscription_url":"https://api.github.com/repos/mucaho/Crafty/subscription","commits_url":"https://api.github.com/repos/mucaho/Crafty/commits{/sha}","git_commits_url":"https://api.github.com/repos/mucaho/Crafty/git/commits{/sha}","comments_url":"https://api.github.com/repos/mucaho/Crafty/comments{/number}","issue_comment_url":"https://api.github.com/repos/mucaho/Crafty/issues/comments{/number}","contents_url":"https://api.github.com/repos/mucaho/Crafty/contents/{+path}","compare_url":"https://api.github.com/repos/mucaho/Crafty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mucaho/Crafty/merges","archive_url":"https://api.github.com/repos/mucaho/Crafty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mucaho/Crafty/downloads","issues_url":"https://api.github.com/repos/mucaho/Crafty/issues{/number}","pulls_url":"https://api.github.com/repos/mucaho/Crafty/pulls{/number}","milestones_url":"https://api.github.com/repos/mucaho/Crafty/milestones{/number}","notifications_url":"https://api.github.com/repos/mucaho/Crafty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mucaho/Crafty/labels{/name}","releases_url":"https://api.github.com/repos/mucaho/Crafty/releases{/id}","created_at":"2013-11-03T03:38:07Z","updated_at":"2015-07-16T11:53:22Z","pushed_at":"2015-11-30T03:29:12Z","git_url":"git://github.com/mucaho/Crafty.git","ssh_url":"git@github.com:mucaho/Crafty.git","clone_url":"https://github.com/mucaho/Crafty.git","svn_url":"https://github.com/mucaho/Crafty","homepage":"http://craftyjs.com","size":6907,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"craftyjs:develop","ref":"develop","sha":"662567dcafe6e1308c7ffa5b5b6bdc488198f589","user":{"login":"craftyjs","id":1334729,"avatar_url":"https://avatars.githubusercontent.com/u/1334729?v=3","gravatar_id":"","url":"https://api.github.com/users/craftyjs","html_url":"https://github.com/craftyjs","followers_url":"https://api.github.com/users/craftyjs/followers","following_url":"https://api.github.com/users/craftyjs/following{/other_user}","gists_url":"https://api.github.com/users/craftyjs/gists{/gist_id}","starred_url":"https://api.github.com/users/craftyjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craftyjs/subscriptions","organizations_url":"https://api.github.com/users/craftyjs/orgs","repos_url":"https://api.github.com/users/craftyjs/repos","events_url":"https://api.github.com/users/craftyjs/events{/privacy}","received_events_url":"https://api.github.com/users/craftyjs/received_events","type":"Organization","site_admin":false},"repo":{"id":1052675,"name":"Crafty","full_name":"craftyjs/Crafty","owner":{"login":"craftyjs","id":1334729,"avatar_url":"https://avatars.githubusercontent.com/u/1334729?v=3","gravatar_id":"","url":"https://api.github.com/users/craftyjs","html_url":"https://github.com/craftyjs","followers_url":"https://api.github.com/users/craftyjs/followers","following_url":"https://api.github.com/users/craftyjs/following{/other_user}","gists_url":"https://api.github.com/users/craftyjs/gists{/gist_id}","starred_url":"https://api.github.com/users/craftyjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craftyjs/subscriptions","organizations_url":"https://api.github.com/users/craftyjs/orgs","repos_url":"https://api.github.com/users/craftyjs/repos","events_url":"https://api.github.com/users/craftyjs/events{/privacy}","received_events_url":"https://api.github.com/users/craftyjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/craftyjs/Crafty","description":"JavaScript Game Engine","fork":false,"url":"https://api.github.com/repos/craftyjs/Crafty","forks_url":"https://api.github.com/repos/craftyjs/Crafty/forks","keys_url":"https://api.github.com/repos/craftyjs/Crafty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/craftyjs/Crafty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/craftyjs/Crafty/teams","hooks_url":"https://api.github.com/repos/craftyjs/Crafty/hooks","issue_events_url":"https://api.github.com/repos/craftyjs/Crafty/issues/events{/number}","events_url":"https://api.github.com/repos/craftyjs/Crafty/events","assignees_url":"https://api.github.com/repos/craftyjs/Crafty/assignees{/user}","branches_url":"https://api.github.com/repos/craftyjs/Crafty/branches{/branch}","tags_url":"https://api.github.com/repos/craftyjs/Crafty/tags","blobs_url":"https://api.github.com/repos/craftyjs/Crafty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/craftyjs/Crafty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/craftyjs/Crafty/git/refs{/sha}","trees_url":"https://api.github.com/repos/craftyjs/Crafty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/craftyjs/Crafty/statuses/{sha}","languages_url":"https://api.github.com/repos/craftyjs/Crafty/languages","stargazers_url":"https://api.github.com/repos/craftyjs/Crafty/stargazers","contributors_url":"https://api.github.com/repos/craftyjs/Crafty/contributors","subscribers_url":"https://api.github.com/repos/craftyjs/Crafty/subscribers","subscription_url":"https://api.github.com/repos/craftyjs/Crafty/subscription","commits_url":"https://api.github.com/repos/craftyjs/Crafty/commits{/sha}","git_commits_url":"https://api.github.com/repos/craftyjs/Crafty/git/commits{/sha}","comments_url":"https://api.github.com/repos/craftyjs/Crafty/comments{/number}","issue_comment_url":"https://api.github.com/repos/craftyjs/Crafty/issues/comments{/number}","contents_url":"https://api.github.com/repos/craftyjs/Crafty/contents/{+path}","compare_url":"https://api.github.com/repos/craftyjs/Crafty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/craftyjs/Crafty/merges","archive_url":"https://api.github.com/repos/craftyjs/Crafty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/craftyjs/Crafty/downloads","issues_url":"https://api.github.com/repos/craftyjs/Crafty/issues{/number}","pulls_url":"https://api.github.com/repos/craftyjs/Crafty/pulls{/number}","milestones_url":"https://api.github.com/repos/craftyjs/Crafty/milestones{/number}","notifications_url":"https://api.github.com/repos/craftyjs/Crafty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/craftyjs/Crafty/labels{/name}","releases_url":"https://api.github.com/repos/craftyjs/Crafty/releases{/id}","created_at":"2010-11-04T23:02:09Z","updated_at":"2015-11-26T04:09:21Z","pushed_at":"2015-11-30T03:29:39Z","git_url":"git://github.com/craftyjs/Crafty.git","ssh_url":"git@github.com:craftyjs/Crafty.git","clone_url":"https://github.com/craftyjs/Crafty.git","svn_url":"https://github.com/craftyjs/Crafty","homepage":"http://craftyjs.com","size":11950,"stargazers_count":1943,"watchers_count":1943,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":475,"mirror_url":null,"open_issues_count":50,"forks":475,"open_issues":50,"watchers":1943,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/craftyjs/Crafty/pulls/986"},"html":{"href":"https://github.com/craftyjs/Crafty/pull/986"},"issue":{"href":"https://api.github.com/repos/craftyjs/Crafty/issues/986"},"comments":{"href":"https://api.github.com/repos/craftyjs/Crafty/issues/986/comments"},"review_comments":{"href":"https://api.github.com/repos/craftyjs/Crafty/pulls/986/comments"},"review_comment":{"href":"https://api.github.com/repos/craftyjs/Crafty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/craftyjs/Crafty/pulls/986/commits"},"statuses":{"href":"https://api.github.com/repos/craftyjs/Crafty/statuses/1cb8a7fbaf76ca138b4a90d6b3a5ec463b9e57fd"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":527,"deletions":100,"changed_files":19}}