diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index 7994b580..1b3fbda0 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' }} @@ -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' }} diff --git a/tests/e2e/fle.test.js b/tests/e2e/fle.test.js index 27a7b015..aa65e6ee 100644 --- a/tests/e2e/fle.test.js +++ b/tests/e2e/fle.test.js @@ -1,25 +1,26 @@ -// 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(); + // 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(); -// 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(); + });