-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml code clean up and enable the e2e test
- Loading branch information
1 parent
a75e247
commit 580c7bc
Showing
5 changed files
with
233 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
// const { _electron: electron } = require('playwright'); | ||
// const { test, expect } = require('@playwright/test'); | ||
|
||
// test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', async () => { | ||
// const app = await electron.launch({ args: ['main.js'], headless: false }); | ||
|
||
// const window = await app.firstWindow(); | ||
|
||
// // selecting MPW1 Gemini from device dropdown | ||
// const deviceDropdown = await window.waitForSelector('#deviceId'); | ||
// await deviceDropdown.selectOption('MPW1'); | ||
// await window.waitForTimeout(2000); // wait for UI update | ||
|
||
// // click on the BCPU block | ||
// 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'; | ||
// await window.waitForSelector(bcpuSelector); | ||
// await window.click(bcpuSelector); | ||
|
||
// // click on "Add" button | ||
// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'; | ||
// await window.waitForSelector(addButtonSelector, { state: 'visible' }); | ||
// await window.click(addButtonSelector); | ||
|
||
// // click on "OK" button | ||
// const okButtonSelector = 'button.ant-btn-primary'; | ||
// await window.waitForSelector(okButtonSelector, { state: 'visible' }); | ||
// await window.click(okButtonSelector); | ||
|
||
// // click on Peripherals tab | ||
// 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) > div > div:nth-child(2) > div:nth-child(2) > div.periph-internal-font-header'; | ||
// await window.waitForSelector(peripheralsTabSelector, { state: 'visible' }); | ||
// await window.click(peripheralsTabSelector); | ||
|
||
// // check SPI/QSPI block | ||
// const spiQspiCheckSelector = '#\\30'; | ||
// await window.waitForSelector(spiQspiCheckSelector, { state: 'visible' }); | ||
// await window.click(spiQspiCheckSelector); | ||
|
||
// // waiting to observe result on UI | ||
// await window.waitForTimeout(5000); | ||
|
||
// // closing RPE | ||
// await app.close(); | ||
// }); | ||
const { _electron: electron } = require('playwright'); | ||
const { test, expect } = require('@playwright/test'); | ||
|
||
test('Launch Electron app, select device MPW1 Gemini, and click on BCPU block', async () => { | ||
const app = await electron.launch({ args: ['main.js'], headless: false }); | ||
|
||
const window = await app.firstWindow(); | ||
|
||
// selecting MPW1 Gemini from device dropdown | ||
const deviceDropdown = await window.waitForSelector('#deviceId'); | ||
await deviceDropdown.selectOption('MPW1'); | ||
await window.waitForTimeout(2000); // wait for UI update | ||
|
||
// click on the BCPU block | ||
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'; | ||
await window.waitForSelector(bcpuSelector); | ||
await window.click(bcpuSelector); | ||
|
||
// click on "Add" button | ||
const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button'; | ||
await window.waitForSelector(addButtonSelector, { state: 'visible' }); | ||
await window.click(addButtonSelector); | ||
|
||
// click on "OK" button | ||
const okButtonSelector = 'button.ant-btn-primary'; | ||
await window.waitForSelector(okButtonSelector, { state: 'visible' }); | ||
await window.click(okButtonSelector); | ||
|
||
// click on Peripherals tab | ||
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) > div > div:nth-child(2) > div:nth-child(2) > div.periph-internal-font-header'; | ||
await window.waitForSelector(peripheralsTabSelector, { state: 'visible' }); | ||
await window.click(peripheralsTabSelector); | ||
|
||
// check SPI/QSPI block | ||
const spiQspiCheckSelector = '#\\30'; | ||
await window.waitForSelector(spiQspiCheckSelector, { state: 'visible' }); | ||
await window.click(spiQspiCheckSelector); | ||
|
||
// waiting to observe result on UI | ||
await window.waitForTimeout(5000); | ||
|
||
// closing RPE | ||
await app.close(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
// const { _electron: electron } = require('playwright'); | ||
// const { test, expect } = require('@playwright/test'); | ||
|
||
// test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add clock source, and submit form', async () => { | ||
// const app = await electron.launch({ args: ['main.js'] }); | ||
// 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 for 2 seconds | ||
|
||
// // Selecting Clocking block | ||
// 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'; | ||
// const clockingBlock = await window.waitForSelector(clockingBlockSelector); | ||
// await clockingBlock.click(); | ||
// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds | ||
|
||
// // Clicking on Add button | ||
// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; | ||
// const addButton = await window.waitForSelector(addButtonSelector); | ||
// await addButton.click(); | ||
// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds | ||
|
||
// // Ensure modal is visible before interacting | ||
// const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; | ||
// await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal | ||
|
||
// // Typing description as 'test' | ||
// 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]'; | ||
// const descriptionInput = await window.waitForSelector(descriptionSelector); | ||
// await descriptionInput.click(); | ||
// await descriptionInput.fill('test'); | ||
// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second | ||
|
||
// // Typing Port/Signal name as 'test' | ||
// 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]'; | ||
// const portSignalInput = await window.waitForSelector(portSignalSelector); | ||
// await portSignalInput.click(); | ||
// await portSignalInput.fill('test'); | ||
// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second | ||
|
||
// // Clicking OK to submit the form | ||
// 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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; | ||
// const okButton = await window.waitForSelector(okButtonSelector); | ||
// await okButton.click(); | ||
|
||
// // Closing the test | ||
// await app.close(); | ||
// }); | ||
const { _electron: electron } = require('playwright'); | ||
const { test, expect } = require('@playwright/test'); | ||
|
||
test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add clock source, and submit form', async () => { | ||
const app = await electron.launch({ args: ['main.js'] }); | ||
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 for 2 seconds | ||
|
||
// Selecting Clocking block | ||
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'; | ||
const clockingBlock = await window.waitForSelector(clockingBlockSelector); | ||
await clockingBlock.click(); | ||
await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds | ||
|
||
// Clicking on Add button | ||
const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button'; | ||
const addButton = await window.waitForSelector(addButtonSelector); | ||
await addButton.click(); | ||
await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds | ||
|
||
// Ensure modal is visible before interacting | ||
const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div'; | ||
await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal | ||
|
||
// Typing description as 'test' | ||
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]'; | ||
const descriptionInput = await window.waitForSelector(descriptionSelector); | ||
await descriptionInput.click(); | ||
await descriptionInput.fill('test'); | ||
await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second | ||
|
||
// Typing Port/Signal name as 'test' | ||
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]'; | ||
const portSignalInput = await window.waitForSelector(portSignalSelector); | ||
await portSignalInput.click(); | ||
await portSignalInput.fill('test'); | ||
await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second | ||
|
||
// Clicking OK to submit the form | ||
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-apn68.ant-btn-primary.ant-btn-color-primary.ant-btn-variant-solid'; | ||
const okButton = await window.waitForSelector(okButtonSelector); | ||
await okButton.click(); | ||
|
||
// Closing the test | ||
await app.close(); | ||
}); | ||
|
Oops, something went wrong.