@@ -33,9 +33,9 @@ test('Launch Electron app, add clocking source, navigate to DSP block, configure
33
33
const portSignalInput = await window . waitForSelector ( portSignalSelector ) ;
34
34
await portSignalInput . fill ( 'test' ) ;
35
35
36
- // Clicking OK to submit the clocking 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 > span ' ;
38
- const okButton = await window . waitForSelector ( okButtonSelector ) ;
36
+ // Clicking OK to submit the form
37
+ const modalFooterSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-footer' ;
38
+ const okButton = await window . locator ( ` ${ modalFooterSelector } button.ant-btn-primary` ) ;
39
39
await okButton . click ( ) ;
40
40
41
41
// Navigate to the DSP block
@@ -72,9 +72,13 @@ test('Launch Electron app, add clocking source, navigate to DSP block, configure
72
72
const toggleRateInput = await window . waitForSelector ( toggleRateSelector ) ;
73
73
await toggleRateInput . fill ( '50' ) ;
74
74
75
- // Clicking OK to submit the DSP form
76
- const dspOkButtonSelector = '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' ;
77
- const dspOkButton = await window . waitForSelector ( dspOkButtonSelector ) ;
75
+ // Define the modal footer selector as the base context
76
+ const dspModalFooterSelector = 'body > div:nth-child(3) > div > div.ant-modal-wrap > div > div:nth-child(1) > div > div.ant-modal-footer' ;
77
+
78
+ // Locate the OK button within the modal footer
79
+ const dspOkButton = await window . locator ( `${ dspModalFooterSelector } button.ant-btn-primary` ) ;
80
+
81
+ // Click the OK button
78
82
await dspOkButton . click ( ) ;
79
83
80
84
// Closing the test
0 commit comments