Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions e2e/components/slide-toggle/slide-toggle.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {browser, element, by, Key} from 'protractor';
import {browser, element, by, Key, ExpectedConditions} from 'protractor';
import {expectToExist} from '../../util/asserts';
import {screenshot} from '../../screenshot';

Expand All @@ -21,7 +21,9 @@ describe('slide-toggle', () => {
getNormalToggle().click();

expect(inputEl.getAttribute('checked')).toBeTruthy('Expect slide-toggle to be checked');
screenshot();
browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
.then(() => screenshot());
});

it('should change the checked state on click', () => {
Expand All @@ -32,7 +34,9 @@ describe('slide-toggle', () => {
getNormalToggle().click();

expect(inputEl.getAttribute('checked')).toBeTruthy('Expect slide-toggle to be checked');
screenshot();
browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
.then(() => screenshot());
});

it('should not change the checked state on click when disabled', () => {
Expand All @@ -43,7 +47,9 @@ describe('slide-toggle', () => {
element(by.css('#disabled-slide-toggle')).click();

expect(inputEl.getAttribute('checked')).toBeFalsy('Expect slide-toggle to be unchecked');
screenshot();
browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
.then(() => screenshot());
});

it('should move the thumb on state change', () => {
Expand All @@ -57,7 +63,9 @@ describe('slide-toggle', () => {
let newX = thumbEl.getLocation().then(pos => pos.x);

expect(previousX).not.toBe(newX);
screenshot();
browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
.then(() => screenshot());
});

it('should toggle the slide-toggle on space key', () => {
Expand Down