From c02ff29bbde05d4d84db78cdb3c5dc38c9a27019 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Nov 2024 06:50:35 -0800 Subject: [PATCH 01/17] Testing Playwright tests on CI --- .github/workflows/rpe_test.yml | 6 +- tests/e2e/acpu.test.js | 56 ++++----- tests/e2e/bcpu.test.js | 88 +++++++------- tests/e2e/clocking.test.js | 100 ++++++++-------- tests/e2e/dsp.test.js | 212 ++++++++++++++++----------------- tests/e2e/fle.test.js | 34 +++--- 6 files changed, 248 insertions(+), 248 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index ae237762..d0b10a54 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -87,9 +87,9 @@ jobs: if: ${{ matrix.os != 'ubuntu-22.04' }} run: npm test - # - name: E2E Playwright tests on Linux latest & MacOS - # if: ${{ matrix.os == 'ubuntu-latest' }} - # run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test + - name: E2E Playwright tests on Linux latest & MacOS + if: ${{ matrix.os == 'ubuntu-latest' }} + run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test - name: Run ESLint only on ubuntu-latest if: ${{ matrix.os == 'ubuntu-latest' }} diff --git a/tests/e2e/acpu.test.js b/tests/e2e/acpu.test.js index a446afbe..b4536c44 100644 --- a/tests/e2e/acpu.test.js +++ b/tests/e2e/acpu.test.js @@ -1,37 +1,37 @@ -// const { _electron: electron } = require('playwright'); -// const { test, expect } = require('@playwright/test'); +const { _electron: electron } = require('playwright'); +const { test, expect } = require('@playwright/test'); -// test('Launch Electron app, select device, toggle ACPU power, and click Add slowly', async () => { -// const app = await electron.launch({ args: ['main.js'] }); +test('Launch Electron app, select device, toggle ACPU power, and click Add slowly', async () => { + const app = await electron.launch({ args: ['main.js'] }); -// const window = await app.firstWindow(); + const window = await app.firstWindow(); -// // selecting the device (MPW1 Gemini) -// const deviceDropdown = await window.waitForSelector('#deviceId'); -// await deviceDropdown.selectOption('MPW1'); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // wait 2 seconds (not really needed, just for demo) + // selecting the device (MPW1 Gemini) + const deviceDropdown = await window.waitForSelector('#deviceId'); + await deviceDropdown.selectOption('MPW1'); + await new Promise((resolve) => setTimeout(resolve, 2000)); // wait 2 seconds (not really needed, just for demo) -// // clicking on ACPU block -// const acpuBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div.top-l2-col1-row1 > div:nth-child(1) > div'); -// await acpuBlock.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); + // clicking on ACPU block + const acpuBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div.top-l2-col1-row1 > div:nth-child(1) > div'); + await acpuBlock.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); -// // toggling ACPU power, basically turning on the power on -// const acpuPowerToggle = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.toggle-container > label.toggle-switch > span'); -// await acpuPowerToggle.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); + // toggling ACPU power, basically turning on the power on + const acpuPowerToggle = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.toggle-container > label.toggle-switch > span'); + await acpuPowerToggle.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); -// // Click on Add button -// const addButton = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'); -// await addButton.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); + // Click on Add button + const addButton = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'); + await addButton.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); -// // Click OK in the popup -// const okButton = await window.waitForSelector('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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid > span'); -// await okButton.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); + // Click OK in the popup + const okButton = await window.waitForSelector('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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid > span'); + await okButton.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); -// console.log('Test case executed successfully.'); + console.log('Test case executed successfully.'); -// await app.close(); -// }); + await app.close(); +}); diff --git a/tests/e2e/bcpu.test.js b/tests/e2e/bcpu.test.js index 3adddb66..0980dc0e 100644 --- a/tests/e2e/bcpu.test.js +++ b/tests/e2e/bcpu.test.js @@ -1,44 +1,44 @@ -// const { _electron: electron } = require('playwright'); -// const { test, expect } = require('@playwright/test'); - -// test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', async () => { -// const app = await electron.launch({ args: ['main.js'], headless: false }); - -// const window = await app.firstWindow(); - -// // selecting MPW1 Gemini from device dropdown -// const deviceDropdown = await window.waitForSelector('#deviceId'); -// await deviceDropdown.selectOption('MPW1'); -// await window.waitForTimeout(2000); // wait for UI update - -// // click on the BCPU block -// const bcpuSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div.top-l2-col1-row1 > div:nth-child(2) > div'; -// await window.waitForSelector(bcpuSelector); -// await window.click(bcpuSelector); - -// // click on "Add" button -// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'; -// await window.waitForSelector(addButtonSelector, { state: 'visible' }); -// await window.click(addButtonSelector); - -// // click on "OK" button -// const okButtonSelector = 'button.ant-btn-primary'; -// await window.waitForSelector(okButtonSelector, { state: 'visible' }); -// await window.click(okButtonSelector); - -// // click on Peripherals tab -// const peripheralsTabSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div:nth-child(3) > div > div:nth-child(2) > div:nth-child(2) > div.periph-internal-font-header'; -// await window.waitForSelector(peripheralsTabSelector, { state: 'visible' }); -// await window.click(peripheralsTabSelector); - -// // check SPI/QSPI block -// const spiQspiCheckSelector = '#\\30'; -// await window.waitForSelector(spiQspiCheckSelector, { state: 'visible' }); -// await window.click(spiQspiCheckSelector); - -// // waiting to observe result on UI -// await window.waitForTimeout(5000); - -// // closing RPE -// await app.close(); -// }); +const { _electron: electron } = require('playwright'); +const { test, expect } = require('@playwright/test'); + +test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', async () => { + const app = await electron.launch({ args: ['main.js'], headless: false }); + + const window = await app.firstWindow(); + + // selecting MPW1 Gemini from device dropdown + const deviceDropdown = await window.waitForSelector('#deviceId'); + await deviceDropdown.selectOption('MPW1'); + await window.waitForTimeout(2000); // wait for UI update + + // click on the BCPU block + const bcpuSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div.top-l2-col1-row1 > div:nth-child(2) > div'; + await window.waitForSelector(bcpuSelector); + await window.click(bcpuSelector); + + // click on "Add" button + const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'; + await window.waitForSelector(addButtonSelector, { state: 'visible' }); + await window.click(addButtonSelector); + + // click on "OK" button + const okButtonSelector = 'button.ant-btn-primary'; + await window.waitForSelector(okButtonSelector, { state: 'visible' }); + await window.click(okButtonSelector); + + // click on Peripherals tab + const peripheralsTabSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div:nth-child(3) > div > div:nth-child(2) > div:nth-child(2) > div.periph-internal-font-header'; + await window.waitForSelector(peripheralsTabSelector, { state: 'visible' }); + await window.click(peripheralsTabSelector); + + // check SPI/QSPI block + const spiQspiCheckSelector = '#\\30'; + await window.waitForSelector(spiQspiCheckSelector, { state: 'visible' }); + await window.click(spiQspiCheckSelector); + + // waiting to observe result on UI + await window.waitForTimeout(5000); + + // closing RPE + await app.close(); +}); diff --git a/tests/e2e/clocking.test.js b/tests/e2e/clocking.test.js index 65f3b561..69714b45 100644 --- a/tests/e2e/clocking.test.js +++ b/tests/e2e/clocking.test.js @@ -1,51 +1,51 @@ -// const { _electron: electron } = require('playwright'); -// const { test, expect } = require('@playwright/test'); - -// test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add clock source, and submit form', async () => { -// const app = await electron.launch({ args: ['main.js'] }); -// const window = await app.firstWindow(); - -// // Selecting the device (MPW1 Gemini) -// const deviceDropdown = await window.waitForSelector('#deviceId'); -// await deviceDropdown.selectOption('MPW1'); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - -// // Selecting Clocking block -// const clockingBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(1) > div'; -// const clockingBlock = await window.waitForSelector(clockingBlockSelector); -// await clockingBlock.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - -// // Clicking on Add button -// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; -// const addButton = await window.waitForSelector(addButtonSelector); -// await addButton.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - -// // Ensure modal is visible before interacting -// const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; -// await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal - -// // Typing description as 'test' -// const descriptionSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=text]'; -// const descriptionInput = await window.waitForSelector(descriptionSelector); -// await descriptionInput.click(); -// await descriptionInput.fill('test'); -// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - -// // Typing Port/Signal name as 'test' -// const portSignalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(3) > input[type=text]'; -// const portSignalInput = await window.waitForSelector(portSignalSelector); -// await portSignalInput.click(); -// await portSignalInput.fill('test'); -// 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; -// const okButton = await window.waitForSelector(okButtonSelector); -// await okButton.click(); - -// // Closing the test -// await app.close(); -// }); +const { _electron: electron } = require('playwright'); +const { test, expect } = require('@playwright/test'); + +test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add clock source, and submit form', async () => { + const app = await electron.launch({ args: ['main.js'] }); + const window = await app.firstWindow(); + + // Selecting the device (MPW1 Gemini) + const deviceDropdown = await window.waitForSelector('#deviceId'); + await deviceDropdown.selectOption('MPW1'); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + + // Selecting Clocking block + const clockingBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(1) > div'; + const clockingBlock = await window.waitForSelector(clockingBlockSelector); + await clockingBlock.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + + // Clicking on Add button + const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; + const addButton = await window.waitForSelector(addButtonSelector); + await addButton.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + + // Ensure modal is visible before interacting + const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; + await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal + + // Typing description as 'test' + const descriptionSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=text]'; + const descriptionInput = await window.waitForSelector(descriptionSelector); + await descriptionInput.click(); + await descriptionInput.fill('test'); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + + // Typing Port/Signal name as 'test' + const portSignalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(3) > input[type=text]'; + const portSignalInput = await window.waitForSelector(portSignalSelector); + await portSignalInput.click(); + await portSignalInput.fill('test'); + 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; + const okButton = await window.waitForSelector(okButtonSelector); + await okButton.click(); + + // Closing the test + await app.close(); +}); diff --git a/tests/e2e/dsp.test.js b/tests/e2e/dsp.test.js index fed0c53c..a64770bd 100644 --- a/tests/e2e/dsp.test.js +++ b/tests/e2e/dsp.test.js @@ -1,106 +1,106 @@ -// const { _electron: electron } = require('playwright'); -// const { test, expect } = require('@playwright/test'); - -// test('Launch Electron app, add clocking source, navigate to DSP block, configure DSP, and submit form', async () => { -// const app = await electron.launch({ args: ['main.js'] }); -// const window = await app.firstWindow(); - -// // Selecting the device (MPW1 Gemini) -// const deviceDropdown = await window.waitForSelector('#deviceId'); -// await deviceDropdown.selectOption('MPW1'); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - -// // Selecting Clocking block -// const clockingBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(1) > div'; -// const clockingBlock = await window.waitForSelector(clockingBlockSelector); -// await clockingBlock.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - -// // Clicking on Add button for Clocking -// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; -// const addButton = await window.waitForSelector(addButtonSelector); -// await addButton.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - -// // Ensure modal is visible before interacting -// const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; -// await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal - -// // Typing description as 'test' -// const descriptionSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=text]'; -// const descriptionInput = await window.waitForSelector(descriptionSelector); -// await descriptionInput.click(); -// await descriptionInput.fill('test'); -// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - -// // Typing Port/Signal name as 'test' -// const portSignalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(3) > input[type=text]'; -// const portSignalInput = await window.waitForSelector(portSignalSelector); -// await portSignalInput.click(); -// await portSignalInput.fill('test'); -// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - -// // 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; -// const okButton = await window.waitForSelector(okButtonSelector); -// await okButton.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for the form to submit - - -// // Navigate to the DSP block -// const dspBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(3) > div:nth-child(2) > div'; -// const dspBlock = await window.waitForSelector(dspBlockSelector); -// await dspBlock.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - -// // Clicking on Add button for DSP -// const addDSPButton = await window.waitForSelector(addButtonSelector); // Reusing the same addButtonSelector -// await addDSPButton.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - -// // Typing Name/Hierarchy as 'test' -// const nameHierarchySelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(1) > input[type=text]'; -// const nameHierarchyInput = await window.waitForSelector(nameHierarchySelector); -// await nameHierarchyInput.click(); -// await nameHierarchyInput.fill('test'); -// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - -// // Typing XX as 32 -// const xxSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=number]'; -// const xxInput = await window.waitForSelector(xxSelector); -// await xxInput.click(); -// await xxInput.fill('32'); -// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - -// // Typing A-input width as 64 -// const aInputWidthSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(4) > input[type=number]'; -// const aInputWidthInput = await window.waitForSelector(aInputWidthSelector); -// await aInputWidthInput.click(); -// await aInputWidthInput.fill('64'); -// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - -// // Typing B-input width as 64 -// const bInputWidthSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(5) > input[type=number]'; -// const bInputWidthInput = await window.waitForSelector(bInputWidthSelector); -// await bInputWidthInput.click(); -// await bInputWidthInput.fill('64'); -// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - -// // Typing toggle rate as 50 -// const toggleRateSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(8) > input[type=number]'; -// const toggleRateInput = await window.waitForSelector(toggleRateSelector); -// await toggleRateInput.click(); -// await toggleRateInput.fill('50'); -// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - -// // Take note of the DSP power generated (assuming it's shown in the UI somewhere, you can add the selector for DSP power if needed) - -// // 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; -// const dspOkButton = await window.waitForSelector(dspOkButtonSelector); -// await dspOkButton.click(); -// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for the form to submit - -// // Closing the test -// await app.close(); -// }); +const { _electron: electron } = require('playwright'); +const { test, expect } = require('@playwright/test'); + +test('Launch Electron app, add clocking source, navigate to DSP block, configure DSP, and submit form', async () => { + const app = await electron.launch({ args: ['main.js'] }); + const window = await app.firstWindow(); + + // Selecting the device (MPW1 Gemini) + const deviceDropdown = await window.waitForSelector('#deviceId'); + await deviceDropdown.selectOption('MPW1'); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + + // Selecting Clocking block + const clockingBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(1) > div'; + const clockingBlock = await window.waitForSelector(clockingBlockSelector); + await clockingBlock.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + + // Clicking on Add button for Clocking + const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; + const addButton = await window.waitForSelector(addButtonSelector); + await addButton.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + + // Ensure modal is visible before interacting + const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; + await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal + + // Typing description as 'test' + const descriptionSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=text]'; + const descriptionInput = await window.waitForSelector(descriptionSelector); + await descriptionInput.click(); + await descriptionInput.fill('test'); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + + // Typing Port/Signal name as 'test' + const portSignalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(3) > input[type=text]'; + const portSignalInput = await window.waitForSelector(portSignalSelector); + await portSignalInput.click(); + await portSignalInput.fill('test'); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + + // 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; + const okButton = await window.waitForSelector(okButtonSelector); + await okButton.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for the form to submit + + + // Navigate to the DSP block + const dspBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(3) > div:nth-child(2) > div'; + const dspBlock = await window.waitForSelector(dspBlockSelector); + await dspBlock.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + + // Clicking on Add button for DSP + const addDSPButton = await window.waitForSelector(addButtonSelector); // Reusing the same addButtonSelector + await addDSPButton.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + + // Typing Name/Hierarchy as 'test' + const nameHierarchySelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(1) > input[type=text]'; + const nameHierarchyInput = await window.waitForSelector(nameHierarchySelector); + await nameHierarchyInput.click(); + await nameHierarchyInput.fill('test'); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + + // Typing XX as 32 + const xxSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=number]'; + const xxInput = await window.waitForSelector(xxSelector); + await xxInput.click(); + await xxInput.fill('32'); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + + // Typing A-input width as 64 + const aInputWidthSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(4) > input[type=number]'; + const aInputWidthInput = await window.waitForSelector(aInputWidthSelector); + await aInputWidthInput.click(); + await aInputWidthInput.fill('64'); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + + // Typing B-input width as 64 + const bInputWidthSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(5) > input[type=number]'; + const bInputWidthInput = await window.waitForSelector(bInputWidthSelector); + await bInputWidthInput.click(); + await bInputWidthInput.fill('64'); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + + // Typing toggle rate as 50 + const toggleRateSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(8) > input[type=number]'; + const toggleRateInput = await window.waitForSelector(toggleRateSelector); + await toggleRateInput.click(); + await toggleRateInput.fill('50'); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + + // Take note of the DSP power generated (assuming it's shown in the UI somewhere, you can add the selector for DSP power if needed) + + // 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; + const dspOkButton = await window.waitForSelector(dspOkButtonSelector); + await dspOkButton.click(); + await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for the form to submit + + // Closing the test + await app.close(); +}); diff --git a/tests/e2e/fle.test.js b/tests/e2e/fle.test.js index 27a7b015..c099bc8f 100644 --- a/tests/e2e/fle.test.js +++ b/tests/e2e/fle.test.js @@ -1,25 +1,25 @@ -// const { _electron: electron } = require('playwright'); -// const { test, expect } = require('@playwright/test'); +const { _electron: electron } = require('playwright'); +const { test, expect } = require('@playwright/test'); -// test('Launch Electron app and click on FLE block', async () => { -// const app = await electron.launch({ args: ['main.js'] }); +test('Launch Electron app and click on FLE block', async () => { + const app = await electron.launch({ args: ['main.js'] }); -// const window = await app.firstWindow(); + const window = await app.firstWindow(); -// // selecting the device (MPW1 Gemini) -// const deviceDropdown = await window.waitForSelector('#deviceId'); -// await deviceDropdown.selectOption('MPW1'); -// await new Promise((resolve) => setTimeout(resolve, 2000)); + // selecting the device (MPW1 Gemini) + const deviceDropdown = await window.waitForSelector('#deviceId'); + await deviceDropdown.selectOption('MPW1'); + await new Promise((resolve) => setTimeout(resolve, 2000)); -// const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); -// await fleBlock.click(); + const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); + await fleBlock.click(); -// const flePowerVisible = await window.isVisible('div.title-comp-total-text'); -// expect(flePowerVisible).toBeTruthy(); + const flePowerVisible = await window.isVisible('div.title-comp-total-text'); + expect(flePowerVisible).toBeTruthy(); -// console.log('FLE block clicked and verified.'); + console.log('FLE block clicked and verified.'); -// await new Promise((resolve) => setTimeout(resolve, 5000)); + await new Promise((resolve) => setTimeout(resolve, 5000)); -// await app.close(); -// }); + await app.close(); +}); From b9d50919af1d5540ea8d12b1bc619308c38682f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Nov 2024 07:01:41 -0800 Subject: [PATCH 02/17] Testing Playwright tests on CI --- .github/workflows/rpe_test.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index d0b10a54..8809f248 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -88,8 +88,16 @@ jobs: run: npm test - name: E2E Playwright tests on Linux latest & MacOS - if: ${{ matrix.os == 'ubuntu-latest' }} - run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + npm run compile + npm start & + sleep 5 + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test + +# - name: E2E Playwright tests on Linux latest & MacOS +# if: ${{ matrix.os == 'ubuntu-latest' }} +# run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test - name: Run ESLint only on ubuntu-latest if: ${{ matrix.os == 'ubuntu-latest' }} From d08a556d5b1988cd0dd3c55ceff4cf1e3e769de4 Mon Sep 17 00:00:00 2001 From: Shiva Ahir Date: Wed, 6 Nov 2024 08:08:58 -0800 Subject: [PATCH 03/17] Update rpe_test.yml --- .github/workflows/rpe_test.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index 8809f248..af7069c4 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -86,18 +86,10 @@ jobs: - name: Unit Jtest Linux latest & windows & MacOS if: ${{ matrix.os != 'ubuntu-22.04' }} run: npm test - + - name: E2E Playwright tests on Linux latest & MacOS - if: ${{ matrix.os == 'ubuntu-latest' }} - run: | - npm run compile - npm start & - sleep 5 - xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test - -# - name: E2E Playwright tests on Linux latest & MacOS -# if: ${{ matrix.os == 'ubuntu-latest' }} -# run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test + if: ${{ matrix.os == 'ubuntu-latest' }} + run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test - name: Run ESLint only on ubuntu-latest if: ${{ matrix.os == 'ubuntu-latest' }} From 5a51e675729e9ed45189d3db4b2be936dc1661de Mon Sep 17 00:00:00 2001 From: Shiva Ahir Date: Wed, 6 Nov 2024 08:15:04 -0800 Subject: [PATCH 04/17] Update bcpu.test.js --- tests/e2e/bcpu.test.js | 88 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/e2e/bcpu.test.js b/tests/e2e/bcpu.test.js index 0980dc0e..3adddb66 100644 --- a/tests/e2e/bcpu.test.js +++ b/tests/e2e/bcpu.test.js @@ -1,44 +1,44 @@ -const { _electron: electron } = require('playwright'); -const { test, expect } = require('@playwright/test'); - -test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', async () => { - const app = await electron.launch({ args: ['main.js'], headless: false }); - - const window = await app.firstWindow(); - - // selecting MPW1 Gemini from device dropdown - const deviceDropdown = await window.waitForSelector('#deviceId'); - await deviceDropdown.selectOption('MPW1'); - await window.waitForTimeout(2000); // wait for UI update - - // click on the BCPU block - const bcpuSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div.top-l2-col1-row1 > div:nth-child(2) > div'; - await window.waitForSelector(bcpuSelector); - await window.click(bcpuSelector); - - // click on "Add" button - const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'; - await window.waitForSelector(addButtonSelector, { state: 'visible' }); - await window.click(addButtonSelector); - - // click on "OK" button - const okButtonSelector = 'button.ant-btn-primary'; - await window.waitForSelector(okButtonSelector, { state: 'visible' }); - await window.click(okButtonSelector); - - // click on Peripherals tab - const peripheralsTabSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div:nth-child(3) > div > div:nth-child(2) > div:nth-child(2) > div.periph-internal-font-header'; - await window.waitForSelector(peripheralsTabSelector, { state: 'visible' }); - await window.click(peripheralsTabSelector); - - // check SPI/QSPI block - const spiQspiCheckSelector = '#\\30'; - await window.waitForSelector(spiQspiCheckSelector, { state: 'visible' }); - await window.click(spiQspiCheckSelector); - - // waiting to observe result on UI - await window.waitForTimeout(5000); - - // closing RPE - await app.close(); -}); +// const { _electron: electron } = require('playwright'); +// const { test, expect } = require('@playwright/test'); + +// test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', async () => { +// const app = await electron.launch({ args: ['main.js'], headless: false }); + +// const window = await app.firstWindow(); + +// // selecting MPW1 Gemini from device dropdown +// const deviceDropdown = await window.waitForSelector('#deviceId'); +// await deviceDropdown.selectOption('MPW1'); +// await window.waitForTimeout(2000); // wait for UI update + +// // click on the BCPU block +// const bcpuSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div.top-l2-col1-row1 > div:nth-child(2) > div'; +// await window.waitForSelector(bcpuSelector); +// await window.click(bcpuSelector); + +// // click on "Add" button +// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'; +// await window.waitForSelector(addButtonSelector, { state: 'visible' }); +// await window.click(addButtonSelector); + +// // click on "OK" button +// const okButtonSelector = 'button.ant-btn-primary'; +// await window.waitForSelector(okButtonSelector, { state: 'visible' }); +// await window.click(okButtonSelector); + +// // click on Peripherals tab +// const peripheralsTabSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div:nth-child(3) > div > div:nth-child(2) > div:nth-child(2) > div.periph-internal-font-header'; +// await window.waitForSelector(peripheralsTabSelector, { state: 'visible' }); +// await window.click(peripheralsTabSelector); + +// // check SPI/QSPI block +// const spiQspiCheckSelector = '#\\30'; +// await window.waitForSelector(spiQspiCheckSelector, { state: 'visible' }); +// await window.click(spiQspiCheckSelector); + +// // waiting to observe result on UI +// await window.waitForTimeout(5000); + +// // closing RPE +// await app.close(); +// }); From b5a40ea8786dd46fb60e00feb169478d6d6a0072 Mon Sep 17 00:00:00 2001 From: Shiva Ahir Date: Wed, 6 Nov 2024 08:15:18 -0800 Subject: [PATCH 05/17] Update clocking.test.js --- tests/e2e/clocking.test.js | 100 ++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/tests/e2e/clocking.test.js b/tests/e2e/clocking.test.js index 69714b45..65f3b561 100644 --- a/tests/e2e/clocking.test.js +++ b/tests/e2e/clocking.test.js @@ -1,51 +1,51 @@ -const { _electron: electron } = require('playwright'); -const { test, expect } = require('@playwright/test'); - -test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add clock source, and submit form', async () => { - const app = await electron.launch({ args: ['main.js'] }); - const window = await app.firstWindow(); - - // Selecting the device (MPW1 Gemini) - const deviceDropdown = await window.waitForSelector('#deviceId'); - await deviceDropdown.selectOption('MPW1'); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - - // Selecting Clocking block - const clockingBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(1) > div'; - const clockingBlock = await window.waitForSelector(clockingBlockSelector); - await clockingBlock.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - - // Clicking on Add button - const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; - const addButton = await window.waitForSelector(addButtonSelector); - await addButton.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - - // Ensure modal is visible before interacting - const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; - await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal - - // Typing description as 'test' - const descriptionSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=text]'; - const descriptionInput = await window.waitForSelector(descriptionSelector); - await descriptionInput.click(); - await descriptionInput.fill('test'); - await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - - // Typing Port/Signal name as 'test' - const portSignalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(3) > input[type=text]'; - const portSignalInput = await window.waitForSelector(portSignalSelector); - await portSignalInput.click(); - await portSignalInput.fill('test'); - 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; - const okButton = await window.waitForSelector(okButtonSelector); - await okButton.click(); - - // Closing the test - await app.close(); -}); +// const { _electron: electron } = require('playwright'); +// const { test, expect } = require('@playwright/test'); + +// test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add clock source, and submit form', async () => { +// const app = await electron.launch({ args: ['main.js'] }); +// const window = await app.firstWindow(); + +// // Selecting the device (MPW1 Gemini) +// const deviceDropdown = await window.waitForSelector('#deviceId'); +// await deviceDropdown.selectOption('MPW1'); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + +// // Selecting Clocking block +// const clockingBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(1) > div'; +// const clockingBlock = await window.waitForSelector(clockingBlockSelector); +// await clockingBlock.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + +// // Clicking on Add button +// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; +// const addButton = await window.waitForSelector(addButtonSelector); +// await addButton.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + +// // Ensure modal is visible before interacting +// const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; +// await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal + +// // Typing description as 'test' +// const descriptionSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=text]'; +// const descriptionInput = await window.waitForSelector(descriptionSelector); +// await descriptionInput.click(); +// await descriptionInput.fill('test'); +// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + +// // Typing Port/Signal name as 'test' +// const portSignalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(3) > input[type=text]'; +// const portSignalInput = await window.waitForSelector(portSignalSelector); +// await portSignalInput.click(); +// await portSignalInput.fill('test'); +// 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; +// const okButton = await window.waitForSelector(okButtonSelector); +// await okButton.click(); + +// // Closing the test +// await app.close(); +// }); From a86c7ff7e914c05db0903d7e994abdddb52ec285 Mon Sep 17 00:00:00 2001 From: Shiva Ahir Date: Wed, 6 Nov 2024 08:15:29 -0800 Subject: [PATCH 06/17] Update dsp.test.js --- tests/e2e/dsp.test.js | 212 +++++++++++++++++++++--------------------- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/tests/e2e/dsp.test.js b/tests/e2e/dsp.test.js index a64770bd..fed0c53c 100644 --- a/tests/e2e/dsp.test.js +++ b/tests/e2e/dsp.test.js @@ -1,106 +1,106 @@ -const { _electron: electron } = require('playwright'); -const { test, expect } = require('@playwright/test'); - -test('Launch Electron app, add clocking source, navigate to DSP block, configure DSP, and submit form', async () => { - const app = await electron.launch({ args: ['main.js'] }); - const window = await app.firstWindow(); - - // Selecting the device (MPW1 Gemini) - const deviceDropdown = await window.waitForSelector('#deviceId'); - await deviceDropdown.selectOption('MPW1'); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - - // Selecting Clocking block - const clockingBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(1) > div'; - const clockingBlock = await window.waitForSelector(clockingBlockSelector); - await clockingBlock.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - - // Clicking on Add button for Clocking - const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; - const addButton = await window.waitForSelector(addButtonSelector); - await addButton.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - - // Ensure modal is visible before interacting - const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; - await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal - - // Typing description as 'test' - const descriptionSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=text]'; - const descriptionInput = await window.waitForSelector(descriptionSelector); - await descriptionInput.click(); - await descriptionInput.fill('test'); - await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - - // Typing Port/Signal name as 'test' - const portSignalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(3) > input[type=text]'; - const portSignalInput = await window.waitForSelector(portSignalSelector); - await portSignalInput.click(); - await portSignalInput.fill('test'); - await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - - // 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; - const okButton = await window.waitForSelector(okButtonSelector); - await okButton.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for the form to submit - - - // Navigate to the DSP block - const dspBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(3) > div:nth-child(2) > div'; - const dspBlock = await window.waitForSelector(dspBlockSelector); - await dspBlock.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - - // Clicking on Add button for DSP - const addDSPButton = await window.waitForSelector(addButtonSelector); // Reusing the same addButtonSelector - await addDSPButton.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds - - // Typing Name/Hierarchy as 'test' - const nameHierarchySelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(1) > input[type=text]'; - const nameHierarchyInput = await window.waitForSelector(nameHierarchySelector); - await nameHierarchyInput.click(); - await nameHierarchyInput.fill('test'); - await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - - // Typing XX as 32 - const xxSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=number]'; - const xxInput = await window.waitForSelector(xxSelector); - await xxInput.click(); - await xxInput.fill('32'); - await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - - // Typing A-input width as 64 - const aInputWidthSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(4) > input[type=number]'; - const aInputWidthInput = await window.waitForSelector(aInputWidthSelector); - await aInputWidthInput.click(); - await aInputWidthInput.fill('64'); - await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - - // Typing B-input width as 64 - const bInputWidthSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(5) > input[type=number]'; - const bInputWidthInput = await window.waitForSelector(bInputWidthSelector); - await bInputWidthInput.click(); - await bInputWidthInput.fill('64'); - await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - - // Typing toggle rate as 50 - const toggleRateSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(8) > input[type=number]'; - const toggleRateInput = await window.waitForSelector(toggleRateSelector); - await toggleRateInput.click(); - await toggleRateInput.fill('50'); - await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second - - // Take note of the DSP power generated (assuming it's shown in the UI somewhere, you can add the selector for DSP power if needed) - - // 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; - const dspOkButton = await window.waitForSelector(dspOkButtonSelector); - await dspOkButton.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for the form to submit - - // Closing the test - await app.close(); -}); +// const { _electron: electron } = require('playwright'); +// const { test, expect } = require('@playwright/test'); + +// test('Launch Electron app, add clocking source, navigate to DSP block, configure DSP, and submit form', async () => { +// const app = await electron.launch({ args: ['main.js'] }); +// const window = await app.firstWindow(); + +// // Selecting the device (MPW1 Gemini) +// const deviceDropdown = await window.waitForSelector('#deviceId'); +// await deviceDropdown.selectOption('MPW1'); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + +// // Selecting Clocking block +// const clockingBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(1) > div'; +// const clockingBlock = await window.waitForSelector(clockingBlockSelector); +// await clockingBlock.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + +// // Clicking on Add button for Clocking +// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; +// const addButton = await window.waitForSelector(addButtonSelector); +// await addButton.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + +// // Ensure modal is visible before interacting +// const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; +// await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal + +// // Typing description as 'test' +// const descriptionSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=text]'; +// const descriptionInput = await window.waitForSelector(descriptionSelector); +// await descriptionInput.click(); +// await descriptionInput.fill('test'); +// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + +// // Typing Port/Signal name as 'test' +// const portSignalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(3) > input[type=text]'; +// const portSignalInput = await window.waitForSelector(portSignalSelector); +// await portSignalInput.click(); +// await portSignalInput.fill('test'); +// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + +// // 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; +// const okButton = await window.waitForSelector(okButtonSelector); +// await okButton.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for the form to submit + + +// // Navigate to the DSP block +// const dspBlockSelector = '#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(3) > div:nth-child(2) > div'; +// const dspBlock = await window.waitForSelector(dspBlockSelector); +// await dspBlock.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + +// // Clicking on Add button for DSP +// const addDSPButton = await window.waitForSelector(addButtonSelector); // Reusing the same addButtonSelector +// await addDSPButton.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds + +// // Typing Name/Hierarchy as 'test' +// const nameHierarchySelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(1) > input[type=text]'; +// const nameHierarchyInput = await window.waitForSelector(nameHierarchySelector); +// await nameHierarchyInput.click(); +// await nameHierarchyInput.fill('test'); +// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + +// // Typing XX as 32 +// const xxSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(2) > input[type=number]'; +// const xxInput = await window.waitForSelector(xxSelector); +// await xxInput.click(); +// await xxInput.fill('32'); +// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + +// // Typing A-input width as 64 +// const aInputWidthSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(4) > input[type=number]'; +// const aInputWidthInput = await window.waitForSelector(aInputWidthSelector); +// await aInputWidthInput.click(); +// await aInputWidthInput.fill('64'); +// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + +// // Typing B-input width as 64 +// const bInputWidthSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(5) > input[type=number]'; +// const bInputWidthInput = await window.waitForSelector(bInputWidthSelector); +// await bInputWidthInput.click(); +// await bInputWidthInput.fill('64'); +// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + +// // Typing toggle rate as 50 +// const toggleRateSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-body > div > form > div:nth-child(8) > input[type=number]'; +// const toggleRateInput = await window.waitForSelector(toggleRateSelector); +// await toggleRateInput.click(); +// await toggleRateInput.fill('50'); +// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second + +// // Take note of the DSP power generated (assuming it's shown in the UI somewhere, you can add the selector for DSP power if needed) + +// // 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; +// const dspOkButton = await window.waitForSelector(dspOkButtonSelector); +// await dspOkButton.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for the form to submit + +// // Closing the test +// await app.close(); +// }); From 452861ffb9c6ddb11c98a9f886ddcb8bd8d532f3 Mon Sep 17 00:00:00 2001 From: Shiva Ahir Date: Wed, 6 Nov 2024 08:15:39 -0800 Subject: [PATCH 07/17] Update fle.test.js --- tests/e2e/fle.test.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/e2e/fle.test.js b/tests/e2e/fle.test.js index c099bc8f..27a7b015 100644 --- a/tests/e2e/fle.test.js +++ b/tests/e2e/fle.test.js @@ -1,25 +1,25 @@ -const { _electron: electron } = require('playwright'); -const { test, expect } = require('@playwright/test'); +// const { _electron: electron } = require('playwright'); +// const { test, expect } = require('@playwright/test'); -test('Launch Electron app and click on FLE block', async () => { - const app = await electron.launch({ args: ['main.js'] }); +// test('Launch Electron app and click on FLE block', async () => { +// const app = await electron.launch({ args: ['main.js'] }); - const window = await app.firstWindow(); +// const window = await app.firstWindow(); - // selecting the device (MPW1 Gemini) - const deviceDropdown = await window.waitForSelector('#deviceId'); - await deviceDropdown.selectOption('MPW1'); - await new Promise((resolve) => setTimeout(resolve, 2000)); +// // selecting the device (MPW1 Gemini) +// const deviceDropdown = await window.waitForSelector('#deviceId'); +// await deviceDropdown.selectOption('MPW1'); +// await new Promise((resolve) => setTimeout(resolve, 2000)); - const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); - await fleBlock.click(); +// const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); +// await fleBlock.click(); - const flePowerVisible = await window.isVisible('div.title-comp-total-text'); - expect(flePowerVisible).toBeTruthy(); +// const flePowerVisible = await window.isVisible('div.title-comp-total-text'); +// expect(flePowerVisible).toBeTruthy(); - console.log('FLE block clicked and verified.'); +// console.log('FLE block clicked and verified.'); - await new Promise((resolve) => setTimeout(resolve, 5000)); +// await new Promise((resolve) => setTimeout(resolve, 5000)); - await app.close(); -}); +// await app.close(); +// }); From eddca70a674e1924a578ee16da5bf4b30cf9cdc4 Mon Sep 17 00:00:00 2001 From: NadeemYaseen Date: Wed, 6 Nov 2024 10:13:06 -0800 Subject: [PATCH 08/17] run e2e without backend --- .github/workflows/rpe_test.yml | 2 +- tests/e2e/fle.test.js | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index af7069c4..b7a598e4 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -89,7 +89,7 @@ jobs: - name: E2E Playwright tests on Linux latest & MacOS if: ${{ matrix.os == 'ubuntu-latest' }} - run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test + run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js - name: Run ESLint only on ubuntu-latest if: ${{ matrix.os == 'ubuntu-latest' }} diff --git a/tests/e2e/fle.test.js b/tests/e2e/fle.test.js index 27a7b015..570a4343 100644 --- a/tests/e2e/fle.test.js +++ b/tests/e2e/fle.test.js @@ -1,25 +1,25 @@ -// const { _electron: electron } = require('playwright'); -// const { test, expect } = require('@playwright/test'); + const { _electron: electron } = require('playwright'); + const { test, expect } = require('@playwright/test'); -// test('Launch Electron app and click on FLE block', async () => { -// const app = await electron.launch({ args: ['main.js'] }); + test('Launch Electron app and click on FLE block', async () => { + const app = await electron.launch({ args: ['main.js'] }); -// const window = await app.firstWindow(); + const window = await app.firstWindow(); -// // selecting the device (MPW1 Gemini) + // selecting the device (MPW1 Gemini) // const deviceDropdown = await window.waitForSelector('#deviceId'); // await deviceDropdown.selectOption('MPW1'); // await new Promise((resolve) => setTimeout(resolve, 2000)); -// const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); -// await fleBlock.click(); + const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); + await fleBlock.click(); -// const flePowerVisible = await window.isVisible('div.title-comp-total-text'); -// expect(flePowerVisible).toBeTruthy(); + const flePowerVisible = await window.isVisible('div.title-comp-total-text'); + expect(flePowerVisible).toBeTruthy(); -// console.log('FLE block clicked and verified.'); + console.log('FLE block clicked and verified.'); -// await new Promise((resolve) => setTimeout(resolve, 5000)); + await new Promise((resolve) => setTimeout(resolve, 5000)); -// await app.close(); -// }); + await app.close(); + }); From f55d8cabfa44f0973b035e45b363d530df27e53b Mon Sep 17 00:00:00 2001 From: NadeemYaseen Date: Wed, 6 Nov 2024 10:19:54 -0800 Subject: [PATCH 09/17] now enable backend invoking in fle test --- tests/e2e/fle.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/fle.test.js b/tests/e2e/fle.test.js index 570a4343..4b6d3059 100644 --- a/tests/e2e/fle.test.js +++ b/tests/e2e/fle.test.js @@ -7,9 +7,9 @@ const window = await app.firstWindow(); // selecting the device (MPW1 Gemini) -// const deviceDropdown = await window.waitForSelector('#deviceId'); -// await deviceDropdown.selectOption('MPW1'); -// await new Promise((resolve) => setTimeout(resolve, 2000)); + const deviceDropdown = await window.waitForSelector('#deviceId'); + await deviceDropdown.selectOption('MPW1'); + await new Promise((resolve) => setTimeout(resolve, 2000)); const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); await fleBlock.click(); From 60b42a1e74afeedd0583ed758633c38f31f9d933 Mon Sep 17 00:00:00 2001 From: NadeemYaseen Date: Wed, 6 Nov 2024 10:38:57 -0800 Subject: [PATCH 10/17] added debug stage --- .github/workflows/rpe_test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index b7a598e4..9968ac73 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -91,6 +91,14 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js + - name: cat rpe log + if: always() + run: + ls -la + pwd + find . -type f -name "rpe.log" -exec cat {} + + + - name: Run ESLint only on ubuntu-latest if: ${{ matrix.os == 'ubuntu-latest' }} run: npx eslint src/ From 3c41df65b925222102c21d2b8e260ec56137f4fb Mon Sep 17 00:00:00 2001 From: NadeemYaseen Date: Wed, 6 Nov 2024 10:44:50 -0800 Subject: [PATCH 11/17] typo --- .github/workflows/rpe_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index 9968ac73..d73648a9 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -92,8 +92,8 @@ jobs: run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js - name: cat rpe log - if: always() - run: + if: matrix.os == 'ubuntu-latest' && always() + run: | ls -la pwd find . -type f -name "rpe.log" -exec cat {} + From b3c4ed9196920ea29c0c10c5298488615f3745d8 Mon Sep 17 00:00:00 2001 From: NadeemYaseen Date: Wed, 6 Nov 2024 10:55:19 -0800 Subject: [PATCH 12/17] added debug stage --- .github/workflows/rpe_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index d73648a9..311ea3a6 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -95,8 +95,8 @@ jobs: if: matrix.os == 'ubuntu-latest' && always() run: | ls -la - pwd - find . -type f -name "rpe.log" -exec cat {} + + cd $HOME && pwd + find $HOME -type f -name "rpe.log" -exec cat {} + - name: Run ESLint only on ubuntu-latest From 3e15c932f909bce8021c4ffb347f988ae9541f60 Mon Sep 17 00:00:00 2001 From: Nadeem Yaseen <70559777+NadeemYaseen@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:41:17 +0500 Subject: [PATCH 13/17] Update rpe_test.yml to sparse checkout Raptor/etc --- .github/workflows/rpe_test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index 311ea3a6..51b10e3e 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -30,6 +30,13 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Bring in closed src device.xml + uses: actions/checkout@v4 + with: + repository: os-fpga/Raptor + path: Raptor + sparse-checkout: 'etc' - name: Setup Node.js ${{ matrix.os }} if: ${{ matrix.os != 'ubuntu-22.04' }} @@ -89,7 +96,7 @@ jobs: - name: E2E Playwright tests on Linux latest & MacOS if: ${{ matrix.os == 'ubuntu-latest' }} - run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js + run: ls -l Raptor/etc && npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js - name: cat rpe log if: matrix.os == 'ubuntu-latest' && always() From bc0e95c7742373a6f8fe8bd6d51126da00048fb4 Mon Sep 17 00:00:00 2001 From: Nadeem Yaseen <70559777+NadeemYaseen@users.noreply.github.com> Date: Fri, 8 Nov 2024 21:00:11 +0500 Subject: [PATCH 14/17] Update rpe_test.yml to copy etc folder to backend on fly --- .github/workflows/rpe_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index 51b10e3e..316fa473 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -96,7 +96,7 @@ jobs: - name: E2E Playwright tests on Linux latest & MacOS if: ${{ matrix.os == 'ubuntu-latest' }} - run: ls -l Raptor/etc && npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js + run: cp -rf Raptor/etc backend && npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js - name: cat rpe log if: matrix.os == 'ubuntu-latest' && always() From 0b9020eaaa7652bca82d806525658bf28c8873e4 Mon Sep 17 00:00:00 2001 From: Nadeem Yaseen <70559777+NadeemYaseen@users.noreply.github.com> Date: Fri, 8 Nov 2024 21:10:11 +0500 Subject: [PATCH 15/17] Update rpe_test.yml --- .github/workflows/rpe_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index 316fa473..a64cb62b 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -96,9 +96,9 @@ jobs: - name: E2E Playwright tests on Linux latest & MacOS if: ${{ matrix.os == 'ubuntu-latest' }} - run: cp -rf Raptor/etc backend && npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js + run: ls -l Raptor/etc/devices && cp -rf Raptor/etc backend && npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js - - name: cat rpe log + - name: cat RPE log if: matrix.os == 'ubuntu-latest' && always() run: | ls -la From dc9df7dd410d8771805306d997e680cbde00e03b Mon Sep 17 00:00:00 2001 From: Shiva Ahir Date: Fri, 8 Nov 2024 13:11:19 -0800 Subject: [PATCH 16/17] Commenting acpu.test.js --- tests/e2e/acpu.test.js | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/e2e/acpu.test.js b/tests/e2e/acpu.test.js index b4536c44..a446afbe 100644 --- a/tests/e2e/acpu.test.js +++ b/tests/e2e/acpu.test.js @@ -1,37 +1,37 @@ -const { _electron: electron } = require('playwright'); -const { test, expect } = require('@playwright/test'); +// const { _electron: electron } = require('playwright'); +// const { test, expect } = require('@playwright/test'); -test('Launch Electron app, select device, toggle ACPU power, and click Add slowly', async () => { - const app = await electron.launch({ args: ['main.js'] }); +// test('Launch Electron app, select device, toggle ACPU power, and click Add slowly', async () => { +// const app = await electron.launch({ args: ['main.js'] }); - const window = await app.firstWindow(); +// const window = await app.firstWindow(); - // selecting the device (MPW1 Gemini) - const deviceDropdown = await window.waitForSelector('#deviceId'); - await deviceDropdown.selectOption('MPW1'); - await new Promise((resolve) => setTimeout(resolve, 2000)); // wait 2 seconds (not really needed, just for demo) +// // selecting the device (MPW1 Gemini) +// const deviceDropdown = await window.waitForSelector('#deviceId'); +// await deviceDropdown.selectOption('MPW1'); +// await new Promise((resolve) => setTimeout(resolve, 2000)); // wait 2 seconds (not really needed, just for demo) - // clicking on ACPU block - const acpuBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div.top-l2-col1-row1 > div:nth-child(1) > div'); - await acpuBlock.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); +// // clicking on ACPU block +// const acpuBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col1 > div.top-l2-col1-row1 > div:nth-child(1) > div'); +// await acpuBlock.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); - // toggling ACPU power, basically turning on the power on - const acpuPowerToggle = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.toggle-container > label.toggle-switch > span'); - await acpuPowerToggle.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); +// // toggling ACPU power, basically turning on the power on +// const acpuPowerToggle = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.toggle-container > label.toggle-switch > span'); +// await acpuPowerToggle.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); - // Click on Add button - const addButton = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'); - await addButton.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); +// // Click on Add button +// const addButton = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'); +// await addButton.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); - // Click OK in the popup - const okButton = await window.waitForSelector('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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid > span'); - await okButton.click(); - await new Promise((resolve) => setTimeout(resolve, 2000)); +// // Click OK in the popup +// const okButton = await window.waitForSelector('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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid > span'); +// await okButton.click(); +// await new Promise((resolve) => setTimeout(resolve, 2000)); - console.log('Test case executed successfully.'); +// console.log('Test case executed successfully.'); - await app.close(); -}); +// await app.close(); +// }); From 06b39d658f1fa6c68c1fcd14072ebafa812f3e3d Mon Sep 17 00:00:00 2001 From: Shiva Ahir Date: Fri, 8 Nov 2024 13:12:12 -0800 Subject: [PATCH 17/17] Update fle.test.js --- tests/e2e/fle.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/fle.test.js b/tests/e2e/fle.test.js index 4b6d3059..aa65e6ee 100644 --- a/tests/e2e/fle.test.js +++ b/tests/e2e/fle.test.js @@ -6,11 +6,12 @@ const window = await app.firstWindow(); - // selecting the device (MPW1 Gemini) + // selecting the device (MPW1 Gemini) const deviceDropdown = await window.waitForSelector('#deviceId'); await deviceDropdown.selectOption('MPW1'); await new Promise((resolve) => setTimeout(resolve, 2000)); + // Clicking on the FLE block const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); await fleBlock.click();