17
17
***********************************************************************/
18
18
19
19
import type { Page } from '@playwright/test' ;
20
- import { expect as playExpect } from '@playwright/test' ;
21
- import { afterAll , beforeAll , beforeEach , describe , test } from 'vitest' ;
20
+ import { expect as playExpect , test } from '@playwright/test' ;
22
21
23
22
import { ContainerState } from '../model/core/states' ;
24
23
import type { ContainerInteractiveParams } from '../model/core/types' ;
@@ -28,7 +27,6 @@ import type { ImagesPage } from '../model/pages/images-page';
28
27
import { WelcomePage } from '../model/pages/welcome-page' ;
29
28
import { NavigationBar } from '../model/workbench/navigation' ;
30
29
import { PodmanDesktopRunner } from '../runner/podman-desktop-runner' ;
31
- import type { RunnerTestContext } from '../testContext/runner-test-context' ;
32
30
import { deleteContainer , deleteImage } from '../utility/operations' ;
33
31
import { waitForPodmanMachineStartup , waitWhile } from '../utility/wait' ;
34
32
@@ -40,7 +38,7 @@ const containerToRun = 'alpine-container';
40
38
const containerList = [ 'first' , 'second' , 'third' ] ;
41
39
const containerStartParams : ContainerInteractiveParams = { attachTerminal : false } ;
42
40
43
- beforeAll ( async ( ) => {
41
+ test . beforeAll ( async ( ) => {
44
42
pdRunner = new PodmanDesktopRunner ( ) ;
45
43
page = await pdRunner . start ( ) ;
46
44
pdRunner . setVideoAndTraceName ( 'containers-e2e' ) ;
@@ -67,11 +65,9 @@ beforeAll(async () => {
67
65
}
68
66
} ) ;
69
67
70
- beforeEach < RunnerTestContext > ( async ctx => {
71
- ctx . pdRunner = pdRunner ;
72
- } ) ;
68
+ test . afterAll ( async ( ) => {
69
+ test . setTimeout ( 90000 ) ;
73
70
74
- afterAll ( async ( ) => {
75
71
try {
76
72
await deleteContainer ( page , containerToRun ) ;
77
73
for ( const container of containerList ) {
@@ -82,10 +78,14 @@ afterAll(async () => {
82
78
} finally {
83
79
await pdRunner . close ( ) ;
84
80
}
85
- } , 90000 ) ;
81
+ } ) ;
82
+
83
+ test . describe . serial ( 'Verification of container creation workflow @smoke' , ( ) => {
84
+ test . describe . configure ( { retries : 2 } ) ;
85
+
86
+ test ( `Pulling of '${ imageToPull } :${ imageTag } ' image` , async ( ) => {
87
+ test . setTimeout ( 90000 ) ;
86
88
87
- describe ( 'Verification of container creation workflow' , async ( ) => {
88
- test ( `Pulling of '${ imageToPull } :${ imageTag } ' image` , { retry : 2 , timeout : 90000 } , async ( ) => {
89
89
const navigationBar = new NavigationBar ( page ) ;
90
90
let images = await navigationBar . openImages ( ) ;
91
91
const pullImagePage = await images . openPullImage ( ) ;
@@ -114,6 +114,7 @@ describe('Verification of container creation workflow', async () => {
114
114
images = await navigationBar . openImages ( ) ;
115
115
playExpect ( await images . getCurrentStatusOfImage ( imageToPull ) ) . toBe ( 'USED' ) ;
116
116
} ) ;
117
+
117
118
test ( 'Test navigation between pages' , async ( ) => {
118
119
const navigationBar = new NavigationBar ( page ) ;
119
120
const containers = await navigationBar . openContainers ( ) ;
@@ -253,6 +254,8 @@ describe('Verification of container creation workflow', async () => {
253
254
} ) ;
254
255
255
256
test ( 'Prune containers' , async ( ) => {
257
+ test . setTimeout ( 120000 ) ;
258
+
256
259
const navigationBar = new NavigationBar ( page ) ;
257
260
//Start 3 containers
258
261
for ( const container of containerList ) {
@@ -300,5 +303,5 @@ describe('Verification of container creation workflow', async () => {
300
303
. poll ( async ( ) => await containersPage . containerExists ( container ) , { timeout : 30000 } )
301
304
. toBeFalsy ( ) ;
302
305
}
303
- } , 120000 ) ;
306
+ } ) ;
304
307
} ) ;
0 commit comments