{"id":40867355,"url":"https://github.com/luarmr/codeceptjs-resources-check","last_synced_at":"2026-01-22T00:35:57.601Z","repository":{"id":57202267,"uuid":"217781931","full_name":"luarmr/codeceptjs-resources-check","owner":"luarmr","description":"Codeceptjs helper. Load with puppeteer a url and listen the request during while the page is loading.","archived":false,"fork":false,"pushed_at":"2019-11-15T02:40:16.000Z","size":18,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-06T04:36:55.003Z","etag":null,"topics":["assertions","codeceptjs-helper","http","puppeteer","requests","resources","size"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luarmr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-26T23:34:14.000Z","updated_at":"2022-08-10T17:59:43.000Z","dependencies_parsed_at":"2022-09-18T09:32:55.006Z","dependency_job_id":null,"html_url":"https://github.com/luarmr/codeceptjs-resources-check","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luarmr/codeceptjs-resources-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luarmr%2Fcodeceptjs-resources-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luarmr%2Fcodeceptjs-resources-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luarmr%2Fcodeceptjs-resources-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luarmr%2Fcodeceptjs-resources-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luarmr","download_url":"https://codeload.github.com/luarmr/codeceptjs-resources-check/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luarmr%2Fcodeceptjs-resources-check/sbom","scorecard":{"id":601557,"data":{"date":"2025-08-11","repo":{"name":"github.com/luarmr/codeceptjs-resources-check","commit":"f8384a38f20faa91445e83fec92aa132cdff150c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T00:34:25.582Z","repository_id":57202267,"created_at":"2025-08-21T00:34:25.582Z","updated_at":"2025-08-21T00:34:25.582Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assertions","codeceptjs-helper","http","puppeteer","requests","resources","size"],"created_at":"2026-01-22T00:35:57.544Z","updated_at":"2026-01-22T00:35:57.593Z","avatar_url":"https://github.com/luarmr.png","language":"JavaScript","readme":"[![npm install codeceptjs-resources-check](https://nodei.co/npm/codeceptjs-resources-check.png)](https://nodei.co/npm/codeceptjs-resources-check/)\n# codeceptjs-resources-check\nCodeceptjs helper. Load a URL with Puppeteer and listen to the requests while the page is loading.\n\n\n## Usage\nRun a browser with puppeteer and spy the resources loaded in a specific url.\nYou can ask questions about these resources later on.\n\n### I.spyTheResourcesLoadedIn(url)\nOpen a new tab in the browser, listen to the resources the page asks for until it is fully loaded.\nClose the tab.\n\n### startSpyTheResources\nStart to listen the resources in the last tab open.\n\n###  I.checkTheNumberOfResources(number)\nCheck that the page loads the exact `number` of resources.\n\n###  I.checkTheResourceSize(pattern, expectedSize) \nCheck that the page only calls for one resource that matches with the `pattern` and has `expectedSize` while taking in consideration \na `threshold` that you can set up in the helper configuration. \n\n \n###  I.checkTheResourcesSize(pattern, expectedSize) \nCheck that the sum of all sizes of the resources that match with the `pattern` and  has `expectedSize`  while taking in consideration \na `threshold` that you can set up in the helper configuration. \n \n###  I.checkTheResourceTypeSize(contentType, expectedSize) \nCheck that the sum of all sizes  of the resources have a specific `contentType` and  has `expectedSize`  while taking in consideration \na `threshold` that you can set up in the helper configuration. \n \n###  I.checkAllResourcesSize(expectedSize) \nCheck that the sum of all sizes of the resources has `expectedSize`  while taking in consideration \na `threshold` that you can set up in the helper configuration. \n  \n###  I.checkTheNumberOfResource(pattern, expectedNumber)\nCheck that the number of the resources that match with a specific `pattern` is `expectedNumber`.\n  \n###  I.checkTheNumberOfResourceType(contentType, expectedNumber)\nCheck that the number of the resources that  have a specific `contentType` is `expectedNumber`.\n  \n  \n## Config:\nYou can add these lines into your `codecept.conf.js`\n```\n  helpers: {\n    CodeceptjsResourcesCheck: {\n      require: 'codeceptjs-resources-check',\n      threshold: 0.2\n    }\n  },\n```\n\n`threshold` by default is 0. \n\n\n## Example of usage in a Scenario:\n\n```\nScenario('test something', async (I) =\u003e {\n\n    // You have lunch the brower, maybe in your before step \n    const browser = await puppeteer.launch();\n\n    I.spyTheResourcesLoadedIn('https://stackoverflow.com/');\n\n    I.checkTheNumberOfResources(49);\n\n    // I.checkTheResourceSize(/vendor-[A-Za-z0-9]{20}\\.js/, 248524);\n    I.checkTheResourceSize(/full-anon/, 67707);\n\n    I.checkTheResourcesSize(/\\.js$/, 67707);\n\n    I.checkTheResourceTypeSize('text/css', 104525);\n    I.checkAllResourcesSize(387616);\n\n    I.checkTheNumberOfResourceType('text/javascript', 1);\n\n    // Remember to close your browser, maybe in your after step \n    await browser.close();\n});\n```\n\n## Another example\n```\nScenario('test something 2', async (I) =\u003e {\n    I.openNewTab();\n    I.emulateIPhone();\n\n    I.startSpyTheResources();\n\n    I.amOnPage('https://stackoverflow.com/')\n\n    I.checkTheNumberOfResources(51);\n\n\t// I.checkTheResourceSize(/vendor-[A-Za-z0-9]{20}\\.js/, 248524);\n    I.checkTheResourceSize(/full-anon/, 67707);\n\n    I.checkTheResourcesSize(/\\.js$/, 67707);\n\n\tI.checkTheResourceTypeSize('text/css', 104525);\n\tI.checkAllResourcesSize(387616);\n\n\tI.checkTheNumberOfResourceType('text/javascript', 1);\n});\n```\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluarmr%2Fcodeceptjs-resources-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluarmr%2Fcodeceptjs-resources-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluarmr%2Fcodeceptjs-resources-check/lists"}