{"id":36399139,"url":"https://github.com/marcortola/behat-seo-contexts","last_synced_at":"2026-01-11T16:01:46.015Z","repository":{"id":57019949,"uuid":"156007212","full_name":"marcortola/behat-seo-contexts","owner":"marcortola","description":"Behat extension for testing some On-Page SEO factors: meta title/description, canonical, hreflang, meta robots, robots.txt, redirects, sitemap validation, HTML validation, performance...","archived":false,"fork":false,"pushed_at":"2022-11-28T19:39:58.000Z","size":154,"stargazers_count":13,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T02:23:44.847Z","etag":null,"topics":["behat-context","canonicalization","hreflang-checker","html-validation","meta-tags","robots-txt","seo","sitemap-validation"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/marcortola.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":"2018-11-03T17:30:45.000Z","updated_at":"2024-05-28T15:35:34.000Z","dependencies_parsed_at":"2022-08-22T20:20:15.907Z","dependency_job_id":null,"html_url":"https://github.com/marcortola/behat-seo-contexts","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/marcortola/behat-seo-contexts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcortola%2Fbehat-seo-contexts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcortola%2Fbehat-seo-contexts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcortola%2Fbehat-seo-contexts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcortola%2Fbehat-seo-contexts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcortola","download_url":"https://codeload.github.com/marcortola/behat-seo-contexts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcortola%2Fbehat-seo-contexts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28312133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: 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":["behat-context","canonicalization","hreflang-checker","html-validation","meta-tags","robots-txt","seo","sitemap-validation"],"created_at":"2026-01-11T16:01:30.695Z","updated_at":"2026-01-11T16:01:45.969Z","avatar_url":"https://github.com/marcortola.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Behat SEO Contexts\n\n[![Latest Version](https://img.shields.io/github/release/marcortola/behat-seo-contexts.svg?style=flat-square)](https://github.com/marcortola/behat-seo-contexts/releases)\n[![Build Status](https://img.shields.io/travis/marcortola/behat-seo-contexts.svg?style=flat-square)](https://travis-ci.org/marcortola/behat-seo-contexts)\n[![Quality Score](https://img.shields.io/scrutinizer/g/marcortola/behat-seo-contexts.svg?style=flat-square)](https://scrutinizer-ci.com/g/marcortola/behat-seo-contexts)\n\n**Behat extension for testing some On-Page SEO factors.**\n\nIncludes contexts for testing:\n* title / meta description\n* canonical\n* hreflang\n* meta robots\n* robots.txt\n* indexation: tests meta robots + robots.txt + X-Robots-Tag header\n* redirects\n* sitemap validation (inc. multilanguage)\n* HTML validation\n* assets performance\n* accessibility\n* UX\n* more...\n\nInstallation\n------------\n\nBasic requirements:\n\n* PHP 7.1+\n* Behat 3+\n* Mink + Mink extension\n\n### How to install it\n\n1. [Install Composer](https://getcomposer.org/download/)\n2. Execute:\n\n```\n$ composer require marcortola/behat-seo-contexts --dev\n```\n\n3. Add the Context you need to `behat.yml`:\n\n```yaml\n# behat.yml\ndefault:\n    # ...\n    suites:\n        default:\n          contexts:\n            - MarcOrtola\\BehatSEOContexts\\Context\\MetaContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\LocalizationContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\RobotsContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\IndexationContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\RedirectContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\SitemapContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\HTMLContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\PerformanceContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\SocialContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\AccessibilityContext\n            - MarcOrtola\\BehatSEOContexts\\Context\\UXContext\n```\n### Featured steps\n##### MetaContext\n```gherkin\nThen the page canonical should not be empty\nThen the page canonical should be :expectedCanonicalUrl\nThen the page title should not be empty\nThen the page title should be :expectedTitle\nThen the page meta description should not be empty\nThen the page meta description should be :expectedMetaDescription\nThen the page meta robots should be noindex\nThen the page meta robots should not be noindex\n```\n##### LocalizationContext\n```gherkin\nThen the page hreflang markup should be valid\n```\n##### RobotsContext\n```gherkin\nGiven I am a :crawlerUserAgent crawler\nThen I should not be able to crawl :resource\nThen I should be able to crawl :resource\nThen I should be able to get the sitemap URL\n```\n##### IndexationContext\n```gherkin\nThen the page should be indexable\nThen the page should not be indexable\n```\n##### RedirectContext\n```gherkin\nGiven I follow redirects\nGiven I do not follow redirects\nThen I should be redirected to :url\n```\n##### SitemapContext\n```gherkin\nGiven the sitemap :sitemapUrl\nThen the sitemap should be valid\nThen the index sitemap should be valid\nThen the multilanguage sitemap should be valid\nThen the index sitemap should have a child with URL :childSitemapUrl\nThen /^the sitemap should have ([0-9]+) children$/\nThen the multilanguage sitemap should pass Google validation\nThen the sitemap URLs should be alive\nThen /^(\\d+) random sitemap URLs? should be alive$/\n```\n##### HTMLContext\n```gherkin\nThen the page HTML markup should be valid\nThen /^the page HTML5 doctype declaration should (not |)be valid$\n```\n##### PerformanceContext\n```gherkin\nThen /^browser cache should be enabled for (.+\\..+|external|internal) (png|jpeg|gif|ico|js|css) resources$/\nThen /^Javascript code should load (async|defer)$/\nThen HTML code should be minified\nThen CSS code should be minified\nThen Javascript code should be minified\nThen CSS code should load deferred\nThen critical CSS code should exist in head\n```\n##### SocialContext\n```gherkin\nThen /^the (Twitter|Facebook) Open Graph data should satisfy (minimum|full) requirements$/\n```\n##### AccessibilityContext\n```gherkin\nThen the images should have alt text\n```\n##### UXContext\n```gherkin\nThen the site should be responsive\nThen the site should not be responsive\n```\n\n### Examples\nThis library is self-tested, and you can find examples inside the [features directory](./tests/features).\nFeel free to explore it to discover each step definition.\n\nUseful tips\n------------\n* Use [Symfony KernelDriver](https://github.com/Behat/Symfony2Extension) for improving the performance if you are working in a Symfony project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcortola%2Fbehat-seo-contexts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcortola%2Fbehat-seo-contexts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcortola%2Fbehat-seo-contexts/lists"}