Skip to content

Commit dd7b721

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
Lint itScreenshot.skip like we lint other skip calls
Fixed: 373791684 Change-Id: If9729360cf7260b9cbf068b9cfa5f6876a60cada No-Presubmit: True Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5933853 Auto-Submit: Jack Franklin <[email protected]> Reviewed-by: Philip Pfaffe <[email protected]> Commit-Queue: Jack Franklin <[email protected]>
1 parent cb883a2 commit dd7b721

File tree

4 files changed

+35
-21
lines changed

4 files changed

+35
-21
lines changed

scripts/eslint_rules/lib/check_test_definitions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module.exports = {
4747
create: function(context) {
4848
return {
4949
MemberExpression(node) {
50-
if ((node.object.name === 'it' || node.object.name === 'describe') &&
50+
if ((node.object.name === 'it' || node.object.name === 'describe' || node.object.name === 'itScreenshot') &&
5151
(node.property.name === 'skip' || node.property.name === 'skipOnPlatforms') &&
5252
node.parent.type === 'CallExpression') {
5353
const testNameNode = node.property.name === 'skip' ? node.parent.arguments[0] : node.parent.arguments[1];

scripts/eslint_rules/tests/check_test_definitions_test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ ruleTester.run('check_e2e_tests', rule, {
121121
filename: 'test/e2e/folder/file.ts',
122122
errors: [{message: rule.meta.messages.missingBugId}],
123123
},
124+
{
125+
code: `describe('e2e-test', async () => {
126+
// Explaining comment
127+
itScreenshot.skip(\`normal test \${withVariable}\`, async () => {
128+
});
129+
});
130+
`,
131+
filename: 'test/e2e/folder/file.ts',
132+
errors: [{message: rule.meta.messages.missingBugId}],
133+
},
124134
{
125135
code: `import {describe, it} from '../../shared/mocha-extensions.js';
126136

test/interactions/panels/performance/timeline/overview_test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {assertElementScreenshotUnchanged} from '../../../../shared/screenshots.j
88
import {loadComponentDocExample} from '../../../helpers/shared.js';
99

1010
describe('Performance panel overview/minimap', function() {
11-
// b/336787201
12-
itScreenshot.skip('renders the overview', async () => {
11+
// Flaking.
12+
itScreenshot.skip('[crbug.com/336787201]: renders the overview', async () => {
1313
await loadComponentDocExample('performance_panel/overview.html?trace=web-dev');
1414
const pane = await waitFor('.container #timeline-overview-pane');
1515
await assertElementScreenshotUnchanged(pane, 'performance/timeline-overview.png', 3);
@@ -21,8 +21,8 @@ describe('Performance panel overview/minimap', function() {
2121
await assertElementScreenshotUnchanged(pane, 'performance/timeline-overview-long-task-red-bar.png', 3);
2222
});
2323

24-
// b/336788321
25-
itScreenshot.skip('shows network requests in the overview', async () => {
24+
// Flaking.
25+
itScreenshot.skip('[crbug.com/336788321]: shows network requests in the overview', async () => {
2626
await loadComponentDocExample('performance_panel/overview.html?trace=many-requests');
2727
const pane = await waitFor('.container #timeline-overview-pane');
2828
await assertElementScreenshotUnchanged(pane, 'performance/timeline-overview-busy-network.png', 3);

test/interactions/panels/performance/timeline/timeline_test.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('Performance panel', function() {
4646

4747
// Flaky on linux
4848
itScreenshot.skipOnPlatforms(
49-
['linux'], '[crbug.com/327586819 renders the timeline correctly when scrolling', async () => {
49+
['linux'], '[crbug.com/327586819]: renders the timeline correctly when scrolling', async () => {
5050
await loadComponentDocExample('performance_panel/basic.html?trace=one-second-interaction');
5151
await waitFor('.timeline-flamechart');
5252
const panel = await waitFor('body');
@@ -89,7 +89,8 @@ describe('Performance panel', function() {
8989
await assertElementScreenshotUnchanged(panel, 'performance/timeline-long-task-candystripe.png', 2);
9090
});
9191

92-
itScreenshot.skip('renders screenshots in the frames track', async () => {
92+
// Flaking.
93+
itScreenshot.skip('[crbug.com/41483851]: renders screenshots in the frames track', async () => {
9394
if (this.timeout() !== 0) {
9495
this.timeout(20_000);
9596
}
@@ -105,21 +106,24 @@ describe('Performance panel', function() {
105106
await assertElementScreenshotUnchanged(panel, 'performance/timeline-web-dev-screenshot-frames.png', 1);
106107
});
107108

108-
itScreenshot.skip('supports the network track being expanded and then clicked', async function() {
109-
await loadComponentDocExample('performance_panel/basic.html?trace=web-dev');
110-
await waitFor('.timeline-flamechart');
111-
const panel = await waitFor('body');
109+
// Flaking.
110+
itScreenshot.skip(
111+
'[crbug.com/373792008]: supports the network track being expanded and then clicked', async function() {
112+
await loadComponentDocExample('performance_panel/basic.html?trace=web-dev');
113+
await waitFor('.timeline-flamechart');
114+
const panel = await waitFor('body');
112115

113-
const {frontend} = getBrowserAndPages();
114-
// Click to expand the network track.
115-
await frontend.mouse.click(27, 131);
116-
await timeout(100); // cannot await for DOM as this is a purely canvas change.
117-
await assertElementScreenshotUnchanged(panel, 'performance/timeline-expand-network-panel.png', 1);
118-
// Click to select a network event.
119-
await frontend.mouse.click(104, 144);
120-
await timeout(100); // cannot await for DOM as this is a purely canvas change.
121-
await assertElementScreenshotUnchanged(panel, 'performance/timeline-expand-network-panel-and-select-event.png', 1);
122-
});
116+
const {frontend} = getBrowserAndPages();
117+
// Click to expand the network track.
118+
await frontend.mouse.click(27, 131);
119+
await timeout(100); // cannot await for DOM as this is a purely canvas change.
120+
await assertElementScreenshotUnchanged(panel, 'performance/timeline-expand-network-panel.png', 1);
121+
// Click to select a network event.
122+
await frontend.mouse.click(104, 144);
123+
await timeout(100); // cannot await for DOM as this is a purely canvas change.
124+
await assertElementScreenshotUnchanged(
125+
panel, 'performance/timeline-expand-network-panel-and-select-event.png', 1);
126+
});
123127

124128
it('renders the window range bounds correctly when loading multiple profiles', async () => {
125129
await loadComponentDocExample('performance_panel/basic.html?cpuprofile=basic');

0 commit comments

Comments
 (0)