From fc8a9b220cf6889ad9c7e72cf18214fef5eba175 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Wed, 15 May 2024 17:13:23 +0200
Subject: [PATCH] fix: wip web tests

---
 .gitlab-ci.yml         | 10 ++++++++--
 test/web/puppeteer.mjs | 18 ++++++++----------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 79e763a4e..ec4105985 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -46,8 +46,14 @@ web-tests:
         - pnpm-lock.yaml
     paths:
       - node_modules/
-
-#deploy:
+  artifacts:
+    paths:
+      - screenshot.png
+  
+  
+  
+  
+  #deploy:
 #  stage: deploy
 #  tags:
 #    - nixos-gen3
diff --git a/test/web/puppeteer.mjs b/test/web/puppeteer.mjs
index 85108a276..3a9770122 100644
--- a/test/web/puppeteer.mjs
+++ b/test/web/puppeteer.mjs
@@ -54,20 +54,18 @@ if (!config.browser) {
     const title = await page.title();
     console.log('Page title:', title);
 
-    page.on('console', async e => {
-        const args = await Promise.all(e.args().map(a => a.jsonValue()));
-        console[e.type() === 'warning' ? 'warn' : e.type()](...args);
-    });
-    
-
-
+    // page.on('console', async e => {
+    //     const args = await Promise.all(e.args().map(a => a.jsonValue()));
+    //     console[e.type() === 'warning' ? 'warn' : e.type()](...args);
+    // });
+    //
+    //
+    //
     console.log('Running tests...');
     await page.waitForFunction('document.getElementById("mocha-done").textContent.length > 0', 
         { 
             timeout: 1000000,
             polling: 1000
-            
-            
         }
     ) ;
 
@@ -87,7 +85,7 @@ if (!config.browser) {
         console.log('Tests passed');
     }
 
-    await page.screenshot({ path: 'google.png' });
+    await page.screenshot({ path: 'screenshot.png' });
 
     await browser.close();
 })();
\ No newline at end of file
-- 
GitLab