{"action":"created","comment":{"url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/comments/89678890","pull_request_review_id":10221440,"id":89678890,"diff_hunk":"@@ -138,45 +142,149 @@ You can initialize a selector with any of these objects.\n     });\n     ```\n \n-### Initializers that Return Multiple Nodes\n+### Check Selector Matching Set Length\n+\n+Functions and CSS selector strings which initialize a selector can have one matching DOM element on the page, several or nothing.\n+Selector provides the following properties to check this:\n+\n+Property | Type | Description\n+------ | ----- | -----\n+`exists` | Boolean | `true` if at least one matching element exists.\n+`count` | Number | The number of matching elements.\n+\n+ \n+```js\n+import { Selector } from 'testcafe';\n+import { expect } from 'chai';\n+\n+fixture `Example page`\n+    .page `http://devexpress.github.io/testcafe/example/`;\n \n-Functions and CSS selector stings that initialize a selector can return multiple DOM nodes.\n-In this instance, you must filter these nodes to select a single node that will eventually be returned by the selector.\n-Use the [text](selector-options.md#optionstext) and [index](selector-options.md#optionsindex) options for this.\n+test('My test', async t => {\n+    const osCount            = await Selector('.column.col-2 label').count;\n+    const submitButtonExists = await Selector('#submit-button').exists;\n+\n+    expect(osCount).eql(3);\n+    expect(submitButtonExists).is.true;\n+});\n+\n+```\n \n-The [text](selector-options.md#optionstext) option specifies text content of the node that should be returned\n-or a regular expression that matches this content.\n+Note that selector property getters are asynchronous.\n \n-The [index](selector-options.md#optionsindex) option specifies the index of the node that should be returned.\n+## Combined Selectors\n \n-The following example demonstrates how to use the `text` and `index` options.\n+Selector api provides methods that can be combined together, making flexible functional-style selector system.","path":"docs/articles/documentation/test-api/selecting-page-elements/selectors.md","position":119,"original_position":119,"commit_id":"1866f0a1ea507f39d737dc6173f31aede03caa91","original_commit_id":"1866f0a1ea507f39d737dc6173f31aede03caa91","user":{"login":"lexkazakov","id":20209898,"avatar_url":"https://avatars.githubusercontent.com/u/20209898?v=3","gravatar_id":"","url":"https://api.github.com/users/lexkazakov","html_url":"https://github.com/lexkazakov","followers_url":"https://api.github.com/users/lexkazakov/followers","following_url":"https://api.github.com/users/lexkazakov/following{/other_user}","gists_url":"https://api.github.com/users/lexkazakov/gists{/gist_id}","starred_url":"https://api.github.com/users/lexkazakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lexkazakov/subscriptions","organizations_url":"https://api.github.com/users/lexkazakov/orgs","repos_url":"https://api.github.com/users/lexkazakov/repos","events_url":"https://api.github.com/users/lexkazakov/events{/privacy}","received_events_url":"https://api.github.com/users/lexkazakov/received_events","type":"User","site_admin":false},"body":"The selector API provides methods that can be combined together, thus providing you with a flexible functional-style selector mechanism.","created_at":"2016-11-26T22:04:26Z","updated_at":"2016-11-26T22:04:27Z","html_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix/pull/5#discussion_r89678890","pull_request_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/comments/89678890"},"html":{"href":"https://github.com/AlexanderMoskovkin/testcafe-phoenix/pull/5#discussion_r89678890"},"pull_request":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/5","id":94976695,"html_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix/pull/5","diff_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix/pull/5.diff","patch_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix/pull/5.patch","issue_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues/5","number":5,"state":"open","locked":false,"title":"[docs]  Redesigned Selectors","user":{"login":"AlexanderMoskovkin","id":12047804,"avatar_url":"https://avatars.githubusercontent.com/u/12047804?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderMoskovkin","html_url":"https://github.com/AlexanderMoskovkin","followers_url":"https://api.github.com/users/AlexanderMoskovkin/followers","following_url":"https://api.github.com/users/AlexanderMoskovkin/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderMoskovkin/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderMoskovkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderMoskovkin/subscriptions","organizations_url":"https://api.github.com/users/AlexanderMoskovkin/orgs","repos_url":"https://api.github.com/users/AlexanderMoskovkin/repos","events_url":"https://api.github.com/users/AlexanderMoskovkin/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderMoskovkin/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-23T10:29:24Z","updated_at":"2016-11-26T22:04:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c0f45115a6448a17fd8c575dea03c8e3ef1765a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/5/commits","review_comments_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/5/comments","review_comment_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues/5/comments","statuses_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/statuses/1866f0a1ea507f39d737dc6173f31aede03caa91","head":{"label":"AlexanderMoskovkin:gh-798-docs","ref":"gh-798-docs","sha":"1866f0a1ea507f39d737dc6173f31aede03caa91","user":{"login":"AlexanderMoskovkin","id":12047804,"avatar_url":"https://avatars.githubusercontent.com/u/12047804?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderMoskovkin","html_url":"https://github.com/AlexanderMoskovkin","followers_url":"https://api.github.com/users/AlexanderMoskovkin/followers","following_url":"https://api.github.com/users/AlexanderMoskovkin/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderMoskovkin/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderMoskovkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderMoskovkin/subscriptions","organizations_url":"https://api.github.com/users/AlexanderMoskovkin/orgs","repos_url":"https://api.github.com/users/AlexanderMoskovkin/repos","events_url":"https://api.github.com/users/AlexanderMoskovkin/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderMoskovkin/received_events","type":"User","site_admin":false},"repo":{"id":40255267,"name":"testcafe-phoenix","full_name":"AlexanderMoskovkin/testcafe-phoenix","owner":{"login":"AlexanderMoskovkin","id":12047804,"avatar_url":"https://avatars.githubusercontent.com/u/12047804?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderMoskovkin","html_url":"https://github.com/AlexanderMoskovkin","followers_url":"https://api.github.com/users/AlexanderMoskovkin/followers","following_url":"https://api.github.com/users/AlexanderMoskovkin/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderMoskovkin/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderMoskovkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderMoskovkin/subscriptions","organizations_url":"https://api.github.com/users/AlexanderMoskovkin/orgs","repos_url":"https://api.github.com/users/AlexanderMoskovkin/repos","events_url":"https://api.github.com/users/AlexanderMoskovkin/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderMoskovkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix","description":null,"fork":true,"url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix","forks_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/forks","keys_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/teams","hooks_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/hooks","issue_events_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/events","assignees_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/tags","blobs_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/languages","stargazers_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/stargazers","contributors_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/contributors","subscribers_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/subscribers","subscription_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/subscription","commits_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/merges","archive_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/downloads","issues_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/labels{/name}","releases_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/deployments","created_at":"2015-08-05T16:08:05Z","updated_at":"2016-01-25T12:26:54Z","pushed_at":"2016-11-24T20:49:35Z","git_url":"git://github.com/AlexanderMoskovkin/testcafe-phoenix.git","ssh_url":"git@github.com:AlexanderMoskovkin/testcafe-phoenix.git","clone_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix.git","svn_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix","homepage":null,"size":29900,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":"master"}},"base":{"label":"AlexanderMoskovkin:master","ref":"master","sha":"6686dc8de500b81546f159e79122c3ca8fd97f1f","user":{"login":"AlexanderMoskovkin","id":12047804,"avatar_url":"https://avatars.githubusercontent.com/u/12047804?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderMoskovkin","html_url":"https://github.com/AlexanderMoskovkin","followers_url":"https://api.github.com/users/AlexanderMoskovkin/followers","following_url":"https://api.github.com/users/AlexanderMoskovkin/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderMoskovkin/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderMoskovkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderMoskovkin/subscriptions","organizations_url":"https://api.github.com/users/AlexanderMoskovkin/orgs","repos_url":"https://api.github.com/users/AlexanderMoskovkin/repos","events_url":"https://api.github.com/users/AlexanderMoskovkin/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderMoskovkin/received_events","type":"User","site_admin":false},"repo":{"id":40255267,"name":"testcafe-phoenix","full_name":"AlexanderMoskovkin/testcafe-phoenix","owner":{"login":"AlexanderMoskovkin","id":12047804,"avatar_url":"https://avatars.githubusercontent.com/u/12047804?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderMoskovkin","html_url":"https://github.com/AlexanderMoskovkin","followers_url":"https://api.github.com/users/AlexanderMoskovkin/followers","following_url":"https://api.github.com/users/AlexanderMoskovkin/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderMoskovkin/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderMoskovkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderMoskovkin/subscriptions","organizations_url":"https://api.github.com/users/AlexanderMoskovkin/orgs","repos_url":"https://api.github.com/users/AlexanderMoskovkin/repos","events_url":"https://api.github.com/users/AlexanderMoskovkin/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderMoskovkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix","description":null,"fork":true,"url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix","forks_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/forks","keys_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/teams","hooks_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/hooks","issue_events_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/events","assignees_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/tags","blobs_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/languages","stargazers_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/stargazers","contributors_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/contributors","subscribers_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/subscribers","subscription_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/subscription","commits_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/merges","archive_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/downloads","issues_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/labels{/name}","releases_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/deployments","created_at":"2015-08-05T16:08:05Z","updated_at":"2016-01-25T12:26:54Z","pushed_at":"2016-11-24T20:49:35Z","git_url":"git://github.com/AlexanderMoskovkin/testcafe-phoenix.git","ssh_url":"git@github.com:AlexanderMoskovkin/testcafe-phoenix.git","clone_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix.git","svn_url":"https://github.com/AlexanderMoskovkin/testcafe-phoenix","homepage":null,"size":29900,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/5"},"html":{"href":"https://github.com/AlexanderMoskovkin/testcafe-phoenix/pull/5"},"issue":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues/5"},"comments":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/AlexanderMoskovkin/testcafe-phoenix/statuses/1866f0a1ea507f39d737dc6173f31aede03caa91"}}}}
{"actor":{"display_login":"lexkazakov"}}