diff --git a/tests/e2e-uninstall/get-matomo-tables.php b/tests/e2e-uninstall/get-matomo-tables.php index 2a1a26660..2f5bf5030 100644 --- a/tests/e2e-uninstall/get-matomo-tables.php +++ b/tests/e2e-uninstall/get-matomo-tables.php @@ -24,4 +24,9 @@ $query->execute(); $tables = $query->fetchAll( \PDO::FETCH_COLUMN ); -echo json_encode( $tables ); +echo json_encode( + [ + 'dbname' => $dbname, + 'tables' => $tables, + ] +); diff --git a/tests/e2e-uninstall/uninstall.e2e.ts b/tests/e2e-uninstall/uninstall.e2e.ts index bb6be2357..a8962c13d 100644 --- a/tests/e2e-uninstall/uninstall.e2e.ts +++ b/tests/e2e-uninstall/uninstall.e2e.ts @@ -16,6 +16,7 @@ describe('MWP Uninstall', () => { }); async function getTablesInstalled(): Promise { + console.log('root url: ' + `${await Website.rootUrl()}/matomo-for-wordpress/tests/e2e-uninstall/get-matomo-tables.php`); let result: any = await fetch(`${await Website.rootUrl()}/matomo-for-wordpress/tests/e2e-uninstall/get-matomo-tables.php`); result = await result.text(); try { @@ -65,7 +66,10 @@ describe('MWP Uninstall', () => { expect(result.length).toBeGreaterThan(0); // sanity check - result = result.filter((t: string) => t.includes('matomo')); - expect(result).toEqual([]); // check there are no tables with "matomo" in the name + console.log(`result.dbname is: ${result.dbname}`); + + let tables = result.tables; + tables = tables.filter((t: string) => t.includes('matomo')); + expect(tables).toEqual([]); // check there are no tables with "matomo" in the name }); });