Skip to content

Commit d85bddc

Browse files
pfaffeDevtools-frontend LUCI CQ
authored andcommitted
Deflake styles-disable-inherited_test.ts
This reverts the changes of https://crrev.com/c/6298060 for this test which likely introduced the flakiness. Bug: none Change-Id: If373e18c88d2733f5fa9f0dda12527daa41d811b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6346611 Reviewed-by: Nikolay Vitkov <[email protected]> Auto-Submit: Philip Pfaffe <[email protected]> Commit-Queue: Philip Pfaffe <[email protected]>
1 parent aec1575 commit d85bddc

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

test/e2e/elements/styles-disable-inherited_test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import {click, goToResource, waitFor, waitForFunction} from '../../shared/helper.js';
5+
import {click, goToResource, waitFor} from '../../shared/helper.js';
66
import {
77
checkStyleAttributes,
88
expandSelectedNodeRecursively,
99
uncheckStylesPaneCheckbox,
10+
waitForElementsStyleSection,
1011
} from '../helpers/elements-helpers.js';
1112

1213
describe('The Elements tab', function() {
@@ -17,18 +18,15 @@ describe('The Elements tab', function() {
1718
await click('text/nested', {
1819
root: elementsContentPanel,
1920
});
20-
await waitForFunction(
21-
() => checkStyleAttributes(['display: block;', 'unicode-bidi: isolate;', 'font-weight: bold;']));
21+
await waitForElementsStyleSection(null);
22+
await checkStyleAttributes(['display: block;', 'font-weight: bold;']);
2223
await click('text/container', {
2324
root: elementsContentPanel,
2425
});
2526
await uncheckStylesPaneCheckbox('font-weight bold');
2627
await click('text/nested', {
2728
root: elementsContentPanel,
2829
});
29-
await waitForFunction(() => checkStyleAttributes([
30-
'display: block;',
31-
'unicode-bidi: isolate;',
32-
]));
30+
await checkStyleAttributes(['display: block;']);
3331
});
3432
});

test/e2e/helpers/elements-helpers.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,15 @@ export const navigateToSidePane = async (paneName: string) => {
292292
]);
293293
};
294294

295-
export const waitForElementsStyleSection = async () => {
295+
export const waitForElementsStyleSection = async (expectedNodeText: string|null = '<body') => {
296296
// Wait for the file to be loaded and selectors to be shown
297297
await waitFor('.styles-selector');
298298
await expectVeEvents([veImpressionsUnder('Panel: elements', [veImpression('Pane', 'styles')])]);
299299

300300
// Check to make sure we have the correct node selected after opening a file.
301-
await waitForPartialContentOfSelectedElementsNode('<body');
301+
if (expectedNodeText) {
302+
await waitForPartialContentOfSelectedElementsNode(expectedNodeText);
303+
}
302304
};
303305

304306
export const waitForElementsComputedSection = async () => {

0 commit comments

Comments
 (0)