]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/cypress/support/commands.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / support / commands.ts
index 2ab1b50025b8497f368b78669be4bf25d295bc94..09a2788eb0042946124b9b59a5cd9ccf0246c56d 100644 (file)
@@ -86,8 +86,14 @@ function requestAuth(username: string, password: string, url = '') {
 }
 
 // @ts-ignore
-Cypress.Commands.add('text', { prevSubject: true }, (subject: any) => {
-  return subject.text();
+Cypress.Commands.add('text', { prevSubject: true }, ($element: JQuery<HTMLElement>) => {
+  cy.wrap($element).scrollIntoView();
+  return cy
+    .wrap($element)
+    .invoke('text')
+    .then((text: string) => {
+      return text.toString();
+    });
 });
 
 Cypress.Commands.add('logToConsole', (message: string, optional?: any) => {