Skip to content

Commit dfe7558

Browse files
committed
first appearance test
1 parent b71af32 commit dfe7558

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { chromium, expect, test } from "@playwright/test";
2+
import { randomName, requiresEnterpriseLicense } from "../../helpers";
3+
4+
test("set application name", async ({ page }) => {
5+
requiresEnterpriseLicense();
6+
7+
await page.goto("/deployment/appearance", { waitUntil: "domcontentloaded" });
8+
9+
const applicationName = randomName();
10+
11+
// Fill out the form
12+
const form = page.locator("form", { hasText: "Application name"})
13+
await form.getByLabel("Application name", { exact: true}).fill(applicationName);
14+
await form.getByRole("button", { name: "Submit"}).click();
15+
16+
// Open a new session without cookies to see the login page
17+
const browser = await chromium.launch()
18+
const incognitoContext = await browser.newContext()
19+
await incognitoContext.clearCookies()
20+
const incognitoPage = await incognitoContext.newPage()
21+
await incognitoPage.goto("/", { waitUntil: "domcontentloaded" });
22+
23+
const banner = incognitoPage.locator("h1", { hasText: applicationName})
24+
await expect(banner).toBeVisible()
25+
26+
// Shut down browser
27+
await incognitoPage.close()
28+
await browser.close()
29+
});

site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ export const AppearanceSettingsPageView: FC<
105105
fullWidth
106106
placeholder='Leave empty to display "Coder".'
107107
disabled={!isEntitled}
108+
inputProps={{
109+
"aria-label": "Application name",
110+
}}
108111
/>
109112
</Fieldset>
110113

@@ -150,6 +153,9 @@ export const AppearanceSettingsPageView: FC<
150153
</InputAdornment>
151154
),
152155
}}
156+
inputProps={{
157+
"aria-label": "Logo URL",
158+
}}
153159
/>
154160
</Fieldset>
155161

@@ -208,6 +214,7 @@ export const AppearanceSettingsPageView: FC<
208214
);
209215
await serviceBannerForm.setFieldValue("enabled", newState);
210216
}}
217+
data-testid="switch-service-banner"
211218
/>
212219
}
213220
label="Enabled"
@@ -221,6 +228,9 @@ export const AppearanceSettingsPageView: FC<
221228
fullWidth
222229
label="Message"
223230
multiline
231+
inputProps={{
232+
"aria-label": "Message",
233+
}}
224234
/>
225235
</Stack>
226236

0 commit comments

Comments
 (0)