Skip to content

Commit

Permalink
debug e2e test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Dec 25, 2024
1 parent 171bee6 commit 085ba5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion tests/e2e-uninstall/get-matomo-tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@
$query->execute();

$tables = $query->fetchAll( \PDO::FETCH_COLUMN );
echo json_encode( $tables );
echo json_encode(
[
'dbname' => $dbname,
'tables' => $tables,
]
);
8 changes: 6 additions & 2 deletions tests/e2e-uninstall/uninstall.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('MWP Uninstall', () => {
});

async function getTablesInstalled(): Promise<any> {
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 {
Expand Down Expand Up @@ -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
});
});

0 comments on commit 085ba5d

Please sign in to comment.