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

351
Views
Matcher error: received value must not be null nor undefined

I am using expect in typescript to write an assertion while writing a Then step definition using typescript in in playwright I have assigned an the class on this url https://www.gov.uk/help/accessibility-statement to confirm I can see accessibility statement when I land on the page.

I then get an undefined error when I run my tests.

Code written:-

import expect from "expect";

Then("I expect to be on the accessibility page", async function(
    
this: OurWorld
) 

{   

    const {page} = this;
    // eslint-disable-next-line no-debugger
    const headMessage =await page?.$(".gem-c-title__text.govuk-heading-xl")
    console.log(headMessage)
    expect (headMessage).toContainEqual(("Accessibility statement")
        
    );
});

I would like to check that the accessibility icon on the accessibility page contains the text accessibility.

The error I am getting back is this:-

× Then I expect to be on the accessibility page # step-definitions\feature.step-definitions.ts:28
       Error: expect(received).toContainEqual(expected) // deep equality

       Matcher error: received value must not be null nor undefined

Thank you for your help

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!