Skip to content
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

Merged
merged 4 commits into from
Oct 24, 2016

Conversation

inikulin
Copy link
Contributor

\cc @AlexanderMoskovkin @helen-dikareva

@VasilyStrelyaev please, check error messages and comments. Feature summary for documentation is here in the OP post: #771

Copy link
Collaborator

@helen-dikareva helen-dikareva left a 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.
Copy link
Collaborator

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

Copy link
Collaborator

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,
Copy link
Contributor

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

@testcafe-build-bot
Copy link
Collaborator

✅ Tests for the commit 8b66fe7 have passed. See details:

Copy link
Collaborator

@VasilyStrelyaev VasilyStrelyaev left a 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
Copy link
Collaborator

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.
Copy link
Collaborator

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 () {
Copy link
Collaborator

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 () {

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit 17a880e have failed. See details:

@inikulin
Copy link
Contributor Author

@testcafe-build-bot \retest

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit e3fc96e have failed. See details:

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit 4499931 have failed. See details:

@testcafe-build-bot
Copy link
Collaborator

✅ Tests for the commit 4499931 have passed. See details:

@inikulin
Copy link
Contributor Author

FPR

@@ -5,3 +5,4 @@ site
.sass-cache
.publish
___test-screenshots___
yarn.lock
Copy link

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.

https://yarnpkg.com/en/docs/migrating-from-npm

Copy link
Contributor Author

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.

Copy link
Collaborator

@helen-dikareva helen-dikareva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@inikulin inikulin merged commit fc41d4b into DevExpress:master Oct 24, 2016
@inikulin inikulin deleted the gh-771 branch October 24, 2016 09:54
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this pull request Dec 18, 2019
…) (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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants