5
5
import { assert } from 'chai' ;
6
6
7
7
import { goTo , goToResource , waitFor } from '../../shared/helper.js' ;
8
-
9
8
import {
10
9
clearSiteData ,
11
10
getHelpText ,
12
11
isGenerateReportButtonDisabled ,
13
12
navigateToLighthouseTab ,
14
13
selectCategories ,
14
+ selectMode ,
15
15
waitForStorageUsage ,
16
16
} from '../helpers/lighthouse-helpers.js' ;
17
17
@@ -47,7 +47,7 @@ describe('The Lighthouse start view', () => {
47
47
assert . strictEqual ( helpText , '' ) ;
48
48
} ) ;
49
49
50
- it ( 'disables the start button for internal pages' , async ( ) => {
50
+ it ( 'disables the start button for internal pages in navigation mode ' , async ( ) => {
51
51
await navigateToLighthouseTab ( ) ;
52
52
await goTo ( 'about:blank' ) ;
53
53
@@ -57,6 +57,17 @@ describe('The Lighthouse start view', () => {
57
57
assert . strictEqual ( helpText , 'Can only audit pages on HTTP or HTTPS. Navigate to a different page.' ) ;
58
58
} ) ;
59
59
60
+ it ( 'disables the start button for internal pages in non-navigation mode' , async ( ) => {
61
+ await navigateToLighthouseTab ( ) ;
62
+ await goTo ( 'about:blank' ) ;
63
+ await selectMode ( 'timespan' ) ;
64
+
65
+ const disabled = await isGenerateReportButtonDisabled ( ) ;
66
+ const helpText = await getHelpText ( ) ;
67
+ assert . isFalse ( disabled , 'The Generate Report button should be enabled' ) ;
68
+ assert . strictEqual ( helpText , '' ) ;
69
+ } ) ;
70
+
60
71
// Broken on non-debug runs
61
72
it . skip ( '[crbug.com/1057948] shows generate report button even when navigating to an unreachable page' , async ( ) => {
62
73
await navigateToLighthouseTab ( 'empty.html' ) ;
0 commit comments