Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!