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

change property unit tests to assert against real DOM #327

Merged
merged 3 commits into from
Oct 1, 2017

Conversation

ro0gr
Copy link
Collaborator

@ro0gr ro0gr commented Aug 29, 2017

Current approach for testing properties doesn't scale very well. For example it's impossible to run existing properties tests against alternative contexts like native contexts.

The general idea of this pr is changing assertions like

this.adapter.click((actualSelector) => assert.equal(actualSelector, expectedSelector));

to

  this.adapter.$(expectedSelector).on('click', () => assert.ok(true));

This way we don't test internals of contexts anymore.

@san650 There is some work left to do here(mostly cleanup). Anyway I would appreciate your thoughts on this change. Does this approach make sense to you?

@ro0gr ro0gr mentioned this pull request Aug 29, 2017
11 tasks
@@ -258,24 +234,6 @@ moduleForProperty('clickOnText', function(test) {
}, /page\.foo\.bar\.baz\.qux/, 'Element not found');
});

test("doesn't raise an error when the element is not visible and `visible` is not set", function(assert) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed by mistake

let name = template.substr(1, gtPos - 1);
const [tagName, attrName] = name.split(' ');

test(`looks for ${tagName} with ${attrName}`, function(assert) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

need to figure out how to simplify [contenteditable], input, textarea, select tests

@coveralls
Copy link

Coverage Status

Coverage increased (+0.8%) to 98.512% when pulling febca1b on ro0gr:property-tests into 88fad42 on san650:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.8%) to 98.512% when pulling eb4a275 on ro0gr:property-tests into 88fad42 on san650:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.8%) to 98.512% when pulling 3ce8d1d on ro0gr:property-tests into 88fad42 on san650:master.

@san650 san650 merged commit da76a88 into san650:master Oct 1, 2017
@san650
Copy link
Owner

san650 commented Oct 1, 2017

Thanks for simplify the test @ro0gr

@ro0gr ro0gr mentioned this pull request Oct 15, 2017
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.

3 participants