{"action":"created","issue":{"url":"https://api.github.com/repos/DevExpress/testcafe/issues/771","repository_url":"https://api.github.com/repos/DevExpress/testcafe","labels_url":"https://api.github.com/repos/DevExpress/testcafe/issues/771/labels{/name}","comments_url":"https://api.github.com/repos/DevExpress/testcafe/issues/771/comments","events_url":"https://api.github.com/repos/DevExpress/testcafe/issues/771/events","html_url":"https://github.com/DevExpress/testcafe/issues/771","id":175466388,"number":771,"title":"Node snapshot properties shorthands for Selector","user":{"login":"inikulin","id":453071,"avatar_url":"https://avatars.githubusercontent.com/u/453071?v=3","gravatar_id":"","url":"https://api.github.com/users/inikulin","html_url":"https://github.com/inikulin","followers_url":"https://api.github.com/users/inikulin/followers","following_url":"https://api.github.com/users/inikulin/following{/other_user}","gists_url":"https://api.github.com/users/inikulin/gists{/gist_id}","starred_url":"https://api.github.com/users/inikulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inikulin/subscriptions","organizations_url":"https://api.github.com/users/inikulin/orgs","repos_url":"https://api.github.com/users/inikulin/repos","events_url":"https://api.github.com/users/inikulin/events{/privacy}","received_events_url":"https://api.github.com/users/inikulin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DevExpress/testcafe/labels/AREA:%20client","name":"AREA: client","color":"fef2c0"},{"url":"https://api.github.com/repos/DevExpress/testcafe/labels/AREA:%20server","name":"AREA: server","color":"fef2c0"},{"url":"https://api.github.com/repos/DevExpress/testcafe/labels/SYSTEM:%20API","name":"SYSTEM: API","color":"bfe5bf"},{"url":"https://api.github.com/repos/DevExpress/testcafe/labels/TYPE:%20proposal","name":"TYPE: proposal","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-09-07T10:21:28Z","updated_at":"2016-09-07T11:47:16Z","closed_at":null,"body":"Currently, you need to re-select node to get access to it's snapshot properties, so you may end up with awkward constructs which involves `await`, e.g.:\r\n```js\r\ntest('Moving the slider', async t => {\r\n    const initialOffset = (await page.slider.handle()).offsetLeft;\r\n\r\n    await t\r\n        .click(page.triedTestCafeCheckbox)\r\n        .dragToElement(page.slider.handle, page.slider.tick.with({ text: '7' }));\r\n\r\n    const newOffset = (await page.slider.handle()).offsetLeft;\r\n\r\n    expect(newOffset).gt(initialOffset);\r\n});\r\n```\r\n\r\nThe idea is to expose snapshot properties on `Selector` which will return promise for the given propety value (it will execute selector and return required property under the hood), so we will have:\r\n```js\r\ntest('Moving the slider', async t => {\r\n    const initialOffset = await page.slider.handle.offsetLeft;\r\n\r\n    await t\r\n        .click(page.triedTestCafeCheckbox)\r\n        .dragToElement(page.slider.handle, page.slider.tick.with({ text: '7' }));\r\n\r\n    const newOffset = await page.slider.handle.offsetLeft;\r\n\r\n    expect(newOffset).gt(initialOffset);\r\n});\r\n```\r\n\r\n\\cc @DevExpress/testcafe \r\nWhat do you guys think?"},"comment":{"url":"https://api.github.com/repos/DevExpress/testcafe/issues/comments/245255943","html_url":"https://github.com/DevExpress/testcafe/issues/771#issuecomment-245255943","issue_url":"https://api.github.com/repos/DevExpress/testcafe/issues/771","id":245255943,"user":{"login":"inikulin","id":453071,"avatar_url":"https://avatars.githubusercontent.com/u/453071?v=3","gravatar_id":"","url":"https://api.github.com/users/inikulin","html_url":"https://github.com/inikulin","followers_url":"https://api.github.com/users/inikulin/followers","following_url":"https://api.github.com/users/inikulin/following{/other_user}","gists_url":"https://api.github.com/users/inikulin/gists{/gist_id}","starred_url":"https://api.github.com/users/inikulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inikulin/subscriptions","organizations_url":"https://api.github.com/users/inikulin/orgs","repos_url":"https://api.github.com/users/inikulin/repos","events_url":"https://api.github.com/users/inikulin/events{/privacy}","received_events_url":"https://api.github.com/users/inikulin/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T11:47:16Z","updated_at":"2016-09-07T11:47:16Z","body":"@miherlosev It's not about internal implementation. We use hammerhead for messaging. Does it support sync communication with client?"}}
{"actor":{"display_login":"inikulin"}}