diff --git a/packages/main/cypress/specs/BusyIndicator.cy.tsx b/packages/main/cypress/specs/BusyIndicator.cy.tsx
index 923f3240c3b5..2d0d9c4f862f 100644
--- a/packages/main/cypress/specs/BusyIndicator.cy.tsx
+++ b/packages/main/cypress/specs/BusyIndicator.cy.tsx
@@ -1,10 +1,12 @@
import BusyIndicator from "../../src/BusyIndicator.js";
+import Button from "../../src/Button.js";
+import Dialog from "../../src/Dialog.js";
describe("Rendering", () => {
it("Rendering without content", () => {
cy.mount();
- cy.get("#busyInd")
+ cy.get("[ui5-busy-indicator]")
.shadow()
.find(".ui5-busy-indicator-busy-area:not(.ui5-busy-indicator-busy-area-over-content)")
.should("exist");
@@ -18,9 +20,209 @@ describe("Rendering", () => {
);
- cy.get("#busyInd")
+ cy.get("[ui5-busy-indicator]")
.shadow()
.find(".ui5-busy-indicator-busy-area.ui5-busy-indicator-busy-area-over-content")
.should("exist");
});
});
+
+describe("BusyIndicator general interaction", () => {
+ it("tests event propagation", () => {
+ const onClickStub = cy.stub().as("clickStub");
+ cy.mount(
+
+
+
+ );
+
+ cy.get("[ui5-button]").realClick();
+ cy.get("[ui5-button]").should("have.focus");
+
+ cy.realPress("Space");
+
+ cy.get("@clickStub").should("have.been.called");
+ });
+
+ it("tests event propagation when busy indicator is active", () => {
+ cy.mount(
+
+
+
+ );
+
+ cy.get("[ui5-busy-indicator]")
+ .shadow()
+ .find(".ui5-busy-indicator-busy-area")
+ .should("exist");
+
+ cy.get("[ui5-button]").realClick();
+ cy.get("[ui5-busy-indicator]")
+ .shadow()
+ .find(".ui5-busy-indicator-busy-area")
+ .should("have.focus");
+
+ cy.realPress("Space");
+
+ cy.get("@clickStub").should("not.have.been.called");
+ });
+
+ it("test activation", () => {
+ cy.mount(
+
+
+
+ );
+
+ cy.get("[ui5-busy-indicator]")
+ .shadow()
+ .find(".ui5-busy-indicator-busy-area")
+ .should("not.exist");
+
+ cy.get("[ui5-busy-indicator]")
+ .invoke("attr", "active", "");
+
+ cy.get("[ui5-busy-indicator]")
+ .shadow()
+ .find(".ui5-busy-indicator-busy-area")
+ .should("exist");
+
+ cy.get("[ui5-busy-indicator]")
+ .invoke("removeAttr", "active");
+
+ cy.get("[ui5-busy-indicator]")
+ .shadow()
+ .find(".ui5-busy-indicator-busy-area")
+ .should("not.exist");
+ });
+
+ it("tests focus handling", () => {
+ cy.mount();
+
+ cy.get("[ui5-busy-indicator]")
+ .shadow()
+ .find(".ui5-busy-indicator-busy-area")
+ .should("exist");
+
+ cy.get("[ui5-busy-indicator]").realClick();
+
+ cy.get("[ui5-busy-indicator]").should("have.focus");
+ });
+
+ it("tests internal focused element attributes", () => {
+ cy.mount();
+
+ cy.get("[ui5-busy-indicator]")
+ .shadow()
+ .find(".ui5-busy-indicator-busy-area")
+ .should("have.attr", "role", "progressbar")
+ .and("have.attr", "tabindex", "0")
+ .and("have.attr", "aria-valuemin", "0")
+ .and("have.attr", "aria-valuemax", "100")
+ .and("have.attr", "aria-valuetext", "Busy");
+ });
+
+ it("tests content is not reachable with keyboard when active in both directions", () => {
+ cy.mount(
+
+
+
+
+
+
+
+ );
+
+ cy.get("#beforeIndicatorWithBtn").realClick();
+ cy.get("#beforeIndicatorWithBtn").should("have.focus");
+
+ cy.get("[ui5-busy-indicator]")
+ .shadow()
+ .find(".ui5-busy-indicator-busy-area")
+ .should("exist");
+
+ cy.realPress("Tab");
+
+ cy.get("[ui5-busy-indicator]").should("have.focus");
+
+ cy.realPress("Tab");
+
+ cy.get("#helloBtn").should("not.have.focus");
+ cy.get("#afterIndicatorWithBtn").should("have.focus");
+
+ cy.realPress(["Shift", "Tab"]);
+
+ cy.get("[ui5-busy-indicator]").should("have.focus");
+ cy.get("#helloBtn").should("not.have.focus");
+
+ cy.realPress(["Shift", "Tab"]);
+
+ cy.get("#beforeIndicatorWithBtn").should("have.focus");
+ });
+
+ it("test inactive indicator in dialog - correct element from default slot is focused", () => {
+ cy.mount(
+
+ );
+
+ cy.get("#dialog-inactive-indicator").invoke("attr", "open", true);
+ cy.get