-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node snapshot properties shorthands for Selector (closes #771) #899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/r-
`), | ||
|
||
[TYPE.cantObtainInfoForElementSpecifiedBySelectorError]: err => markup(err, ` | ||
Can't obtain information for node because specified selector does not match any node in the DOM tree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I remember better to use the full version Cannot
for message and even for vars. Am I right ? @VasilyStrelyaev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I thought that it's just Armina who doesn't like contractions but MS Word also treats all contractions as "poor style" - so yes.
Cannot obtain information about the node because the specified selector does not match any node in the DOM tree.
var elementSnapshotPropertyInitializers = { | ||
tagName: element => element.tagName.toLowerCase(), | ||
visible: positionUtils.isElementVisible, | ||
focused: element => document.activeElement === element, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to use domUtils.getActiveElement()
here instead of document.activeElement
because of this
✅ Tests for the commit 8b66fe7 have passed. See details: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\r-
@@ -106,6 +107,9 @@ export default class SelectorBuilder extends ClientFunctionBuilder { | |||
|
|||
this._defineSelectorPropertyWithBoundArgs(lazyPromise, args); | |||
|
|||
// OPTIMIZATION: use buffer function as selector to not trigger lazy property ahead of time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// OPTIMIZATION: use buffer function as selector not to trigger lazy property ahead of time
`), | ||
|
||
[TYPE.cantObtainInfoForElementSpecifiedBySelectorError]: err => markup(err, ` | ||
Can't obtain information for node because specified selector does not match any node in the DOM tree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I thought that it's just Armina who doesn't like contractions but MS Word also treats all contractions as "poor style" - so yes.
Cannot obtain information about the node because the specified selector does not match any node in the DOM tree.
@@ -77,13 +77,17 @@ describe('[API] Selector', function () { | |||
return runTests('./testcafe-fixtures/selector-test.js', 'Compound filter'); | |||
}); | |||
|
|||
it('Should provide snapshot properties shorthands on selector', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('Should provide snapshot property shorthands on selector', function () {
❌ Tests for the commit 17a880e have failed. See details: |
@testcafe-build-bot \retest |
❌ Tests for the commit e3fc96e have failed. See details: |
❌ Tests for the commit 4499931 have failed. See details: |
✅ Tests for the commit 4499931 have passed. See details: |
FPR |
@@ -5,3 +5,4 @@ site | |||
.sass-cache | |||
.publish | |||
___test-screenshots___ | |||
yarn.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn.lock should be in the repo:
Yarn will generate a yarn.lock file within the root directory of your package. You don’t need to read or understand this file - just check it into source control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good approach if you use it for end user application, which can't be a dependency itself or shipped with dependencies included. See ongoing discussion in yarnpkg/yarn#1067. The issue with checking in a lock file is that we'll not have the same configuration that our end users have. E.g. we use lock file and always have a fixed set of dependencies. Everything works fine for us. Meanwhile, our end user may use npm
to install testcafe and they'll end up with another set of dependencies, which may broke functionality for them. And we'll be not even aware about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…) (DevExpress#899) * Node snapshot properties shorthands for Selector (closes DevExpress#771) * Fix review issues * Remove no-var eslint rule * Fix tests. Add yarn.lock to .gitignore
\cc @AlexanderMoskovkin @helen-dikareva
@VasilyStrelyaev please, check error messages and comments. Feature summary for documentation is here in the OP post: #771