Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda