Skip to content

Commit efcd133

Browse files
authored
Commenting playwright tests for now (#255)
* commenting playwright tests for now
1 parent 28de7a5 commit efcd133

File tree

6 files changed

+248
-248
lines changed

6 files changed

+248
-248
lines changed

.github/workflows/rpe_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ jobs:
8787
if: ${{ matrix.os != 'ubuntu-22.04' }}
8888
run: npm test
8989

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
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
9393

9494
- name: Run ESLint only on ubuntu-latest
9595
if: ${{ matrix.os == 'ubuntu-latest' }}

tests/e2e/acpu.test.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
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, select device, toggle ACPU power, and click Add slowly', async () => {
5-
const app = await electron.launch({ args: ['main.js'] });
4+
// test('Launch Electron app, select device, toggle ACPU power, and click Add slowly', 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)); // wait 2 seconds (not really needed, just for demo)
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)); // wait 2 seconds (not really needed, just for demo)
1313

14-
// clicking on ACPU block
15-
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');
16-
await acpuBlock.click();
17-
await new Promise((resolve) => setTimeout(resolve, 2000));
14+
// // clicking on ACPU block
15+
// 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');
16+
// await acpuBlock.click();
17+
// await new Promise((resolve) => setTimeout(resolve, 2000));
1818

19-
// toggling ACPU power, basically turning on the power on
20-
const acpuPowerToggle = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.toggle-container > label.toggle-switch > span');
21-
await acpuPowerToggle.click();
22-
await new Promise((resolve) => setTimeout(resolve, 2000));
19+
// // toggling ACPU power, basically turning on the power on
20+
// const acpuPowerToggle = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.toggle-container > label.toggle-switch > span');
21+
// await acpuPowerToggle.click();
22+
// await new Promise((resolve) => setTimeout(resolve, 2000));
2323

24-
// Click on Add button
25-
const addButton = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button');
26-
await addButton.click();
27-
await new Promise((resolve) => setTimeout(resolve, 2000));
24+
// // Click on Add button
25+
// const addButton = await window.waitForSelector('#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button');
26+
// await addButton.click();
27+
// await new Promise((resolve) => setTimeout(resolve, 2000));
2828

29-
// Click OK in the popup
30-
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');
31-
await okButton.click();
32-
await new Promise((resolve) => setTimeout(resolve, 2000));
29+
// // Click OK in the popup
30+
// 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');
31+
// await okButton.click();
32+
// await new Promise((resolve) => setTimeout(resolve, 2000));
3333

34-
console.log('Test case executed successfully.');
34+
// console.log('Test case executed successfully.');
3535

36-
await app.close();
37-
});
36+
// await app.close();
37+
// });

tests/e2e/bcpu.test.js

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
const { _electron: electron } = require('playwright');
2-
const { test, expect } = require('@playwright/test');
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-
7-
const window = await app.firstWindow();
8-
9-
// selecting MPW1 Gemini from device dropdown
10-
const deviceDropdown = await window.waitForSelector('#deviceId');
11-
await deviceDropdown.selectOption('MPW1');
12-
await window.waitForTimeout(2000); // wait for UI update
13-
14-
// click on the BCPU block
15-
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';
16-
await window.waitForSelector(bcpuSelector);
17-
await window.click(bcpuSelector);
18-
19-
// click on "Add" button
20-
const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button';
21-
await window.waitForSelector(addButtonSelector, { state: 'visible' });
22-
await window.click(addButtonSelector);
23-
24-
// click on "OK" button
25-
const okButtonSelector = 'button.ant-btn-primary';
26-
await window.waitForSelector(okButtonSelector, { state: 'visible' });
27-
await window.click(okButtonSelector);
28-
29-
// click on Peripherals tab
30-
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';
31-
await window.waitForSelector(peripheralsTabSelector, { state: 'visible' });
32-
await window.click(peripheralsTabSelector);
33-
34-
// check SPI/QSPI block
35-
const spiQspiCheckSelector = '#\\30';
36-
await window.waitForSelector(spiQspiCheckSelector, { state: 'visible' });
37-
await window.click(spiQspiCheckSelector);
38-
39-
// waiting to observe result on UI
40-
await window.waitForTimeout(5000);
41-
42-
// closing RPE
43-
await app.close();
44-
});
1+
// const { _electron: electron } = require('playwright');
2+
// const { test, expect } = require('@playwright/test');
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+
7+
// const window = await app.firstWindow();
8+
9+
// // selecting MPW1 Gemini from device dropdown
10+
// const deviceDropdown = await window.waitForSelector('#deviceId');
11+
// await deviceDropdown.selectOption('MPW1');
12+
// await window.waitForTimeout(2000); // wait for UI update
13+
14+
// // click on the BCPU block
15+
// 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';
16+
// await window.waitForSelector(bcpuSelector);
17+
// await window.click(bcpuSelector);
18+
19+
// // click on "Add" button
20+
// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.cpu-container > div.table-wrapper > button';
21+
// await window.waitForSelector(addButtonSelector, { state: 'visible' });
22+
// await window.click(addButtonSelector);
23+
24+
// // click on "OK" button
25+
// const okButtonSelector = 'button.ant-btn-primary';
26+
// await window.waitForSelector(okButtonSelector, { state: 'visible' });
27+
// await window.click(okButtonSelector);
28+
29+
// // click on Peripherals tab
30+
// 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';
31+
// await window.waitForSelector(peripheralsTabSelector, { state: 'visible' });
32+
// await window.click(peripheralsTabSelector);
33+
34+
// // check SPI/QSPI block
35+
// const spiQspiCheckSelector = '#\\30';
36+
// await window.waitForSelector(spiQspiCheckSelector, { state: 'visible' });
37+
// await window.click(spiQspiCheckSelector);
38+
39+
// // waiting to observe result on UI
40+
// await window.waitForTimeout(5000);
41+
42+
// // closing RPE
43+
// await app.close();
44+
// });

