Skip to content

Commit 4f7493d

Browse files
authored
Update clocking.test.js
1 parent 4af80d0 commit 4f7493d

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

tests/e2e/clocking.test.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,38 @@ test('Launch Electron app, select device, toggle ACPU power, click Clocking, Add
66
const window = await app.firstWindow();
77

88
// Selecting the device (MPW1 Gemini)
9-
const deviceDropdown = await window.waitForSelector('#deviceId');
9+
const deviceDropdown = await window.waitForSelector('#deviceId', { timeout: 5000 });
1010
await deviceDropdown.selectOption('MPW1');
11-
await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
1211

1312
// Selecting Clocking block
1413
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);
14+
const clockingBlock = await window.waitForSelector(clockingBlockSelector, { timeout: 5000 });
1615
await clockingBlock.click();
17-
await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
1816

1917
// Clicking on Add button
2018
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);
19+
const addButton = await window.waitForSelector(addButtonSelector, { timeout: 5000 });
2220
await addButton.click();
23-
await new Promise((resolve) => setTimeout(resolve, 2000)); // Wait for 2 seconds
2421

2522
// Ensure modal is visible before interacting
2623
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
24+
await window.waitForSelector(modalSelector, { state: 'visible', timeout: 5000 });
2825

2926
// Typing description as 'test'
3027
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();
28+
const descriptionInput = await window.waitForSelector(descriptionSelector, { timeout: 5000 });
3329
await descriptionInput.fill('test');
34-
await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second
3530

3631
// Typing Port/Signal name as 'test'
3732
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();
33+
const portSignalInput = await window.waitForSelector(portSignalSelector, { timeout: 5000 });
4034
await portSignalInput.fill('test');
41-
await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second
4235

4336
// Clicking OK to submit the form
4437
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 > span';
45-
const okButton = await window.waitForSelector(okButtonSelector);
38+
const okButton = await window.waitForSelector(okButtonSelector, { timeout: 5000 });
4639
await okButton.click();
4740

4841
// Closing the test
4942
await app.close();
5043
});
51-

0 commit comments

Comments
 (0)