mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-08 21:47:35 +01:00
fix playwright tests
This commit is contained in:
+10
-1
@@ -438,7 +438,16 @@ export class DataExplorer {
|
||||
* There's only a single "primary" button, but we still require you to pass the label to confirm you're selecting the right button.
|
||||
*/
|
||||
async globalCommandButton(label: string): Promise<Locator> {
|
||||
await this.frame.getByTestId("GlobalCommands").click();
|
||||
const globalCommands = this.frame.getByTestId("GlobalCommands");
|
||||
// Prefer the explicit dropdown trigger so we always open the menu rather than
|
||||
// triggering a primary action directly. The SplitButton (wide sidebar) exposes
|
||||
// "More commands" and the MenuButton (narrow sidebar) is labelled "New…".
|
||||
const dropdownTrigger = globalCommands.getByRole("button", { name: "More commands" });
|
||||
if (await dropdownTrigger.isVisible()) {
|
||||
await dropdownTrigger.click();
|
||||
} else {
|
||||
await globalCommands.click();
|
||||
}
|
||||
return this.frame.getByRole("menuitem", { name: label });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user