Skip to content

Commit a75e247

Browse files
Testing Playwright tests on CI (#259)
* Testing Playwright tests on CI * Testing Playwright tests on CI * Update rpe_test.yml * Update bcpu.test.js * Update clocking.test.js * Update dsp.test.js * Update fle.test.js * run e2e without backend * now enable backend invoking in fle test * added debug stage * typo * added debug stage * Update rpe_test.yml to sparse checkout Raptor/etc * Update rpe_test.yml to copy etc folder to backend on fly * Update rpe_test.yml * Commenting acpu.test.js * Update fle.test.js --------- Co-authored-by: NadeemYaseen <[email protected]> Co-authored-by: Nadeem Yaseen <[email protected]>
1 parent e89099e commit a75e247

File tree

2 files changed

+36
-20
lines changed

2 files changed

+36
-20
lines changed

.github/workflows/rpe_test.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ jobs:
3030

3131
steps:
3232
- uses: actions/checkout@v4
33+
34+
- name: Bring in closed src device.xml
35+
uses: actions/checkout@v4
36+
with:
37+
repository: os-fpga/Raptor
38+
path: Raptor
39+
sparse-checkout: 'etc'
3340

3441
- name: Setup Node.js ${{ matrix.os }}
3542
if: ${{ matrix.os != 'ubuntu-22.04' }}
@@ -86,10 +93,18 @@ jobs:
8693
- name: Unit Jtest Linux latest & windows & MacOS
8794
if: ${{ matrix.os != 'ubuntu-22.04' }}
8895
run: npm test
96+
97+
- name: E2E Playwright tests on Linux latest & MacOS
98+
if: ${{ matrix.os == 'ubuntu-latest' }}
99+
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
100+
101+
- name: cat RPE log
102+
if: matrix.os == 'ubuntu-latest' && always()
103+
run: |
104+
ls -la
105+
cd $HOME && pwd
106+
find $HOME -type f -name "rpe.log" -exec cat {} +
89107
90-
# - name: E2E Playwright tests on Linux latest & MacOS
91-
# if: ${{ matrix.os == 'ubuntu-latest' }}
92-
# run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test
93108
94109
- name: Run ESLint only on ubuntu-latest
95110
if: ${{ matrix.os == 'ubuntu-latest' }}

tests/e2e/fle.test.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
// const { _electron: electron } = require('playwright');
2-
// const { test, expect } = require('@playwright/test');
1+
const { _electron: electron } = require('playwright');
2+
const { test, expect } = require('@playwright/test');
33

4-
// test('Launch Electron app and click on FLE block', async () => {
5-
// const app = await electron.launch({ args: ['main.js'] });
4+
test('Launch Electron app and click on FLE block', async () => {
5+
const app = await electron.launch({ args: ['main.js'] });
66

7-
// const window = await app.firstWindow();
7+
const window = await app.firstWindow();
88

9-
// // selecting the device (MPW1 Gemini)
10-
// const deviceDropdown = await window.waitForSelector('#deviceId');
11-
// await deviceDropdown.selectOption('MPW1');
12-
// await new Promise((resolve) => setTimeout(resolve, 2000));
9+
// selecting the device (MPW1 Gemini)
10+
const deviceDropdown = await window.waitForSelector('#deviceId');
11+
await deviceDropdown.selectOption('MPW1');
12+
await new Promise((resolve) => setTimeout(resolve, 2000));
1313

14-
// 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');
15-
// await fleBlock.click();
14+
// Clicking on the FLE block
15+
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');
16+
await fleBlock.click();
1617

17-
// const flePowerVisible = await window.isVisible('div.title-comp-total-text');
18-
// expect(flePowerVisible).toBeTruthy();
18+
const flePowerVisible = await window.isVisible('div.title-comp-total-text');
19+
expect(flePowerVisible).toBeTruthy();
1920

20-
// console.log('FLE block clicked and verified.');
21+
console.log('FLE block clicked and verified.');
2122

22-
// await new Promise((resolve) => setTimeout(resolve, 5000));
23+
await new Promise((resolve) => setTimeout(resolve, 5000));
2324

24-
// await app.close();
25-
// });
25+
await app.close();
26+
});

0 commit comments

Comments
 (0)