From 75cfcd78caf20dd6654eec4dae35db16cdbc21d4 Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Tue, 15 Sep 2026 21:07:50 +0200 Subject: [PATCH] fix(tests): two #706 tests that could not pass in CI ConnectionsDeclarationTest read appinfo/info.xml with simplexml_load_file(). Nextcloud's lib/base.php nulls libxml's external entity loader, so that call returns false for a well-formed file whenever the suite runs under the Nextcloud bootstrap, which is every CI cell. It now parses the file contents as a string, as NextcloudFloorMatrixTest already does. The Integrations page e2e test looked a row up by an accessible name starting with the connection title, but each row's name starts with its "Select row" checkbox, so it found nothing while the page showed both rows. It now matches the row by its Connection cell. --- tests/Unit/Settings/ConnectionsDeclarationTest.php | 5 ++++- tests/e2e/workflows/integrations-page.spec.ts | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/Unit/Settings/ConnectionsDeclarationTest.php b/tests/Unit/Settings/ConnectionsDeclarationTest.php index f3fd655dd..f667b0c49 100644 --- a/tests/Unit/Settings/ConnectionsDeclarationTest.php +++ b/tests/Unit/Settings/ConnectionsDeclarationTest.php @@ -164,7 +164,10 @@ public function testTheSchemaRefusesAMisspelledFieldAndABadKey(): void { * @return void */ public function testTheFileNamesThisApp(): void { - $infoXml = simplexml_load_file($this->root() . '/appinfo/info.xml'); + // Parse the string, not the file: Nextcloud's lib/base.php nulls libxml's + // external entity loader, so simplexml_load_file() returns false in CI + // for a well-formed file. See NextcloudFloorMatrixTest::declaredFloor(). + $infoXml = simplexml_load_string($this->read(path: 'appinfo/info.xml')); $this->assertNotFalse(condition: $infoXml); $this->assertSame(expected: 'keepiq', actual: (string) $infoXml->id); diff --git a/tests/e2e/workflows/integrations-page.spec.ts b/tests/e2e/workflows/integrations-page.spec.ts index 0282ee996..98e50d7f3 100644 --- a/tests/e2e/workflows/integrations-page.spec.ts +++ b/tests/e2e/workflows/integrations-page.spec.ts @@ -29,7 +29,8 @@ * Locale: nothing forces the E2E language, so statuses are read from the API * and rows are found by their declared titles, which are not translated. * - * Written, not yet run: it needs an instance with both apps (tasks.md 5.1). + * It needs an instance with both apps (tasks.md 5.1). First run in CI on + * 2026-09-15 (keepiq run 34955589876), where the row lookup below was fixed. * * @e2e openspec/changes/adopt-connection-registry/specs/admin-integrations/spec.md#the-page-lists-only-the-rows-of-keepiq * @e2e openspec/changes/adopt-connection-registry/specs/admin-integrations/spec.md#add-integration-goes-to-integriq @@ -125,9 +126,14 @@ test.describe('Integrations over the connection registry', () => { } await openIntegrations(page) + // Match the row by its Connection cell, not by the row's accessible name: + // that name starts with the "Select row" checkbox, so a `^title` pattern + // on it never matches. for (const { title } of DECLARED) { await expect( - page.getByRole('row', { name: new RegExp(`^${title}\\b`, 'i') }), + page.getByRole('row').filter({ + has: page.getByRole('cell', { name: title, exact: true }), + }), ).toHaveCount(1) } })