tests/e2e/clocking.test.js

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
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');
10-
await deviceDropdown.selectOption('MPW1');
11-
await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
12-
13-
// Selecting Clocking block
14-
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';
15-
const clockingBlock = await window.waitForSelector(clockingBlockSelector);
16-
await clockingBlock.click();
17-
await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
18-
19-
// Clicking on Add button
20-
const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button';
21-
const addButton = await window.waitForSelector(addButtonSelector);
22-
await addButton.click();
23-
await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
24-
25-
// Ensure modal is visible before interacting
26-
const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div';
27-
await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal
28-
29-
// Typing description as 'test'
30-
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]';
31-
const descriptionInput = await window.waitForSelector(descriptionSelector);
32-
await descriptionInput.click();
33-
await descriptionInput.fill('test');
34-
await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second
35-
36-
// Typing Port/Signal name as 'test'
37-
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]';
38-
const portSignalInput = await window.waitForSelector(portSignalSelector);
39-
await portSignalInput.click();
40-
await portSignalInput.fill('test');
41-
await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second
42-
43-
// Clicking OK to submit the form
44-
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';
45-
const okButton = await window.waitForSelector(okButtonSelector);
46-
await okButton.click();
47-
48-
// Closing the test
49-
await app.close();
50-
});
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');
10+
// await deviceDropdown.selectOption('MPW1');
11+
// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
12+
13+
// // Selecting Clocking block
14+
// 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';
15+
// const clockingBlock = await window.waitForSelector(clockingBlockSelector);
16+
// await clockingBlock.click();
17+
// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
18+
19+
// // Clicking on Add button
20+
// const addButtonSelector = '#app > div > div.table-container.main-border > div > div.power-and-table-wrapper > div.table-wrapper > button';
21+
// const addButton = await window.waitForSelector(addButtonSelector);
22+
// await addButton.click();
23+
// await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
24+
25+
// // Ensure modal is visible before interacting
26+
// const modalSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div';
27+
// await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 }); // Wait for modal
28+
29+
// // Typing description as 'test'
30+
// 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]';
31+
// const descriptionInput = await window.waitForSelector(descriptionSelector);
32+
// await descriptionInput.click();
33+
// await descriptionInput.fill('test');
34+
// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second
35+
36+
// // Typing Port/Signal name as 'test'
37+
// 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]';
38+
// const portSignalInput = await window.waitForSelector(portSignalSelector);
39+
// await portSignalInput.click();
40+
// await portSignalInput.fill('test');
41+
// await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second
42+
43+
// // Clicking OK to submit the form
44+
// 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';
45+
// const okButton = await window.waitForSelector(okButtonSelector);
46+
// await okButton.click();
47+
48+
// // Closing the test
49+
// await app.close();
50+
// });
5151

0 commit comments

Comments
 (0)