chore: fix MQTT test skip mechanism if remote server is down (#22019)

This commit is contained in:
Michael Geers 2025-06-24 14:00:56 +02:00 • committed by GitHub
parent 2cad067baf
commit 0de3b48680
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,18 +26,17 @@ const VALID_USERNAME = "rw";
const VALID_PASSWORD = "readwrite";
test.describe("mqtt", async () => {
let mqttReachable = true;
test.beforeAll(async () => {
mqttReachable = await isMqttReachable(VALID_BROKER, VALID_USERNAME, VALID_PASSWORD);
});
test.skip(!mqttReachable, `MQTT broker ${VALID_BROKER} is not reachable, skipping tests`);
test("mqtt not configured", async ({ page }) => {
await expect(page.getByTestId("mqtt")).toBeVisible();
await expect(page.getByTestId("mqtt")).toContainText(["Configured", "no"].join(""));
});
test("mqtt via ui", async ({ page }) => {
test.skip(
!(await isMqttReachable(VALID_BROKER, VALID_USERNAME, VALID_PASSWORD)),
`MQTT broker ${VALID_BROKER} is not reachable, skipping tests`
);
await page.getByTestId("mqtt").getByRole("button", { name: "edit" }).click();
const modal = await page.getByTestId("mqtt-modal");
await expectModalVisible(modal);