Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Updated e2e tests to use the screenshotName attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-TrevorBurch committed Mar 20, 2019
1 parent 84f8621 commit ea2f980
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions e2e/flyout.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ describe('Flyout', () => {
SkyHostBrowser.get('visual/flyout');
SkyHostBrowser.setWindowBreakpoint('lg');
element(by.css('.sky-btn-primary')).click();
expect('body').toMatchBaselineScreenshot(done);
expect('body').toMatchBaselineScreenshot(done, {
screenshotName: 'flyout-lg'
});
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});

it('should match previous screenshot (screen: xs)', (done) => {
SkyHostBrowser.get('visual/flyout');
SkyHostBrowser.setWindowBreakpoint('xs');
element(by.css('.sky-btn-primary')).click();
expect('body').toMatchBaselineScreenshot(done);
expect('body').toMatchBaselineScreenshot(done, {
screenshotName: 'flyout-xs'
});
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});

Expand All @@ -33,7 +37,9 @@ describe('Flyout', () => {
browser.sleep(250);
element(by.css('.sky-flyout .sky-dropdown-button')).click();
SkyHostBrowser.moveCursorOffScreen();
expect('body').toMatchBaselineScreenshot(done);
expect('body').toMatchBaselineScreenshot(done, {
screenshotName: 'flyout-absolute-lg'
});
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});

Expand All @@ -44,39 +50,49 @@ describe('Flyout', () => {
browser.sleep(250);
element(by.css('.sky-flyout .sky-dropdown-button')).click();
SkyHostBrowser.moveCursorOffScreen();
expect('body').toMatchBaselineScreenshot(done);
expect('body').toMatchBaselineScreenshot(done, {
screenshotName: 'flyout-absolute-xs'
});
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});

it('should match previous screenshot when row iterators are enabled', (done) => {
SkyHostBrowser.get('visual/flyout');
SkyHostBrowser.setWindowBreakpoint('lg');
element(by.css('#open-flyout-with-iterators')).click();
expect('body').toMatchBaselineScreenshot(done);
expect('body').toMatchBaselineScreenshot(done, {
screenshotName: 'flyout-iterators-lg'
});
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});

it('should match previous screenshot when row iterators are enabled (screen: xs)', (done) => {
SkyHostBrowser.get('visual/flyout');
SkyHostBrowser.setWindowBreakpoint('xs');
element(by.css('#open-flyout-with-iterators')).click();
expect('body').toMatchBaselineScreenshot(done);
expect('body').toMatchBaselineScreenshot(done, {
screenshotName: 'flyout-iterators-xs'
});
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});

it('should match previous screenshot when row iterators are disabled', (done) => {
SkyHostBrowser.get('visual/flyout');
SkyHostBrowser.setWindowBreakpoint('lg');
element(by.css('#open-flyout-with-iterators-disabled')).click();
expect('body').toMatchBaselineScreenshot(done);
expect('body').toMatchBaselineScreenshot(done, {
screenshotName: 'flyout-no-iterators-lg'
});
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});

it('should match previous screenshot when row iterator are disabled (screen: xs)', (done) => {
SkyHostBrowser.get('visual/flyout');
SkyHostBrowser.setWindowBreakpoint('xs');
element(by.css('#open-flyout-with-iterators-disabled')).click();
expect('body').toMatchBaselineScreenshot(done);
expect('body').toMatchBaselineScreenshot(done, {
screenshotName: 'flyout-no-iterators-xs'
});
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});
});

0 comments on commit ea2f980

Please sign in to comment.