From 1b7b41b010066b4766cfa374444285490c12380c Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 11:51:11 +0100 Subject: [PATCH 01/10] fix foundry test --- apps/remix-ide-e2e/src/tests/remixd.test.ts | 2 +- apps/remixdesktop/test/tests/app/foundry.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index 6a0dedd582..c145a2934b 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -527,7 +527,7 @@ async function installFoundry(): Promise { server.stdout.on('data', function (data) { console.log(data.toString()) if ( - data.toString().includes("foundryup: use - chisel 0.3.0") + data.toString().includes("foundryup: use - chisel 1.0.0-stable") ) { console.log('resolving') resolve() diff --git a/apps/remixdesktop/test/tests/app/foundry.test.ts b/apps/remixdesktop/test/tests/app/foundry.test.ts index f4d2615f93..a1d733d09e 100644 --- a/apps/remixdesktop/test/tests/app/foundry.test.ts +++ b/apps/remixdesktop/test/tests/app/foundry.test.ts @@ -89,7 +89,7 @@ async function installFoundry(): Promise { server.stdout.on('data', function (data) { console.log(data.toString()) if ( - data.toString().includes("foundryup: use - chisel 0.3.0") + data.toString().includes("foundryup: use - chisel 1.0.0-stable") ) { console.log('resolving') resolve() From bb96a9cdd8eb4d3c94db118949e5d4d9787bf610 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 12:07:51 +0100 Subject: [PATCH 02/10] add pause --- apps/remixdesktop/test/tests/app/github_3.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index 12542bb86f..9674f5d870 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -131,7 +131,7 @@ const tests = { .elements('xpath', '//*[@data-id="commits-current-branch-master"]//*[@data-type="commit-summary"]', function (result) { console.log('Number of commit-summary elements:', (result.value as any).length); browser.assert.ok((result.value as any).length > commitCount) - }) + }).pause(10000) }, 'load more branches from remote #group3': function (browser: NightwatchBrowser) { From 85fe2046a420174b4b81e436fd7ab232f5515d0b Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 12:28:44 +0100 Subject: [PATCH 03/10] screenshots --- apps/remixdesktop/test/tests/app/github_3.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index 9674f5d870..f61a749b66 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -145,7 +145,7 @@ const tests = { console.log('Number of branches elements:', (result.value as any).length); if (useIsoGit) { branchCount = (result.value as any).length - browser.assert.ok((result.value as any).length == 1) + browser.assert.ok((result.value as any).length == 1).saveScreenshot('./reports/screenshots/branches-panel0.png') } else { branchCount = (result.value as any).length browser.assert.ok((result.value as any).length > 2) @@ -155,10 +155,15 @@ const tests = { if (useIsoGit) { - browser.waitForElementVisible('*[data-id="remote-sync-origin"]') + browser + .saveScreenshot('./reports/screenshots/branches-panel.png') + .waitForElementVisible('*[data-id="remote-sync-origin"]') .click('*[data-id="remote-sync-origin"]') + .saveScreenshot('./reports/screenshots/branches-panel2.png') .waitForElementVisible('*[data-id="loader-indicator"]') + .saveScreenshot('./reports/screenshots/branches-panel3.png') .waitForElementNotPresent('*[data-id="loader-indicator"]') + .saveScreenshot('./reports/screenshots/branches-panel4.png') .pause(2000) .elements('xpath', '//*[@data-id="branches-panel-content-remote-branches"]//*[@data-type="branches-branch"]', function (result) { console.log('Number of branches elements:', (result.value as any).length); From a08b0cbc92d99ed39cc85a0e39c8e9e578f65967 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 12:42:50 +0100 Subject: [PATCH 04/10] long pause --- apps/remixdesktop/test/tests/app/github_3.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index f61a749b66..dde23a46f1 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -162,6 +162,7 @@ const tests = { .saveScreenshot('./reports/screenshots/branches-panel2.png') .waitForElementVisible('*[data-id="loader-indicator"]') .saveScreenshot('./reports/screenshots/branches-panel3.png') + .pause(20000) .waitForElementNotPresent('*[data-id="loader-indicator"]') .saveScreenshot('./reports/screenshots/branches-panel4.png') .pause(2000) From 474ce808aafd6a1d68e82f1f2b67962e8286a0e3 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 12:43:07 +0100 Subject: [PATCH 05/10] screen --- apps/remixdesktop/test/tests/app/github_3.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index dde23a46f1..8c8ead3f3a 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -163,8 +163,9 @@ const tests = { .waitForElementVisible('*[data-id="loader-indicator"]') .saveScreenshot('./reports/screenshots/branches-panel3.png') .pause(20000) - .waitForElementNotPresent('*[data-id="loader-indicator"]') .saveScreenshot('./reports/screenshots/branches-panel4.png') + .waitForElementNotPresent('*[data-id="loader-indicator"]') + .pause(2000) .elements('xpath', '//*[@data-id="branches-panel-content-remote-branches"]//*[@data-type="branches-branch"]', function (result) { console.log('Number of branches elements:', (result.value as any).length); From acded9c2208f3ac2fc9565779d7c3d1b2cc317ad Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 12:59:10 +0100 Subject: [PATCH 06/10] try other method --- .../test/tests/app/github_3.test.ts | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index 8c8ead3f3a..ca00ad0d34 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -155,6 +155,9 @@ const tests = { if (useIsoGit) { + const branchSelector = '//*[@data-id="branches-panel-content-remote-branches"]//*[@data-type="branches-branch"]'; + const minCount = branchCount + browser .saveScreenshot('./reports/screenshots/branches-panel.png') .waitForElementVisible('*[data-id="remote-sync-origin"]') @@ -162,15 +165,27 @@ const tests = { .saveScreenshot('./reports/screenshots/branches-panel2.png') .waitForElementVisible('*[data-id="loader-indicator"]') .saveScreenshot('./reports/screenshots/branches-panel3.png') - .pause(20000) - .saveScreenshot('./reports/screenshots/branches-panel4.png') - .waitForElementNotPresent('*[data-id="loader-indicator"]') - - .pause(2000) - .elements('xpath', '//*[@data-id="branches-panel-content-remote-branches"]//*[@data-type="branches-branch"]', function (result) { - console.log('Number of branches elements:', (result.value as any).length); - browser.assert.ok((result.value as any).length > branchCount) - }) + + browser.perform(function (done) { + function checkElements() { + browser.execute( + function (xpath) { + return document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotLength; + }, + [branchSelector], + function (result) { + if ((result.value as number) > minCount) { + done(); + } else { + browser.pause(1000); // Wait and check again + checkElements(); + } + } + ); + } + + checkElements(); + }); } else { browser.waitForElementVisible('*[data-id="show-more-branches-on-remote"]') .click('*[data-id="show-more-branches-on-remote"]') From 3b4536a4e3cda84a36430f6eb416b6b769238f59 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 13:18:15 +0100 Subject: [PATCH 07/10] extra check --- apps/remixdesktop/test/tests/app/github_3.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index ca00ad0d34..2157bf2de8 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -175,6 +175,8 @@ const tests = { [branchSelector], function (result) { if ((result.value as number) > minCount) { + console.log('Number of loaded branches elements:', result.value); + browser.saveScreenshot('./reports/screenshots/branches-panel4.png') done(); } else { browser.pause(1000); // Wait and check again From d912aa8ccb4ee6c3e708e67736803b712468e115 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 13:45:40 +0100 Subject: [PATCH 08/10] checks --- apps/remixdesktop/test/tests/app/github_3.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index 2157bf2de8..5bac3f0b39 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -175,7 +175,7 @@ const tests = { [branchSelector], function (result) { if ((result.value as number) > minCount) { - console.log('Number of loaded branches elements:', result.value); + console.log('Number of loaded branches elements:', result.value, minCount); browser.saveScreenshot('./reports/screenshots/branches-panel4.png') done(); } else { From 611c32f7fb2a46c19f20e6f6aa7b416be7dc13e3 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 14:14:21 +0100 Subject: [PATCH 09/10] count different --- apps/remixdesktop/test/tests/app/github_3.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index 5bac3f0b39..95c1723bd7 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -156,7 +156,6 @@ const tests = { if (useIsoGit) { const branchSelector = '//*[@data-id="branches-panel-content-remote-branches"]//*[@data-type="branches-branch"]'; - const minCount = branchCount browser .saveScreenshot('./reports/screenshots/branches-panel.png') @@ -174,8 +173,8 @@ const tests = { }, [branchSelector], function (result) { - if ((result.value as number) > minCount) { - console.log('Number of loaded branches elements:', result.value, minCount); + if ((result.value as number) > 1) { + console.log('Number of loaded branches elements:', result.value); browser.saveScreenshot('./reports/screenshots/branches-panel4.png') done(); } else { From fb74423d9e8ad7400715f9e8ec37efa1597f7af1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 15 Feb 2025 14:33:58 +0100 Subject: [PATCH 10/10] turn off screenshots --- apps/remixdesktop/test/tests/app/github_3.test.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/remixdesktop/test/tests/app/github_3.test.ts b/apps/remixdesktop/test/tests/app/github_3.test.ts index 95c1723bd7..f2c8f1132b 100644 --- a/apps/remixdesktop/test/tests/app/github_3.test.ts +++ b/apps/remixdesktop/test/tests/app/github_3.test.ts @@ -145,7 +145,7 @@ const tests = { console.log('Number of branches elements:', (result.value as any).length); if (useIsoGit) { branchCount = (result.value as any).length - browser.assert.ok((result.value as any).length == 1).saveScreenshot('./reports/screenshots/branches-panel0.png') + browser.assert.ok((result.value as any).length == 1) } else { branchCount = (result.value as any).length browser.assert.ok((result.value as any).length > 2) @@ -158,12 +158,9 @@ const tests = { const branchSelector = '//*[@data-id="branches-panel-content-remote-branches"]//*[@data-type="branches-branch"]'; browser - .saveScreenshot('./reports/screenshots/branches-panel.png') .waitForElementVisible('*[data-id="remote-sync-origin"]') .click('*[data-id="remote-sync-origin"]') - .saveScreenshot('./reports/screenshots/branches-panel2.png') .waitForElementVisible('*[data-id="loader-indicator"]') - .saveScreenshot('./reports/screenshots/branches-panel3.png') browser.perform(function (done) { function checkElements() { @@ -175,7 +172,6 @@ const tests = { function (result) { if ((result.value as number) > 1) { console.log('Number of loaded branches elements:', result.value); - browser.saveScreenshot('./reports/screenshots/branches-panel4.png') done(); } else { browser.pause(1000); // Wait and check again