test(button): ripple effect screenshot tests (#25295)

This commit is contained in:
Sean Perkins
2022-05-20 12:47:06 -04:00
committed by GitHub
parent 61e571e585
commit 8130f2c509
8 changed files with 26 additions and 1 deletions

View File

@ -10,3 +10,28 @@ test.describe('button: basic', () => {
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot(`button-diff-${page.getSnapshotSettings()}.png`);
});
});
test.describe('button: ripple effect', () => {
test('should not have visual regressions', async ({ page }, testInfo) => {
test.skip(testInfo.project.metadata.mode !== 'md', 'Ripple effect is only available in MD mode.');
await page.goto(`/src/components/button/test/basic?ionic:_testing=false`);
const button = page.locator('#default');
await button.scrollIntoViewIfNeeded();
const boundingBox = await button.boundingBox();
if (boundingBox) {
await page.mouse.move(boundingBox.x + boundingBox.width / 2, boundingBox.y + boundingBox.height / 2);
await page.mouse.down();
}
await page.waitForSelector('#default.ion-activated');
expect(await button.screenshot({ animations: 'disabled' })).toMatchSnapshot(
`button-ripple-effect-${page.getSnapshotSettings()}.png`
);
});
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -24,7 +24,7 @@
<ion-content class="ion-padding ion-text-center" id="content" no-bounce>
<p>
<ion-button>Default</ion-button>
<ion-button id="default">Default</ion-button>
<ion-button class="ion-focused">Default.focused</ion-button>
<ion-button class="ion-activated">Default.activated</ion-button>
</p>