From 40dad1408a5d596efe35d3fcb076b6fd9f973de9 Mon Sep 17 00:00:00 2001 From: Nadeem Yaseen <70559777+NadeemYaseen@users.noreply.github.com> Date: Thu, 21 Nov 2024 08:17:15 +0500 Subject: [PATCH] Added RPE icon (#271) * added RPE icon * added rpeicon.png file * Update restart.test.js * Update dsp.test.js * Update clocking.test.js * Update clocking.test.js * Update clocking.test.js * Update bcpu.test.js * Update clocking.test.js * Update dsp.test.js * Update restart.test.js * Update bcpu.test.js * Update clocking.test.js * Update dsp.test.js * Update restart.test.js --------- Co-authored-by: Shiva Ahir --- imgs/rpeicon.png | Bin 0 -> 2052 bytes main.js | 1 + package.json | 5 +++++ tests/e2e/bcpu.test.js | 2 +- tests/e2e/clocking.test.js | 5 +++-- tests/e2e/dsp.test.js | 16 ++++++++++------ tests/e2e/restart.test.js | 4 ++-- 7 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 imgs/rpeicon.png diff --git a/imgs/rpeicon.png b/imgs/rpeicon.png new file mode 100644 index 0000000000000000000000000000000000000000..91a4adfca257a17dbce7273c965e4b9df69f1ad6 GIT binary patch literal 2052 zcmbtVc~BE)6pxA^L9jvxC|F%V4T{NTlK>{>AP@-QDn~4)sJPi(Ad<_?1_Dy6P_2sK zfdCE0Me`gpV>LV!F^GAPICB0RtADR&NqmL<~ExfPANxK?VuJ(R4wQEOG=wS|Ua! zK^O%fn3I#k%HgsMcm@dZ`FxPg0XZBdiC~&?^#p8T>P`M610Aq)$S@OvYm9`(pa&>U zSZy#9A_jvFj8IDn0@tWV+4UwCY+o@`E-W%>5JpWP#9~v&0s!GKULZwHlsOzE8Cz{P zhApke9?1yfCQO-Y#6*lF%w#a*2xe!XoJL5(aSSFfRLo&>cuWXla@a!foh>THTZae> zp+LnL%I9LRTFngMAi+!?#9=dGE{DrR)FF_X%SHGwJAIUB*kwFTq?%+2;skMmgZK~+ z3gHJWdK=lkIUcVxn2}5>6)|U&_wAY;D+HY1=8KpdOgG`D$k`!qPq-G-1fQzMi zG#7|9140V&&myUKd)@z2ZOKn^w7BEWV1bQe)K9_$cGVhirNN*Thr{}87zjwh^eBd7 z_Y#f82pa6#p7p!{#VzU#%sJd|Kc5k$3qt^l-4aRNUwFctadJMcIU;kyR@$rw*@=( z6^0=N%PaFM!w#ojFK&ET{QNur=iSUs)0CfQODkfk{5neH)BW*@iN!CTIyuX}c$DZ~ zA6Q+)mD4*7AGb|*JphSc${#o%c>GOSOYPhh%Z{ZLb+*s44W6H{yh1W#-+nO6>Q|#G zk65zax3?*|m3PKf)+<-%{phd>ePVSy$1A>M7&x%@W{b69=Bi6|JLW>4UNo+Fx;?tD zl%)?IXgHEhe?%8<{4%n%-f=SEa<(K4ly4E;)Mr*-o)ynOK+AXgx~}KOuDtL6eBf1C z+nBZ3Rp&l?WwVlDtDwy~`SPg1lNC{^#vOIK(+*7!8$BF8ST(g-vMyoharpBD@6^z= zuE^T`Zkv;bsyqyHVh1hNww7>s_dQU;ZDrb&cdA1HZ`-d&=S@6&-&@t2wCL2SwmmBY z4&nD&Eu9IeSII)at|G<@;kU7-Fv6v+%vjZudP00 z;cUn~W0R^1u9wiVqN`RD9qzY!pZ7chz|QPMl{Ka+`J=&G+?V5%RbZDYw|qLgV&SKSm=ReJ@@As1?VgNvZyPvP+r|I=~8XS%l;#Yjs?@NEH_k2ycIqvby;n! zPL=AyoBXt2ZufRhUDdw}@4vxlKUH`)eoNY27ka)nP2#jIMzN=C%4~;jq1%Vee|#I8 q=T$vP(>3k0F$yf2n`y20dgHeFVsB1HPiqtPpH@V~%MORFEchE! { mainWindow = new BrowserWindow({ width: 1400, height: 800, + icon: `${__dirname}/imgs/rpeicon.png`, webPreferences: { preload: path.join(app.getAppPath(), 'preload.js'), nodeIntegration: true, diff --git a/package.json b/package.json index 14722835..58edea7c 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "node_modules/**/*", "package.json", "cleanup.js", + "imgs/*", "projectFile.js" ], "directories": { @@ -38,6 +39,10 @@ "from": "backend/restapi_server.exe", "to": "./backend/restapi_server.exe" }, + { + "from": "backend/etc/devices", + "to": "./backend/etc/devices" + }, { "from": "backend/etc/device.xml", "to": "./backend/etc/device.xml" diff --git a/tests/e2e/bcpu.test.js b/tests/e2e/bcpu.test.js index 2ac29cad..9950cf9d 100644 --- a/tests/e2e/bcpu.test.js +++ b/tests/e2e/bcpu.test.js @@ -35,4 +35,4 @@ test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', // Close the app await app.close(); -}); \ No newline at end of file +}); diff --git a/tests/e2e/clocking.test.js b/tests/e2e/clocking.test.js index 176a2231..370d1c85 100644 --- a/tests/e2e/clocking.test.js +++ b/tests/e2e/clocking.test.js @@ -41,9 +41,10 @@ test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second // Clicking OK to submit the form - const okButtonSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-footer > button.ant-btn.css-dev-only-do-not-override-49qm.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid > span'; - const okButton = await window.waitForSelector(okButtonSelector); + const modalFooterSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-footer'; + const okButton = await window.locator(`${modalFooterSelector} button.ant-btn-primary`); await okButton.click(); + // Closing the test await app.close(); diff --git a/tests/e2e/dsp.test.js b/tests/e2e/dsp.test.js index c3cf20a9..8a35a101 100644 --- a/tests/e2e/dsp.test.js +++ b/tests/e2e/dsp.test.js @@ -33,9 +33,9 @@ test('Launch Electron app, add clocking source, navigate to DSP block, configure const portSignalInput = await window.waitForSelector(portSignalSelector); await portSignalInput.fill('test'); - // Clicking OK to submit the clocking form - const okButtonSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-footer > button.ant-btn.css-dev-only-do-not-override-49qm.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid > span'; - const okButton = await window.waitForSelector(okButtonSelector); + // Clicking OK to submit the form + const modalFooterSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-footer'; + const okButton = await window.locator(`${modalFooterSelector} button.ant-btn-primary`); await okButton.click(); // Navigate to the DSP block @@ -72,9 +72,13 @@ test('Launch Electron app, add clocking source, navigate to DSP block, configure const toggleRateInput = await window.waitForSelector(toggleRateSelector); await toggleRateInput.fill('50'); - // Clicking OK to submit the DSP form - const dspOkButtonSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-footer > button.ant-btn.css-dev-only-do-not-override-49qm.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; - const dspOkButton = await window.waitForSelector(dspOkButtonSelector); +// Define the modal footer selector as the base context + const dspModalFooterSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-footer'; + +// Locate the OK button within the modal footer + const dspOkButton = await window.locator(`${dspModalFooterSelector} button.ant-btn-primary`); + +// Click the OK button await dspOkButton.click(); // Closing the test diff --git a/tests/e2e/restart.test.js b/tests/e2e/restart.test.js index 743b547a..f174c19b 100644 --- a/tests/e2e/restart.test.js +++ b/tests/e2e/restart.test.js @@ -52,8 +52,8 @@ function isProcessRunning(pid) { } } -test('Launch and close Electron app 10 times, ensuring backend termination', async () => { - for (let i = 0; i < 10; i++) { +test('Launch and close Electron app 5 times, ensuring backend termination', async () => { + for (let i = 0; i < 5; i++) { console.log(`Iteration ${i + 1}: Launching and closing Electron app.`); // Launch the Electron app