@@ -35,13 +35,19 @@ import { waitForPodmanMachineStartup } from '/@/utility/wait';
3535const PODMAN_MACHINE_NAME : string = 'podman-machine-default' ;
3636const PODMAN_MACHINE_VISIBLE_NAME : string = 'Podman Machine' ;
3737
38+ const TIMEOUT_SHORT = 10_000 ;
39+ const TIMEOUT_STANDARD = 30_000 ;
40+ const TIMEOUT_SETUP = 120_000 ;
41+ const PODMAN_MACHINE_STARTUP_TIMEOUT = 300_000 ;
42+ const TIMEOUT_CREATE_MACHINE_TEST = 320_000 ;
43+
3844test . skip (
3945 isLinux || process . env . TEST_PODMAN_MACHINE !== 'true' ,
4046 'Tests suite should not run on Linux platform or if TEST_PODMAN_MACHINE is not true' ,
4147) ;
4248
4349test . beforeAll ( async ( { runner, welcomePage, page } ) => {
44- test . setTimeout ( 120_000 ) ;
50+ test . setTimeout ( TIMEOUT_SETUP ) ;
4551 runner . setVideoAndTraceName ( 'enhanced-dashboard-e2e' ) ;
4652 await welcomePage . handleWelcomePage ( true ) ;
4753
@@ -52,7 +58,7 @@ test.beforeAll(async ({ runner, welcomePage, page }) => {
5258} ) ;
5359
5460test . afterAll ( async ( { runner, page } ) => {
55- test . setTimeout ( 120_000 ) ;
61+ test . setTimeout ( TIMEOUT_SETUP ) ;
5662
5763 try {
5864 if ( test . info ( ) . status === 'failed' ) {
@@ -70,75 +76,93 @@ test.afterAll(async ({ runner, page }) => {
7076test . describe
7177 . serial ( 'Enhanced dashboard experimental feature' , { tag : [ '@experimental' ] } , ( ) => {
7278 test ( 'Enable/disable experimental feature' , async ( { navigationBar, page } ) => {
73- // assert assets state before enabling it (disabled by default for the time being)
74- await setEnhancedDashboardFeature ( page , navigationBar , false ) ;
75- let dashboardPage = await waitForDashboardState ( navigationBar , false ) ;
76- await playExpect ( dashboardPage . systemOverviewButton ) . not . toBeVisible ( ) ;
77- await playExpect ( dashboardPage . podmanProvider ) . toBeVisible ( { timeout : 10_000 } ) ;
78- await dashboardPage . podmanProvider . scrollIntoViewIfNeeded ( ) ;
79- // enable the feature
80- await setEnhancedDashboardFeature ( page , navigationBar , true ) ;
81- dashboardPage = await waitForDashboardState ( navigationBar , true ) ;
82- // assert assets state after enabling it
83- await playExpect ( dashboardPage . systemOverviewButton ) . toBeEnabled ( ) ;
84- await dashboardPage . expandSystemOverview ( true ) ;
85- await playExpect ( dashboardPage . systemOverview ) . toBeVisible ( { timeout : 10_000 } ) ;
86- await playExpect ( dashboardPage . podmanProvider ) . not . toBeVisible ( ) ;
87- await playExpect ( dashboardPage . statusButton ) . toBeEnabled ( ) ;
88- await playExpect ( dashboardPage . statusButton ) . toHaveText ( SystemOverviewState . Stopped ) ;
89- await playExpect ( dashboardPage . noContainerEngineLabel ) . toBeVisible ( ) ;
90- await playExpect ( dashboardPage . setUpPodmanButton ) . toBeEnabled ( ) ;
91- // disable the feature and assert everything went back to the expected state
92- await setEnhancedDashboardFeature ( page , navigationBar , false ) ;
93- dashboardPage = await waitForDashboardState ( navigationBar , false ) ;
94- await playExpect ( dashboardPage . systemOverviewButton ) . not . toBeVisible ( ) ;
95- await dashboardPage . podmanProvider . scrollIntoViewIfNeeded ( ) ;
79+ await test . step ( 'Verify feature is disabled by default' , async ( ) => {
80+ await setEnhancedDashboardFeature ( page , navigationBar , false ) ;
81+ const dashboardPage = await waitForDashboardState ( navigationBar , false ) ;
82+ await playExpect ( dashboardPage . systemOverviewButton ) . not . toBeVisible ( ) ;
83+ await playExpect ( dashboardPage . podmanProvider ) . toBeVisible ( { timeout : TIMEOUT_SHORT } ) ;
84+ await dashboardPage . podmanProvider . scrollIntoViewIfNeeded ( ) ;
85+ } ) ;
86+
87+ await test . step ( 'Enable feature and verify system overview appears' , async ( ) => {
88+ await setEnhancedDashboardFeature ( page , navigationBar , true ) ;
89+ const dashboardPage = await waitForDashboardState ( navigationBar , true ) ;
90+ await playExpect ( dashboardPage . systemOverviewButton ) . toBeEnabled ( ) ;
91+ await dashboardPage . expandSystemOverview ( true ) ;
92+ await playExpect ( dashboardPage . systemOverview ) . toBeVisible ( { timeout : TIMEOUT_SHORT } ) ;
93+ await playExpect ( dashboardPage . podmanProvider ) . not . toBeVisible ( ) ;
94+ await playExpect ( dashboardPage . statusButton ) . toHaveText ( SystemOverviewState . Stopped ) ;
95+ await playExpect ( dashboardPage . noContainerEngineLabel ) . toBeVisible ( ) ;
96+ await playExpect ( dashboardPage . setUpPodmanButton ) . toBeEnabled ( ) ;
97+ } ) ;
98+
99+ await test . step ( 'Disable feature and verify dashboard reverts' , async ( ) => {
100+ await setEnhancedDashboardFeature ( page , navigationBar , false ) ;
101+ const dashboardPage = await waitForDashboardState ( navigationBar , false ) ;
102+ await playExpect ( dashboardPage . systemOverviewButton ) . not . toBeVisible ( ) ;
103+ await playExpect ( dashboardPage . podmanProvider ) . toBeVisible ( { timeout : TIMEOUT_SHORT } ) ;
104+ } ) ;
96105 } ) ;
97106
98107 test ( 'Create Podman machine from Dashboard' , async ( { page, navigationBar } ) => {
99- test . setTimeout ( 320_000 ) ;
108+ test . setTimeout ( TIMEOUT_CREATE_MACHINE_TEST ) ;
100109
101- await test . step ( 'Open dashboard and initialize Podman machine' , async ( ) => {
102- // enable the feature
110+ await test . step ( 'Create machine from system overview' , async ( ) => {
103111 await setEnhancedDashboardFeature ( page , navigationBar , true ) ;
104- let dashboardPage = await waitForDashboardState ( navigationBar , true ) ;
112+ const dashboardPage = await waitForDashboardState ( navigationBar , true ) ;
105113 await dashboardPage . createPodmanMachineFromSystemOverview ( PODMAN_MACHINE_NAME , {
106114 isRootful : false ,
107115 enableUserNet : false ,
108116 startNow : true ,
109117 virtualizationProvider : getVirtualizationProvider ( ) ,
110118 } ) ;
111- // systemOverview button -> starting up; status label -> starting (missing aria-label)
112- dashboardPage = await navigationBar . openDashboard ( ) ;
119+ } ) ;
120+
121+ await test . step ( 'Wait for machine to reach operational state' , async ( ) => {
122+ const dashboardPage = await navigationBar . openDashboard ( ) ;
113123 await dashboardPage . statusButton . scrollIntoViewIfNeeded ( ) ;
114- await playExpect ( dashboardPage . statusButton ) . toHaveText ( SystemOverviewState . Starting , { timeout : 300_000 } ) ;
115- // systemOverview button -> systems operational; status label -> running (missing aria-label)
124+ await playExpect ( dashboardPage . statusButton ) . toHaveText ( SystemOverviewState . Starting , {
125+ timeout : PODMAN_MACHINE_STARTUP_TIMEOUT ,
126+ } ) ;
116127 await playExpect ( dashboardPage . statusButton ) . toHaveText ( SystemOverviewState . Operational , {
117- timeout : 300_000 ,
128+ timeout : PODMAN_MACHINE_STARTUP_TIMEOUT ,
118129 } ) ;
119- // click on 'status' button to go to podman machine in settings/resources
130+ } ) ;
131+
132+ await test . step ( 'Navigate to resources via status button' , async ( ) => {
133+ const dashboardPage = await navigationBar . openDashboard ( ) ;
134+ await dashboardPage . statusButton . scrollIntoViewIfNeeded ( ) ;
120135 await playExpect ( dashboardPage . statusButton ) . toBeEnabled ( ) ;
121136 await dashboardPage . statusButton . click ( ) ;
122- let resourcesPage = new ResourcesPage ( page ) ;
137+ const resourcesPage = new ResourcesPage ( page ) ;
123138 await playExpect
124- . poll ( async ( ) => resourcesPage . resourceCardIsVisible ( 'podman' ) , { timeout : 30_000 } )
139+ . poll ( async ( ) => resourcesPage . resourceCardIsVisible ( 'podman' ) , { timeout : TIMEOUT_STANDARD } )
125140 . toBeTruthy ( ) ;
126141 const resourcesPodmanConnections = new ResourceConnectionCardPage ( page , 'podman' , PODMAN_MACHINE_NAME ) ;
127- await playExpect ( resourcesPodmanConnections . providerConnections ) . toBeVisible ( { timeout : 10_000 } ) ;
128- // stop machine
142+ await playExpect ( resourcesPodmanConnections . providerConnections ) . toBeVisible ( { timeout : TIMEOUT_SHORT } ) ;
143+ } ) ;
144+
145+ await test . step ( 'Stop machine and verify dashboard reflects stopped state' , async ( ) => {
146+ const resourcesPodmanConnections = new ResourceConnectionCardPage ( page , 'podman' , PODMAN_MACHINE_NAME ) ;
129147 await resourcesPodmanConnections . performConnectionAction ( ResourceElementActions . Stop ) ;
130- // come back to dashboard, button -> some systems are stopped
131- await navigationBar . openDashboard ( ) ;
148+ const dashboardPage = await navigationBar . openDashboard ( ) ;
132149 await dashboardPage . statusButton . scrollIntoViewIfNeeded ( ) ;
133- await playExpect ( dashboardPage . statusButton ) . toHaveText ( SystemOverviewState . Stopped , { timeout : 10_000 } ) ;
134- // click on 'navigate to...' button, verify it goes to machine details
150+ await playExpect ( dashboardPage . statusButton ) . toHaveText ( SystemOverviewState . Stopped , {
151+ timeout : TIMEOUT_SHORT ,
152+ } ) ;
153+ } ) ;
154+
155+ await test . step ( 'Verify resource details navigation' , async ( ) => {
156+ const dashboardPage = await navigationBar . openDashboard ( ) ;
135157 await dashboardPage . checkSystemOverviewResourceDetails ( PODMAN_MACHINE_VISIBLE_NAME ) ;
136- // come back to dashboard, click on status button, verify it goes to resources
137- await navigationBar . openDashboard ( ) ;
158+ } ) ;
159+
160+ await test . step ( 'Verify status button navigates to resources page' , async ( ) => {
161+ const dashboardPage = await navigationBar . openDashboard ( ) ;
138162 await dashboardPage . statusButton . scrollIntoViewIfNeeded ( ) ;
139163 await playExpect ( dashboardPage . statusButton ) . toBeEnabled ( ) ;
140164 await dashboardPage . statusButton . click ( ) ;
141- resourcesPage = new ResourcesPage ( page ) ;
165+ const resourcesPage = new ResourcesPage ( page ) ;
142166 await playExpect ( resourcesPage . header ) . toBeVisible ( ) ;
143167 } ) ;
144168 } ) ;
0 commit comments