|
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'); |
3 | 3 |
|
4 | | -// test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', async () => { |
5 | | -// const app = await electron.launch({ args: ['main.js'], headless: false }); |
6 | | -// const window = await app.firstWindow(); |
| 4 | +test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', async () => { |
| 5 | + const app = await electron.launch({ args: ['main.js'], headless: false }); |
| 6 | + const window = await app.firstWindow(); |
7 | 7 |
|
8 | | -// // Selecting MPW1 Gemini from device dropdown |
9 | | -// const deviceDropdown = await window.waitForSelector('#deviceId'); |
10 | | -// await deviceDropdown.selectOption('MPW1'); |
| 8 | + // Selecting MPW1 Gemini from device dropdown |
| 9 | + const deviceDropdown = await window.waitForSelector('#deviceId'); |
| 10 | + await deviceDropdown.selectOption('MPW1'); |
11 | 11 |
|
12 | | -// // Click on the BCPU block |
13 | | -// 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'; |
14 | | -// await window.click(bcpuSelector); |
| 12 | + // Click on the BCPU block |
| 13 | + 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'; |
| 14 | + await window.click(bcpuSelector); |
15 | 15 |
|
16 | | -// // Click on "Add" button |
17 | | -// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'; |
18 | | -// await window.waitForSelector(addButtonSelector, { state: 'visible' }); |
19 | | -// await window.click(addButtonSelector); |
| 16 | + // Click on "Add" button |
| 17 | + const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'; |
| 18 | + await window.waitForSelector(addButtonSelector, { state: 'visible' }); |
| 19 | + await window.click(addButtonSelector); |
20 | 20 |
|
21 | | -// // Click on "OK" button |
22 | | -// const okButtonSelector = 'button.ant-btn-primary'; |
23 | | -// await window.waitForSelector(okButtonSelector, { state: 'visible' }); |
24 | | -// await window.click(okButtonSelector); |
| 21 | + // Click on "OK" button |
| 22 | + const okButtonSelector = 'button.ant-btn-primary'; |
| 23 | + await window.waitForSelector(okButtonSelector, { state: 'visible' }); |
| 24 | + await window.click(okButtonSelector); |
25 | 25 |
|
26 | | -// // Click on Peripherals tab |
27 | | -// 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)'; |
28 | | -// await window.click(peripheralsTabSelector); |
| 26 | + // Click on Peripherals tab |
| 27 | + 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)'; |
| 28 | + await window.click(peripheralsTabSelector); |
29 | 29 |
|
30 | | -// // Check SPI/QSPI block |
31 | | -// const spiQspiCheckSelector = '#\\30'; |
32 | | -// await window.click(spiQspiCheckSelector); |
| 30 | + // Check SPI/QSPI block |
| 31 | + const spiQspiCheckSelector = '#\\30'; |
| 32 | + await window.click(spiQspiCheckSelector); |
33 | 33 |
|
34 | | -// console.log('BCPU power verified.'); |
| 34 | + console.log('BCPU power verified.'); |
35 | 35 |
|
36 | | -// // Close the app |
37 | | -// await app.close(); |
38 | | -// }); |
| 36 | + // Close the app |
| 37 | + await app.close(); |
| 38 | +}); |
0 commit comments