1
1
import { chromium , expect , test } from "@playwright/test" ;
2
+ import { expectUrl } from "../../expectUrl" ;
2
3
import { randomName , requiresEnterpriseLicense } from "../../helpers" ;
3
4
4
5
test ( "set application name" , async ( { page } ) => {
@@ -22,9 +23,9 @@ test("set application name", async ({ page }) => {
22
23
const incognitoPage = await incognitoContext . newPage ( ) ;
23
24
await incognitoPage . goto ( "/" , { waitUntil : "domcontentloaded" } ) ;
24
25
25
- // Verify banner
26
- const banner = incognitoPage . locator ( "h1" , { hasText : applicationName } ) ;
27
- await expect ( banner ) . toBeVisible ( ) ;
26
+ // Verify the application name
27
+ const name = incognitoPage . locator ( "h1" , { hasText : applicationName } ) ;
28
+ await expect ( name ) . toBeVisible ( ) ;
28
29
29
30
// Shut down browser
30
31
await incognitoPage . close ( ) ;
@@ -58,3 +59,24 @@ test("set application logo", async ({ page }) => {
58
59
await incognitoPage . close ( ) ;
59
60
await browser . close ( ) ;
60
61
} ) ;
62
+
63
+ test ( "set service banner" , async ( { page } ) => {
64
+ requiresEnterpriseLicense ( ) ;
65
+
66
+ await page . goto ( "/deployment/appearance" , { waitUntil : "domcontentloaded" } ) ;
67
+
68
+ const message = "Mary has a little lamb." ;
69
+
70
+ // Fill out the form
71
+ const form = page . locator ( "form" , { hasText : "Service Banner" } ) ;
72
+ await form . getByLabel ( "Enabled" , { exact : true } ) . check ( ) ;
73
+ await form . getByLabel ( "Message" , { exact : true } ) . fill ( message ) ;
74
+ await form . getByRole ( "button" , { name : "Submit" } ) . click ( ) ;
75
+
76
+ // Verify service banner
77
+ await page . goto ( "/workspaces" , { waitUntil : "domcontentloaded" } ) ;
78
+ await expectUrl ( page ) . toHavePathName ( "/workspaces" ) ;
79
+
80
+ const bar = page . locator ( "div.service-banner" , { hasText : message } ) ;
81
+ await expect ( bar ) . toBeVisible ( ) ;
82
+ } ) ;
0 commit comments