|
1 | | -const { _electron: electron } = require('playwright'); |
2 | | -const { test, expect } = require('@playwright/test'); |
3 | | - |
4 | | -test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add clock source, and submit form', async () => { |
5 | | - const app = await electron.launch({ args: ['main.js'] }); |
6 | | - const window = await app.firstWindow(); |
7 | | - |
8 | | - // Selecting the device (MPW1 Gemini) |
9 | | - const deviceDropdown = await window.waitForSelector('#deviceId', { timeout: 5000 }); |
10 | | - await deviceDropdown.selectOption('MPW1'); |
11 | | - |
12 | | - // Selecting Clocking block |
13 | | - 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'; |
14 | | - const clockingBlock = await window.waitForSelector(clockingBlockSelector, { timeout: 5000 }); |
15 | | - await clockingBlock.click(); |
16 | | - |
17 | | - // Clicking on Add button |
18 | | - const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; |
19 | | - const addButton = await window.waitForSelector(addButtonSelector, { timeout: 5000 }); |
20 | | - await addButton.click(); |
21 | | - |
22 | | - // Ensure modal is visible before interacting |
23 | | - const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; |
24 | | - await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); |
25 | | - |
26 | | - // Typing description as 'test' |
27 | | - 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]'; |
28 | | - const descriptionInput = await window.waitForSelector(descriptionSelector, { timeout: 5000 }); |
29 | | - await descriptionInput.fill('test'); |
30 | | - |
31 | | - // Typing Port/Signal name as 'test' |
32 | | - 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]'; |
33 | | - const portSignalInput = await window.waitForSelector(portSignalSelector, { timeout: 5000 }); |
34 | | - await portSignalInput.fill('test'); |
35 | | - |
36 | | - // Clicking OK to submit the form |
37 | | - 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-49qm.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; |
38 | | - await okButton.click(); |
39 | | - |
40 | | - // Closing the test |
41 | | - await app.close(); |
42 | | -}); |
| 1 | +// const { _electron: electron } = require('playwright'); |
| 2 | +// const { test, expect } = require('@playwright/test'); |
| 3 | + |
| 4 | +// test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add clock source, and submit form', async () => { |
| 5 | +// const app = await electron.launch({ args: ['main.js'] }); |
| 6 | +// const window = await app.firstWindow(); |
| 7 | + |
| 8 | +// // Selecting the device (MPW1 Gemini) |
| 9 | +// const deviceDropdown = await window.waitForSelector('#deviceId', { timeout: 5000 }); |
| 10 | +// await deviceDropdown.selectOption('MPW1'); |
| 11 | + |
| 12 | +// // Selecting Clocking block |
| 13 | +// 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'; |
| 14 | +// const clockingBlock = await window.waitForSelector(clockingBlockSelector, { timeout: 5000 }); |
| 15 | +// await clockingBlock.click(); |
| 16 | + |
| 17 | +// // Clicking on Add button |
| 18 | +// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; |
| 19 | +// const addButton = await window.waitForSelector(addButtonSelector, { timeout: 5000 }); |
| 20 | +// await addButton.click(); |
| 21 | + |
| 22 | +// // Ensure modal is visible before interacting |
| 23 | +// const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; |
| 24 | +// await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); |
| 25 | + |
| 26 | +// // Typing description as 'test' |
| 27 | +// 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]'; |
| 28 | +// const descriptionInput = await window.waitForSelector(descriptionSelector, { timeout: 5000 }); |
| 29 | +// await descriptionInput.fill('test'); |
| 30 | + |
| 31 | +// // Typing Port/Signal name as 'test' |
| 32 | +// 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]'; |
| 33 | +// const portSignalInput = await window.waitForSelector(portSignalSelector, { timeout: 5000 }); |
| 34 | +// await portSignalInput.fill('test'); |
| 35 | + |
| 36 | +// // Clicking OK to submit the form |
| 37 | +// 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-49qm.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; |
| 38 | +// await okButton.click(); |
| 39 | + |
| 40 | +// // Closing the test |
| 41 | +// await app.close(); |
| 42 | +// }); |
0 commit comments