Skip to content

Commit 1a7e9d5

Browse files
authored
[PM-19280] Bugfix - Update login fixture for new ui changes (#317)
* update browser client config and login fixture * update environment-selector button locator * Revert "[deps]: Lock file maintenance (#308)" This reverts commit 747ebe5. Due to version mismatch in axe-core * bump playwright version * update locator
1 parent 747ebe5 commit 1a7e9d5

File tree

3 files changed

+47
-49
lines changed

3 files changed

+47
-49
lines changed

package-lock.json

Lines changed: 23 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"homepage": "https://bitwarden.com",
1616
"devDependencies": {
1717
"@axe-core/playwright": "4.10.1",
18-
"@playwright/test": "1.51.0",
18+
"@playwright/test": "1.51.1",
1919
"@types/chrome": "0.0.308",
2020
"@types/node": "22.10.9",
2121
"cross-env": "7.0.3",
@@ -80,6 +80,6 @@
8080
},
8181
"engines": {
8282
"node": "22.13.x",
83-
"npm": "~11.1.0"
83+
"npm": "~11.2.0"
8484
}
8585
}

tests/fixtures.browser.ts

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,29 @@ export const test = base.extend<{
131131

132132
await test.step("Configure the environment", async () => {
133133
if (vaultHostURL) {
134-
const extensionURL = `chrome-extension://${extensionId}/popup/index.html?uilocation=popout#/environment`;
134+
const extensionURL = `chrome-extension://${extensionId}/popup/index.html#/login`;
135135
await testPage.goto(extensionURL, defaultGotoOptions);
136-
const baseUrlInput = await testPage.locator("input#baseUrl");
136+
137+
const environmentSelectorMenuButton = await testPage
138+
.locator("environment-selector")
139+
.getByRole("button");
140+
141+
await environmentSelectorMenuButton.waitFor(defaultWaitForOptions);
142+
await environmentSelectorMenuButton.click();
143+
144+
const environmentSelectorMenu = await testPage.getByTestId(
145+
"environment-selector-dialog-item-self-hosted",
146+
);
147+
148+
await environmentSelectorMenu.waitFor(defaultWaitForOptions);
149+
await environmentSelectorMenu.click();
150+
151+
const baseUrlInput = await testPage.locator(
152+
"input#self_hosted_env_settings_form_input_base_url",
153+
);
137154
await baseUrlInput.waitFor(defaultWaitForOptions);
138155

139-
await testPage.fill("input#baseUrl", vaultHostURL);
156+
await baseUrlInput.fill(vaultHostURL);
140157

141158
await testPage.screenshot({
142159
fullPage: true,
@@ -147,12 +164,7 @@ export const test = base.extend<{
147164
),
148165
});
149166

150-
const serverConfigContent = await testPage.locator("#baseUrlHelp");
151-
await testPage.click("button[type='submit']");
152-
await serverConfigContent.waitFor({
153-
...defaultWaitForOptions,
154-
state: "detached",
155-
});
167+
await testPage.click("bit-dialog button[type='submit']");
156168
}
157169
});
158170

@@ -175,7 +187,7 @@ export const test = base.extend<{
175187
await loginButton.waitFor(defaultWaitForOptions);
176188
await loginButton.click();
177189

178-
const extensionURL = `chrome-extension://${extensionId}/popup/index.html?uilocation=popout#/tabs/vault`;
190+
const extensionURL = `chrome-extension://${extensionId}/popup/index.html#/tabs/vault`;
179191
await testPage.waitForURL(extensionURL, defaultGotoOptions);
180192
// Legacy UI
181193
const vaultFilterBox = await testPage

0 commit comments

Comments
 (0)