Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
I am trying to assert that below method is true But I am getting Undefined

So basically I am able to get the text for all the buttons but I am getting the error which says Undefined when asserting that it's true. Please I need help, let me know if more information is needed. Thank you

async isNoticationsEnabled(type: string) {

    const notificationType = await this.getNotificationsTypeByText(type);
    const selectContainer = await notificationType.$$('.NotificationTypeSchedule__selectContainer');
    const sms = selectContainer[1];
    const mobilePush = selectContainer[2];
    const webPush = selectContainer[3];
    const enabled = [];
    enabled.push(sms, mobilePush, webPush)
    for (let i = 0; i < enabled.length; i++) {
      const elements = enabled[i];
      if(await elements?.getText() === 'On') {
        return true;
      }
    }
  }

Output:

expect(received).toBe(expected) // Object.is equality

    Expected: true
    Received: undefined

      42 |     expect(await NotificationsTabs.isNotificationSectionDisplayed()).toBe(true)
      43 |     await NotificationsTabs.scrollTo('Note Mentions')
    > 44 |     expect(await NotificationsTabs.isNoticationsEnabled('Note Mentions')).toBe(true);
         |                                                                            ^
      45 |   });
      46 | });
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda