-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
feat(tabs): adds e2e tests for tabs #650
feat(tabs): adds e2e tests for tabs #650
Conversation
@@ -1,6 +1,6 @@ | |||
<!doctype html> | |||
{{!-- This file is an handlebar file that gets filled at build time. --}} | |||
<html> | |||
<html lang="en"> |
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.
Update this for demo-app as well?
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.
You could probably use this PR for the a11y test fixes instead of #654 (because lang="en"
on the demo-app will fix one)
.toMatch('md-active'); | ||
|
||
element(by.css('.md-tab-label:nth-of-type(1)')).click(); | ||
expect(element(by.css('.md-tab-label:nth-of-type(2)')).getAttribute('class')).not |
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.
To assert that the tabs contain a class you can do something like this:
// Note: $$('.abc') === element.all(by.css('.abc'))
let tabsActive = $$('.md-tab-label').map((item, index) => {
// Note: I am creating an array that contains {index, isActive} where isActive means that
// it has the active class
return {
index: index,
isActive: item.getAttribute('class').then(
classAttr => !!classAttr.match('dropdown'))
};
});
expect(tabsActive).toEqual([
{index: 0, isActive: false},
{index: 1, isActive: true},
{index: 2, isActive: false}
]);
Or you can just do:
let tabsActive = $$('.md-tab-label')
.map(item => item.getAttribute('class')
.then(classAttr => !!classAttr.match('dropdown')));
expect(tabsActive).toEqual([false, true, false]);
@jelbourn This should be okay to merge now. |
@@ -0,0 +1,76 @@ | |||
import ElementArrayFinder = protractor.ElementArrayFinder; | |||
import ElementFinder = protractor.ElementFinder; |
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.
import {ElementArrayFinder} from ...
? etc.
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.
Apparently, this is how WebStorm fixed my code.
@robertmesserle needs a rebase on top of the new router. LGTM aside from that (and one minor nit). Feel free to merge directly after rebase. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
closes #549
R: @jelbourn