Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/rpe_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down Expand Up @@ -86,10 +93,18 @@ 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: 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
if: matrix.os == 'ubuntu-latest' && always()
run: |
ls -la
cd $HOME && pwd
find $HOME -type f -name "rpe.log" -exec cat {} +
# - 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' }}
Expand Down
56 changes: 28 additions & 28 deletions tests/e2e/acpu.test.js
Original file line number Diff line number Diff line change
@@ -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();
});
34 changes: 17 additions & 17 deletions tests/e2e/fle.test.js
Original file line number Diff line number Diff line change
@@ -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();
});
Loading