DSingh0304 commented on code in PR #3258:
URL: https://github.com/apache/apisix-dashboard/pull/3258#discussion_r2642151631


##########
e2e/tests/plugin_metadata.crud-all-fields.spec.ts:
##########
@@ -36,13 +36,29 @@ const deletePluginMetadata = async (req: typeof e2eReq, 
name: string) => {
 const getMonacoEditorValue = async (editPluginDialog: Locator) => {
   let editorValue = '';
   const textarea = editPluginDialog.locator('textarea');
-  if (await textarea.count() > 0) {
-    editorValue = await textarea.inputValue();
-  }
-  if (!editorValue || editorValue.trim() === '{') {
-    const lines = await 
editPluginDialog.locator('.view-line').allTextContents();
-    editorValue = lines.join('\n').replace(/\s+/g, ' ');
+
+  // Retry logic to handle potential race conditions where editor content 
isn't fully loaded
+  for (let i = 0; i < 20; i++) {

Review Comment:
   I've refactored the code to use Playwright's built-in waitFor() mechanism 
instead of the manual retry loop. The new implementation waits up to 10 seconds 
for the Monaco editor elements to be attached/populated, which is cleaner and 
more aligned with Playwright best practices. Test still passes successfully.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to