Verify the URL is returning 200 , 400 or 404

I want to verify that the pages of my websites are returning 200 , 400 or 404.
I know mocking API can be verified but I want to verify the URL itself.
e.g” is returning 200.

How can I do that?

Have you tried using the REST helper?

If you need authentication e.g. via cookies, there are ways to do that, e.g. if you are using puppeteer its possible to copy cookies into requests with onRequest, like in here

So for authenticated pages steps would be:
0. configure onRequest to extract auth and put it on request headers

  1. go to website as normal
  2. use REST helper e.g. I.sendGetRequest, you can get the status code by awaiting the response
    const res = await I.sendGetRequest();

Example onRequest that grabs auth cookies using Puppeteer (not sure how to do with other helpers)

      onRequest: async request => {
      let cookies;
      try {
        const puppeteer = codeceptjs.container.helpers("Puppeteer");
        const cookiesObj = await puppeteer.grabCookie();
        if (cookiesObj) {
          cookies = cookiesObj
            .map(c => `${}=${c.value}`)
            .join("; ");
      } catch (e) {
        // dont care
    request.headers = Object.assign(
        Cookie: cookies || ""
      request.headers || {}