@@ -223,9 +223,10 @@ def stagePipelines(ctx):
223
223
if (determineReleasePackage (ctx ) != None ):
224
224
return unit_test_pipelines
225
225
226
+ e2e_playwright_pipeline = e2eTestsOnPlaywright (ctx )
226
227
e2e_pipelines = e2eTests (ctx )
227
228
keycloak_pipelines = e2eTestsOnKeycloak (ctx )
228
- return unit_test_pipelines + pipelinesDependsOn (e2e_pipelines + keycloak_pipelines , unit_test_pipelines )
229
+ return unit_test_pipelines + pipelinesDependsOn (e2e_playwright_pipeline + e2e_pipelines + keycloak_pipelines , unit_test_pipelines )
229
230
230
231
def afterPipelines (ctx ):
231
232
return build (ctx ) + pipelinesDependsOn (notify (ctx ), build (ctx ))
@@ -535,6 +536,64 @@ def unitTests(ctx):
535
536
},
536
537
}]
537
538
539
+ def e2eTestsOnPlaywright (ctx ):
540
+ e2e_workspace = {
541
+ "base" : dir ["base" ],
542
+ "path" : config ["app" ],
543
+ }
544
+
545
+ e2e_trigger = {
546
+ "ref" : [
547
+ "refs/heads/master" ,
548
+ "refs/heads/stable-*" ,
549
+ "refs/tags/**" ,
550
+ "refs/pull/**" ,
551
+ ],
552
+ }
553
+
554
+ pipelines = []
555
+
556
+ # pipeline steps
557
+ steps = skipIfUnchanged (ctx , "e2e-tests-playwright" )
558
+
559
+ environment = {
560
+ "BASE_URL_OCIS" : "ocis:9200" ,
561
+ "PLAYWRIGHT_BROWSERS_PATH" : ".playwright" ,
562
+ }
563
+
564
+ steps += restoreBuildArtifactCache (ctx , "pnpm" , ".pnpm-store" ) + \
565
+ installPnpm () + \
566
+ restoreBrowsersCache () + \
567
+ restoreBuildArtifactCache (ctx , "web-dist" , "dist" )
568
+
569
+ if ctx .build .event == "cron" :
570
+ steps += restoreBuildArtifactCache (ctx , "ocis" , "ocis" )
571
+ else :
572
+ steps += restoreOcisCache ()
573
+
574
+ steps += ocisService ()
575
+
576
+ steps += [{
577
+ "name" : "e2e-tests-playwright" ,
578
+ "image" : OC_CI_NODEJS_IMAGE ,
579
+ "environment" : environment ,
580
+ "commands" : [
581
+ "pnpm test:e2e:playwright --project=chromium" ,
582
+ ],
583
+ }]
584
+
585
+ pipelines .append ({
586
+ "kind" : "pipeline" ,
587
+ "type" : "docker" ,
588
+ "name" : "e2e-tests-playwright" ,
589
+ "workspace" : e2e_workspace ,
590
+ "steps" : steps ,
591
+ "depends_on" : ["cache-ocis" ],
592
+ "trigger" : e2e_trigger ,
593
+ })
594
+
595
+ return pipelines
596
+
538
597
def e2eTests (ctx ):
539
598
e2e_workspace = {
540
599
"base" : dir ["base" ],
@@ -1365,12 +1424,26 @@ def skipIfUnchanged(ctx, type):
1365
1424
}
1366
1425
return [skip_step ]
1367
1426
1427
+ if type == "e2e-tests-playwright" :
1428
+ e2e_playwright_skip_steps = [
1429
+ "^__fixtures__/.*" ,
1430
+ "^__mocks__/.*" ,
1431
+ "^packages/.*/tests/.*" ,
1432
+ "^tests/unit/.*" ,
1433
+ "^tests/e2e/cucumber/.*" ,
1434
+ ]
1435
+ skip_step ["settings" ] = {
1436
+ "ALLOW_SKIP_CHANGED" : base_skip_steps + e2e_playwright_skip_steps ,
1437
+ }
1438
+ return [skip_step ]
1439
+
1368
1440
if type == "e2e-tests" :
1369
1441
e2e_skip_steps = [
1370
1442
"^__fixtures__/.*" ,
1371
1443
"^__mocks__/.*" ,
1372
1444
"^packages/.*/tests/.*" ,
1373
1445
"^tests/unit/.*" ,
1446
+ "^tests/e2e-playwright/.*" ,
1374
1447
]
1375
1448
skip_step ["settings" ] = {
1376
1449
"ALLOW_SKIP_CHANGED" : base_skip_steps + e2e_skip_steps ,
0 commit comments