Skip to content

Commit 5e016a6

Browse files
thetaPCIonitronbrandyscarney
authored
test(item-sliding): re-enable flaky tests (#28192)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Some of the tests for `item-sliding` were being skipped due to flakiness. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Updated the tests to use the stable function, `dragElementBy` to handle gestures, removing the gesture flakiness. - Separated the basic test to lessen the gesture complexity else it becomes flaky since it can't handle opening and closing and opening in the same test. - Tests are now checking all modes and all directions. - Updated a utils function with a warning regarding an open issue with RTL. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> N/A --------- Co-authored-by: ionitron <[email protected]> Co-authored-by: Brandy Carney <[email protected]>
1 parent 0edcb2c commit 5e016a6

File tree

86 files changed

+78
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+78
-25
lines changed

core/src/components/item-sliding/test/basic/item-sliding.e2e.ts

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,53 @@
11
import { expect } from '@playwright/test';
22
import { configs, dragElementBy, test } from '@utils/test/playwright';
33

4-
import { testSlidingItem } from '../test.utils';
5-
64
/**
7-
* item-sliding doesn't have mode-specific styling
5+
* item-sliding doesn't have mode-specific styling,
6+
* but the child components, item-options and item-option, do.
7+
*
8+
* It is important to test all modes to ensure that the
9+
* child components are being rendered correctly.
810
*/
9-
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
11+
configs().forEach(({ title, screenshot, config }) => {
1012
test.describe(title('item-sliding: basic'), () => {
11-
test.fixme('should not have visual regressions', async ({ page }) => {
13+
test.beforeEach(async ({ page }) => {
1214
await page.goto(`/src/components/item-sliding/test/basic`, config);
15+
});
16+
test.describe('start options', () => {
17+
test('should not have visual regressions', async ({ page }) => {
18+
const item = page.locator('#item2');
19+
20+
/**
21+
* Negative dragByX value to drag element from the right to the left
22+
* to reveal the options on the right side.
23+
* Positive dragByX value to drag element from the left to the right
24+
* to reveal the options on the left side.
25+
*/
26+
const dragByX = config.direction === 'rtl' ? -150 : 150;
27+
28+
await dragElementBy(item, page, dragByX);
29+
await page.waitForChanges();
30+
31+
await expect(item).toHaveScreenshot(screenshot('item-sliding-start'));
32+
});
33+
});
34+
35+
test.describe('end options', () => {
36+
test('should not have visual regressions', async ({ page }) => {
37+
const item = page.locator('#item2');
38+
39+
/**
40+
* Negative dragByX value to drag element from the right to the left
41+
* to reveal the options on the right side.
42+
* Positive dragByX value to drag element from the left to the right
43+
* to reveal the options on the left side.
44+
*/
45+
const dragByX = config.direction === 'rtl' ? 150 : -150;
46+
47+
await dragElementBy(item, page, dragByX);
1348

14-
await testSlidingItem(page, 'item2', 'start', screenshot, true);
15-
await testSlidingItem(page, 'item2', 'end', screenshot);
49+
await expect(item).toHaveScreenshot(screenshot('item-sliding-end'));
50+
});
1651
});
1752
});
1853
});

0 commit comments

Comments
 (0)